Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornhauge2008-11-21 21:18:41 +0000
committernhauge2008-11-21 21:18:41 +0000
commit5c46f8f3f750263f4ad91619f6fd53072f28de91 (patch)
tree7e67a2a3cfaf262356c7344c2653035e7b7e6e32
parentdc0148f401c2cadda6664c40470bdd758cc2ef05 (diff)
downloadwebtools.dali-5c46f8f3f750263f4ad91619f6fd53072f28de91.tar.gz
webtools.dali-5c46f8f3f750263f4ad91619f6fd53072f28de91.tar.xz
webtools.dali-5c46f8f3f750263f4ad91619f6fd53072f28de91.zip
This commit was manufactured by cvs2svn to create tag 'v200811240000'.v200811240000
-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.properties16
-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.patch/.project17
-rw-r--r--assembly/features/org.eclipse.jpt.patch/build.properties10
-rw-r--r--assembly/features/org.eclipse.jpt.patch/buildnotes_org.eclipse.jpt.patch.html20
-rw-r--r--assembly/features/org.eclipse.jpt.patch/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--assembly/features/org.eclipse.jpt.patch/epl-v10.html328
-rw-r--r--assembly/features/org.eclipse.jpt.patch/feature.properties143
-rw-r--r--assembly/features/org.eclipse.jpt.patch/feature.xml35
-rw-r--r--assembly/features/org.eclipse.jpt.patch/license.html93
-rw-r--r--assembly/features/org.eclipse.jpt.sdk/.cvsignore4
-rw-r--r--assembly/features/org.eclipse.jpt.sdk/.project17
-rw-r--r--assembly/features/org.eclipse.jpt.sdk/build.properties15
-rw-r--r--assembly/features/org.eclipse.jpt.sdk/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--assembly/features/org.eclipse.jpt.sdk/epl-v10.html328
-rw-r--r--assembly/features/org.eclipse.jpt.sdk/feature.properties145
-rw-r--r--assembly/features/org.eclipse.jpt.sdk/feature.xml42
-rw-r--r--assembly/features/org.eclipse.jpt.sdk/license.html98
-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.properties5
-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.tests/.cvsignore3
-rw-r--r--assembly/features/org.eclipse.jpt.tests/.project17
-rw-r--r--assembly/features/org.eclipse.jpt.tests/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--assembly/features/org.eclipse.jpt.tests/build.properties5
-rw-r--r--assembly/features/org.eclipse.jpt.tests/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--assembly/features/org.eclipse.jpt.tests/epl-v10.html328
-rw-r--r--assembly/features/org.eclipse.jpt.tests/feature.properties145
-rw-r--r--assembly/features/org.eclipse.jpt.tests/feature.xml28
-rw-r--r--assembly/features/org.eclipse.jpt.tests/license.html98
-rw-r--r--assembly/features/org.eclipse.jpt/.cvsignore2
-rw-r--r--assembly/features/org.eclipse.jpt/.project17
-rw-r--r--assembly/features/org.eclipse.jpt/build.properties16
-rw-r--r--assembly/features/org.eclipse.jpt/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--assembly/features/org.eclipse.jpt/epl-v10.html328
-rw-r--r--assembly/features/org.eclipse.jpt/feature.properties144
-rw-r--r--assembly/features/org.eclipse.jpt/feature.xml42
-rw-r--r--assembly/features/org.eclipse.jpt/license.html93
-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.properties15
-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--assembly/plugins/org.eclipse.jpt/.cvsignore2
-rw-r--r--assembly/plugins/org.eclipse.jpt/.project22
-rw-r--r--assembly/plugins/org.eclipse.jpt/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--assembly/plugins/org.eclipse.jpt/META-INF/MANIFEST.MF7
-rw-r--r--assembly/plugins/org.eclipse.jpt/about.html34
-rw-r--r--assembly/plugins/org.eclipse.jpt/about.ini44
-rw-r--r--assembly/plugins/org.eclipse.jpt/about.mappings6
-rw-r--r--assembly/plugins/org.eclipse.jpt/about.properties24
-rw-r--r--assembly/plugins/org.eclipse.jpt/build.properties19
-rw-r--r--assembly/plugins/org.eclipse.jpt/component.xml12
-rw-r--r--assembly/plugins/org.eclipse.jpt/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--assembly/plugins/org.eclipse.jpt/eclipse32.pngbin4594 -> 0 bytes
-rw-r--r--assembly/plugins/org.eclipse.jpt/plugin.properties13
-rw-r--r--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.properties140
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/feature.xml52
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/license.html98
-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.html83
-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.properties145
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/license.html82
-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.html83
-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.properties140
-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.html98
-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.properties140
-rw-r--r--jpa/features/org.eclipse.jpt.feature/feature.xml92
-rw-r--r--jpa/features/org.eclipse.jpt.feature/license.html98
-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.html83
-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.properties145
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/license.html82
-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.html83
-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.properties145
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/feature.xml44
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/license.html98
-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.properties140
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/feature.xml35
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/license.html98
-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.MF70
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/build.properties23
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/component.xml1
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/DaliEmfFormatter.xml264
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/jptResourceModels.genmodel402
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/orm.ecore488
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/persistence.ecore63
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/plugin.properties40
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/plugin.xml309
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/property_files/jpa_core.properties38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation.properties74
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/schema/jpaPlatform.exsd127
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/schema/resourceModelProvider.exsd107
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/EntityGeneratorDatabaseAnnotationNameBuilder.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaAnnotationProvider.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaDataSource.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFactory.java411
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFile.java131
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFileProvider.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaModel.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaNode.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatform.java179
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaProject.java416
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaStructureNode.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JptCorePlugin.java450
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/MappingKeys.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/ResourceModelListener.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AccessType.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AssociationOverride.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AttributeMapping.java58
-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/BaseColumn.java89
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseEmbeddedMapping.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseJoinColumn.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseOverride.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BasicMapping.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Cascade.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Column.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ColumnMapping.java25
-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.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/DiscriminatorColumn.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/DiscriminatorType.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Embeddable.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EmbeddedIdMapping.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EmbeddedMapping.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Entity.java308
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EnumType.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EnumeratedConverter.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/FetchType.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Fetchable.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GeneratedValue.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GenerationType.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Generator.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GeneratorHolder.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/IdClass.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/IdMapping.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/InheritanceType.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumn.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinTable.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JpaContextNode.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JpaRootContextNode.java69
-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.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToOneMapping.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedSuperclass.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappingFile.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappingFilePersistenceUnitDefaults.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappingFileRoot.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MultiRelationshipMapping.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedColumn.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedNativeQuery.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedQuery.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NonOwningMapping.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Nullable.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToManyMapping.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToOneMapping.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PersistentAttribute.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PersistentType.java124
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PersistentTypeContext.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumn.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Query.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/QueryHint.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/QueryHolder.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/RelationshipMapping.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SecondaryTable.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SequenceGenerator.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SingleRelationshipMapping.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Table.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TableGenerator.java133
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TemporalConverter.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TemporalType.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TransientMapping.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TypeMapping.java146
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/UniqueConstraint.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/VersionMapping.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/XmlContextNode.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/DefaultJavaAttributeMappingProvider.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAssociationOverride.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeMapping.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeMappingProvider.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeOverride.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBaseColumn.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBaseEmbeddedMapping.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBaseJoinColumn.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBasicMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaColumn.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaColumnMapping.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaConverter.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaDiscriminatorColumn.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddable.java31
-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.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEnumeratedConverter.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGeneratedValue.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGenerator.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGeneratorHolder.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaIdMapping.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumn.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinTable.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJpaContextNode.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaLobConverter.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToManyMapping.java27
-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/JavaMappedSuperclass.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMultiRelationshipMapping.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedColumn.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedNativeQuery.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedQuery.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToManyMapping.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToOneMapping.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPersistentAttribute.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPersistentType.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPrimaryKeyJoinColumn.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQuery.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQueryHint.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaRelationshipMapping.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSecondaryTable.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSequenceGenerator.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSingleRelationshipMapping.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaStructureNodes.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTable.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTableGenerator.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTemporalConverter.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTransientMapping.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTypeMapping.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTypeMappingProvider.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaUniqueConstraint.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaVersionMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/EntityMappings.java141
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAssociationOverride.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeMapping.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeMappingProvider.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeOverride.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBaseColumn.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBaseEmbeddedMapping.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBaseJoinColumn.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBasicMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmColumn.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmColumnMapping.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmConverter.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmDiscriminatorColumn.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddable.java45
-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.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmGeneratedValue.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmGenerator.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmGeneratorHolder.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmIdMapping.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumn.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinTable.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToManyMapping.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToOneMapping.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMappedSuperclass.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMultiRelationshipMapping.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedColumn.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedNativeQuery.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedQuery.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToManyMapping.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToOneMapping.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistenceUnitDefaults.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentAttribute.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentType.java157
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentTypeContext.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPrimaryKeyJoinColumn.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQuery.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQueryHint.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmRelationshipMapping.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSecondaryTable.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSequenceGenerator.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSingleRelationshipMapping.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmStructureNodes.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTable.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTableGenerator.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTransientMapping.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTypeMapping.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTypeMappingProvider.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmUniqueConstraint.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmVersionMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXml.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/PersistenceUnitMetadata.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/ClassRef.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/MappingFileRef.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/Persistence.java90
-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.java491
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnitTransactionType.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceXml.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/Property.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaFile.java151
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaNode.java171
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AsynchronousJpaProjectUpdater.java121
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaDataSource.java225
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaModel.java512
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaProject.java749
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JavaJpaFile.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JavaJpaFileProvider.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaConstants.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaModelManager.java564
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaPlatformTester.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaProjectAdapterFactory.java44
-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.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/OrmJpaFileProvider.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/PersistenceJpaFileProvider.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SimpleJpaProjectConfig.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SynchronousJpaProjectUpdater.java142
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/XmlJpaFile.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/AbstractJpaContextNode.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/AbstractXmlContextNode.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/GenericRootContextNode.java241
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/JpaContextNodeAdapterFactory.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/MappingTools.java189
-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/java/AbstractJavaAttributeMapping.java184
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaBaseColumn.java302
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaBaseEmbeddedMapping.java367
-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/AbstractJavaJpaContextNode.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMultiRelationshipMapping.java457
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaNamedColumn.java194
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOverride.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaQuery.java201
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaRelationshipMapping.java208
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaSingleRelationshipMapping.java457
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaTable.java501
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaTypeMapping.java135
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaAssociationOverride.java362
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaAttributeOverride.java194
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaBasicMapping.java322
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaColumn.java154
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaDiscriminatorColumn.java151
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEmbeddable.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEmbeddedIdMapping.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEmbeddedMapping.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEntity.java2028
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEnumeratedConverter.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaGeneratedValue.java114
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaIdMapping.java511
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinColumn.java214
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinTable.java726
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaLobConverter.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaManyToManyMapping.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaManyToOneMapping.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaMappedSuperclass.java170
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNamedNativeQuery.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNamedQuery.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNullAttributeMapping.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNullConverter.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaOneToManyMapping.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaOneToOneMapping.java327
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPersistentAttribute.java338
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPersistentType.java551
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPrimaryKeyJoinColumn.java176
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaQueryHint.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaSecondaryTable.java389
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaSequenceGenerator.java145
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTable.java149
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTableGenerator.java518
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTemporalConverter.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTransientMapping.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaUniqueConstraint.java167
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaVersionMapping.java218
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaBasicMappingProvider.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaCascade.java142
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddableProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddedIdMappingProvider.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddedMappingProvider.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEntityProvider.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaIdMappingProvider.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaManyToManyMappingProvider.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaManyToOneMappingProvider.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaMappedSuperclassProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaNullAttributeMappingProvider.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaNullTypeMapping.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaNullTypeMappingProvider.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOneToManyMappingProvider.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOneToOneMappingProvider.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaTransientMappingProvider.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaVersionMappingProvider.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualAttributeOverride.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualAttributeOverrideColumn.java146
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmAttributeMapping.java326
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseColumn.java308
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java364
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmGenerator.java237
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java373
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmNamedColumn.java196
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmQuery.java192
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmRelationshipMapping.java230
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmSingleRelationshipMapping.java467
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmTable.java466
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmTypeMapping.java397
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericEntityMappings.java929
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmAssociationOverride.java266
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmAttributeOverride.java222
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmBasicMapping.java332
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmColumn.java191
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmDiscriminatorColumn.java166
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddable.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddedIdMapping.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddedMapping.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEntity.java2074
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEnumeratedConverter.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmGeneratedValue.java132
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmIdMapping.java521
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinColumn.java203
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinTable.java727
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmLobConverter.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToManyMapping.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToOneMapping.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmMappedSuperclass.java201
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNamedNativeQuery.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNamedQuery.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNullAttributeMapping.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNullConverter.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToManyMapping.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToOneMapping.java299
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentAttribute.java187
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentType.java706
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPrimaryKeyJoinColumn.java150
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmQueryHint.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmSecondaryTable.java381
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmSequenceGenerator.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTable.java136
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTableGenerator.java411
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTemporalConverter.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTransientMapping.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmUniqueConstraint.java123
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmVersionMapping.java245
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericPersistenceUnitDefaults.java287
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericPersistenceUnitMetadata.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmBasicMappingProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmCascade.java244
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddableProvider.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddedIdMappingProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddedMappingProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEntityProvider.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmIdMappingProvider.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmManyToManyMappingProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmManyToOneMappingProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmMappedSuperclassProvider.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmNullAttributeMappingProvider.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOneToManyMappingProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOneToOneMappingProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmTransientMappingProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmVersionMappingProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmXmlImpl.java216
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualCascadeType.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualMapKey.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeMapping.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeOverride.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlBasic.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlColumn.java165
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlEmbedded.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlEmbeddedId.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlGeneratedValue.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlId.java144
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlJoinColumn.java129
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlJoinTable.java121
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToMany.java121
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToOne.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlNullAttributeMapping.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToMany.java122
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToOne.java130
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlPrimaryKeyJoinColumn.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlSecondaryTable.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlSequenceGenerator.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlTableGenerator.java160
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlTransient.java26
-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.java89
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceUnit.java1274
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericClassRef.java278
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericMappingFileRef.java279
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistence.java230
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistenceUnit.java22
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistenceXml.java197
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericProperty.java89
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProperties.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProvider.java523
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDelegate.java160
-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/operations/OrmFileCreationDataModelProperties.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/OrmFileCreationDataModelProvider.java471
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/OrmFileCreationOperation.java171
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericEntityGeneratorDatabaseAnnotationNameBuilder.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericJpaAnnotationProvider.java337
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericJpaFactory.java669
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericJpaPlatform.java423
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JpaPlatformRegistry.java237
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceConstants.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceInitializer.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/JpaResourceModelProviderManager.java260
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/common/translators/BooleanTranslator.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/common/translators/EmptyTagBooleanTranslator.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractJavaResourceNode.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractJavaResourcePersistentMember.java639
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractNamedColumn.java152
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractNamedQuery.java324
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractRelationshipMappingAnnotation.java314
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractResourceAnnotation.java138
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractResourceTable.java353
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverrideImpl.java290
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverridesImpl.java153
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverrideImpl.java163
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverridesImpl.java154
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/BaseColumnImpl.java233
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/BasicImpl.java155
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ColumnImpl.java242
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ContainerAnnotationTools.java214
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorColumnImpl.java168
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorValueImpl.java115
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddableImpl.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedIdImpl.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedImpl.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EntityImpl.java125
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EnumeratedImpl.java116
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/GeneratedValueImpl.java152
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/GeneratorImpl.java168
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdClassImpl.java139
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdImpl.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/InheritanceImpl.java115
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JavaResourcePersistentAttributeImpl.java553
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JavaResourcePersistentTypeImpl.java599
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnImpl.java225
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnsImpl.java157
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinTableImpl.java400
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JpaCompilationUnitImpl.java306
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/LobImpl.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToManyImpl.java165
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToOneImpl.java164
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MapKeyImpl.java125
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MappedSuperclassImpl.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueriesImpl.java157
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueryImpl.java238
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueriesImpl.java156
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueryImpl.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAssociationOverride.java121
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAttributeOverrideColumn.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBaseColumn.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBaseTable.java146
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBasic.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullColumn.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullDiscriminatorColumn.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullDiscriminatorValue.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullEmbedded.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullEnumerated.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullInheritance.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullJoinColumn.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullJoinTable.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullNamedColumn.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullOneToMany.java163
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullOneToOne.java173
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullPrimaryKeyJoinColumn.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullTable.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullTemporal.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToManyImpl.java161
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToOneImpl.java205
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OrderByImpl.java116
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OverrideImpl.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnImpl.java184
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnsImpl.java157
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/QueryHintImpl.java164
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTableImpl.java333
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTablesImpl.java161
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SequenceGeneratorImpl.java157
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableGeneratorImpl.java525
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableImpl.java104
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TemporalImpl.java116
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TransientImpl.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/UniqueConstraintImpl.java188
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/VersionImpl.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/OrmResourceModelProvider.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/OrmResourceModelProviderFactory.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/AssociationOverrideTranslator.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/AttributeOverrideTranslator.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/AttributesTranslator.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/BasicTranslator.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/CascadeTypeTranslator.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ColumnResultTranslator.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ColumnTranslator.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/DiscriminatorColumnTranslator.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmbeddableTranslator.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmbeddedIdTranslator.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmbeddedTranslator.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityListenerTranslator.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityListenersTranslator.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityMappingsTranslator.java136
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityResultTranslator.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityTranslator.java187
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EventMethodTranslator.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/FieldResultTranslator.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/GeneratedValueTranslator.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/IdClassTranslator.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/IdTranslator.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/InheritanceTranslator.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/JoinColumnTranslator.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/JoinTableTranslator.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ManyToManyTranslator.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ManyToOneTranslator.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/MapKeyTranslator.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/MappedSuperclassTranslator.java117
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/NamedNativeQueryTranslator.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/NamedQueryTranslator.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/OneToManyTranslator.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/OneToOneTranslator.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/OrmXmlMapper.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/PersistenceUnitDefaultsTranslator.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/PersistenceUnitMetadataTranslator.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/PrimaryKeyJoinColumnTranslator.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/QueryHintTranslator.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/SecondaryTableTranslator.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/SequenceGeneratorTranslator.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/SqlResultSetMappingTranslator.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/TableGeneratorTranslator.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/TableTranslator.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/TransientTranslator.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/UniqueConstraintTranslator.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/VersionTranslator.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/PersistenceResourceModelProvider.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/PersistenceResourceModelProviderFactory.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/JavaClassRefTranslator.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/MappingFileTranslator.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PersistenceTranslator.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PersistenceUnitTranslator.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PersistenceXmlMapper.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PropertiesTranslator.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PropertyTranslator.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/synch/SynchronizeClassesJob.java127
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/SimpleSchedulingRule.java46
-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/emf/ComponentUtilities.java76
-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/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.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTFieldAttribute.java181
-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.java188
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTModifiedDeclaration.java532
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTTools.java168
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTType.java174
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JPTTools.java182
-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/validation/DefaultJpaValidationMessages.java60
-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/JpaValidationMessages.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidator.java154
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/AbstractResourceModelProvider.java372
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaResourceModelProvider.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaResourceModelProviderEvent.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaResourceModelProviderFactory.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaResourceModelProviderListener.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/AbstractJpaEObject.java293
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaArtifactEdit.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaEObject.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaXmlResource.java166
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AccessType.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Annotation.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AnnotationDefinition.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverrideAnnotation.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverridesAnnotation.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverrideAnnotation.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverridesAnnotation.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseColumnAnnotation.java129
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BasicAnnotation.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/CascadeType.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ColumnAnnotation.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ContainerAnnotation.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorColumnAnnotation.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorType.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorValueAnnotation.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddableAnnotation.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddedAnnotation.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddedIdAnnotation.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EntityAnnotation.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EnumType.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EnumeratedAnnotation.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/FetchType.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratedValueAnnotation.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GenerationType.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratorAnnotation.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/IdAnnotation.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/IdClassAnnotation.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/InheritanceAnnotation.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/InheritanceType.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JPA.java302
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceNode.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentAttribute.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentMember.java191
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentType.java124
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnAnnotation.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnsAnnotation.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinTableAnnotation.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JpaCompilationUnit.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/LobAnnotation.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToManyAnnotation.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToOneAnnotation.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MapKeyAnnotation.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MappedSuperclassAnnotation.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedColumnAnnotation.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueriesAnnotation.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueryAnnotation.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueriesAnnotation.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueryAnnotation.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAnnotation.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAssociationOverride.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAttributeOverride.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableJoinColumn.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedNativeQuery.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedQuery.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestablePrimaryKeyJoinColumn.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableQueryHint.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableSecondaryTable.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableUniqueConstraint.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToManyAnnotation.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToOneAnnotation.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OrderByAnnotation.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OverrideAnnotation.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnAnnotation.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnsAnnotation.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/QueryAnnotation.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/QueryHintAnnotation.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/RelationshipMappingAnnotation.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTableAnnotation.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTablesAnnotation.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SequenceGeneratorAnnotation.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableAnnotation.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableGeneratorAnnotation.java208
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TemporalAnnotation.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TemporalType.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TransientAnnotation.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/UniqueConstraintAnnotation.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/VersionAnnotation.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAbstractColumn.java512
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAttributeMapping.java200
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlBaseTable.java410
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlNamedColumn.java267
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlTypeMapping.java516
-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.java658
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/BaseXmlEmbedded.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/CascadeType.java173
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/CascadeTypeImpl.java462
-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.java202
-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.java799
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityListeners.java185
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityResult.java338
-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.java202
-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.java270
-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.java202
-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/Lob.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/MapKey.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/MapKeyImpl.java194
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmFactory.java1047
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmPackage.java13890
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmResource.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmResourceFactory.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostLoad.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostPersist.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostRemove.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostUpdate.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PrePersist.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PreRemove.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PreUpdate.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/SqlResultSetMapping.java317
-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/XmlAbstractColumn.java179
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAssociationOverride.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAssociationOverrideImpl.java261
-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.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverrideImpl.java292
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBaseTable.java155
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBasic.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBasicImpl.java651
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlColumn.java117
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlColumnImpl.java369
-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.java267
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddable.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbedded.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedId.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedIdImpl.java232
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedImpl.java232
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEntity.java1925
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEntityMappings.java1079
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratedValue.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratedValueImpl.java266
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGenerator.java123
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlId.java117
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlIdClass.java202
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlIdImpl.java769
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumn.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumnImpl.java236
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinTable.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinTableImpl.java264
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToMany.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToManyImpl.java744
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToOne.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToOneImpl.java638
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlMappedSuperclass.java1040
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlMultiRelationshipMapping.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedColumn.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedNativeQuery.java474
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedQuery.java333
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNullAttributeMapping.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToMany.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToManyImpl.java797
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToOne.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToOneImpl.java761
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPersistenceUnitDefaults.java505
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPersistenceUnitMetadata.java301
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPrimaryKeyJoinColumn.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPrimaryKeyJoinColumnImpl.java236
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlQuery.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlQueryHint.java270
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlRelationshipMapping.java148
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSecondaryTable.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSecondaryTableImpl.java214
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSequenceGenerator.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSequenceGeneratorImpl.java404
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSingleRelationshipMapping.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTable.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTableGenerator.java216
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTableGeneratorImpl.java806
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTransient.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTransientImpl.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlUniqueConstraint.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlUniqueConstraintImpl.java175
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlVersion.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlVersionImpl.java517
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceFactory.java291
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistencePackage.java1324
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceResource.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceResourceFactory.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlJavaClassRef.java203
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlMappingFileRef.java203
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistence.java288
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistenceUnit.java856
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistenceUnitTransactionType.java235
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlProperties.java185
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlProperty.java266
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/AbstractTextRange.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/PlatformUtilities.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/TextRange.java114
-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.java53
-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.MF14
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/build.properties17
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/component.xml1
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/plugin.properties25
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/src/org/eclipse/jpt/db/ui/internal/DTPUiTools.java115
-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.MF16
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/build.properties19
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/component.xml1
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/plugin.properties25
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Catalog.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Column.java123
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionAdapter.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionListener.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfile.java206
-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.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileListener.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Database.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/DatabaseFinder.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/DatabaseObject.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ForeignKey.java139
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/JptDbPlugin.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Schema.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/SchemaContainer.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Sequence.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Table.java130
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPCatalogWrapper.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPColumnWrapper.java241
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileFactory.java165
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileWrapper.java543
-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.java189
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseWrapper.java1191
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPForeignKeyWrapper.java339
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSchemaContainerWrapper.java197
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSchemaWrapper.java306
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSequenceWrapper.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPTableWrapper.java420
-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.htm42
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/about.html42
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/build.properties115
-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.htm45
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concept_persistence.htm40
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concepts.htm59
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concepts001.htm42
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concepts002.htm57
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concepts003.htm72
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/contexts.xml422
-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.htm46
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started001.htm82
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started002.htm48
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started003.htm101
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started004.htm200
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/address.java_jpa_details.pngbin11748 -> 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/change_connection_profile.pngbin27031 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/column_support_new.pngbin12713 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/convert_java_project_new.pngbin16438 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_entity_new.pngbin23710 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_entity_wizard.pngbin23711 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_fields.pngbin21704 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/details_entitymappings.pngbin5647 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/entering_query_new.pngbin6361 -> 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_entities.pngbin6223 -> 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.pngbin4236 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/java_editor_address.pngbin7823 -> 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.pngbin11725 -> 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.pngbin15081 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_entity.pngbin14963 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_superclass.pngbin15145 -> 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.pngbin26085 -> 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.pngbin25449 -> 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/open_persistence_editor.pngbin12520 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_editor_new.pngbin14334 -> 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/persistence_xml_editor.pngbin2899 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/project_properties_tasks.pngbin22916 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/quickstart_project.pngbin9094 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/secondary_tables.pngbin1750 -> 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.pngbin20509 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/synchornize_classes.pngbin16378 -> 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.pngbin6361 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/index.xml544
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/legal.htm39
-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_details_orm.htm46
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_jpa_facet.htm89
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_mapping_general.htm261
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project.htm85
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project_wizard.htm45
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_map_view.htm51
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_outline.htm48
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm55
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_prop_view.htm51
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_primary_key.htm138
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_project_properties.htm84
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference.htm59
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference001.htm45
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference002.htm45
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference003.htm131
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference004.htm113
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference005.htm38
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference006.htm119
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference007.htm39
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference008.htm51
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference009.htm97
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference010.htm75
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference011.htm47
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference012.htm100
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference013.htm46
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference014.htm78
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference015.htm67
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference016.htm94
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference017.htm103
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference018.htm81
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference019.htm115
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference020.htm163
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference021.htm153
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference022.htm157
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference023.htm217
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference024.htm124
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference025.htm139
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference026.htm39
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference027.htm45
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference028.htm42
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference029.htm45
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference030.htm65
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference031.htm45
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference032.htm106
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference033.htm59
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference034.htm52
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_add_persistence.htm59
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_additonal_tables.htm70
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_create_new_project.htm128
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_generate_entities.htm72
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_inheritance.htm134
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_manage_orm.htm62
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm212
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_mapping.htm72
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks.htm71
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm156
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks002.htm61
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks003.htm74
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks004.htm69
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks005.htm62
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks006.htm95
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks007.htm69
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm83
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks009.htm61
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks010.htm181
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks011.htm107
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks012.htm87
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks013.htm169
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks014.htm172
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks015.htm160
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks016.htm190
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks017.htm139
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks018.htm65
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks019.htm133
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks020.htm66
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks021.htm47
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks022.htm53
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks023.htm91
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks024.htm49
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks025.htm87
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tips_and_tricks.htm65
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/toc.xml130
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new.htm59
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new001.htm58
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new002.htm55
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new003.htm53
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new004.htm47
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new005.htm53
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new006.htm41
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new007.htm48
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new008.htm43
-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.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.properties20
-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.properties24
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/src/org/eclipse/jpt/eclipselink/core/ddlgen/Main.java217
-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.prefs3
-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.MF50
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/build.properties23
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/model/eclipselink_orm.ecore192
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/model/jptEclipseLinkResourceModels.genmodel163
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/plugin.properties32
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/plugin.xml77
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/property_files/eclipselink_jpa_validation.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/src/org/eclipse/jpt/eclipselink/core/EclipseLinkJpaFile.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/EclipseLinkMappingKeys.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/BasicCollectionMapping.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/BasicMapMapping.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/CacheCoordinationType.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/CacheType.java133
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Caching.java205
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ChangeTracking.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ChangeTrackingType.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ConversionValue.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Convert.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/CustomConverter.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Customizer.java38
-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/EclipseLinkConverter.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkEmbeddable.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkEntity.java33
-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/EclipseLinkMappedSuperclass.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkOneToManyMapping.java29
-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/EclipseLinkRelationshipMapping.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkVersionMapping.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ExistenceType.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ExpiryTimeOfDay.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/JoinFetch.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/JoinFetchType.java89
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Mutable.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ObjectTypeConverter.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/PrivateOwned.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ReadOnly.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/StructConverter.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/TransformationMapping.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/TypeConverter.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/EclipseLinkJavaEmbeddable.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/EclipseLinkJavaEntity.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/EclipseLinkJavaMappedSuperclass.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaCaching.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaConverterHolder.java65
-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/EclipseLinkConstants.java19
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaAnnotationProvider.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaFactory.java375
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaPlatform.java89
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaValidationMessages.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkOrmJpaFileProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/JptEclipseLinkCorePlugin.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMappingImpl.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaCaching.java557
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaChangeTracking.java134
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaConversionValue.java131
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaConvert.java199
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaConverter.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaConverterHolder.java345
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaCustomConverter.java110
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaCustomizer.java138
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddableImpl.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaEntityImpl.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaExpiryTimeOfDay.java137
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaIdMappingImpl.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaJoinFetch.java118
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaManyToManyMappingImpl.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaManyToOneMappingImpl.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassImpl.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaMutable.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaObjectTypeConverter.java258
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingImpl.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingProvider.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingImpl.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingProvider.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaPrivateOwned.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaReadOnly.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaStructConverter.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaTypeConverter.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaVersionMappingImpl.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicCollectionMapping.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicCollectionMappingProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicMapMapping.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicMapMappingProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaTransformationMapping.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaTransformationMappingProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/ConverterHolder.java164
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkEntityMappings.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkEntityMappingsImpl.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmBasicMapping.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmCaching.java652
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmChangeTracking.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmConversionValue.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmConvert.java250
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmConverter.java105
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmConverterHolder.java430
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmCustomConverter.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmCustomizer.java114
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmEmbeddable.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmEmbeddableImpl.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmEntity.java18
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmEntityImpl.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmExpiryTimeOfDay.java137
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmIdMapping.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmJoinFetch.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmManyToManyMapping.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmManyToOneMapping.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmMappedSuperclass.java18
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmMappedSuperclassImpl.java141
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmMutable.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmObjectTypeConverter.java249
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmOneToManyMapping.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmOneToOneMapping.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmPersistentType.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmPrivateOwned.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmReadOnly.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmStructConverter.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmTypeConverter.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmVersionMapping.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmXml.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlBasic.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlConversionValue.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlConverter.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlId.java130
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlManyToMany.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlManyToOne.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlObjectTypeConverter.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlOneToMany.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlOneToOne.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlStructConverter.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlTypeConverter.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlVersion.java128
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicCollectionMapping.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicCollectionMappingProvider.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicMapMapping.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicMapMappingProvider.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmTransformationMapping.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmTransformationMappingProvider.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualXmlBasicCollection.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualXmlBasicMap.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualXmlTransformation.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkImpliedMappingFileRef.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceUnit.java337
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceUnitProperties.java469
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/PersistenceUnitProperties.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/PersistenceUnitPropertyListListener.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/CacheProperties.java115
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/CacheType.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/Caching.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/EclipseLinkCaching.java492
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/connection/BatchWriting.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/connection/Connection.java152
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/connection/EclipseLinkConnection.java655
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/Customization.java113
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/CustomizerProperties.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/EclipseLinkCustomization.java696
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/Profiler.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/Weaving.java24
-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/general/GeneralProperties.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/logging/EclipseLinkLogging.java349
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/logging/Logger.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/logging/Logging.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/logging/LoggingLevel.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/options/EclipseLinkOptions.java393
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/options/Options.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/options/TargetDatabase.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/options/TargetServer.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/schema/generation/DdlGenerationType.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/schema/generation/EclipseLinkSchemaGeneration.java221
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/schema/generation/OutputMode.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/schema/generation/SchemaGeneration.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/ddlgen/EclipseLinkDDLGenerator.java469
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationDataModelProvider.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationOperation.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/BasicCollectionImpl.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/BasicMapImpl.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/CacheImpl.java423
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ChangeTrackingImpl.java123
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ConversionValueImpl.java152
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ConvertImpl.java121
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ConverterImpl.java177
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/CustomizerImpl.java142
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ExistenceCheckingImpl.java123
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/JoinFetchImpl.java123
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/MutableImpl.java121
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullCacheAnnotation.java193
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullJoinFetchAnnotation.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullTransformation.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullWriteTransformerColumn.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ObjectTypeConverterImpl.java392
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/PrivateOwnedImpl.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ReadOnlyImpl.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ReadTransformerImpl.java152
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/StructConverterImpl.java155
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/TimeOfDayImpl.java183
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/TransformationImpl.java156
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/TypeConverterImpl.java188
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/WriteTransformerImpl.java220
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/EclipseLinkOrmResourceModelProvider.java89
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/EclipseLinkOrmResourceModelProviderFactory.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/BasicCollectionTranslator.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/BasicMapTranslator.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/CacheTranslator.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/ConversionValueTranslator.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/ConverterTranslator.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/CustomizerTranslator.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkAttributesTranslator.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkBasicTranslator.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkChangeTrackingTranslator.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkEmbeddableTranslator.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkEntityMappingsTranslator.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkEntityTranslator.java116
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkIdTranslator.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkManyToManyTranslator.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkManyToOneTranslator.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkMappedSuperclassTranslator.java104
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkOneToManyTranslator.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkOneToOneTranslator.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkOrmXmlMapper.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkVersionTranslator.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/ExpiryTimeOfDayTranslator.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/ObjectTypeConverterTranslator.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/StructConverterTranslator.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/TransformationTranslator.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/TypeConverterTranslator.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/BasicCollectionAnnotation.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/BasicMapAnnotation.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/CacheAnnotation.java199
-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.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ChangeTrackingAnnotation.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ChangeTrackingType.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ConversionValueAnnotation.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ConvertAnnotation.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ConverterAnnotation.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/CustomizerAnnotation.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkJPA.java155
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ExistenceCheckingAnnotation.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ExistenceType.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/JoinFetchAnnotation.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/JoinFetchType.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/MutableAnnotation.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/NamedConverterAnnotation.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/NestableConversionValue.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ObjectTypeConverterAnnotation.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/PrivateOwnedAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ReadOnlyAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ReadTransformerAnnotation.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/StructConverterAnnotation.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/TimeOfDayAnnotation.java113
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/TransformationAnnotation.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/TransformerAnnotation.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/TypeConverterAnnotation.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/WriteTransformerAnnotation.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/Attributes.java351
-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/EclipseLinkOrmFactory.java565
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java7382
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmResource.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmResourceFactory.java51
-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/XmlBasic.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicCollection.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicCollectionImpl.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicImpl.java701
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicMap.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicMapImpl.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCache.java781
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCacheHolder.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlChangeTracking.java203
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlChangeTrackingHolder.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlChangeTrackingType.java287
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConversionValue.java108
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConversionValueImpl.java274
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConverter.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConverterHolder.java151
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConverterImpl.java265
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConvertersHolder.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConvertibleMapping.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCustomizer.java213
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCustomizerHolder.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlEmbeddable.java560
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlEntity.java831
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlEntityMappings.java362
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlId.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlIdImpl.java707
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlJoinFetch.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlJoinFetchType.java238
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlManyToMany.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlManyToManyImpl.java253
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlManyToOne.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlManyToOneImpl.java253
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlMappedSuperclass.java830
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlMutable.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlNamedConverter.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlObjectTypeConverter.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlObjectTypeConverterImpl.java466
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOneToMany.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOneToManyImpl.java340
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOneToOne.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOneToOneImpl.java340
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlPrivateOwned.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlReadOnly.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlStructConverter.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlStructConverterImpl.java265
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTimeOfDay.java411
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTransformation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTransformationImpl.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTypeConverter.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTypeConverterImpl.java332
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlVersion.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlVersionImpl.java707
-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.MF14
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/build.properties17
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/component.xml1
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/plugin.properties24
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/property_files/jpt_gen.properties13
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/EntityGenTools.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/EntityGenerator.java1779
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenScope.java186
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenTable.java362
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/JPA.java302
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/JptGenMessages.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToManyRelation.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToOneRelation.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/OneToManyRelation.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/PackageGenerator.java103
-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.MF67
-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.xml1
-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.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/CommandExecutor.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/CommandExecutorProvider.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/Filter.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/JavaType.java105
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/MethodSignature.java63
-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/Association.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Bag.java187
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiFilter.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiStringConverter.java127
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiTransformer.java81
-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/BooleanHolder.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ClassTools.java1678
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Classpath.java911
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CollectionTools.java3918
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Counter.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/EmptyIterable.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/FileTools.java1006
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/HashBag.java914
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IdentityHashBag.java879
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IndentingPrintWriter.java148
-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.java167
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ListenerList.java117
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NameTools.java358
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NullList.java150
-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/ReverseComparator.java40
-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/SimpleFilter.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleJavaType.java231
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleMethodSignature.java234
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleStack.java95
-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/Stack.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringConverter.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringMatcher.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringTools.java4108
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedBoolean.java374
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedObject.java372
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedStack.java279
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Transformer.java69
-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/iterators/ArrayIterator.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayListIterator.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ChainIterator.java145
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneIterator.java154
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneListIterator.java253
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeIterator.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeListIterator.java194
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyEnumeration.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyIterator.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyListIterator.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EnumerationIterator.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/FilteringIterator.java134
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GenericIteratorWrapper.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GraphIterator.java242
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/IteratorEnumeration.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/PeekableIterator.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyCompositeListIterator.java178
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyIterator.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyListIterator.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ResultSetIterator.java154
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementIterator.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementListIterator.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationIterator.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationListIterator.java108
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TreeIterator.java194
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/AbstractModel.java996
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/CallbackChangeSupport.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/ChangeSupport.java2363
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/SingleAspectChangeSupport.java331
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTCollectionChangeListenerWrapper.java150
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTListChangeListenerWrapper.java198
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTPropertyChangeListenerWrapper.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTStateChangeListenerWrapper.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTTreeChangeListenerWrapper.java150
-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.java279
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectPropertyValueModelAdapter.java179
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/BufferedWritablePropertyValueModel.java345
-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/CollectionAspectAdapter.java238
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionListValueModelAdapter.java296
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionPropertyValueModelAdapter.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionValueModelWrapper.java179
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeCollectionValueModel.java406
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeListValueModel.java574
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ExtendedListValueModelWrapper.java204
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringCollectionValueModel.java171
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringPropertyValueModel.java138
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringWritablePropertyValueModel.java125
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemAspectListValueModelAdapter.java295
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemCollectionListValueModelAdapter.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemListListValueModelAdapter.java103
-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.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListAspectAdapter.java287
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCollectionValueModelAdapter.java300
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCurator.java220
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListPropertyValueModelAdapter.java166
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListValueModelWrapper.java206
-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.java50
-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.java255
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyCollectionValueModelAdapter.java194
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyListValueModelAdapter.java219
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyValueModelWrapper.java145
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimpleCollectionValueModel.java183
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimpleListValueModel.java316
-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.java132
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StatePropertyValueModelAdapter.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticCollectionValueModel.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticListValueModel.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticPropertyValueModel.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticTreeValueModel.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationListValueModelAdapter.java241
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationPropertyValueModel.java131
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationWritablePropertyValueModel.java127
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TreeAspectAdapter.java215
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TreePropertyValueModelAdapter.java137
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueAspectAdapter.java157
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueCollectionAdapter.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueListAdapter.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValuePropertyAdapter.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueStateAdapter.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueTreeAdapter.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencePropertyValueModel.java345
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencesCollectionValueModel.java200
-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.java362
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ListModelAdapter.java286
-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.java233
-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.java410
-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.java722
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/AbstractNode.java939
-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.java419
-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/RunnableValidation.java128
-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.java93
-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.java425
-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.java177
-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/model/Model.java195
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ChangeEvent.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionChangeEvent.java137
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListChangeEvent.java262
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/PropertyChangeEvent.java104
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/StateChangeEvent.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeChangeEvent.java111
-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.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/CollectionChangeListener.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ListChangeAdapter.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ListChangeListener.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/MultiMethodReflectiveChangeListener.java145
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/PropertyChangeListener.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ReflectiveChangeListener.java312
-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/StateChangeListener.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/TreeChangeAdapter.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/TreeChangeListener.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/CollectionValueModel.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/ListValueModel.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/PropertyValueModel.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/TreeNodeValueModel.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/TreeValueModel.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/WritablePropertyValueModel.java31
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.classpath7
-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/META-INF/MANIFEST.MF25
-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.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/plugin.xml27
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/ExtensionTestPlugin.java54
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMapping.java38
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMappingProvider.java48
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMapping.java43
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMappingProvider.java51
-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.java20
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaFactory.java37
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatform.java50
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatformUi.java55
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaUiFactory.java27
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/.classpath14
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/.cvsignore5
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/META-INF/MANIFEST.MF40
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/about.html34
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/build.properties18
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/plugin.properties22
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/JptAllCoreTests.java35
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/JptCoreTests.java73
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/ContextModelTestCase.java177
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/JpaFileTests.java400
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/JptCoreContextModelTests.java39
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaAssociationOverrideTests.java389
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaAttributeOverrideTests.java259
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaBasicMappingTests.java977
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaColumnTests.java815
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaDiscriminatorColumnTests.java310
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEmbeddableTests.java177
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEmbeddedIdMappingTests.java590
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEmbeddedMappingTests.java640
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEntityTests.java2880
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaGeneratedValueTests.java147
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaIdMappingTests.java707
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaJoinColumnTests.java511
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaJoinTableTests.java963
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToManyMappingTests.java963
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToOneMappingTests.java886
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaMappedSuperclassTests.java245
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaNamedNativeQueryTests.java424
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaNamedQueryTests.java323
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToManyMappingTests.java939
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToOneMappingTests.java1292
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPersistentAttributeTests.java215
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPersistentTypeTests.java758
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPrimaryKeyJoinColumnTests.java295
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaQueryHintTests.java142
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaSecondaryTableTests.java734
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaSequenceGeneratorTests.java255
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTableGeneratorTests.java700
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTableTests.java546
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTransientMappingTests.java248
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaVersionMappingTests.java398
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JptCoreContextJavaModelTests.java62
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/EntityMappingsTests.java1067
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/JptCoreOrmContextModelTests.java66
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmAssociationOverrideTests.java255
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmAttributeOverrideTests.java96
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmBasicMappingTests.java708
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmCascadeTests.java280
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmColumnTests.java838
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmDiscriminatorColumnTests.java338
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEmbeddableTests.java297
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEmbeddedIdMappingTests.java874
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEmbeddedMappingTests.java743
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEntityTests.java2224
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmGeneratedValueTests.java153
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmIdMappingTests.java744
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmJoinColumnTests.java506
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmJoinTableTests.java1156
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToManyMappingTests.java654
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToOneMappingTests.java542
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmMappedSuperclassTests.java347
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmNamedNativeQueryTests.java358
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmNamedQueryTests.java273
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToManyMappingTests.java655
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToOneMappingTests.java955
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmPersistentAttributeTests.java251
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmPersistentTypeTests.java510
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmPrimaryKeyJoinColumnTests.java292
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmQueryHintTests.java122
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmSecondaryTableTests.java763
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmSequenceGeneratorTests.java211
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTableGeneratorTests.java622
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTableTests.java767
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTransientMappingTests.java301
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmVersionMappingTests.java485
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmXmlTests.java112
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/PersistenceUnitDefaultsTests.java369
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/PersistenceUnitMetadataTests.java105
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/ClassRefTests.java112
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/JptCorePersistenceContextModelTests.java37
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/MappingFileRefTests.java97
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceTests.java137
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceUnitTests.java1162
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceXmlTests.java92
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/RootContextNodeTests.java93
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/JpaModelTests.java227
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/JptCoreModelTests.java32
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/BaseJpaPlatformTests.java76
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/JpaPlatformExtensionTests.java71
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/JpaPlatformTests.java120
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestFacetedProject.java80
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJavaProject.java118
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJpaProject.java77
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestPlatformProject.java78
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/JptCoreResourceModelTests.java36
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/OrmModelTests.java82
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/PersistenceModelTests.java77
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AssociationOverrideTests.java252
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AssociationOverridesTests.java320
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AttributeOverrideTests.java149
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AttributeOverridesTests.java272
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/BasicTests.java150
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ColumnTests.java403
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/DiscriminatorColumnTests.java211
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/DiscriminatorValueTests.java82
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddableTests.java73
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddedIdTests.java49
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddedTests.java49
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EntityTests.java124
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EnumeratedTests.java88
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/GeneratedValueTests.java132
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/IdClassTests.java105
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/IdTests.java49
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/InheritanceTests.java82
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JPTToolsTests.java517
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourceModelTestCase.java177
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourcePersistentAttributeTests.java859
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourcePersistentTypeTests.java921
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinColumnTests.java351
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinColumnsTests.java421
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinTableTests.java655
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JptJavaResourceTests.java79
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/LobTests.java48
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ManyToManyTests.java393
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ManyToOneTests.java386
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/MapKeyTests.java87
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/MappedSuperclassTests.java73
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedNativeQueriesTests.java421
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedNativeQueryTests.java340
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedQueriesTests.java331
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedQueryTests.java258
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OneToManyTests.java396
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OneToOneTests.java446
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OrderByTests.java86
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/PrimaryKeyJoinColumnTests.java186
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/PrimaryKeyJoinColumnsTests.java252
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/QueryHintTests.java64
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SecondaryTableTests.java435
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SecondaryTablesTests.java503
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SequenceGeneratorTests.java230
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TableGeneratorTests.java500
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TableTests.java345
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TemporalTests.java87
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TransientTests.java49
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/VersionTests.java48
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/AnnotationTestCase.java512
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapterTests.java731
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/DefaultAnnotationEditFormatterTests.java74
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/JDTToolsTests.java87
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/JptCoreUtilityJdtTests.java39
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/MemberAnnotationElementAdapterTests.java1297
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/NestedDeclarationAnnotationAdapterTests.java764
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/NestedIndexedDeclarationAnnotationAdapterTests.java2220
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/SimpleDeclarationAnnotationAdapterTests.java274
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/TypeTests.java51
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/test.xml47
-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/META-INF/MANIFEST.MF20
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/about.html34
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/build.properties15
-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.properties25
-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.java1080
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DerbyTests.java433
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/MySQLTests.java366
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gTests.java342
-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.java433
-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.java383
-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.jdt.core.prefs7
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/META-INF/MANIFEST.MF13
-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.properties22
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/src/org/eclipse/jpt/gen/tests/internal/EntityGenToolsTests.java144
-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.xml40
-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/META-INF/MANIFEST.MF23
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/build.properties4
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/plugin.properties22
-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.java599
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java569
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java57
-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/CComboModelAdapterTest.java75
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/CheckBoxModelAdapterUITest.java318
-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.java39
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/ListBoxModelAdapterUITest.java640
-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/TextFieldModelAdapterUITest.java252
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TriStateCheckBoxModelAdapterUITest.java320
-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.java84
-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.java93
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneVisibilityEnablerTest.java93
-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.MF18
-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/BitToolsTests.java243
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BooleanHolderTests.java80
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClassToolsTests.java633
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClasspathTests.java289
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CollectionToolsTests.java3906
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CounterTests.java92
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/EmptyIterableTests.java30
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/FileToolsTests.java594
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/HashBagTests.java545
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IdentityHashBagTests.java564
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IndentingPrintWriterTests.java107
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JDBCTypeTests.java66
-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.java64
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ListenerListTests.java179
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/MethodSignatureTests.java235
-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/RangeTests.java74
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ReverseComparatorTests.java101
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleAssociationTests.java98
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleStackTests.java140
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java1640
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedBooleanTests.java225
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedObjectTests.java292
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedStackTests.java270
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/TestTools.java142
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/XMLStringEncoderTests.java135
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayIteratorTests.java126
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayListIteratorTests.java150
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ChainIteratorTests.java132
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneIteratorTests.java252
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneListIteratorTests.java408
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeIteratorTests.java350
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeListIteratorTests.java330
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyEnumerationTests.java53
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyIteratorTests.java63
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyListIteratorTests.java127
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EnumerationIteratorTests.java119
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/FilteringIteratorTests.java298
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/GraphIteratorTests.java196
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/IteratorEnumerationTests.java98
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/JptUtilityIteratorsTests.java55
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/PeekableIteratorTests.java140
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyCompositeListIteratorTests.java204
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyIteratorTests.java118
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyListIteratorTests.java203
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementIteratorTests.java71
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementListIteratorTests.java111
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationIteratorTests.java229
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationListIteratorTests.java321
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TreeIteratorTests.java210
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/AbstractModelTests.java1721
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/JptUtilityModelTests.java36
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/NewEventTests.java187
-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.java453
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveListChangeListenerTests.java742
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectivePropertyChangeListenerTests.java193
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveStateChangeListenerTests.java144
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveTreeChangeListenerTests.java513
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/BufferedWritablePropertyValueModelTests.java408
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CachingTransformationPropertyValueModelTests.java220
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CachingTransformationWritablePropertyValueModelTests.java249
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionAspectAdapterTests.java367
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionListValueModelAdapterTests.java234
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionPropertyValueModelAdapterTests.java234
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeCollectionValueModelTests.java414
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeListValueModelTests.java847
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedBag.java153
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedList.java254
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ExtendedListValueModelWrapperTests.java292
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringCollectionValueModelTests.java287
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringPropertyValueModelTests.java186
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemCollectionListValueModelAdapterTests.java239
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemListListValueModelAdapterTests.java240
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemPropertyListValueModelAdapterTests.java330
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemStateListValueModelAdapterTests.java302
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/JptUtilityModelValueTests.java73
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListAspectAdapterTests.java473
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCollectionValueModelAdapterTests.java271
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCuratorTests.java314
-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.java326
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyCollectionValueModelAdapterTests.java151
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyListValueModelAdapterTests.java198
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleCollectionValueModelTests.java409
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleListValueModelTests.java327
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimplePropertyValueModelTests.java93
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SortedListValueModelAdapterTests.java196
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticCollectionValueModelTests.java61
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticListValueModelTests.java64
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticValueModelTests.java46
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationListValueModelAdapterTests.java317
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java185
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TreeAspectAdapterTests.java353
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueCollectionAdapterTests.java156
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueListAdapterTests.java167
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValuePropertyAdapterTests.java143
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueStateAdapterTests.java143
-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.java382
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesCollectionValueModelTests.java276
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesTestCase.java85
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterTests.java134
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterUITest.java313
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterTests.java110
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest.java391
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest2.java74
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DateSpinnerModelAdapterTests.java159
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterTests.java158
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterUITest.java255
-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.java315
-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.java133
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/NumberSpinnerModelAdapterTests.java147
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ObjectListSelectionModelTests.java202
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/PrimitiveListTreeModelTests.java197
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterTests.java229
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterUITest.java257
-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.java117
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterUITest.java341
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterTests.java643
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterUITest.java731
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterTests.java814
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterUITest.java424
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/node/AbstractNodeTests.java526
-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/test.xml40
2171 files changed, 0 insertions, 368606 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 470b4bcb63..0000000000
--- a/assembly/features/org.eclipse.jpt.assembly.feature/build.properties
+++ /dev/null
@@ -1,16 +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
- \ No newline at end of file
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 0ae42bbb56..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=Java Persistence API Tools
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Java Persistence API 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 6920326edf..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.1.0.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.patch/.project b/assembly/features/org.eclipse.jpt.patch/.project
deleted file mode 100644
index b7a2bf552d..0000000000
--- a/assembly/features/org.eclipse.jpt.patch/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.patch</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/assembly/features/org.eclipse.jpt.patch/build.properties b/assembly/features/org.eclipse.jpt.patch/build.properties
deleted file mode 100644
index c381fb22bb..0000000000
--- a/assembly/features/org.eclipse.jpt.patch/build.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-bin.includes = feature.xml,\
- license.html,\
- feature.properties,\
- epl-v10.html,\
- eclipse_update_120.jpg
-src.includes = eclipse_update_120.jpg,\
- epl-v10.html,\
- feature.properties,\
- feature.xml,\
- license.html
diff --git a/assembly/features/org.eclipse.jpt.patch/buildnotes_org.eclipse.jpt.patch.html b/assembly/features/org.eclipse.jpt.patch/buildnotes_org.eclipse.jpt.patch.html
deleted file mode 100644
index 0d115f43fb..0000000000
--- a/assembly/features/org.eclipse.jpt.patch/buildnotes_org.eclipse.jpt.patch.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Build" content="Build">
- <title>Java Persistence Tools (JTP) 1.0.2 Patches</title>
-</head>
-
-<body>
-
-<h1>JTP 2.0.2 Patches</h1>
-
-<h2>Feature Patched: org.eclipse.jpt.patch</h2>
-<h3>Plugin(s) replaced:</h3>
-<ul><li>org.eclipse.jpt.gen</li></ul>
-<p>Bug <a href='https://bugs.eclipse.org/220297'>220297</a>. Entity generation creates Embeddables with compile errors in some cases.</p>
-
-
-</body></html> \ No newline at end of file
diff --git a/assembly/features/org.eclipse.jpt.patch/eclipse_update_120.jpg b/assembly/features/org.eclipse.jpt.patch/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/assembly/features/org.eclipse.jpt.patch/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/assembly/features/org.eclipse.jpt.patch/epl-v10.html b/assembly/features/org.eclipse.jpt.patch/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/assembly/features/org.eclipse.jpt.patch/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html> \ No newline at end of file
diff --git a/assembly/features/org.eclipse.jpt.patch/feature.properties b/assembly/features/org.eclipse.jpt.patch/feature.properties
deleted file mode 100644
index a8457ea0cc..0000000000
--- a/assembly/features/org.eclipse.jpt.patch/feature.properties
+++ /dev/null
@@ -1,143 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Java Persistence Tools (JTP) Patches
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=\
-Patch(s) for Java Persistence API (JPA) Tools. \n\
-See bug 220297 (https://bugs.eclipse.org/bugs/220297) Entity generation creates Embeddables with compile errors in some cases \n\
-
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006-08 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
- - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/assembly/features/org.eclipse.jpt.patch/feature.xml b/assembly/features/org.eclipse.jpt.patch/feature.xml
deleted file mode 100644
index 4fae92b5fa..0000000000
--- a/assembly/features/org.eclipse.jpt.patch/feature.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.patch"
- label="%featureName"
- version="1.0.2.qualifier"
- provider-name="%providerName">
-
- <description url="http://download.eclipse.org/webtools/patches/">
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="%licenseURL">
- %license
- </license>
-
- <url>
- <update label="Web Tools Platform (WTP) Patches" url="http://download.eclipse.org/webtools/patches/"/>
- </url>
-
- <requires>
- <import feature="org.eclipse.jpt.feature" version="1.0.2.v200802140100-77-7_CYQCD2CaLYCHCD" patch="true"/>
- </requires>
-
- <plugin
- id="org.eclipse.jpt.gen"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/assembly/features/org.eclipse.jpt.patch/license.html b/assembly/features/org.eclipse.jpt.patch/license.html
deleted file mode 100644
index 2347060ef3..0000000000
--- a/assembly/features/org.eclipse.jpt.patch/license.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>January 28, 2005</P>
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse
-Foundation is provided to you under the terms and conditions of the Eclipse
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this
-Content and is also available at <A
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code,
-documentation and other files maintained in the Eclipse.org CVS repository
-("Repository") in CVS modules ("Modules") and made available as downloadable
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may
-contain a list of the names and version numbers of the Plug-ins and/or Fragments
-associated with a Feature. Plug-ins and Fragments are located in directories
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named
-"feature.xml" may contain a list of the names and version numbers of Included
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained
-in files named "about.html" ("Abouts"). The terms and conditions governing
-Features and Included Features should be contained in files named "license.html"
-("Feature Licenses"). Abouts and Feature Licenses may be located in any
-directory of a Download or Module including, but not limited to the following
-locations:</P>
-<UL>
- <LI>The top-level (root) directory
- <LI>Plug-in and Fragment directories
- <LI>Subdirectories of the directory named "src" of certain Plug-ins
- <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed
-using the Eclipse Update Manager, you must agree to a license ("Feature Update
-License") during the installation process. If the Feature contains Included
-Features, the Feature Update License should either provide you with the terms
-and conditions governing the Included Features or inform you where you can
-locate them. Feature Update Licenses may be found in the "license" property of
-files named "feature.properties". Such Abouts, Feature Licenses and Feature
-Update Licenses contain the terms and conditions (or references to such terms
-and conditions) that govern your use of the associated Content in that
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
- <LI>Common Public License Version 1.0 (available at <A
- href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>)
-
- <LI>Apache Software License 1.1 (available at <A
- href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>)
-
- <LI>Apache Software License 2.0 (available at <A
- href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>)
-
- <LI>IBM Public License 1.0 (available at <A
- href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>)
-
- <LI>Metro Link Public License 1.00 (available at <A
- href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>)
-
- <LI>Mozilla Public License Version 1.1 (available at <A
- href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>)
- </LI></UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is
-provided, please contact the Eclipse Foundation to determine what terms and
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are
-currently may have restrictions on the import, possession, and use, and/or
-re-export to another country, of encryption software. BEFORE using any
-encryption software, please check the country's laws, regulations and policies
-concerning the import, possession, or use, and re-export of encryption software,
-to see if this is permitted.</P></BODY></HTML>
diff --git a/assembly/features/org.eclipse.jpt.sdk/.cvsignore b/assembly/features/org.eclipse.jpt.sdk/.cvsignore
deleted file mode 100644
index bc2abf75c1..0000000000
--- a/assembly/features/org.eclipse.jpt.sdk/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-*.bin.dist.zip
-build.xml
-features
-plugins
diff --git a/assembly/features/org.eclipse.jpt.sdk/.project b/assembly/features/org.eclipse.jpt.sdk/.project
deleted file mode 100644
index 821d453136..0000000000
--- a/assembly/features/org.eclipse.jpt.sdk/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.sdk</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/assembly/features/org.eclipse.jpt.sdk/build.properties b/assembly/features/org.eclipse.jpt.sdk/build.properties
deleted file mode 100644
index 7200939aca..0000000000
--- a/assembly/features/org.eclipse.jpt.sdk/build.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- epl-v10.html,\
- license.html,\
- feature.properties
diff --git a/assembly/features/org.eclipse.jpt.sdk/eclipse_update_120.jpg b/assembly/features/org.eclipse.jpt.sdk/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/assembly/features/org.eclipse.jpt.sdk/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/assembly/features/org.eclipse.jpt.sdk/epl-v10.html b/assembly/features/org.eclipse.jpt.sdk/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/assembly/features/org.eclipse.jpt.sdk/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html> \ No newline at end of file
diff --git a/assembly/features/org.eclipse.jpt.sdk/feature.properties b/assembly/features/org.eclipse.jpt.sdk/feature.properties
deleted file mode 100644
index abb0c88d62..0000000000
--- a/assembly/features/org.eclipse.jpt.sdk/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 API (JPA) project SDK
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Dali Java Persistence API (JPA) 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/feature.xml b/assembly/features/org.eclipse.jpt.sdk/feature.xml
deleted file mode 100644
index c7f1fe5f0c..0000000000
--- a/assembly/features/org.eclipse.jpt.sdk/feature.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.sdk"
- label="%featureName"
- version="2.1.0.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.jpt"
- image="eclipse_update_120.jpg">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <url>
- <update label="%updateSiteName" url="http://download.eclipse.org/webtools/updates"/>
- <discovery label="Web Tools Platform (WTP) Updates" url="http://download.eclipse.org/webtools/updates"/>
- </url>
-
- <includes
- id="org.eclipse.jpt_sdk.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.eclipselink_sdk.feature"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jpt"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/assembly/features/org.eclipse.jpt.sdk/license.html b/assembly/features/org.eclipse.jpt.sdk/license.html
deleted file mode 100644
index 76abfb4621..0000000000
--- a/assembly/features/org.eclipse.jpt.sdk/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.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 7f47694aab..0000000000
--- a/assembly/features/org.eclipse.jpt.tests.assembly.feature/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- epl-v10.html,\
- license.html,\
- feature.properties
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 6b58fe6a33..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 API (JPA) project Tests
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Dali Java Persistence API (JPA) 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 8c1d8196fd..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.1.0.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.tests/.cvsignore b/assembly/features/org.eclipse.jpt.tests/.cvsignore
deleted file mode 100644
index 2544693f86..0000000000
--- a/assembly/features/org.eclipse.jpt.tests/.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/.project b/assembly/features/org.eclipse.jpt.tests/.project
deleted file mode 100644
index 3d1dde631a..0000000000
--- a/assembly/features/org.eclipse.jpt.tests/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.tests</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/.settings/org.eclipse.core.resources.prefs b/assembly/features/org.eclipse.jpt.tests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 17acb651a8..0000000000
--- a/assembly/features/org.eclipse.jpt.tests/.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/build.properties b/assembly/features/org.eclipse.jpt.tests/build.properties
deleted file mode 100644
index 7f47694aab..0000000000
--- a/assembly/features/org.eclipse.jpt.tests/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- epl-v10.html,\
- license.html,\
- feature.properties
diff --git a/assembly/features/org.eclipse.jpt.tests/eclipse_update_120.jpg b/assembly/features/org.eclipse.jpt.tests/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/assembly/features/org.eclipse.jpt.tests/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/assembly/features/org.eclipse.jpt.tests/epl-v10.html b/assembly/features/org.eclipse.jpt.tests/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/assembly/features/org.eclipse.jpt.tests/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/feature.properties b/assembly/features/org.eclipse.jpt.tests/feature.properties
deleted file mode 100644
index 6b58fe6a33..0000000000
--- a/assembly/features/org.eclipse.jpt.tests/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 API (JPA) project Tests
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Dali Java Persistence API (JPA) 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/feature.xml b/assembly/features/org.eclipse.jpt.tests/feature.xml
deleted file mode 100644
index 020fa447a7..0000000000
--- a/assembly/features/org.eclipse.jpt.tests/feature.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.tests"
- label="%featureName"
- version="2.1.0.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/license.html b/assembly/features/org.eclipse.jpt.tests/license.html
deleted file mode 100644
index 56445985d9..0000000000
--- a/assembly/features/org.eclipse.jpt.tests/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/.cvsignore b/assembly/features/org.eclipse.jpt/.cvsignore
deleted file mode 100644
index de8b73fb72..0000000000
--- a/assembly/features/org.eclipse.jpt/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-build.xml
-org.eclipse.jpt_1.0.0.*
diff --git a/assembly/features/org.eclipse.jpt/.project b/assembly/features/org.eclipse.jpt/.project
deleted file mode 100644
index b7aaec2f54..0000000000
--- a/assembly/features/org.eclipse.jpt/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/assembly/features/org.eclipse.jpt/build.properties b/assembly/features/org.eclipse.jpt/build.properties
deleted file mode 100644
index 470b4bcb63..0000000000
--- a/assembly/features/org.eclipse.jpt/build.properties
+++ /dev/null
@@ -1,16 +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
- \ No newline at end of file
diff --git a/assembly/features/org.eclipse.jpt/eclipse_update_120.jpg b/assembly/features/org.eclipse.jpt/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/assembly/features/org.eclipse.jpt/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/assembly/features/org.eclipse.jpt/epl-v10.html b/assembly/features/org.eclipse.jpt/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/assembly/features/org.eclipse.jpt/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/feature.properties b/assembly/features/org.eclipse.jpt/feature.properties
deleted file mode 100644
index 0ae42bbb56..0000000000
--- a/assembly/features/org.eclipse.jpt/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=Java Persistence API Tools
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Java Persistence API 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/feature.xml b/assembly/features/org.eclipse.jpt/feature.xml
deleted file mode 100644
index d33f93fb1b..0000000000
--- a/assembly/features/org.eclipse.jpt/feature.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt"
- label="%featureName"
- version="2.1.0.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.jpt"
- image="eclipse_update_120.jpg">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <url>
- <update label="%updateSiteName" url="http://download.eclipse.org/webtools/updates"/>
- <discovery label="Web Tools Platform (WTP) Updates" url="http://download.eclipse.org/webtools/updates"/>
- </url>
-
- <includes
- id="org.eclipse.jpt.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.eclipselink.feature"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jpt"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/assembly/features/org.eclipse.jpt/license.html b/assembly/features/org.eclipse.jpt/license.html
deleted file mode 100644
index 2347060ef3..0000000000
--- a/assembly/features/org.eclipse.jpt/license.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>January 28, 2005</P>
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse
-Foundation is provided to you under the terms and conditions of the Eclipse
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this
-Content and is also available at <A
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code,
-documentation and other files maintained in the Eclipse.org CVS repository
-("Repository") in CVS modules ("Modules") and made available as downloadable
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may
-contain a list of the names and version numbers of the Plug-ins and/or Fragments
-associated with a Feature. Plug-ins and Fragments are located in directories
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named
-"feature.xml" may contain a list of the names and version numbers of Included
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained
-in files named "about.html" ("Abouts"). The terms and conditions governing
-Features and Included Features should be contained in files named "license.html"
-("Feature Licenses"). Abouts and Feature Licenses may be located in any
-directory of a Download or Module including, but not limited to the following
-locations:</P>
-<UL>
- <LI>The top-level (root) directory
- <LI>Plug-in and Fragment directories
- <LI>Subdirectories of the directory named "src" of certain Plug-ins
- <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed
-using the Eclipse Update Manager, you must agree to a license ("Feature Update
-License") during the installation process. If the Feature contains Included
-Features, the Feature Update License should either provide you with the terms
-and conditions governing the Included Features or inform you where you can
-locate them. Feature Update Licenses may be found in the "license" property of
-files named "feature.properties". Such Abouts, Feature Licenses and Feature
-Update Licenses contain the terms and conditions (or references to such terms
-and conditions) that govern your use of the associated Content in that
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
- <LI>Common Public License Version 1.0 (available at <A
- href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>)
-
- <LI>Apache Software License 1.1 (available at <A
- href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>)
-
- <LI>Apache Software License 2.0 (available at <A
- href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>)
-
- <LI>IBM Public License 1.0 (available at <A
- href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>)
-
- <LI>Metro Link Public License 1.00 (available at <A
- href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>)
-
- <LI>Mozilla Public License Version 1.1 (available at <A
- href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>)
- </LI></UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is
-provided, please contact the Eclipse Foundation to determine what terms and
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are
-currently may have restrictions on the import, possession, and use, and/or
-re-export to another country, of encryption software. BEFORE using any
-encryption software, please check the country's laws, regulations and policies
-concerning the import, possession, or use, and re-export of encryption software,
-to see if this is permitted.</P></BODY></HTML>
diff --git a/assembly/features/org.eclipse.jpt_sdk.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 7200939aca..0000000000
--- a/assembly/features/org.eclipse.jpt_sdk.assembly.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/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 abb0c88d62..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 API (JPA) project SDK
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Dali Java Persistence API (JPA) 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 f3fb17f14a..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.1.0.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/assembly/plugins/org.eclipse.jpt/.cvsignore b/assembly/plugins/org.eclipse.jpt/.cvsignore
deleted file mode 100644
index c9401a2c83..0000000000
--- a/assembly/plugins/org.eclipse.jpt/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-build.xml
-org.eclipse.jpt_1.0.0.* \ No newline at end of file
diff --git a/assembly/plugins/org.eclipse.jpt/.project b/assembly/plugins/org.eclipse.jpt/.project
deleted file mode 100644
index f51b04cc90..0000000000
--- a/assembly/plugins/org.eclipse.jpt/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/assembly/plugins/org.eclipse.jpt/.settings/org.eclipse.core.resources.prefs b/assembly/plugins/org.eclipse.jpt/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 4aec29d1cd..0000000000
--- a/assembly/plugins/org.eclipse.jpt/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:10:09 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/assembly/plugins/org.eclipse.jpt/META-INF/MANIFEST.MF b/assembly/plugins/org.eclipse.jpt/META-INF/MANIFEST.MF
deleted file mode 100644
index 94e3bbd5b3..0000000000
--- a/assembly/plugins/org.eclipse.jpt/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jpt; singleton:=true
-Bundle-Version: 2.1.0.qualifier
-Bundle-Localization: plugin
-Bundle-Vendor: %providerName
diff --git a/assembly/plugins/org.eclipse.jpt/about.html b/assembly/plugins/org.eclipse.jpt/about.html
deleted file mode 100644
index ca606b1bb5..0000000000
--- a/assembly/plugins/org.eclipse.jpt/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June 06, 2007</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML> \ No newline at end of file
diff --git a/assembly/plugins/org.eclipse.jpt/about.ini b/assembly/plugins/org.eclipse.jpt/about.ini
deleted file mode 100644
index 588a325a8f..0000000000
--- a/assembly/plugins/org.eclipse.jpt/about.ini
+++ /dev/null
@@ -1,44 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-# Property "tipsAndTricksHref" contains the Help topic href to a tips and tricks page
-# optional
-tipsAndTricksHref=/org.eclipse.jpt.doc.user/tips_and_tricks.htm
-
-
diff --git a/assembly/plugins/org.eclipse.jpt/about.mappings b/assembly/plugins/org.eclipse.jpt/about.mappings
deleted file mode 100644
index bddaab4310..0000000000
--- a/assembly/plugins/org.eclipse.jpt/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@ \ No newline at end of file
diff --git a/assembly/plugins/org.eclipse.jpt/about.properties b/assembly/plugins/org.eclipse.jpt/about.properties
deleted file mode 100644
index 159bfceeba..0000000000
--- a/assembly/plugins/org.eclipse.jpt/about.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-
-blurb=Java Persistence API Tools\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2006. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
diff --git a/assembly/plugins/org.eclipse.jpt/build.properties b/assembly/plugins/org.eclipse.jpt/build.properties
deleted file mode 100644
index 0ccfb0ebb8..0000000000
--- a/assembly/plugins/org.eclipse.jpt/build.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2007 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = META-INF/,\
- about.ini,\
- about.html,\
- about.mappings,\
- about.properties,\
- eclipse32.gif,\
- eclipse32.png,\
- plugin.properties,\
- component.xml
diff --git a/assembly/plugins/org.eclipse.jpt/component.xml b/assembly/plugins/org.eclipse.jpt/component.xml
deleted file mode 100644
index 11f133f65a..0000000000
--- a/assembly/plugins/org.eclipse.jpt/component.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt">
-<description url=""></description>
-<component-depends unrestricted="true"></component-depends>
-<plugin id="org.eclipse.jpt" fragment="false"/>
-<plugin id="org.eclipse.jpt.core" fragment="false"/>
-<plugin id="org.eclipse.jpt.db" fragment="false"/>
-<plugin id="org.eclipse.jpt.db.ui" fragment="false"/>
-<plugin id="org.eclipse.jpt.gen" fragment="false"/>
-<plugin id="org.eclipse.jpt.ui" fragment="false"/>
-<plugin id="org.eclipse.jpt.utility" fragment="false"/>
-</component> \ No newline at end of file
diff --git a/assembly/plugins/org.eclipse.jpt/eclipse32.gif b/assembly/plugins/org.eclipse.jpt/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/assembly/plugins/org.eclipse.jpt/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/assembly/plugins/org.eclipse.jpt/eclipse32.png b/assembly/plugins/org.eclipse.jpt/eclipse32.png
deleted file mode 100644
index 568fac1d05..0000000000
--- a/assembly/plugins/org.eclipse.jpt/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/assembly/plugins/org.eclipse.jpt/plugin.properties b/assembly/plugins/org.eclipse.jpt/plugin.properties
deleted file mode 100644
index f45a08d54e..0000000000
--- a/assembly/plugins/org.eclipse.jpt/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Java Persistence API Tools
-providerName = Eclipse.org
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 6f0fd807a2..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/feature.properties
+++ /dev/null
@@ -1,140 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Java Persistence API Tools - EclipseLink Support (Optional)
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Java Persistence API Tools - EclipseLink Support (Optional)
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006-08 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
- - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/feature.xml b/jpa/features/org.eclipse.jpt.eclipselink.feature/feature.xml
deleted file mode 100644
index b3626a2278..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/feature.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.eclipselink.feature"
- label="%featureName"
- version="2.1.0.qualifier"
- provider-name="%providerName"
- image="eclipse_update_120.jpg">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <url>
- <update label="Web Tools Platform (WTP) Updates" url="http://download.eclipse.org/webtools/updates"/>
- <discovery label="Web Tools Platform (WTP) Updates" url="http://download.eclipse.org/webtools/updates"/>
- <discovery label="Dali Java Persistence API Tools (JPA) Updates" url="http://download.eclipse.org/webtools/updates/"/>
- </url>
-
- <requires>
- <import feature="org.eclipse.jpt.feature" version="2.0.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"/>
-
-</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 fc77372d46..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.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/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 50c0a9ef9c..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# 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=Java Persistence API 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 14b1d50265..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/license.html
+++ /dev/null
@@ -1,83 +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>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 &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>
-
- <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>
-
-<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 d0d5f1c727..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/plugin.properties
+++ /dev/null
@@ -1,13 +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
-###############################################################################
-
-pluginName = Java Persistence API Tools - EclipseLink Support
-providerName = Eclipse.org
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 9566406636..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,145 +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
-###############################################################################
-# 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=Java Persistence API Tools - EclipseLink Support (Optional)
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Source code zips for JPA EclipseLink Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2008 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/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 fec4a489ad..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/license.html
+++ /dev/null
@@ -1,82 +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>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 &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>
- <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>
-
-<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/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 50c0a9ef9c..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# 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=Java Persistence API 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 14b1d50265..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/license.html
+++ /dev/null
@@ -1,83 +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>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 &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>
-
- <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>
-
-<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 d0d5f1c727..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,13 +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
-###############################################################################
-
-pluginName = Java Persistence API Tools - EclipseLink Support
-providerName = Eclipse.org
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 e8d47d70af..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/feature.properties
+++ /dev/null
@@ -1,140 +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
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Java Persistence API Tools - EclipseLink Support SDK (Optional)
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Source code zips for JPA EclipseLink Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006-08 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
- - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/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 58f025eff3..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.1.0.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 fc77372d46..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink_sdk.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.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 a2b39f3024..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/feature.properties
+++ /dev/null
@@ -1,140 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Java Persistence API Tools
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Java Persistence API (JPA) Tools
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006-07 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/jpa/features/org.eclipse.jpt.feature/feature.xml b/jpa/features/org.eclipse.jpt.feature/feature.xml
deleted file mode 100644
index a7cf3d2d3b..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/feature.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.feature"
- label="%featureName"
- version="2.1.0.qualifier"
- provider-name="%providerName"
- image="eclipse_update_120.jpg">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <url>
- <update label="Web Tools Platform (WTP) Updates" url="http://download.eclipse.org/webtools/updates"/>
- <discovery label="Web Tools Platform (WTP) Updates" url="http://download.eclipse.org/webtools/updates"/>
- <discovery label="Dali Java Persistence API Tools (JPA) Updates" url="http://download.eclipse.org/webtools/updates/"/>
- </url>
-
- <requires>
- <import feature="org.eclipse.platform" version="3.4.0"/>
- <import feature="org.eclipse.gef" version="3.4.0"/>
- <import feature="org.eclipse.jdt" version="3.4.0"/>
- <import feature="org.eclipse.xsd" version="2.4.0"/>
- <import feature="org.eclipse.emf.codegen" version="2.4.0"/>
- <import feature="org.eclipse.emf.ecore" version="2.4.0"/>
- <import feature="org.eclipse.jst.web_core.feature" version="3.0.0"/>
- <import feature="org.eclipse.jst.enterprise_core.feature" version="3.0.0"/>
- <import feature="org.eclipse.jst.enterprise_ui.feature" version="3.0.0"/>
- <import feature="org.eclipse.datatools.modelbase.feature" version="1.6.0"/>
- <import feature="org.eclipse.datatools.enablement.feature" version="1.6.0"/>
- <import feature="org.eclipse.datatools.sqldevtools.feature" version="1.6.0"/>
- <import feature="org.eclipse.datatools.connectivity.feature" version="1.6.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.doc.user"
- 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 fc77372d46..0000000000
--- a/jpa/features/org.eclipse.jpt.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.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 15417ff15a..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.properties
+++ /dev/null
@@ -1,26 +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
-###############################################################################
-# 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 API (JPA) 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 14b1d50265..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/license.html
+++ /dev/null
@@ -1,83 +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>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 &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>
-
- <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>
-
-<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 f948547000..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/plugin.properties
+++ /dev/null
@@ -1,13 +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
-###############################################################################
-
-pluginName = Dali Java Persistence API (JPA) Tools
-providerName = Eclipse.org
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 267f534af6..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,145 +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
-###############################################################################
-# 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 API (JPA) Tools
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Dali Java Persistence API (JPA) Tools
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006 2008 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/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/license.html b/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/license.html
deleted file mode 100644
index fec4a489ad..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/license.html
+++ /dev/null
@@ -1,82 +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>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 &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>
- <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>
-
-<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/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 15417ff15a..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +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
-###############################################################################
-# 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 API (JPA) 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/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 14b1d50265..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/license.html
+++ /dev/null
@@ -1,83 +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>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 &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>
-
- <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>
-
-<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 f948547000..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,13 +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
-###############################################################################
-
-pluginName = Dali Java Persistence API (JPA) Tools
-providerName = Eclipse.org
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 33ec536d55..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.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
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "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 API (JPA) Tools
-
-# "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/jpa/features/org.eclipse.jpt.tests.feature/feature.xml b/jpa/features/org.eclipse.jpt.tests.feature/feature.xml
deleted file mode 100644
index a34a08d462..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="Dali Java Persistence API Tools (JPA) JUnit Tests"
- version="2.1.0.qualifier"
- provider-name="Eclipse.org">
-
- <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 56445985d9..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.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_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 a14204ac5e..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/feature.properties
+++ /dev/null
@@ -1,140 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Java Persistence API Tools Plug-in SDK
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Source code zips for JPA Tools
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006-07 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/jpa/features/org.eclipse.jpt_sdk.feature/feature.xml b/jpa/features/org.eclipse.jpt_sdk.feature/feature.xml
deleted file mode 100644
index 0e36c7c6ce..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.1.0.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 fc77372d46..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.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/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 56f01c3c10..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Jan 15 11:10:33 EST 2008
-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 5b30f5df59..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,70 +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.1.0.qualifier
-Bundle-Activator: org.eclipse.jpt.core.JptCorePlugin
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-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;bundle-version="[2.4.0,3.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;bundle-version="[2.0.200,3.0.0)",
- org.eclipse.jem.util;bundle-version="[2.0.100,3.0.0)",
- org.eclipse.jem.workbench;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.j2ee;bundle-version="[1.1.200,1.2.0)",
- org.eclipse.jst.j2ee.core;bundle-version="[1.1.200,1.2.0)",
- org.eclipse.jst.jee.ejb;bundle-version="[1.0.100,1.1.0)",
- org.eclipse.text;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.common.emf;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.emfworkbench.integration;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.frameworks;bundle-version="[1.1.200,1.2.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)",
- org.eclipse.xsd;bundle-version="[2.4.0,3.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-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.context;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.context.java;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.context.orm;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.context.persistence;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.facet;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.operations,
- org.eclipse.jpt.core.internal.platform;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.prefs;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.resource,
- org.eclipse.jpt.core.internal.resource.common.translators;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.resource.java;x-friends:="org.eclipse.jpt.ui,org.eclipse.jpt.gen",
- org.eclipse.jpt.core.internal.resource.orm,
- org.eclipse.jpt.core.internal.resource.orm.translators;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.resource.persistence,
- org.eclipse.jpt.core.internal.resource.persistence.translators;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.synch;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.utility;x-internal:=true,
- org.eclipse.jpt.core.internal.utility.emf;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.utility.jdt;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.validation;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.resource,
- org.eclipse.jpt.core.resource.common,
- org.eclipse.jpt.core.resource.java,
- org.eclipse.jpt.core.resource.orm,
- org.eclipse.jpt.core.resource.persistence,
- org.eclipse.jpt.core.utility,
- org.eclipse.jpt.core.utility.jdt
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
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 21c5a32af7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/build.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
-###############################################################################
-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 2311024fcd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/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.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 a8ed2dd9e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/model/DaliEmfFormatter.xml
+++ /dev/null
@@ -1,264 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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/jptResourceModels.genmodel b/jpa/plugins/org.eclipse.jpt.core/model/jptResourceModels.genmodel
deleted file mode 100644
index 34e5c1ee41..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/model/jptResourceModels.genmodel
+++ /dev/null
@@ -1,402 +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.common.JpaEObject"
- rootExtendsClass="org.eclipse.jpt.core.resource.common.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>orm.ecore</foreignModel>
- <foreignModel>persistence.ecore</foreignModel>
- <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>
- <genDataTypes ecoreDataType="orm.ecore#//DiscriminatorValue"/>
- <genDataTypes ecoreDataType="orm.ecore#//Enumerated"/>
- <genDataTypes ecoreDataType="orm.ecore#//OrderBy"/>
- <genDataTypes ecoreDataType="orm.ecore#//VersionType"/>
- <genClasses ecoreClass="orm.ecore#//XmlEntityMappings">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlEntityMappings/version"/>
- <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 createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlEntityMappings/access"/>
- <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/namedQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntityMappings/namedNativeQueries"/>
- <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#//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 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/access"/>
- <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 image="false" ecoreClass="orm.ecore#//AbstractXmlTypeMapping">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlTypeMapping/className"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlTypeMapping/access"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlTypeMapping/metadataComplete"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlTypeMapping/description"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//AbstractXmlTypeMapping/attributes"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlMappedSuperclass">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlMappedSuperclass/idClass"/>
- <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"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlMappedSuperclass/prePersist"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlMappedSuperclass/postPersist"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlMappedSuperclass/preRemove"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlMappedSuperclass/postRemove"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlMappedSuperclass/preUpdate"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlMappedSuperclass/postUpdate"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlMappedSuperclass/postLoad"/>
- </genClasses>
- <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/idClass"/>
- <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/sequenceGenerator"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/tableGenerator"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/namedQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/namedNativeQueries"/>
- <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"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/prePersist"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/postPersist"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/preRemove"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/postRemove"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/preUpdate"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/postUpdate"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/postLoad"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/attributeOverrides"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/associationOverrides"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlEmbeddable"/>
- <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#//XmlAttributeMapping">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlAttributeMapping/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//AbstractXmlAttributeMapping"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlNullAttributeMapping"/>
- <genClasses ecoreClass="orm.ecore#//ColumnMapping">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//ColumnMapping/column"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlRelationshipMapping">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlRelationshipMapping/targetEntity"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlRelationshipMapping/fetch"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlRelationshipMapping/joinTable"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlRelationshipMapping/cascade"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlMultiRelationshipMapping">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlMultiRelationshipMapping/mappedBy"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlMultiRelationshipMapping/orderBy"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlMultiRelationshipMapping/mapKey"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlSingleRelationshipMapping">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlSingleRelationshipMapping/optional"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlSingleRelationshipMapping/joinColumns"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlId">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlId/generatedValue"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlId/tableGenerator"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlId/sequenceGenerator"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlIdImpl"/>
- <genClasses image="false" ecoreClass="orm.ecore#//BaseXmlEmbedded">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//BaseXmlEmbedded/attributeOverrides"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlEmbeddedId"/>
- <genClasses ecoreClass="orm.ecore#//XmlEmbeddedIdImpl"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlEmbedded"/>
- <genClasses ecoreClass="orm.ecore#//XmlEmbeddedImpl"/>
- <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 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#//XmlBasicImpl"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlVersion"/>
- <genClasses ecoreClass="orm.ecore#//XmlVersionImpl"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlManyToOne"/>
- <genClasses ecoreClass="orm.ecore#//XmlManyToOneImpl"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlOneToMany">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlOneToMany/joinColumns"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlOneToManyImpl"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlOneToOne">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlOneToOne/mappedBy"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlOneToOne/primaryKeyJoinColumns"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlOneToOneImpl"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlManyToMany"/>
- <genClasses ecoreClass="orm.ecore#//XmlManyToManyImpl"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlTransient"/>
- <genClasses ecoreClass="orm.ecore#//XmlTransientImpl"/>
- <genClasses ecoreClass="orm.ecore#//XmlAssociationOverride">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlAssociationOverride/joinColumns"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlAssociationOverride/name"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlAssociationOverrideImpl"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlAttributeOverride">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlAttributeOverride/column"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlAttributeOverride/name"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlAttributeOverrideImpl"/>
- <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#//CascadeTypeImpl"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlNamedColumn">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlNamedColumn/columnDefinition"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlNamedColumn/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//AbstractXmlNamedColumn"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlAbstractColumn">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlAbstractColumn/insertable"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlAbstractColumn/nullable"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlAbstractColumn/table"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlAbstractColumn/unique"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlAbstractColumn/updatable"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//AbstractXmlAbstractColumn"/>
- <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#//XmlColumnImpl"/>
- <genClasses ecoreClass="orm.ecore#//ColumnResult">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//ColumnResult/name"/>
- </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#//EntityListeners">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//EntityListeners/entityListeners"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//EntityListener">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//EntityListener/className"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//EntityListener/prePersist"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//EntityListener/postPersist"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//EntityListener/preRemove"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//EntityListener/postRemove"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//EntityListener/preUpdate"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//EntityListener/postUpdate"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//EntityListener/postLoad"/>
- </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 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 ecoreClass="orm.ecore#//XmlGeneratedValueImpl"/>
- <genClasses ecoreClass="orm.ecore#//XmlIdClass">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlIdClass/className"/>
- </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 ecoreClass="orm.ecore#//XmlJoinColumnImpl"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlJoinTable">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlJoinTable/joinColumns"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlJoinTable/inverseJoinColumns"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlJoinTableImpl"/>
- <genClasses ecoreClass="orm.ecore#//Lob"/>
- <genClasses ecoreClass="orm.ecore#//MapKey">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//MapKey/name"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//MapKeyImpl"/>
- <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 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 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 ecoreClass="orm.ecore#//XmlPrimaryKeyJoinColumnImpl"/>
- <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 image="false" ecoreClass="orm.ecore#//AbstractXmlBaseTable"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlBaseTable">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlBaseTable/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlBaseTable/catalog"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlBaseTable/schema"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlBaseTable/uniqueConstraints"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlTable"/>
- <genClasses ecoreClass="orm.ecore#//XmlSecondaryTable">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlSecondaryTable/primaryKeyJoinColumns"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlSecondaryTableImpl"/>
- <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#//XmlSequenceGenerator">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlSequenceGenerator/sequenceName"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlSequenceGeneratorImpl"/>
- <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 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 ecoreClass="orm.ecore#//XmlTableGeneratorImpl"/>
- <genClasses ecoreClass="orm.ecore#//XmlUniqueConstraint">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlUniqueConstraint/columnNames"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlUniqueConstraintImpl"/>
- </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>
- <genDataTypes ecoreDataType="persistence.ecore#//XmlPersistenceUnitTransactionTypeObject"/>
- <genDataTypes ecoreDataType="persistence.ecore#//XmlVersion"/>
- <genClasses ecoreClass="persistence.ecore#//XmlPersistence">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference persistence.ecore#//XmlPersistence/persistenceUnits"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlPersistence/version"/>
- </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:EAttribute 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#//XmlMappingFileRef">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlMappingFileRef/fileName"/>
- </genClasses>
- <genClasses ecoreClass="persistence.ecore#//XmlJavaClassRef">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlJavaClassRef/javaClass"/>
- </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>
- </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 67874d44a3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/model/orm.ecore
+++ /dev/null
@@ -1,488 +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="XmlEntityMappings">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="version" lowerBound="1"
- eType="#//VersionType" defaultValueLiteral="1.0" unsettable="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="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:EAttribute" name="access" eType="#//AccessType"
- defaultValueLiteral="PROPERTY"/>
- <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="namedQueries" upperBound="-1"
- eType="#//XmlNamedQuery" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedNativeQueries" upperBound="-1"
- eType="#//XmlNamedNativeQuery" 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="XmlPersistenceUnitMetadata">
- <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="XmlPersistenceUnitDefaults">
- <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="access" eType="#//AccessType"
- defaultValueLiteral="PROPERTY"/>
- <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="AbstractXmlTypeMapping" abstract="true">
- <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="access" eType="#//AccessType"
- defaultValueLiteral="PROPERTY"/>
- <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="XmlMappedSuperclass" eSuperTypes="#//AbstractXmlTypeMapping">
- <eStructuralFeatures xsi:type="ecore:EReference" name="idClass" eType="#//XmlIdClass"
- 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"/>
- <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="XmlEntity" eSuperTypes="#//AbstractXmlTypeMapping">
- <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="idClass" eType="#//XmlIdClass"
- 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="#//DiscriminatorValue"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="discriminatorColumn" eType="#//XmlDiscriminatorColumn"
- containment="true" resolveProxies="false"/>
- <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"/>
- <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"/>
- <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"/>
- <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"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="attributeOverrides" upperBound="-1"
- eType="#//XmlAttributeOverride" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="associationOverrides" upperBound="-1"
- eType="#//XmlAssociationOverride" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddable" eSuperTypes="#//AbstractXmlTypeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="Attributes">
- <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="XmlAttributeMapping" 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="AbstractXmlAttributeMapping" abstract="true"
- eSuperTypes="#//XmlAttributeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNullAttributeMapping" abstract="true"
- interface="true" eSuperTypes="#//XmlAttributeMapping"/>
- <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="XmlRelationshipMapping" abstract="true"
- interface="true" eSuperTypes="#//XmlAttributeMapping">
- <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="joinTable" eType="#//XmlJoinTable"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="cascade" eType="#//CascadeType"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMultiRelationshipMapping" abstract="true"
- interface="true" eSuperTypes="#//XmlRelationshipMapping">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="mappedBy" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="orderBy" eType="#//OrderBy"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="mapKey" eType="#//MapKey"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlSingleRelationshipMapping" abstract="true"
- interface="true" eSuperTypes="#//XmlRelationshipMapping">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="optional" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="joinColumns" upperBound="-1"
- eType="#//XmlJoinColumn" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlId" abstract="true" interface="true"
- eSuperTypes="#//XmlAttributeMapping #//ColumnMapping #//XmlConvertibleMapping">
- <eStructuralFeatures xsi:type="ecore:EReference" name="generatedValue" eType="#//XmlGeneratedValue"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="tableGenerator" eType="#//XmlTableGenerator"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="sequenceGenerator" eType="#//XmlSequenceGenerator"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlIdImpl" eSuperTypes="#//AbstractXmlAttributeMapping #//XmlId"/>
- <eClassifiers xsi:type="ecore:EClass" name="BaseXmlEmbedded" abstract="true" interface="true"
- eSuperTypes="#//XmlAttributeMapping">
- <eStructuralFeatures xsi:type="ecore:EReference" name="attributeOverrides" upperBound="-1"
- eType="#//XmlAttributeOverride" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddedId" abstract="true" interface="true"
- eSuperTypes="#//XmlAttributeMapping #//BaseXmlEmbedded"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddedIdImpl" eSuperTypes="#//AbstractXmlAttributeMapping #//XmlEmbeddedId"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbedded" abstract="true" interface="true"
- eSuperTypes="#//BaseXmlEmbedded"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddedImpl" eSuperTypes="#//AbstractXmlAttributeMapping #//XmlEmbedded"/>
- <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="XmlBasic" abstract="true" interface="true"
- eSuperTypes="#//XmlAttributeMapping #//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="XmlBasicImpl" eSuperTypes="#//AbstractXmlAttributeMapping #//XmlBasic"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlVersion" abstract="true" interface="true"
- eSuperTypes="#//XmlAttributeMapping #//ColumnMapping #//XmlConvertibleMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlVersionImpl" eSuperTypes="#//AbstractXmlAttributeMapping #//XmlVersion"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToOne" abstract="true" interface="true"
- eSuperTypes="#//XmlSingleRelationshipMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToOneImpl" eSuperTypes="#//AbstractXmlAttributeMapping #//XmlManyToOne"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToMany" abstract="true" interface="true"
- eSuperTypes="#//XmlMultiRelationshipMapping">
- <eStructuralFeatures xsi:type="ecore:EReference" name="joinColumns" upperBound="-1"
- eType="#//XmlJoinColumn" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToManyImpl" eSuperTypes="#//AbstractXmlAttributeMapping #//XmlOneToMany"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToOne" abstract="true" interface="true"
- eSuperTypes="#//XmlSingleRelationshipMapping">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="mappedBy" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="primaryKeyJoinColumns"
- upperBound="-1" eType="#//XmlPrimaryKeyJoinColumn" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToOneImpl" eSuperTypes="#//AbstractXmlAttributeMapping #//XmlOneToOne"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToMany" abstract="true" interface="true"
- eSuperTypes="#//XmlMultiRelationshipMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToManyImpl" eSuperTypes="#//AbstractXmlAttributeMapping #//XmlManyToMany"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTransient" abstract="true" interface="true"
- eSuperTypes="#//XmlAttributeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTransientImpl" eSuperTypes="#//AbstractXmlAttributeMapping #//XmlTransient"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAssociationOverride" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="joinColumns" lowerBound="1"
- upperBound="-1" eType="#//XmlJoinColumn" containment="true" resolveProxies="false"/>
- <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="XmlAssociationOverrideImpl" eSuperTypes="#//XmlAssociationOverride"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAttributeOverride" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="column" lowerBound="1"
- eType="#//XmlColumn" containment="true" resolveProxies="false"/>
- <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="XmlAttributeOverrideImpl" eSuperTypes="#//XmlAttributeOverride"/>
- <eClassifiers xsi:type="ecore:EClass" name="CascadeType" abstract="true" interface="true">
- <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="CascadeTypeImpl" eSuperTypes="#//CascadeType"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNamedColumn" abstract="true" interface="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="AbstractXmlNamedColumn" abstract="true"
- eSuperTypes="#//XmlNamedColumn"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAbstractColumn" abstract="true" interface="true"
- eSuperTypes="#//XmlNamedColumn">
- <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="AbstractXmlAbstractColumn" abstract="true"
- eSuperTypes="#//AbstractXmlNamedColumn #//XmlAbstractColumn"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlColumn" abstract="true" interface="true"
- eSuperTypes="#//XmlAbstractColumn">
- <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="XmlColumnImpl" eSuperTypes="#//AbstractXmlAbstractColumn #//XmlColumn"/>
- <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="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="EntityListeners">
- <eStructuralFeatures xsi:type="ecore:EReference" name="entityListeners" upperBound="-1"
- eType="#//EntityListener" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="EntityListener">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="className" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <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="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">
- <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="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" abstract="true" interface="true">
- <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="XmlGeneratedValueImpl" eSuperTypes="#//XmlGeneratedValue"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlIdClass">
- <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="Inheritance">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="strategy" eType="#//InheritanceType"
- defaultValueLiteral="SINGLE_TABLE"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlJoinColumn" abstract="true" interface="true"
- eSuperTypes="#//XmlAbstractColumn">
- <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="XmlJoinColumnImpl" eSuperTypes="#//AbstractXmlAbstractColumn #//XmlJoinColumn"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlJoinTable" abstract="true" interface="true"
- eSuperTypes="#//XmlBaseTable">
- <eStructuralFeatures xsi:type="ecore:EReference" name="joinColumns" upperBound="-1"
- eType="#//XmlJoinColumn" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="inverseJoinColumns" upperBound="-1"
- eType="#//XmlJoinColumn" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlJoinTableImpl" eSuperTypes="#//AbstractXmlBaseTable #//XmlJoinTable"/>
- <eClassifiers xsi:type="ecore:EClass" name="Lob"/>
- <eClassifiers xsi:type="ecore:EClass" name="MapKey" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="MapKeyImpl" eSuperTypes="#//MapKey"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlQuery" abstract="true" interface="true">
- <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="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"/>
- <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" abstract="true"
- interface="true" eSuperTypes="#//XmlNamedColumn">
- <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="XmlPrimaryKeyJoinColumnImpl" eSuperTypes="#//AbstractXmlNamedColumn #//XmlPrimaryKeyJoinColumn"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlQueryHint">
- <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="AbstractXmlBaseTable" abstract="true"
- eSuperTypes="#//XmlBaseTable"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBaseTable" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="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="XmlTable" eSuperTypes="#//AbstractXmlBaseTable"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlSecondaryTable" abstract="true" interface="true"
- eSuperTypes="#//XmlBaseTable">
- <eStructuralFeatures xsi:type="ecore:EReference" name="primaryKeyJoinColumns"
- upperBound="-1" eType="#//XmlPrimaryKeyJoinColumn" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlSecondaryTableImpl" eSuperTypes="#//AbstractXmlBaseTable #//XmlSecondaryTable"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlGenerator" abstract="true" interface="true">
- <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="XmlSequenceGenerator" abstract="true"
- interface="true" eSuperTypes="#//XmlGenerator">
- <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="XmlSequenceGeneratorImpl" eSuperTypes="#//XmlSequenceGenerator"/>
- <eClassifiers xsi:type="ecore:EClass" name="SqlResultSetMapping">
- <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="XmlTableGenerator" abstract="true" interface="true"
- 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="XmlTableGeneratorImpl" eSuperTypes="#//XmlTableGenerator"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlUniqueConstraint" abstract="true"
- interface="true">
- <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="XmlUniqueConstraintImpl" eSuperTypes="#//XmlUniqueConstraint"/>
- <eClassifiers xsi:type="ecore:EDataType" name="DiscriminatorValue" instanceClassName="java.lang.String"/>
- <eClassifiers xsi:type="ecore:EDataType" name="Enumerated" instanceClassName="org.eclipse.emf.common.util.Enumerator"/>
- <eClassifiers xsi:type="ecore:EDataType" name="OrderBy" instanceClassName="java.lang.String"/>
- <eClassifiers xsi:type="ecore:EDataType" name="VersionType" instanceClassName="java.lang.String"/>
- <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>
-</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 92d62eaa41..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/model/persistence.ecore
+++ /dev/null
@@ -1,63 +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="XmlPersistence">
- <eStructuralFeatures xsi:type="ecore:EReference" name="persistenceUnits" upperBound="-1"
- eType="#//XmlPersistenceUnit" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="version" unique="false"
- lowerBound="1" eType="#//XmlVersion"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPersistenceUnit">
- <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" unique="false"
- upperBound="-1" eType="#//XmlMappingFileRef" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="jarFiles" unique="false"
- upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="classes" unique="false"
- 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: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="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="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>
- <eClassifiers xsi:type="ecore:EEnum" name="XmlPersistenceUnitTransactionType">
- <eLiterals name="JTA"/>
- <eLiterals name="RESOURCE_LOCAL" value="1"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EDataType" name="XmlPersistenceUnitTransactionTypeObject"
- instanceClassName="org.eclipse.emf.common.util.Enumerator"/>
- <eClassifiers xsi:type="ecore:EDataType" name="XmlVersion" instanceClassName="java.lang.String"/>
-</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 ed3f8e734b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/plugin.properties
+++ /dev/null
@@ -1,40 +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
-###############################################################################
-# ====================================================================
-# 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 Tools - Core
-providerName = Eclipse.org
-
-JPA_PLATFORM=JPA Platform
-JPA_RESOURCE_MODEL_PROVIDERS=JPA Resource Model Providers
-JPA_PROBLEM_MARKER=JPA Problem Marker
-JPA_FILE_CONTENT=JPA File Content
-
-GENERIC_PLATFORM_LABEL=Generic
-
-JPA_FACET_LABEL=Java Persistence
-JPA_FACET_DESCRIPTION=Adds support for writing persistent meta-data using Java Persistence Architecture.
-JPA_PRESET_LABEL=Utility JPA project with Java 5.0
-JPA_TEMPLATE_LABEL=JPA Project
-JPA_VALIDATOR=JPA Validator
-
-ORM_XML_CONTENT = ORM XML Content
-PERSISTENCE_XML_CONTENT = Persistence XML Content
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 ea984a162f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/plugin.xml
+++ /dev/null
@@ -1,309 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin>
-
- <!-- ***** extension points ***** -->
-
- <extension-point
- id="jpaPlatform"
- name="%JPA_PLATFORM"
- schema="schema/jpaPlatform.exsd"
- />
-
-
- <extension-point
- id="resourceModelProviders"
- name="%JPA_RESOURCE_MODEL_PROVIDERS"
- schema="schema/resourceModelProvider.exsd"/>
-
-
- <!-- ***** Eclipse core extensions ***** -->
-
- <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>
-
- <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>
-
- <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>
-
- </extension>
-
-
- <extension
- point="org.eclipse.core.resources.markers"
- id="jpaProblemMarker"
- name="%JPA_PROBLEM_MARKER">
-
- <persistent value="true"/>
-
- <!-- Can't use text marker until we have specific models for each input type (XML, java)
- <super type="org.eclipse.core.resources.textmarker"/>
- -->
-
- <super type="org.eclipse.wst.validation.problemmarker"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.core.runtime.adapters">
-
- <factory
- class="org.eclipse.jpt.core.internal.JpaProjectAdapterFactory"
- adaptableType="org.eclipse.core.resources.IProject">
- <adapter type="org.eclipse.jpt.core.JpaProject"/>
- </factory>
-
- <factory
- class="org.eclipse.jpt.core.internal.JpaProjectAdapterFactory"
- adaptableType="org.eclipse.jdt.core.IJavaProject">
- <adapter type="org.eclipse.jpt.core.JpaProject"/>
- </factory>
-
- </extension>
-
-
- <extension
- point="org.eclipse.core.runtime.contentTypes">
-
- <content-type
- id="org.eclipse.jpt.core.content.orm"
- name="%ORM_XML_CONTENT"
- base-type="org.eclipse.core.runtime.xml">
- <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>
-
- <content-type
- id="org.eclipse.jpt.core.content.persistence"
- name="%PERSISTENCE_XML_CONTENT"
- base-type="org.eclipse.core.runtime.xml"
- 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>
-
- </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.jpaPlatform">
-
- <jpaPlatform
- id="generic"
- label="%GENERIC_PLATFORM_LABEL"
- class="org.eclipse.jpt.core.internal.platform.GenericJpaPlatform"
- default="false"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.jpt.core.resourceModelProviders">
-
- <modelProvider
- fileContentType="org.eclipse.jpt.core.content.persistence"
- factoryClass="org.eclipse.jpt.core.internal.resource.persistence.PersistenceResourceModelProviderFactory"/>
-
- <modelProvider
- fileContentType="org.eclipse.jpt.core.content.orm"
- factoryClass="org.eclipse.jpt.core.internal.resource.orm.OrmResourceModelProviderFactory"/>
-
- </extension>
-
-
- <!-- ***** WTP extensions ***** -->
-
- <extension
- point="org.eclipse.wst.common.modulecore.resourceFactories">
-
- <resourceFactory
- class="org.eclipse.jpt.core.resource.persistence.PersistenceResourceFactory"
- isDefault="true">
- <contentTypeBinding
- contentTypeId="org.eclipse.jpt.core.content.persistence">
- </contentTypeBinding>
- </resourceFactory>
-
- <resourceFactory
- class="org.eclipse.jpt.core.resource.orm.OrmResourceFactory"
- isDefault="true">
- <contentTypeBinding
- contentTypeId="org.eclipse.jpt.core.content.orm">
- </contentTypeBinding>
- </resourceFactory>
-
- </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"/>
- <or>
- <requires facet="jst.utility" version="[1.0"/>
- <requires facet="jst.appclient" version="[1.2"/>
- <requires facet="jst.ejb" version="[1.1"/>
- <requires facet="jst.connector" version="[1.0"/>
- <requires facet="jst.web" version="[2.2"/>
- </or>
- </and>
- </constraint>
- </project-facet-version>
-
- <template id="jpt.jpa.template">
- <label>%JPA_TEMPLATE_LABEL</label>
- <fixed facet="jst.java"/>
- <fixed facet="jst.utility"/>
- <fixed facet="jpt.jpa"/>
- <preset id="jpt.jpa.preset"/>
- </template>
-
- <action facet="jpt.jpa" type="install" id="jpt.jpa.install">
- <config-factory class="org.eclipse.jpt.core.internal.facet.JpaFacetDataModelProvider"/>
- <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>
-
- <!--
- There is no version change delegate, because as of now, there is
- only a single version of JPA
- -->
-
- </extension>
-
-
- <extension
- point="org.eclipse.wst.common.project.facet.core.presets">
-
- <static-preset id="jpt.jpa.preset">
- <label>%JPA_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>
-
- </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.validator"
- id="jpaValidator"
- name="%JPA_VALIDATOR">
-
- <validator>
- <enablement>
- <and>
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa"/>
- </and>
- </enablement>
-
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="orm.xml"/>
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="persistence.xml"/>
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.java"/>
-
- <run class="org.eclipse.jpt.core.internal.validation.JpaValidator"/>
- <helper class="org.eclipse.jpt.core.internal.validation.JpaHelper"/>
-
- <markerId markerIdValue="jpaProblemMarker"/>
-
- <!-- don't know what this does
- <dependentValidator depValValue="true"/>
- -->
-
- </validator>
-
- </extension>
-
-
- <extension point="org.eclipse.wst.xml.core.catalogContributions">
-
- <catalogContribution id="default">
-
- <public
- publicId="http://java.sun.com/xml/ns/persistence/orm"
- uri="platform:/plugin/org.eclipse.jst.standard.schemas/dtdsAndSchemas/orm_1_0.xsd"/>
-
- <public
- publicId="http://java.sun.com/xml/ns/persistence"
- uri="platform:/plugin/org.eclipse.jst.standard.schemas/dtdsAndSchemas/persistence_1_0.xsd"/>
-
- </catalogContribution>
-
- </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 7dcad14175..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_core.properties
+++ /dev/null
@@ -1,38 +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
-################################################################################
-
-NONE=<None>
-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_ORM_FILE_ALREADY_EXISTS=File already exists at this location
-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_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_SCHEMA_NOT_SPECIFIED=Default schema is not 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
-RESOURCE_MODEL_PROVIDER_REGISTRY_MISSING_ATTRIBUTE=The extension element ''{0}'' in plug-in ''{1}'' is missing the required attribute ''{2}''
-RESOURCE_MODEL_PROVIDER_REGISTRY_DUPLICATE_FILE_CONTENT_TYPE=The plugins ''{0}'' and ''{1}'' have registered a duplicate attribute ''{2}'' for the extension element ''{3}'': ''{4}''
-RESOURCE_MODEL_PROVIDER_REGISTRY_FAILED_INSTANTIATION=Could not instantiate the class ''{0}'' for the extension element ''{1}'' in the plugin ''{2}''
-UPDATE_JOB_NAME=Update JPA project: ''{0}''
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 cad2d11d99..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation.properties
+++ /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
-################################################################################
-
-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
-PERSISTENCE_XML_INVALID_CONTENT=Invalid content (no root node)
-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_NONEXISTENT_MAPPING_FILE=Mapping file \"{0}\" cannot be resolved
-PERSISTENCE_UNIT_INVALID_MAPPING_FILE=Mapping file \"{0}\" does not have ORM content
-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 listed in the persistence.xml file but not mapped
-PERSISTENCE_UNIT_DUPLICATE_CLASS=Duplicate class \"{0}\"
-PERSISTENCE_UNIT_REDUNDANT_CLASS=Class \"{0}\" is already specified in mapping file \"{1}\"
-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_UNSPECIFIED_CONTEXT=This mapped class is not specified in persistence unit \"{0}\"
-PERSISTENT_TYPE_UNSPECIFIED_CLASS=Unspecified class
-PERSISTENT_TYPE_UNRESOLVED_CLASS=Class \"{0}\" cannot be resolved
-ENTITY_NO_ID=Entity \"{0}\" has no Id or EmbeddedId
-PERSISTENT_ATTRIBUTE_UNSPECIFIED_NAME=Unspecified name
-PERSISTENT_ATTRIBUTE_UNRESOLVED_NAME=Attribute \"{0}\" in class \"{1}\" cannot be resolved
-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=Cannot resolve attribute named \"{0}\"
-MAPPING_INVALID_MAPPED_BY=Attribute named \"{0}\" has invalid mapping for this relationship
-MAPPING_MAPPED_BY_WITH_JOIN_TABLE=Cannot specify join table if this attribute is mapped by another attribute
-MAPPING_MAPPED_BY_ON_BOTH_SIDES=Relationship must have an owner
-ID_MAPPING_UNRESOLVED_GENERATOR_NAME=Unresolved generator name \"{0}\"
-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}\"
-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}\"
-JOIN_TABLE_CANNOT_BE_DETERMINED=Target Entity for \"{0}\" not defined - join table cannot be determined
-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
-VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_TABLE=In implied attribute \"{0}\", table \"{1}\" for column \"{2}\" cannot be resolved
-VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_TABLE=In implied attribute override \"{0}\", table \"{1}\" for column \"{2}\" cannot be resolved
-COLUMN_UNRESOLVED_NAME=Column \"{0}\" cannot be resolved
-VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME=In implied attribute \"{0}\", column \"{1}\" cannot be resolved
-VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME=In implied attribute override \"{0}\", column \"{1}\" cannot be resolved
-JOIN_COLUMN_UNRESOLVED_TABLE=Table \"{0}\" for join column \"{1}\" cannot be resolved
-VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_TABLE=In implied attribute \"{0}\", table \"{1}\" for join column \"{2}\" cannot be resolved
-VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_TABLE=In implied association override \"{0}\", table \"{1}\" for join column \"{2}\" cannot be resolved
-JOIN_COLUMN_UNRESOLVED_NAME=Join column \"{0}\" cannot be resolved
-VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_NAME=In implied attribute \"{0}\", join column \"{1}\" cannot be resolved
-VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME=In implied association override \"{0}\", join column \"{1}\" cannot be resolved
-JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME=Referenced column \"{0}\" in join column \"{1}\" cannot be resolved
-VIRTUAL_ATTRIBUTE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME=In implied attribute \"{0}\", referenced column \"{1}\" in join column \"{2}\" cannot be resolved
-VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME=In implied association override \"{0}\", referenced column \"{1}\" in join column \"{2}\" cannot be resolved
-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
-PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Referenced Column \"{0}\" in primary key join column \"{1}\" cannot be resolved
diff --git a/jpa/plugins/org.eclipse.jpt.core/schema/jpaPlatform.exsd b/jpa/plugins/org.eclipse.jpt.core/schema/jpaPlatform.exsd
deleted file mode 100644
index 61956cc6a1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/schema/jpaPlatform.exsd
+++ /dev/null
@@ -1,127 +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="jpaPlatform" name="JPA Platform"/>
- </appinfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <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. See &lt;samp&gt;org.eclipse.jpt.core.JpaPlatform&lt;/samp&gt; for more information on JPA platforms.
- </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="class" type="string" use="required">
- <annotation>
- <documentation>
- The class that implements &lt;samp&gt;org.eclipse.jpt.core.JpaPlatform&lt;/samp&gt;.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.jpt.core.JpaPlatform"/>
- </appinfo>
- </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, 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>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiInfo"/>
- </appinfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
-
-</schema>
diff --git a/jpa/plugins/org.eclipse.jpt.core/schema/resourceModelProvider.exsd b/jpa/plugins/org.eclipse.jpt.core/schema/resourceModelProvider.exsd
deleted file mode 100644
index e61d874c14..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/schema/resourceModelProvider.exsd
+++ /dev/null
@@ -1,107 +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="resourceModelProvider" name="JPA Resource Model Provider"/>
- </appinfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="modelProvider" 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="modelProvider">
- <complexType>
- <attribute name="fileContentType" type="string" use="required">
- <documentation>
-
- </documentation>
- </attribute>
- <attribute name="factoryClass" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.jpt.core.resource.JpaResourceModelProviderFactory"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- JPT 2.0
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiinfo"/>
- </appinfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </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 1e41f3f4cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/EntityGeneratorDatabaseAnnotationNameBuilder.java
+++ /dev/null
@@ -1,75 +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;
-
-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.
- */
-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/JpaAnnotationProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaAnnotationProvider.java
deleted file mode 100644
index e49af53a23..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaAnnotationProvider.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;
-
-import java.util.ListIterator;
-
-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;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 mapping annotations that can modify a type.
- */
- ListIterator<String> typeMappingAnnotationNames();
-
- /**
- * Build a type mapping annotation with the specified name.
- */
- Annotation buildTypeMappingAnnotation(JavaResourcePersistentType parent, Type type, String annotationName);
-
- /**
- * Build a null type mapping annotation with the specified name.
- */
- Annotation buildNullTypeMappingAnnotation(JavaResourcePersistentType parent, Type type, String annotationName);
-
- /**
- * Return the names of the supporting annotations that can modify a type.
- */
- ListIterator<String> typeSupportingAnnotationNames();
-
- /**
- * Build a type supporting annotation with the specified name.
- */
- Annotation buildTypeSupportingAnnotation(JavaResourcePersistentType parent, Type type, String annotationName);
-
- /**
- * Build a null type supporting annotation with the specified name.
- */
- Annotation buildNullTypeSupportingAnnotation(JavaResourcePersistentType parent, Type type, String annotationName);
-
-
- // ********** attribute annotations **********
-
- /**
- * Return the names of the mapping annotations that can modify an attribute.
- */
- ListIterator<String> attributeMappingAnnotationNames();
-
- /**
- * Build an attribute mapping annotation with the specified name.
- */
- Annotation buildAttributeMappingAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, String annotationName);
-
- /**
- * Build a null attribute mapping annotation with the specified name.
- */
- Annotation buildNullAttributeMappingAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, String annotationName);
-
- /**
- * Return the names of the supporting annotations that can modify an attribute.
- */
- ListIterator<String> attributeSupportingAnnotationNames();
-
- /**
- * Build an attribute supporting annotation with the specified name.
- */
- Annotation buildAttributeSupportingAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, String annotationName);
-
- /**
- * Build a null attribute supporting annotation with the specified name.
- */
- Annotation buildNullAttributeSupportingAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, 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 7a00b02fe1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaDataSource.java
+++ /dev/null
@@ -1,77 +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;
-
-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.
- */
-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(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 d282c1dbf3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFactory.java
+++ /dev/null
@@ -1,411 +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;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.jpt.core.context.JpaRootContextNode;
-import org.eclipse.jpt.core.context.PersistentTypeContext;
-import org.eclipse.jpt.core.context.UniqueConstraint;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-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.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.JavaIdMapping;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaJoinTable;
-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.JavaQueryHint;
-import org.eclipse.jpt.core.context.java.JavaRelationshipMapping;
-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.orm.OrmAssociationOverride;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverride;
-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.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.OrmIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJoinTable;
-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.OrmPersistentTypeContext;
-import org.eclipse.jpt.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmQuery;
-import org.eclipse.jpt.core.context.orm.OrmQueryHint;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipMapping;
-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.context.persistence.ClassRef;
-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.Property;
-import org.eclipse.jpt.core.resource.common.JpaXmlResource;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.orm.OrmResource;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddedId;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.core.resource.orm.XmlId;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-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.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.XmlUniqueConstraint;
-import org.eclipse.jpt.core.resource.orm.XmlVersion;
-import org.eclipse.jpt.core.resource.persistence.PersistenceResource;
-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;
-
-/**
- * Use JpaFactory to build any core (e.g. JpaProject) model object or any
- * java (e.g. JavaEntity), orm (e.g. EntityMappings), or
- * persistence (e.g. PersistenceUnit) context model objects.
- *
- * Assumes a base JPA project context structure
- * corresponding to the JPA spec:
- *
- * RootContent
- * |- 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)
- *
- * ... and associated objects.
- *
- * @see org.eclipse.jpt.core.internal.platform.GenericJpaFactory
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 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) throws CoreException;
-
- JpaDataSource buildJpaDataSource(JpaProject jpaProject, String connectionProfileName);
-
- /**
- * Construct a Java JPA file for the specified JPA project and file.
- */
- JpaFile buildJavaJpaFile(JpaProject jpaProject, IFile file);
-
- /**
- * Construct a Persistence JPA file for the specified JPA project and file.
- */
- JpaFile buildPersistenceJpaFile(JpaProject jpaProject, IFile file);
-
- /**
- * Construct an ORM JPA file for the specified JPA project and file.
- */
- JpaFile buildOrmJpaFile(JpaProject jpaProject, IFile file);
-
-
- // **************** 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(ProgressMonitor)
- */
- JpaRootContextNode buildRootContextNode(JpaProject jpaProject);
-
- /**
- * Build a context node that is appropriate to the given resource.
- * This may return null if the resource cannot be associated with an
- * appropriate context node.
- */
- XmlContextNode buildContextNode(JpaContextNode parent, JpaXmlResource resource);
-
-
- // **************** Persistence Context Model ****************************
-
- PersistenceXml buildPersistenceXml(JpaRootContextNode parent, PersistenceResource persistenceResource);
-
- Persistence buildPersistence(PersistenceXml parent, XmlPersistence resourcePersistence);
-
- PersistenceUnit buildPersistenceUnit(Persistence parent, XmlPersistenceUnit resourcePersistenceUnit);
-
- /**
- * xmlMappingFileRef is allowed to be null, this would be used for the implied mapping file ref
- */
- MappingFileRef buildMappingFileRef(PersistenceUnit parent, XmlMappingFileRef xmlMappingFileRef);
-
- ClassRef buildClassRef(PersistenceUnit parent, XmlJavaClassRef xmlClassRef);
-
- ClassRef buildClassRef(PersistenceUnit parent, String className);
-
- Property buildProperty(PersistenceUnit parent, XmlProperty property);
-
-
- // **************** ORM Context Model ************************************
-
- OrmXml buildOrmXml(MappingFileRef parent, OrmResource ormResource);
-
- EntityMappings buildEntityMappings(OrmXml parent, XmlEntityMappings entityMappings);
-
- PersistenceUnitMetadata buildPersistenceUnitMetadata(EntityMappings parent, XmlEntityMappings entityMappings);
-
- OrmPersistenceUnitDefaults buildPersistenceUnitDefaults(PersistenceUnitMetadata parent, XmlEntityMappings entityMappings);
-
- OrmPersistentType buildOrmPersistentType(OrmPersistentTypeContext parent, String mappingKey);
-
- OrmEntity buildOrmEntity(OrmPersistentType parent);
-
- OrmMappedSuperclass buildOrmMappedSuperclass(OrmPersistentType parent);
-
- OrmEmbeddable buildOrmEmbeddable(OrmPersistentType parent);
-
- OrmPersistentAttribute buildOrmPersistentAttribute(OrmPersistentType parent, String mappingKey);
-
- OrmTable buildOrmTable(OrmEntity parent);
-
- OrmSecondaryTable buildOrmSecondaryTable(OrmEntity parent, XmlSecondaryTable xmlSecondaryTable);
-
- OrmPrimaryKeyJoinColumn buildOrmPrimaryKeyJoinColumn(XmlContextNode parent, OrmBaseJoinColumn.Owner owner, XmlPrimaryKeyJoinColumn resourcePkJoinColumn);
-
- OrmJoinTable buildOrmJoinTable(OrmRelationshipMapping parent);
-
- OrmJoinColumn buildOrmJoinColumn(XmlContextNode parent, OrmJoinColumn.Owner owner, XmlJoinColumn resourceJoinColumn);
-
- OrmAttributeOverride buildOrmAttributeOverride(XmlContextNode parent, AttributeOverride.Owner owner, XmlAttributeOverride xmlAttributeOverride);
-
- OrmAssociationOverride buildOrmAssociationOverride(XmlContextNode parent, AssociationOverride.Owner owner, XmlAssociationOverride associationOverride);
-
- OrmDiscriminatorColumn buildOrmDiscriminatorColumn(OrmEntity parent, OrmNamedColumn.Owner owner);
-
- OrmColumn buildOrmColumn(XmlContextNode parent, OrmColumn.Owner owner);
-
- OrmGeneratedValue buildOrmGeneratedValue(XmlContextNode parent, XmlGeneratedValue resourceGeneratedValue);
-
- OrmSequenceGenerator buildOrmSequenceGenerator(XmlContextNode parent, XmlSequenceGenerator resourceSequenceGenerator);
-
- OrmTableGenerator buildOrmTableGenerator(XmlContextNode parent, XmlTableGenerator resourceTableGenerator);
-
- OrmNamedNativeQuery buildOrmNamedNativeQuery(XmlContextNode parent, XmlNamedNativeQuery resourceNamedQuery);
-
- OrmNamedQuery buildOrmNamedQuery(XmlContextNode parent, XmlNamedQuery resourceNamedQuery);
-
- OrmQueryHint buildOrmQueryHint(OrmQuery parent, XmlQueryHint resourceQueryhint);
-
- OrmBasicMapping buildOrmBasicMapping(OrmPersistentAttribute parent);
-
- OrmManyToManyMapping buildOrmManyToManyMapping(OrmPersistentAttribute parent);
-
- OrmOneToManyMapping buildOrmOneToManyMapping(OrmPersistentAttribute parent);
-
- OrmManyToOneMapping buildOrmManyToOneMapping(OrmPersistentAttribute parent);
-
- OrmOneToOneMapping buildOrmOneToOneMapping(OrmPersistentAttribute parent);
-
- OrmEmbeddedIdMapping buildOrmEmbeddedIdMapping(OrmPersistentAttribute parent);
-
- OrmEmbeddedMapping buildOrmEmbeddedMapping(OrmPersistentAttribute parent);
-
- OrmIdMapping buildOrmIdMapping(OrmPersistentAttribute parent);
-
- OrmTransientMapping buildOrmTransientMapping(OrmPersistentAttribute parent);
-
- OrmVersionMapping buildOrmVersionMapping(OrmPersistentAttribute parent);
-
- OrmAttributeMapping buildOrmNullAttributeMapping(OrmPersistentAttribute parent);
-
- OrmUniqueConstraint buildOrmUniqueConstraint(XmlContextNode parent, UniqueConstraint.Owner owner, XmlUniqueConstraint resourceUniqueConstraint);
-
-
- // **************** orm virtual resource model ***********************************
-
- 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);
-
-
- // **************** java context objects ***********************************
-
- JavaPersistentType buildJavaPersistentType(PersistentTypeContext parent, JavaResourcePersistentType jrpt);
-
- JavaEntity buildJavaEntity(JavaPersistentType parent);
-
- JavaMappedSuperclass buildJavaMappedSuperclass(JavaPersistentType parent);
-
- JavaEmbeddable buildJavaEmbeddable(JavaPersistentType parent);
-
- JavaTypeMapping buildJavaNullTypeMapping(JavaPersistentType parent);
-
- JavaPersistentAttribute buildJavaPersistentAttribute(JavaPersistentType parent, JavaResourcePersistentAttribute jrpa);
-
- JavaBasicMapping buildJavaBasicMapping(JavaPersistentAttribute parent);
-
- JavaEmbeddedIdMapping buildJavaEmbeddedIdMapping(JavaPersistentAttribute parent);
-
- JavaEmbeddedMapping buildJavaEmbeddedMapping(JavaPersistentAttribute 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(JavaRelationshipMapping parent);
-
- JavaColumn buildJavaColumn(JavaJpaContextNode parent, JavaColumn.Owner owner);
-
- JavaDiscriminatorColumn buildJavaDiscriminatorColumn(JavaEntity parent, JavaNamedColumn.Owner owner);
-
- JavaJoinColumn buildJavaJoinColumn(JavaJpaContextNode parent, JavaJoinColumn.Owner owner);
-
- JavaSecondaryTable buildJavaSecondaryTable(JavaEntity parent);
-
- JavaSequenceGenerator buildJavaSequenceGenerator(JavaJpaContextNode parent);
-
- JavaTableGenerator buildJavaTableGenerator(JavaJpaContextNode parent);
-
- JavaGeneratedValue buildJavaGeneratedValue(JavaAttributeMapping parent);
-
- JavaPrimaryKeyJoinColumn buildJavaPrimaryKeyJoinColumn(JavaJpaContextNode parent, JavaBaseJoinColumn.Owner owner);
-
- JavaAttributeOverride buildJavaAttributeOverride(JavaJpaContextNode parent, AttributeOverride.Owner owner);
-
- JavaAssociationOverride buildJavaAssociationOverride(JavaJpaContextNode parent, AssociationOverride.Owner owner);
-
- 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);
-} \ No newline at end of file
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 813a54e618..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFile.java
+++ /dev/null
@@ -1,131 +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;
-
-import java.util.Iterator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-
-/**
- * A JPA Project contains JPA files for all files in the project that
- * are relevant to the JPA platform.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 JpaFile
- extends JpaNode
-{
-
- /**
- * Return the JPA file's Eclipse file.
- */
- IFile getFile();
-
- /**
- * Return all the types that are "persistable", as defined by the JPA spec.
- */
- Iterator<JavaResourcePersistentType> persistableTypes();
-
- // ********** event handlers **********
-
- /**
- * A JDT Java element has changed. Synchronize the JPA file's resource
- * model.
- */
- void javaElementChanged(ElementChangedEvent event);
-
- /**
- * Calculate any information that is dependent on other files
- * being added or removed. For now, only the Java resource model needs
- * this; in particular, it needs to re-calculate resolved types.
- */
- void jpaFilesChanged();
-
-
- // ********** resource type **********
-
- /**
- * Return the type of resource held by the JPA file.
- */
- String getResourceType();
-
- /**
- * Constant representing a Java resource type.
- * @see #getResourceType()
- */
- static final String JAVA_RESOURCE_TYPE = "JAVA_RESOURCE_TYPE"; //$NON-NLS-1$
-
- /**
- * Constant representing a persistence.xml resource type.
- * @see #getResourceType()
- */
- static final String PERSISTENCE_RESOURCE_TYPE = "PERSISTENCE_RESOURCE_TYPE"; //$NON-NLS-1$
-
- /**
- * Constant representing a mapping file (e.g. orm.xml) resource type.
- * @see #getResourceType()
- */
- static final String ORM_RESOURCE_TYPE = "ORM_RESOURCE_TYPE"; //$NON-NLS-1$
-
-
- // ********** resource model listeners **********
-
- /**
- * Changes to the resource model result in events. In particular, the JPA
- * project performs an "update" whenever a resource changes.
- */
- void addResourceModelListener(ResourceModelListener listener);
-
- /**
- * @see #addResourceModelChangeListener(ResourceModelListener)
- */
- void removeResourceModelListener(ResourceModelListener listener);
-
-
- // ********** 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 context 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/JpaFileProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFileProvider.java
deleted file mode 100644
index fc694eb0c7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFileProvider.java
+++ /dev/null
@@ -1,38 +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;
-
-import org.eclipse.core.resources.IFile;
-
-/**
- * Map a content type to a JPA 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.
- */
-public interface JpaFileProvider {
-
- /**
- * Return the JPA file's content type ID.
- */
- String getContentId();
-
- /**
- * Build a JPA file 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.
- */
- JpaFile buildJpaFile(JpaProject jpaProject, IFile file, JpaFactory factory);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaModel.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaModel.java
deleted file mode 100644
index 97d817d02c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaModel.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core;
-
-import java.util.Iterator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * The JPA model holds all the JPA projects.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 JpaModel extends Model {
-
- /**
- * 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) throws CoreException;
-
- /**
- * Return whether the JPA model contains a JPA project corresponding
- * to the specified Eclipse project.
- */
- boolean containsJpaProject(IProject project);
-
- /**
- * Return the JPA model's JPA projects. This has performance implications,
- * it will build all the JPA projects.
- */
- Iterator<JpaProject> jpaProjects() throws CoreException;
- public static final String JPA_PROJECTS_COLLECTION = "jpaProjects"; //$NON-NLS-1$
-
- /**
- * Return the size of the JPA model's list of JPA projects.
- */
- int jpaProjectsSize();
-
- /**
- * 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) throws CoreException;
-
-}
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 1122f07f91..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaNode.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.core;
-
-import org.eclipse.core.resources.IResource;
-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.
- */
-public interface JpaNode
- extends Model, IAdaptable
-{
- /**
- * Return the JPA project the node belongs to.
- */
- JpaProject getJpaProject();
-
- /**
- * Return the resource that most directly contains the node.
- * This is used by JpaHelper.
- */
- IResource getResource();
-
- /**
- * 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 ad6a97101f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatform.java
+++ /dev/null
@@ -1,179 +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;
-
-import org.eclipse.core.resources.IFile;
-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.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.db.ConnectionProfileFactory;
-import org.eclipse.jpt.db.DatabaseFinder;
-
-/**
- * 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.genericPlatform 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.
- *
- * See the org.eclipse.jpt.core.jpaPlatform 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.
- */
-public interface JpaPlatform
-{
- /**
- * Get the ID for this platform
- */
- String getId();
-
- /**
- * Set the ID for this platform. This is an extension
- * so you can't use a non-default constructor.
- *
- * *************
- * * IMPORTANT * For INTERNAL use only!!
- * *************
- */
- void setId(String theId);
-
-
- // ********** 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 annotations
- * are supported and constructing java resource model objects
- */
- JpaAnnotationProvider getAnnotationProvider();
-
-
- // ********** Java type mappings **********
-
- /**
- * Build a Java type mapping for the specified key and persistent type.
- * Use identity when comparing keys; so clients must use the same key
- * constants as the providers.
- * Throw an IllegalArgumentException if the key is not supported by the
- * platform.
- */
- JavaTypeMapping buildJavaTypeMappingFromMappingKey(String key, JavaPersistentType type);
-
- /**
- * Build a Java type mapping for the specified annotation and persistent
- * type. Use identity when comparing annotation names; so clients must
- * use the same name constants as the providers.
- * Throw an IllegalArgumentException if the mapping annotation is not
- * supported by the platform.
- */
- JavaTypeMapping buildJavaTypeMappingFromAnnotation(String annotationName, JavaPersistentType type);
-
-
- // ********** Java attribute mappings **********
-
- /**
- * Build a Java attribute mapping for the specified key and persistent attribute.
- * Use identity when comparing keys; so clients must use the same key
- * constants as the providers.
- * Throw an IllegalArgumentException if the key is not supported by the
- * platform.
- */
- JavaAttributeMapping buildJavaAttributeMappingFromMappingKey(String key, JavaPersistentAttribute attribute);
-
- /**
- * Build a Java attribute mapping for the specified annotation and persistent
- * attribute. Use identity when comparing annotation names; so clients must
- * use the same name constants as the providers.
- * Throw an IllegalArgumentException if the mapping annotation is not
- * supported by the platform.
- */
- JavaAttributeMapping buildJavaAttributeMappingFromAnnotation(String annotationName, JavaPersistentAttribute attribute);
-
- /**
- * Build a default Java attribute mapping for the specified persistent attribute.
- */
- JavaAttributeMapping buildDefaultJavaAttributeMapping(JavaPersistentAttribute attribute);
-
- /**
- * Return the Java attribute mapping key for the default mapping for the
- * specified attribute.
- * @see org.eclipse.jpt.core.context.java.DefaultJavaAttributeMappingProvider#defaultApplies(JavaPersistentAttribute)
- */
- String getDefaultJavaAttributeMappingKey(JavaPersistentAttribute attribute);
-
-
- // ********** ORM attribute mappings **********
-
- /**
- * Build an ORM attribute mapping for the specified key and persistent attribute.
- * Use identity when comparing keys; so clients must use the same key
- * constants as the providers.
- */
- OrmAttributeMapping buildOrmAttributeMappingFromMappingKey(String key, OrmPersistentAttribute attribute);
-
- /**
- * Build a virtual resource attribute mapping to be used when the mapping is not specified in the orm.xml
- * file. There is no XmlAttributeMapping in this case, so we build one that delegates to the
- * JavaAttributeMapping as necessary
- */
- XmlAttributeMapping buildVirtualOrmResourceMappingFromMappingKey(String key, OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping);
-
- // ********** 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();
-
- /**
- * Return a finder that can be used to look up various objects (schemata,
- * tables, columns, etc.) on the database, respecting the platform's and
- * database's case-sensitivity.
- */
- DatabaseFinder getDatabaseFinder();
-
-}
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 97b31b4184..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaProject.java
+++ /dev/null
@@ -1,416 +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;
-
-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.CoreException;
-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.JavaResourcePersistentType;
-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.jpt.utility.CommandExecutorProvider;
-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.
- */
-public interface JpaProject extends JpaNode {
-
- /**
- * Return the JPA project's name, which is the 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();
-
-
- // **************** database **********************
-
- /**
- * Return the data source the JPA project is mapped to.
- */
- JpaDataSource getDataSource();
-
- /**
- * Return the project's connection.
- * The connection profile is null if the connection profile name is invalid.
- */
- ConnectionProfile getConnectionProfile();
-
- /**
- * Return the project's default database schema container
- * (either the project's default catalog or the project's database).
- */
- SchemaContainer getDefaultDbSchemaContainer();
-
- /**
- * Return the project's default catalog:
- * - the user override catalog
- * - the database's default catalog
- */
- String getDefaultCatalog();
-
- /**
- * Return the project's default database catalog.
- * @see #getDefaultCatalog()
- */
- Catalog getDefaultDbCatalog();
-
- /**
- * Return the project's default schema:
- * - the user override schema
- * - the default catalog's default schema
- * - the database's default schema
- */
- String getDefaultSchema();
-
- /**
- * Return the project's default database schema.
- * @see #getDefaultSchema()
- */
- Schema getDefaultDbSchema();
-
-
- // **************** user override default catalog **********************
-
- /**
- * ID string used when userOverrideDefaultCatalog property is changed.
- * @see org.eclipse.jpt.utility.model.Model#addPropertyChangeListener(String, org.eclipse.jpt.utility.model.listener.PropertyChangeListener)
- */
- String USER_OVERRIDE_DEFAULT_CATALOG_PROPERTY = "userOverrideDefaultCatalog"; //$NON-NLS-1$
-
- /**
- * Return the name of the catalog to be used as a default for the project
- * instead of the one that is associated by default with the connection profile.
- * @return The catalog name. May be null (implies that the connection profile
- * default catalog should be used).
- */
- String getUserOverrideDefaultCatalog();
-
- /**
- * Set the name of the catalog to be used as a default for the project
- * instead of the one that is associated by default with the connection profile.
- * @parameter catalog The default catalog name to use instead of
- * the default catalog of the connection profile. May be null (implies that
- * the connection profile default catalog should be used).
- */
- void setUserOverrideDefaultCatalog(String catalog);
-
-
- // **************** user override default schema **********************
-
- /**
- * ID string used when userOverrideDefaultSchema property is changed.
- * @see org.eclipse.jpt.utility.model.Model#addPropertyChangeListener(String, org.eclipse.jpt.utility.model.listener.PropertyChangeListener)
- */
- String USER_OVERRIDE_DEFAULT_SCHEMA_PROPERTY = "userOverrideDefaultSchema"; //$NON-NLS-1$
-
- /**
- * Return the name of the schema to be used as a default for the project
- * instead of the one that is associated by default with the connection profile.
- * @return The schema name. May be null (implies that the connection profile
- * default schema should be used).
- */
- String getUserOverrideDefaultSchema();
-
- /**
- * Set the name of the schema to be used as a default for the project
- * instead of the one that is associated by default with the connection profile.
- * @parameter schema The default schema name to use instead of
- * the default schema of the connection profile. May be null (implies that
- * the connection profile default schema should be used).
- */
- void setUserOverrideDefaultSchema(String schema);
-
-
- // **************** discover annotated classes *****************************
-
- /**
- * ID string used when discoversAnnotatedClasses property is changed.
- * @see org.eclipse.jpt.utility.model.Model#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 persistence.xml.
- */
- boolean discoversAnnotatedClasses();
-
- /**
- * Set whether the JPA project will "discover" annotated classes
- * automatically, as opposed to requiring the classes to be
- * listed in persistence.xml.
- */
- void setDiscoversAnnotatedClasses(boolean discoversAnnotatedClasses);
-
-
- // **************** jpa files **********************************************
-
- /**
- * ID string used when jpaFiles collection is changed.
- * @see org.eclipse.jpt.utility.model.Model#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 unable to associate the given file
- * with a JPA file.
- */
- JpaFile getJpaFile(IFile file);
-
-
- // **************** various queries ****************************************
-
- /**
- * Return the JPA project's root "deploy path".
- * JPA projects associated with Web projects return "WEB-INF/classes";
- * all others simply return an empty string.
- */
- String getRootDeployLocation();
-
- /**
- * Return the {@link JpaRootContextNode} representing the JPA content of this project
- */
- JpaRootContextNode getRootContextNode();
-
- /**
- * Return the names of the JPA project's annotated classes.
- */
- Iterator<String> annotatedClassNames();
-
- /**
- * Return the Java resource persistent type for the specified fully
- * qualified type name; return null, if none exists.
- */
- JavaResourcePersistentType getJavaResourcePersistentType(String typeName);
-
-
- // **************** jpa model synchronization and lifecycle ****************
-
- /**
- * Synchronize the JPA project's JPA files with the specified resource
- * delta, watching for added and removed files.
- */
- void synchronizeJpaFiles(IResourceDelta delta) throws CoreException;
-
- /**
- * Forward the Java element change event to the JPA project's JPA files.
- */
- void javaElementChanged(ElementChangedEvent event);
-
- /**
- * The JPA project has been removed from the JPA model. Clean up any
- * hooks to external resources etc.
- */
- void dispose();
-
-
- // **************** validation *********************************************
-
- /**
- * Return project's validation messages.
- */
- Iterator<IMessage> validationMessages();
-
-
- // **************** support for modifying shared documents *****************
-
- /**
- * Set a thread-specific implementation of the 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 CommandExecutor.
- */
- void setThreadLocalModifySharedDocumentCommandExecutor(CommandExecutor commandExecutor);
-
- /**
- * Return the project-wide implementation of the CommandExecutorProvider
- * interface.
- */
- CommandExecutorProvider getModifySharedDocumentCommandExecutorProvider();
-
-
- // **************** project "update" ***************************************
-
- /**
- * Return the implementation of the Updater
- * interface that will be used to "update" a JPA project.
- */
- Updater getUpdater();
-
- /**
- * Set the implementation of the Updater
- * interface that will be used to "update" a JPA project.
- * Before setting the updater, Clients should save the current updater so
- * it can be restored later.
- */
- void setUpdater(Updater updater);
-
- /**
- * Something in the JPA project has changed, "update" those parts of the
- * JPA project that are dependent on other parts of the JPA project.
- * This is called when
- * - The JPA project updater is changed {@link JpaProject#setUpdater(Updater)}
- * - anything in the JPA project changes
- * - the JPA project's database connection is changed, opened, or closed
- */
- void update();
-
- /**
- * This is the callback used by the updater to perform the actual
- * "update".
- */
- IStatus update(IProgressMonitor monitor);
-
-
- /**
- * 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.
- */
- void update();
-
- /**
- * The JPA project is disposed; dispose the updater.
- */
- void dispose();
-
- /**
- * 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 dispose() {
- // do nothing
- }
- @Override
- public String toString() {
- return "JpaProject.Updater.Null"; //$NON-NLS-1$
- }
- }
-
- }
-
-
- // **************** config that can be used to construct a JPA project *****
-
- /**
- * 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/JpaStructureNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaStructureNode.java
deleted file mode 100644
index 13acbcb8f6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaStructureNode.java
+++ /dev/null
@@ -1,53 +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;
-
-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.
- */
-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();
-
- /**
- * Dispose of this structureNode and dispose of chil 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 9ae4589b7b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JptCorePlugin.java
+++ /dev/null
@@ -1,450 +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;
-
-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.IStatus;
-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.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.jpt.core.internal.JpaModelManager;
-import org.eclipse.jpt.core.internal.platform.GenericJpaPlatform;
-import org.eclipse.jpt.core.internal.platform.JpaPlatformRegistry;
-import org.eclipse.jpt.core.internal.prefs.JpaPreferenceConstants;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
-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;
-
-/**
- * The JPT plug-in lifecycle implementation.
- * A number of globally-available constants and methods.
- *
- * 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.
- */
-// TODO keep preferences in synch with the JPA project
-// (connection profile name, "discover" flag)
-// use listeners?
-public class JptCorePlugin extends Plugin {
-
-
- // ********** 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$
-
- /**
- * The identifier for the JPA facet
- * (value <code>"jpt.jpa"</code>).
- */
- public static final String FACET_ID = "jpt.jpa"; //$NON-NLS-1$
-
- /**
- * The key for storing a JPA project's platform in the Eclipse
- * project's preferences.
- */
- public static final String JPA_PLATFORM = PLUGIN_ID + ".platform"; //$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 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 schema name
- * in the Eclipse project's persistent properties.
- */
- public static final QualifiedName USER_OVERRIDE_DEFAULT_SCHEMA_NAME =
- new QualifiedName(PLUGIN_ID, "userOverrideDefaultSchemaName"); //$NON-NLS-1$
-
- /**
- * The identifier for the JPA validation marker
- * (value <code>"org.eclipse.jpt.core.jpaProblemMarker"</code>).
- */
- public static final String VALIDATION_MARKER_ID = PLUGIN_ID + ".jpaProblemMarker"; //$NON-NLS-1$
-
- /**
- * Value of the content-type for orm.xml mappings files. Use this value to retrieve
- * the ORM xml content type from the content type manager and to add new
- * orm.xml-like extensions to this content type.
- *
- * @see org.eclipse.core.runtime.content.IContentTypeManager#getContentType(String)
- */
- public static final String ORM_XML_CONTENT_TYPE = PLUGIN_ID + ".content.orm"; //$NON-NLS-1$
-
- /**
- * Ditto for persistence.xml.
- * @see #ORM_XML_CONTENT_TYPE
- */
- public static final String PERSISTENCE_XML_CONTENT_TYPE = PLUGIN_ID + ".content.persistence"; //$NON-NLS-1$
-
- /**
- * 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$
-
-
- // ********** singleton **********
-
- private static JptCorePlugin INSTANCE;
-
- /**
- * Return the singleton JPT plug-in.
- */
- public static JptCorePlugin instance() {
- return INSTANCE;
- }
-
-
- // ********** public static methods **********
-
- /**
- * Return the singular JPA model corresponding to the current workspace.
- */
- public static JpaModel getJpaModel() {
- return JpaModelManager.instance().getJpaModel();
- }
-
- /**
- * Return the JPA project corresponding to the specified Eclipse project,
- * or null if unable to associate the specified project with a
- * JPA project.
- */
- public static JpaProject getJpaProject(IProject project) {
- try {
- return JpaModelManager.instance().getJpaProject(project);
- } catch (CoreException ex) {
- log(ex);
- return null;
- }
- }
-
- /**
- * Return the JPA file corresponding to the specified Eclipse file,
- * or null if unable to associate the specified file with a JPA file.
- */
- public static JpaFile getJpaFile(IFile file) {
- try {
- return JpaModelManager.instance().getJpaFile(file);
- } catch (CoreException ex) {
- log(ex);
- return null;
- }
- }
-
- /**
- * 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 JPA 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 persistence.xml (specified as "META-INF/persistence.xml")
- * 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 "META-INF/orm.xml")
- * 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 "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 default JPA preferences
- * @see JpaPreferenceInitializer
- */
- public static IEclipsePreferences getDefaultPreferences() {
- IScopeContext context = new DefaultScope();
- return context.getNode(PLUGIN_ID);
- }
-
- /**
- * Return the JPA preferences for the current workspace instance.
- */
- public static IEclipsePreferences getWorkspacePreferences() {
- IScopeContext context = new InstanceScope();
- return context.getNode(PLUGIN_ID);
- }
-
- /**
- * Return the JPA preferences for the specified Eclipse project.
- */
- public static IEclipsePreferences getProjectPreferences(IProject project) {
- IScopeContext context = new ProjectScope(project);
- return context.getNode(PLUGIN_ID);
- }
-
- /**
- * Return the default JPA library for creating new JPA projects
- */
- public static String getDefaultJpaLibrary() {
- return Platform.getPreferencesService().get(
- JpaPreferenceConstants.PREF_DEFAULT_JPA_LIB, null,
- new Preferences[] {getWorkspacePreferences(), getDefaultPreferences()});
- }
-
- /**
- * Return the default JPA platform ID for creating new JPA projects
- */
- public static String getDefaultJpaPlatformId() {
- String platformId =
- Platform.getPreferencesService().get(
- JpaPreferenceConstants.PREF_DEFAULT_JPA_PLATFORM, GenericJpaPlatform.ID,
- new Preferences[] {getWorkspacePreferences(), getDefaultPreferences()});
- if (! JpaPlatformRegistry.instance().containsPlatform(platformId)) {
- platformId =
- Platform.getPreferencesService().get(
- JpaPreferenceConstants.PREF_DEFAULT_JPA_PLATFORM, GenericJpaPlatform.ID,
- new Preferences[] {getDefaultPreferences()});
- }
- return platformId;
- }
-
- /**
- * Set the default JPA platform ID for creating new JPA projects
- */
- public static void setDefaultJpaPlatformId(String platformId) {
- IEclipsePreferences prefs = getWorkspacePreferences();
- prefs.put(JpaPreferenceConstants.PREF_DEFAULT_JPA_PLATFORM, platformId);
- flush(prefs);
- }
-
- /**
- * Return the JPA platform associated with the specified Eclipse project.
- */
- public static JpaPlatform getJpaPlatform(IProject project) {
- return JpaPlatformRegistry.instance().getJpaPlatform(getJpaPlatformId(project));
- }
-
- /**
- * Return the JPA platform ID associated with the specified Eclipse project.
- */
- public static String getJpaPlatformId(IProject project) {
- return getProjectPreferences(project).get(JPA_PLATFORM, GenericJpaPlatform.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, jpaPlatformId);
- flush(prefs);
- }
-
- /**
- * 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);
- }
-
- /**
- * checked exceptions bite
- */
- private static void flush(IEclipsePreferences prefs) {
- try {
- prefs.flush();
- } catch(BackingStoreException ex) {
- log(ex);
- }
- }
-
- /**
- * Return the name of the connection profile associated with the specified
- * Eclipse project.
- */
- public static String getConnectionProfileName(IProject project) {
- try {
- return project.getPersistentProperty(DATA_SOURCE_CONNECTION_PROFILE_NAME);
- } 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 schema name associated with the specified Eclipse project.
- * @see JpaProject#getUserOverrideDefaultSchemaName()
- */
- public static String getUserOverrideDefaultSchemaName(IProject project) {
- try {
- return project.getPersistentProperty(USER_OVERRIDE_DEFAULT_SCHEMA_NAME);
- }
- catch (CoreException ce) {
- log(ce);
- return null;
- }
- }
-
- /**
- * Set the default schema name associated with the specified Eclipse project.
- * @see JpaProject#setUserOverrideDefaultSchemaName()
- */
- public static void setUserOverrideDefaultSchemaName(IProject project, String defaultSchemaName) {
- try {
- project.setPersistentProperty(USER_OVERRIDE_DEFAULT_SCHEMA_NAME, defaultSchemaName);
- }
- catch (CoreException ce) {
- log(ce);
- }
- }
-
- /**
- * 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);
- JpaModelManager.instance().start();
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- try {
- JpaModelManager.instance().stop();
- } finally {
- super.stop(context);
- }
- }
-
-}
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 c66b89286f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/MappingKeys.java
+++ /dev/null
@@ -1,41 +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;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 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/ResourceModelListener.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/ResourceModelListener.java
deleted file mode 100644
index 13b84dd110..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/ResourceModelListener.java
+++ /dev/null
@@ -1,27 +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;
-
-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.
- */
-public interface ResourceModelListener
- extends EventListener
-{
- void resourceModelChanged();
-}
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 e57caa5d32..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AccessType.java
+++ /dev/null
@@ -1,69 +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.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.
- */
-public enum AccessType {
-
- FIELD,
- PROPERTY;
-
-
- public static AccessType fromJavaResourceModel(org.eclipse.jpt.core.resource.java.AccessType javaAccessType) {
- if (javaAccessType == null) {
- return null;
- }
- switch (javaAccessType) {
- case FIELD:
- return FIELD;
- case PROPERTY:
- return PROPERTY;
- default:
- throw new IllegalArgumentException("unknown access type: " + javaAccessType);
- }
- }
-
- public static AccessType fromXmlResourceModel(org.eclipse.jpt.core.resource.orm.AccessType ormAccessType) {
- if (ormAccessType == null) {
- return null;
- }
- switch (ormAccessType) {
- case FIELD:
- return FIELD;
- case PROPERTY:
- return PROPERTY;
- default:
- throw new IllegalArgumentException("unknown access type: " + ormAccessType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.orm.AccessType toXmlResourceModel(AccessType accessType) {
- if (accessType == null) {
- return null;
- }
- switch (accessType) {
- case FIELD:
- return org.eclipse.jpt.core.resource.orm.AccessType.FIELD;
- case PROPERTY:
- return org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY;
- default:
- throw new IllegalArgumentException("unknown access type: " + accessType);
- }
- }
-
-}
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 0d6e42d95f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AssociationOverride.java
+++ /dev/null
@@ -1,52 +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.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.
- */
-public interface AssociationOverride extends BaseOverride
-{
- <T extends JoinColumn> ListIterator<T> joinColumns();
- <T extends JoinColumn> ListIterator<T> specifiedJoinColumns();
- <T extends JoinColumn> ListIterator<T> defaultJoinColumns();
- int joinColumnsSize();
- int specifiedJoinColumnsSize();
- int defaultJoinColumnsSize();
- JoinColumn addSpecifiedJoinColumn(int index);
- void removeSpecifiedJoinColumn(int index);
- void moveSpecifiedJoinColumn(int targetIndex, int sourceIndex);
- String SPECIFIED_JOIN_COLUMNS_LIST = "specifiedJoinColumnsList";
- String DEFAULT_JOIN_COLUMNS_LIST = "defaultJoinColumnsList";
-
- boolean containsSpecifiedJoinColumns();
-
- AssociationOverride.Owner getOwner();
-
- AssociationOverride setVirtual(boolean virtual);
-
- 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);
- }
-} \ No newline at end of file
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 aec90ff35d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AttributeMapping.java
+++ /dev/null
@@ -1,58 +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.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.
- */
-public interface AttributeMapping extends JpaContextNode
-{
- PersistentAttribute getPersistentAttribute();
-
- boolean isDefault();
-
- /**
- * Return a unique key for the IPersistentAttributeMapping. If this is defined in
- * an extension they should be equal.
- */
- String getKey();
-
- /**
- * If the mapping is for a primary key column, return the column's name,
- * otherwise return null.
- */
- String getPrimaryKeyColumnName();
-
- /**
- * Return the mapping for the attribute mapping's attribute's type.
- */
- TypeMapping getTypeMapping();
-
- /**
- * Return whether the "attribute" mapping can be overridden.
- */
- boolean isOverridableAttributeMapping();
-
- /**
- * Return whether the "association" mapping can be overridden.
- */
- boolean isOverridableAssociationMapping();
-
- /**
- * Return whether the "attribute" mapping is for an ID.
- */
- boolean isIdMapping();
-} \ No newline at end of file
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 604636dc98..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * 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.
- */
-public interface AttributeOverride extends BaseOverride, Column.Owner
-{
- Column getColumn();
-
- AttributeOverride.Owner getOwner();
-
- AttributeOverride setVirtual(boolean virtual);
-
- interface Owner extends BaseOverride.Owner
- {
- /**
- * Return the column mapping 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
- */
- ColumnMapping getColumnMapping(String attributeName);
- }
-} \ No newline at end of file
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 7c01c916e4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseColumn.java
+++ /dev/null
@@ -1,89 +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.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.
- */
-public interface BaseColumn extends NamedColumn
-{
-
- String getTable();
-
- 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 getUnique();
-
- Boolean getDefaultUnique();
- String DEFAULT_UNIQUE_PROPERTY = "defaultUnique"; //$NON-NLS-1$
- Boolean DEFAULT_UNIQUE = Boolean.FALSE;
- Boolean getSpecifiedUnique();
- void setSpecifiedUnique(Boolean newSpecifiedUnique);
- String SPECIFIED_UNIQUE_PROPERTY = "specifiedUnique"; //$NON-NLS-1$
-
-
- Boolean getNullable();
-
- Boolean getDefaultNullable();
- String DEFAULT_NULLABLE_PROPERTY = "defaultNullable"; //$NON-NLS-1$
- Boolean DEFAULT_NULLABLE = Boolean.TRUE;
- Boolean getSpecifiedNullable();
- void setSpecifiedNullable(Boolean newSpecifiedNullable);
- String SPECIFIED_NULLABLE_PROPERTY = "specifiedNullable"; //$NON-NLS-1$
-
-
- Boolean getInsertable();
-
- Boolean getDefaultInsertable();
- String DEFAULT_INSERTABLE_PROPERTY = "defaulInsertable"; //$NON-NLS-1$
- Boolean DEFAULT_INSERTABLE = Boolean.TRUE;
- Boolean getSpecifiedInsertable();
- void setSpecifiedInsertable(Boolean newSpecifiedInsertable);
- String SPECIFIED_INSERTABLE_PROPERTY = "specifiedInsertable"; //$NON-NLS-1$
-
-
- Boolean getUpdatable();
-
- Boolean getDefaultUpdatable();
- String DEFAULT_UPDATABLE_PROPERTY = "defaulUpdatable"; //$NON-NLS-1$
- Boolean DEFAULT_UPDATABLE = Boolean.TRUE;
- Boolean getSpecifiedUpdatable();
- void setSpecifiedUpdatable(Boolean newSpecifiedUpdatable);
- String SPECIFIED_UPDATABLE_PROPERTY = "specifiedUpdatable"; //$NON-NLS-1$
-
- //TODO not sure we really need/want this to be public. 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
- Owner getOwner();
-
- /**
- * interface allowing columns to be used in multiple places
- * (e.g. basic mappings and attribute overrides)
- */
- interface Owner extends NamedColumn.Owner
- {
- /**
- * Return the table to which the column belongs by default.
- */
- String getDefaultTableName();
- }
-}
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 ced177aef7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseEmbeddedMapping.java
+++ /dev/null
@@ -1,72 +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.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.
- */
-public interface BaseEmbeddedMapping extends AttributeMapping, AttributeOverride.Owner
-{
-
- /**
- * Return a list iterator of the attribute overrides whether specified or virtual.
- * 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.
- */
- <T extends AttributeOverride> ListIterator<T> specifiedAttributeOverrides();
- String SPECIFIED_ATTRIBUTE_OVERRIDES_LIST = "specifiedAttributeOverridesList";
-
- /**
- * Return the number of specified attribute overrides.
- */
- int specifiedAttributeOverridesSize();
-
- /**
- * Return a list iterator of the virtual attribute overrides.
- * This will not be null.
- */
- <T extends AttributeOverride> ListIterator<T> virtualAttributeOverrides();
- String VIRTUAL_ATTRIBUTE_OVERRIDES_LIST = "virtualAttributeOverridesList";
-
- /**
- * Return the number of virtual attribute overrides.
- */
- int virtualAttributeOverridesSize();
-
- /**
- * Move the specified attribute override from the source index to the target index.
- */
- void moveSpecifiedAttributeOverride(int targetIndex, int sourceIndex);
-
- /**
- * Return the attribute overrides, whether specified or default,
- * with the given name.
- */
- AttributeOverride getAttributeOverrideNamed(String name);
-
-}
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 3a28c4bb89..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseJoinColumn.java
+++ /dev/null
@@ -1,55 +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.context;
-
-import org.eclipse.jpt.db.Column;
-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.
- */
-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
- */
- boolean isReferencedColumnResolved();
-
- boolean isVirtual();
-
- interface Owner extends NamedColumn.Owner
- {
- /**
- * Return the wrapper for the datasource table for the referenced column
- */
- Table getReferencedColumnDbTable();
-
- boolean isVirtual(BaseJoinColumn joinColumn);
- }
-}
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 f126995048..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseOverride.java
+++ /dev/null
@@ -1,65 +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.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.
- */
-public interface BaseOverride extends JpaContextNode
-{
-
- String getName();
- void setName(String value);
- String NAME_PROPERTY = "nameProperty";
-
- /**
- * 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 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);
- }
-} \ 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 dd39440ed1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BasicMapping.java
+++ /dev/null
@@ -1,26 +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.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.
- */
-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 af68654463..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Cascade.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.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.
- */
-public interface Cascade extends JpaContextNode
-{
-
- boolean isAll();
- void setAll(boolean value);
- String ALL_PROPERTY = "allProperty";
-
- boolean isPersist();
- void setPersist(boolean value);
- String PERSIST_PROPERTY = "persistProperty";
-
- boolean isMerge();
- void setMerge(boolean value);
- String MERGE_PROPERTY = "mergeProperty";
-
- boolean isRemove();
- void setRemove(boolean value);
- String REMOVE_PROPERTY = "removeProperty";
-
- boolean isRefresh();
- void setRefresh(boolean value);
- String REFRESH_PROPERTY = "refreshProperty";
-}
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 f30be42ffc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Column.java
+++ /dev/null
@@ -1,59 +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.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.
- */
-public interface Column extends BaseColumn
-{
- Integer getLength();
-
- Integer getDefaultLength();
- Integer DEFAULT_LENGTH = Integer.valueOf(255);
- String DEFAULT_LENGTH_PROPERTY = "defaultLength"; //$NON-NLS-1$
-
- Integer getSpecifiedLength();
- void setSpecifiedLength(Integer newSpecifiedLength);
- String SPECIFIED_LENGTH_PROPERTY = "spcifiedLength"; //$NON-NLS-1$
-
- Integer getPrecision();
-
- Integer getDefaultPrecision();
- Integer DEFAULT_PRECISION = Integer.valueOf(0);
- String DEFAULT_PRECISION_PROPERTY = "defaultPrecision"; //$NON-NLS-1$
-
- Integer getSpecifiedPrecision();
- void setSpecifiedPrecision(Integer newSpecifiedPrecision);
- String SPECIFIED_PRECISION_PROPERTY = "spcifiedPrecision"; //$NON-NLS-1$
-
-
- Integer getScale();
-
- Integer getDefaultScale();
- Integer DEFAULT_SCALE = Integer.valueOf(0);
- String DEFAULT_SCALE_PROPERTY = "defaultScale"; //$NON-NLS-1$
-
- Integer getSpecifiedScale();
- void setSpecifiedScale(Integer newSpecifiedScale);
- String SPECIFIED_SCALE_PROPERTY = "spcifiedScale"; //$NON-NLS-1$
-
- /**
- * Return whether the column is found on the datasource
- */
- boolean isResolved();
-
-}
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 8e3c920caa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ColumnMapping.java
+++ /dev/null
@@ -1,25 +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.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.
- */
-public interface ColumnMapping extends JpaContextNode, 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 2b340496ca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ConvertibleMapping.java
+++ /dev/null
@@ -1,57 +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 ConvertibleMapping
-{
- /**
- * Return the specified converter if it is not null and the default converter otherwise.
- */
- Converter getConverter();
-
- /**
- * Return the default converter, NO_CONVERTER except in instances where an underlying
- * model has a converter set (an xml mapping could return a default converter if one is set in java)
- */
- Converter getDefaultConverter();
- String DEFAULT_CONVERTER_PROPERTY = "defaultConverterProperty";
-
- /**
- * Return the specified converter or null, if none is specified in the underlying resource model
- */
- Converter getSpecifiedConverter();
-
- /**
- * Set the specified 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 for basic mapppings.
- * {@link Converter#ENUMERATED_CONVERTER}
- * {@link Converter#LOB_CONVERTER}
- * {@link Converter#TEMPORAL_CONVERTER}
- * {@link Converter#NO_CONVERTER}
- */
- void setSpecifiedConverter(String converterType);
- String SPECIFIED_CONVERTER_PROPERTY = "specifiedConverterProperty";
-
-
-}
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 855cfa2b9a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/DiscriminatorColumn.java
+++ /dev/null
@@ -1,46 +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.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.
- */
-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$
-
-
- Integer getLength();
-
- Integer getDefaultLength();
- Integer DEFAULT_LENGTH = Integer.valueOf(31);
- String DEFAULT_LENGTH_PROPERTY = "defaultLength"; //$NON-NLS-1$
-
- Integer getSpecifiedLength();
- void setSpecifiedLength(Integer value);
- String SPECIFIED_LENGTH_PROPERTY = "spcifiedLength"; //$NON-NLS-1$
-
-}
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 ee146f5c98..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/DiscriminatorType.java
+++ /dev/null
@@ -1,92 +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.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.
- */
-public enum DiscriminatorType {
-
- STRING,
- CHAR,
- INTEGER;
-
-
- public static DiscriminatorType fromJavaResourceModel(org.eclipse.jpt.core.resource.java.DiscriminatorType javaDiscriminatorType) {
- if (javaDiscriminatorType == null) {
- return null;
- }
- switch (javaDiscriminatorType) {
- case STRING:
- return STRING;
- case CHAR:
- return CHAR;
- case INTEGER:
- return INTEGER;
- default:
- throw new IllegalArgumentException("unknown discriminator type: " + javaDiscriminatorType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.java.DiscriminatorType toJavaResourceModel(DiscriminatorType discriminatorType) {
- if (discriminatorType == null) {
- return null;
- }
- switch (discriminatorType) {
- case STRING:
- return org.eclipse.jpt.core.resource.java.DiscriminatorType.STRING;
- case CHAR:
- return org.eclipse.jpt.core.resource.java.DiscriminatorType.CHAR;
- case INTEGER:
- return org.eclipse.jpt.core.resource.java.DiscriminatorType.INTEGER;
- default:
- throw new IllegalArgumentException("unknown discriminator type: " + discriminatorType);
- }
- }
-
- public static DiscriminatorType fromOrmResourceModel(org.eclipse.jpt.core.resource.orm.DiscriminatorType ormDiscriminatorType) {
- if (ormDiscriminatorType == null) {
- return null;
- }
- switch (ormDiscriminatorType) {
- case STRING:
- return STRING;
- case CHAR:
- return CHAR;
- case INTEGER:
- return INTEGER;
- default:
- throw new IllegalArgumentException("unknown discriminator type: " + ormDiscriminatorType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.orm.DiscriminatorType toOrmResourceModel(DiscriminatorType discriminatorType) {
- if (discriminatorType == null) {
- return null;
- }
- switch (discriminatorType) {
- case STRING:
- return org.eclipse.jpt.core.resource.orm.DiscriminatorType.STRING;
- case CHAR:
- return org.eclipse.jpt.core.resource.orm.DiscriminatorType.CHAR;
- case INTEGER:
- return org.eclipse.jpt.core.resource.orm.DiscriminatorType.INTEGER;
- default:
- throw new IllegalArgumentException("unknown discriminator type: " + discriminatorType);
- }
- }
-
-}
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 e5f4d18328..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Embeddable.java
+++ /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
- ******************************************************************************/
-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.
- */
-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 98f71d1f56..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EmbeddedIdMapping.java
+++ /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
- ******************************************************************************/
-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.
- */
-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 98fa513f0f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EmbeddedMapping.java
+++ /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
- ******************************************************************************/
-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.
- */
-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 923d290bf5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Entity.java
+++ /dev/null
@@ -1,308 +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.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.
- */
-public interface Entity extends
- TypeMapping,
- GeneratorHolder,
- QueryHolder,
- IdClass
-{
- // **************** 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$
-
-
- // **************** 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$
-
- /**
- * 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 first parent in the class hierarchy that is an entity.
- * This is the parent in the entity (persistent) inheritance hierarchy
- * (vs class inheritance hierarchy)
- */
- 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 IType is concrete (not abstract)
- */
- boolean isDiscriminatorValueAllowed();
- String DISCRIMINATOR_VALUE_ALLOWED_PROPERTY = "discriminatorValueAllowed"; //$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);
-
-
- // **************** 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 overrides, whether specified or default,
- * with the given name.
- */
- AttributeOverride getAttributeOverrideNamed(String name);
-
-
- // **************** 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$
-
-}
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 09fab0ab60..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EnumType.java
+++ /dev/null
@@ -1,83 +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.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.
- */
-public enum EnumType {
-
- ORDINAL,
- STRING;
-
-
- public static EnumType fromJavaResourceModel(org.eclipse.jpt.core.resource.java.EnumType javaEnumType) {
- if (javaEnumType == null) {
- return null;
- }
- switch (javaEnumType) {
- case ORDINAL:
- return ORDINAL;
- case STRING:
- return STRING;
- default:
- throw new IllegalArgumentException("unknown enum type: " + javaEnumType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.java.EnumType toJavaResourceModel(EnumType enumType) {
- if (enumType == null) {
- return null;
- }
- switch (enumType) {
- case ORDINAL:
- return org.eclipse.jpt.core.resource.java.EnumType.ORDINAL;
- case STRING:
- return org.eclipse.jpt.core.resource.java.EnumType.STRING;
- default:
- throw new IllegalArgumentException("unknown enum type: " + enumType);
- }
- }
-
-
- public static EnumType fromOrmResourceModel(org.eclipse.jpt.core.resource.orm.EnumType ormEnumType) {
- if (ormEnumType == null) {
- return null;
- }
- switch (ormEnumType) {
- case ORDINAL:
- return ORDINAL;
- case STRING:
- return STRING;
- default:
- throw new IllegalArgumentException("unknown enum type: " + ormEnumType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.orm.EnumType toOrmResourceModel(EnumType enumType) {
- if (enumType == null) {
- return null;
- }
- switch (enumType) {
- case ORDINAL:
- return org.eclipse.jpt.core.resource.orm.EnumType.ORDINAL;
- case STRING:
- return org.eclipse.jpt.core.resource.orm.EnumType.STRING;
- default:
- throw new IllegalArgumentException("unknown enum type: " + enumType);
- }
- }
-}
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 cadf12c67f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EnumeratedConverter.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.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 EnumeratedConverter extends Converter
-{
- EnumType getEnumType();
-
- EnumType getDefaultEnumType();
- EnumType DEFAULT_ENUM_TYPE = EnumType.ORDINAL;
-
- EnumType getSpecifiedEnumType();
- void setSpecifiedEnumType(EnumType newSpecifiedEnumType);
- String SPECIFIED_ENUM_TYPE_PROPERTY = "specifiedEnumTypeProperty";
-}
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 86aadee6d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/FetchType.java
+++ /dev/null
@@ -1,84 +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.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.
- */
-public enum FetchType {
-
- EAGER,
- LAZY;
-
-
- public static FetchType fromJavaResourceModel(org.eclipse.jpt.core.resource.java.FetchType javaFetchType) {
- if (javaFetchType == null) {
- return null;
- }
- switch (javaFetchType) {
- case EAGER:
- return EAGER;
- case LAZY:
- return LAZY;
- default:
- throw new IllegalArgumentException("unknown fetch type: " + javaFetchType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.java.FetchType toJavaResourceModel(FetchType fetchType) {
- if (fetchType == null) {
- return null;
- }
- switch (fetchType) {
- case EAGER:
- return org.eclipse.jpt.core.resource.java.FetchType.EAGER;
- case LAZY:
- return org.eclipse.jpt.core.resource.java.FetchType.LAZY;
- default:
- throw new IllegalArgumentException("unknown fetch type: " + fetchType);
- }
- }
-
-
- public static FetchType fromOrmResourceModel(org.eclipse.jpt.core.resource.orm.FetchType ormFetchType) {
- if (ormFetchType == null) {
- return null;
- }
- switch (ormFetchType) {
- case EAGER:
- return EAGER;
- case LAZY:
- return LAZY;
- default:
- throw new IllegalArgumentException("unknown fetch type: " + ormFetchType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.orm.FetchType toOrmResourceModel(FetchType fetchType) {
- if (fetchType == null) {
- return null;
- }
- switch (fetchType) {
- case EAGER:
- return org.eclipse.jpt.core.resource.orm.FetchType.EAGER;
- case LAZY:
- return org.eclipse.jpt.core.resource.orm.FetchType.LAZY;
- default:
- throw new IllegalArgumentException("unknown fetch type: " + fetchType);
- }
- }
-
-}
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 d583aa0fff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Fetchable.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.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.
- */
-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 f576711b6c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GeneratedValue.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.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.
- */
-public interface GeneratedValue
- extends JpaContextNode
-{
-
- GenerationType getStrategy();
- GenerationType getDefaultStrategy();
- GenerationType getSpecifiedStrategy();
- void setSpecifiedStrategy(GenerationType value);
- String SPECIFIED_STRATEGY_PROPERTY = "specifiedStrategy"; //$NON-NLS-1$
- String DEFAULT_STRATEGY_PROPERTY = "defaultStrategy"; //$NON-NLS-1$
-
- String getGenerator();
- String getDefaultGenerator();
- GenerationType DEFAULT_STRATEGY = GenerationType.AUTO;
- String getSpecifiedGenerator();
- void setSpecifiedGenerator(String value);
- String SPECIFIED_GENERATOR_PROPERTY = "specifiedGenerator"; //$NON-NLS-1$
- String DEFAULT_GENERATOR_PROPERTY = "defaultGenerator"; //$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 d46990d054..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GenerationType.java
+++ /dev/null
@@ -1,100 +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.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.
- */
-public enum GenerationType {
-
- TABLE,
- SEQUENCE,
- IDENTITY,
- AUTO;
-
-
- public static GenerationType fromJavaResourceModel(org.eclipse.jpt.core.resource.java.GenerationType javaGenerationType) {
- if (javaGenerationType == null) {
- return null;
- }
- switch (javaGenerationType) {
- case TABLE:
- return TABLE;
- case SEQUENCE:
- return SEQUENCE;
- case IDENTITY:
- return IDENTITY;
- case AUTO:
- return AUTO;
- default:
- throw new IllegalArgumentException("unknown generation type: " + javaGenerationType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.java.GenerationType toJavaResourceModel(GenerationType generationType) {
- if (generationType == null) {
- return null;
- }
- switch (generationType) {
- case TABLE:
- return org.eclipse.jpt.core.resource.java.GenerationType.TABLE;
- case SEQUENCE:
- return org.eclipse.jpt.core.resource.java.GenerationType.SEQUENCE;
- case IDENTITY:
- return org.eclipse.jpt.core.resource.java.GenerationType.IDENTITY;
- case AUTO:
- return org.eclipse.jpt.core.resource.java.GenerationType.AUTO;
- default:
- throw new IllegalArgumentException("unknown generation type: " + generationType);
- }
- }
-
- public static GenerationType fromOrmResourceModel(org.eclipse.jpt.core.resource.orm.GenerationType ormGenerationType) {
- if (ormGenerationType == null) {
- return null;
- }
- switch (ormGenerationType) {
- case TABLE:
- return TABLE;
- case SEQUENCE:
- return SEQUENCE;
- case IDENTITY:
- return IDENTITY;
- case AUTO:
- return AUTO;
- default:
- throw new IllegalArgumentException("unknown generation type: " + ormGenerationType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.orm.GenerationType toOrmResourceModel(GenerationType generationType) {
- if (generationType == null) {
- return null;
- }
- switch (generationType) {
- case TABLE:
- return org.eclipse.jpt.core.resource.orm.GenerationType.TABLE;
- case SEQUENCE:
- return org.eclipse.jpt.core.resource.orm.GenerationType.SEQUENCE;
- case IDENTITY:
- return org.eclipse.jpt.core.resource.orm.GenerationType.IDENTITY;
- case AUTO:
- return org.eclipse.jpt.core.resource.orm.GenerationType.AUTO;
- default:
- throw new IllegalArgumentException("unknown generation type: " + generationType);
- }
- }
-}
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 1970d682a3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Generator.java
+++ /dev/null
@@ -1,93 +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.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.
- */
-public interface Generator
- extends JpaContextNode
-{
-
- // ********** name **********
-
- String getName();
- void setName(String value);
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
-
- // ********** initial value **********
-
- Integer getInitialValue();
- Integer getSpecifiedInitialValue();
- void setSpecifiedInitialValue(Integer value);
- String SPECIFIED_INITIAL_VALUE_PROPERTY = "specifiedInitialValue"; //$NON-NLS-1$
- Integer getDefaultInitialValue();
- String DEFAULT_INITIAL_VALUE_PROPERTY = "defaultInitialValue"; //$NON-NLS-1$
-
-
- // ********** allocation size **********
-
- Integer getAllocationSize();
- Integer getSpecifiedAllocationSize();
- void setSpecifiedAllocationSize(Integer value);
- String SPECIFIED_ALLOCATION_SIZE_PROPERTY = "specifiedAllocationSize"; //$NON-NLS-1$
- Integer getDefaultAllocationSize();
- Integer DEFAULT_ALLOCATION_SIZE = Integer.valueOf(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/GeneratorHolder.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GeneratorHolder.java
deleted file mode 100644
index e98d535a8f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GeneratorHolder.java
+++ /dev/null
@@ -1,43 +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.
- */
-public interface GeneratorHolder
- 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/IdClass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/IdClass.java
deleted file mode 100644
index 352ae27e6e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/IdClass.java
+++ /dev/null
@@ -1,29 +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.
- */
-public interface IdClass extends JpaContextNode
-{
- String getIdClass();
-
- void setIdClass(String value);
-
- String ID_CLASS_PROPERTY = "idClassProperty";
-
-}
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 dc39bfa4b6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/IdMapping.java
+++ /dev/null
@@ -1,28 +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.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.
- */
-public interface IdMapping extends AttributeMapping, ColumnMapping, GeneratorHolder, ConvertibleMapping
-{
- GeneratedValue getGeneratedValue();
- GeneratedValue addGeneratedValue();
- void removeGeneratedValue();
- String GENERATED_VALUE_PROPERTY = "generatedValueProperty";
-
-}
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 a84b805c12..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/InheritanceType.java
+++ /dev/null
@@ -1,94 +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.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.
- */
-public enum InheritanceType {
-
-
- SINGLE_TABLE,
- JOINED,
- TABLE_PER_CLASS;
-
-
- public static InheritanceType fromJavaResourceModel(org.eclipse.jpt.core.resource.java.InheritanceType javaInheritanceType) {
- if (javaInheritanceType == null) {
- return null;
- }
- switch (javaInheritanceType) {
- case SINGLE_TABLE:
- return SINGLE_TABLE;
- case JOINED:
- return JOINED;
- case TABLE_PER_CLASS:
- return TABLE_PER_CLASS;
- default:
- throw new IllegalArgumentException("unknown inheritance type: " + javaInheritanceType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.java.InheritanceType toJavaResourceModel(InheritanceType inheritanceType) {
- if (inheritanceType == null) {
- return null;
- }
- switch (inheritanceType) {
- case SINGLE_TABLE:
- return org.eclipse.jpt.core.resource.java.InheritanceType.SINGLE_TABLE;
- case JOINED:
- return org.eclipse.jpt.core.resource.java.InheritanceType.JOINED;
- case TABLE_PER_CLASS:
- return org.eclipse.jpt.core.resource.java.InheritanceType.TABLE_PER_CLASS;
- default:
- throw new IllegalArgumentException("unknown inheritance type: " + inheritanceType);
- }
- }
-
-
- public static InheritanceType fromOrmResourceModel(org.eclipse.jpt.core.resource.orm.InheritanceType ormInheritanceType) {
- if (ormInheritanceType == null) {
- return null;
- }
- switch (ormInheritanceType) {
- case SINGLE_TABLE:
- return SINGLE_TABLE;
- case JOINED:
- return JOINED;
- case TABLE_PER_CLASS:
- return TABLE_PER_CLASS;
- default:
- throw new IllegalArgumentException("unknown inheritance type: " + ormInheritanceType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.orm.InheritanceType toOrmResourceModel(InheritanceType inheritanceType) {
- if (inheritanceType == null) {
- return null;
- }
- switch (inheritanceType) {
- case SINGLE_TABLE:
- return org.eclipse.jpt.core.resource.orm.InheritanceType.SINGLE_TABLE;
- case JOINED:
- return org.eclipse.jpt.core.resource.orm.InheritanceType.JOINED;
- case TABLE_PER_CLASS:
- return org.eclipse.jpt.core.resource.orm.InheritanceType.TABLE_PER_CLASS;
- default:
- throw new IllegalArgumentException("unknown inheritance type: " + inheritanceType);
- }
- }
-
-}
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 f6b6795f7d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumn.java
+++ /dev/null
@@ -1,64 +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.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.
- */
-public interface JoinColumn
- extends BaseColumn, BaseJoinColumn
-{
- Owner getOwner();
-
- /**
- * 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
- {
- /**
- * return whether the specified table cannot be explicitly specified
- * in the join column's 'table' element
- */
- boolean tableNameIsInvalid(String tableName);
-
- /**
- * return whether the join column's table can be specified explicitly
- */
- boolean tableIsAllowed();
-
- /**
- * return the entity referenced by the join column
- */
- Entity getTargetEntity();
-
- /**
- * return the join column's attribute name
- */
- String getAttributeName();
-
- /**
- * return the relationship mapping for this join column
- */
- RelationshipMapping getRelationshipMapping();
-
- /**
- * return the size of the joinColumns collection this join column is a part of
- */
- int joinColumnsSize();
- }
-}
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 ce132fe7be..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinTable.java
+++ /dev/null
@@ -1,140 +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.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.
- */
-public interface JoinTable extends Table
-{
-
- RelationshipMapping getParent();
-
- // **************** join columns **************************************
-
- /**
- * 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();
-
- /**
- * Return a list iterator of the specified join columns.
- * This will not be null.
- */
- <T extends JoinColumn> ListIterator<T> specifiedJoinColumns();
- String SPECIFIED_JOIN_COLUMNS_LIST = "specifiedJoinColumnsList";
-
- /**
- * 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";
-
- /**
- * 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);
-
- boolean containsSpecifiedJoinColumns();
-
-
- // **************** inverse join columns **************************************
-
- /**
- * Return a list iterator of the inverse join columns whether specified or default.
- * This will not be null.
- */
- <T extends JoinColumn> ListIterator<T> inverseJoinColumns();
-
- /**
- * Return the number of inverse join columns, both specified and default.
- */
- int inverseJoinColumnsSize();
-
- /**
- * Return a list iterator of the specified inverse join columns.
- * This will not be null.
- */
- <T extends JoinColumn> ListIterator<T> specifiedInverseJoinColumns();
- String SPECIFIED_INVERSE_JOIN_COLUMNS_LIST = "specifiedInverseJoinColumnsList";
-
- /**
- * 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";
-
- /**
- * Add a specified inverse join column to the join table return the object
- * representing it.
- */
- JoinColumn addSpecifiedInverseJoinColumn(int index);
-
- /**
- * Remove the specified inverse join column from the join table.
- */
- void removeSpecifiedInverseJoinColumn(int index);
-
- /**
- * Remove the specified inverse join column at the index from the join table.
- */
- void removeSpecifiedInverseJoinColumn(JoinColumn joinColumn);
-
-
- /**
- * Move the specified inverse join column from the source index to the target index.
- */
- void moveSpecifiedInverseJoinColumn(int targetIndex, int sourceIndex);
-
- boolean containsSpecifiedInverseJoinColumns();
-
-}
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 d59071805b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JpaContextNode.java
+++ /dev/null
@@ -1,48 +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.context;
-
-import org.eclipse.jpt.core.JpaNode;
-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.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 JpaContextNode
- extends JpaNode
-{
- /**
- * Return the persistence unit if the context node is within a
- * persistence.xml context. Otherwise return null.
- */
- PersistenceUnit getPersistenceUnit();
-
- /**
- * Return the mapping file root object if the context node is within a
- * mapping file context. Otherwise return null.
- */
- MappingFileRoot getMappingFileRoot();
-
- SchemaContainer getContextDefaultDbSchemaContainer();
-
- Catalog getContextDefaultDbCatalog();
-
- Schema getContextDefaultDbSchema();
-}
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 925ff20573..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JpaRootContextNode.java
+++ /dev/null
@@ -1,69 +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.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;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 JpaRootContextNode extends JpaContextNode
-{
- /**
- * String constant associated with changes to the persistenceXml property
- */
- public final static String PERSISTENCE_XML_PROPERTY = "persistenceXml"; //$NON-NLS-1$
-
- /**
- * Return the content represented by the persistence.xml file associated with
- * this project.
- * This may be null.
- */
- PersistenceXml getPersistenceXml();
-
- /**
- * Add a persistence.xml file to this content and return the content associated
- * with it.
- * Throws {@link IllegalStateException} if a persistence.xml already exists.
- */
- PersistenceXml addPersistenceXml();
-
- /**
- * Remove the persistence.xml file from this content.
- * Throws {@link IllegalStateException} if a persistence.xml does not exist.
- */
- void removePersistenceXml();
-
-
- // **************** updating ***********************************************
-
- /**
- * Update the context model with the content of the JPA project
- */
- void update(IProgressMonitor monitor);
-
-
- // **************** validation *********************************************
-
- /**
- * Add validation messages to the specified list.
- */
- public void validate(List<IMessage> messages);
-
-}
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 7fac7a8a83..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToManyMapping.java
+++ /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
- ******************************************************************************/
-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.
- */
-public interface ManyToManyMapping extends MultiRelationshipMapping
-{
- // nothing yet
-}
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 c28576c1a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToOneMapping.java
+++ /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
- ******************************************************************************/
-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.
- */
-public interface ManyToOneMapping extends SingleRelationshipMapping
-{
- // nothing yet
-}
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 af4ec25b87..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedSuperclass.java
+++ /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
- ******************************************************************************/
-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.
- */
-public interface MappedSuperclass extends TypeMapping, IdClass
-{
- //nothing yet
-}
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 a48813c7ba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappingFile.java
+++ /dev/null
@@ -1,49 +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;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.resource.common.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.
- */
-public interface MappingFile extends XmlContextNode, JpaStructureNode
-{
- /**
- * Return the underlying xml resource
- */
- JpaXmlResource getXmlResource();
-
- /**
- * Return the root object of this mapping file
- */
- MappingFileRoot getRoot();
-
- /**
- * Return the PersistentType listed in this mapping file
- * with the given fullyQualifiedTypeName. Return null if none exists.
- */
- PersistentType getPersistentType(String fullyQualifiedTypeName);
-
-
- // **************** updating **********************************************
-
- /**
- * Update the MappingFile context model object to match the JpaXmlResource
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(JpaXmlResource mappingFileResource);
-}
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 442f44a80f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappingFilePersistenceUnitDefaults.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.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.
- */
-public interface MappingFilePersistenceUnitDefaults
-{
- AccessType getAccess();
-
- String getCatalog();
-
- String getSchema();
-
- boolean isCascadePersist();
-
- /**
- * Return whether the underlying resource exists for the MappingFilePersistenceUnitDefaults object
- * If there is a node in the orm.xml file for persistence-unit-default, this returns true, otherwise false.
- * @return
- */
- 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 6cedf87188..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappingFileRoot.java
+++ /dev/null
@@ -1,48 +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;
-
-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.
- */
-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 624452c45c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MultiRelationshipMapping.java
+++ /dev/null
@@ -1,55 +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.context;
-
-import java.util.Iterator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 MultiRelationshipMapping extends NonOwningMapping
-{
- FetchType DEFAULT_FETCH_TYPE = FetchType.LAZY;
-
- String getOrderBy();
- void setOrderBy(String value);
- String ORDER_BY_PROPERTY = "orderBy"; //$NON-NLS-1$
-
-
- boolean isNoOrdering();
- void setNoOrdering(boolean newNoOrdering);
- String NO_ORDERING_PROPERTY = "noOrdering"; //$NON-NLS-1$
-
- boolean isPkOrdering();
- void setPkOrdering(boolean newPkOrdering);
- String PK_ORDERING_PROPERTY = "pkOrdering"; //$NON-NLS-1$
-
- boolean isCustomOrdering();
- void setCustomOrdering(boolean newCustomOrdering);
- String CUSTOM_ORDERING_PROPERTY = "customOrdering"; //$NON-NLS-1$
-
-
- JoinTable getJoinTable();
-
- boolean joinTableIsSpecified();
-
-
- String getMapKey();
- void setMapKey(String value);
- String MAP_KEY_PROPERTY = "mapKey"; //$NON-NLS-1$
-
- Iterator<String> candidateMapKeyNames();
-}
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 d9d518ae22..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedColumn.java
+++ /dev/null
@@ -1,81 +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.context;
-
-import org.eclipse.jpt.db.Column;
-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.
- */
-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$
-
-
- 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();
-
- Owner getOwner();
-
- /**
- * 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 database table for the specified table name
- */
- Table getDbTable(String tableName);
-
- /**
- * Return the default column name
- */
- String getDefaultColumnName();
- }
-
-}
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 f93e9ee565..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedNativeQuery.java
+++ /dev/null
@@ -1,31 +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.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.
- */
-public interface NamedNativeQuery extends Query
-{
- String getResultClass();
- void setResultClass(String value);
- String RESULT_CLASS_PROPERTY = "resultClassProperty";
-
- String getResultSetMapping();
- void setResultSetMapping(String value);
- String RESULT_SET_MAPPING_PROPERTY = "resultSetMappingProperty";
-
-}
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 8e9520c307..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedQuery.java
+++ /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
- ******************************************************************************/
-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.
- */
-public interface NamedQuery extends Query {
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NonOwningMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NonOwningMapping.java
deleted file mode 100644
index e83031bd0d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NonOwningMapping.java
+++ /dev/null
@@ -1,33 +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.context;
-
-import java.util.Iterator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 NonOwningMapping extends RelationshipMapping
-{
- String getMappedBy();
- void setMappedBy(String value);
- String MAPPED_BY_PROPERTY = "mappedByProperty";
-
- Iterator<String> candidateMappedByAttributeNames();
-
- boolean mappedByIsValid(AttributeMapping mappedByMapping);
-
-} \ No newline at end of file
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 cc292f61a8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Nullable.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.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.
- */
-public interface Nullable extends AttributeMapping
-{
- Boolean getOptional();
-
- Boolean getDefaultOptional();
- String DEFAULT_OPTIONAL_PROPERTY = "defaultOptionalProperty";
- Boolean DEFAULT_OPTIONAL = Boolean.TRUE;
-
- Boolean getSpecifiedOptional();
- void setSpecifiedOptional(Boolean newSpecifiedOptional);
- String SPECIFIED_OPTIONAL_PROPERTY = "specifiedOptionalProperty";
-
-}
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 339f2b8e98..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToManyMapping.java
+++ /dev/null
@@ -1,23 +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.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.
- */
-public interface OneToManyMapping extends MultiRelationshipMapping {
- // nothing yet
-}
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 20b51e0e80..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToOneMapping.java
+++ /dev/null
@@ -1,62 +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.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.
- */
-public interface OneToOneMapping
- extends SingleRelationshipMapping, NonOwningMapping
-{
- // **************** primary key join columns **************************************
-
- /**
- * 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();
- /**
- * 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);
-
- boolean containsPrimaryKeyJoinColumns();
- String PRIMARY_KEY_JOIN_COLUMNS_LIST = "primaryKeyJoinColumnsList";
-
-}
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 4e5205fb4a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PersistentAttribute.java
+++ /dev/null
@@ -1,91 +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.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.
- */
-public interface PersistentAttribute extends JpaContextNode, JpaStructureNode
-{
- String getName();
- String NAME_PROPERTY = "nameProperty";
-
- /**
- * 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 "default" mapping. WIll not return null.
- */
- AttributeMapping getMapping();
-
- /**
- * Return the attribute's "specified" mapping, could be null
- */
- AttributeMapping getSpecifiedMapping();
-
- /**
- * 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);
- String SPECIFIED_MAPPING_PROPERTY = "specifiedMappingProperty";
- String DEFAULT_MAPPING_PROPERTY = "defaultMappingProperty";
-
- TypeMapping getTypeMapping();
-
- PersistentType getPersistentType();
-
- /**
- * If the attribute is mapped to a primary key column, return the
- * column's name, otherwise return null.
- */
- String getPrimaryKeyColumnName();
-
- /**
- * Return whether the attribute's "attribute" mapping can be overridden.
- */
- boolean isOverridableAttribute();
-
- /**
- * Return whether the attribute's "association" mapping can be overridden.
- */
- boolean isOverridableAssociation();
-
- /**
- * Return whether the attribute's "attribute" mapping is for an ID.
- */
- boolean isIdAttribute();
-
- /**
- * 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 c69ad9a78e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PersistentType.java
+++ /dev/null
@@ -1,124 +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.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;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 PersistentType extends JpaContextNode, JpaStructureNode
-{
- /**
- * Return the owning context
- */
- PersistentTypeContext getContext();
-
- String getName();
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- String getShortName();
-
- AccessType getAccess();
- String ACCESS_PROPERTY = "access"; //$NON-NLS-1$
-
- TypeMapping getMapping();
- String getMappingKey();
- void setMappingKey(String key);
- String MAPPING_PROPERTY = "mapping"; //$NON-NLS-1$
-
- boolean isMapped();
-
-
- /**
- * Return the parent {@link PersistentType} from the 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 null if this persistentType is the root persistent type.
- * Example:
- * <pre>
- * &#64;Entity
- * public abstract class Model {}
- * <a>
- * public abstract class Animal extends Model {}
- * <a>
- * &#64;Entity
- * public class Cat extends Animal {}
- * </pre>
- *
- * If this is the Cat JavaPersistentType then parentPersistentType is the Model JavaPersistentType
- * The parentPersistentType could be found in java or xml.
- */
- PersistentType getParentPersistentType();
- String PARENT_PERSISTENT_TYPE_PROPERTY = "parentPersistentType"; //$NON-NLS-1$
-
- /**
- * Return a read-only iterator of the contained {@link PersistentAttribute}
- */
- <T extends PersistentAttribute> ListIterator<T> attributes();
-
- /**
- * Return the size of {@link PersistentAttribute}s list
- * @return
- */
- int attributesSize();
- String SPECIFIED_ATTRIBUTES_LIST = "specifiedAttributes"; //$NON-NLS-1$
-
- Iterator<String> attributeNames();
-
- /**
- * Return a read-only iterator of the all the {@link PersistentAttribute}s
- * in the hierarchy
- */
- Iterator<PersistentAttribute> allAttributes();
-
- Iterator<String> allAttributeNames();
-
- /**
- * Return the attribute named <code>attributeName</code> if
- * it exists locally on this type
- */
- PersistentAttribute getAttributeNamed(String attributeName);
-
- /**
- * Resolve and return the attribute named <code>attributeName</code> if it
- * is distinct and exists within the context of this type
- */
- PersistentAttribute resolveAttribute(String attributeName);
-
- /**
- * Includes the present persistent type.
- */
- Iterator<PersistentType> inheritanceHierarchy();
-
- /**
- * Excludes the present persistent type.
- */
- Iterator<PersistentType> ancestors();
-
-
- // **************** validation **************************************
-
- /**
- * Add to the list of current validation messages
- */
- void validate(List<IMessage> messages);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PersistentTypeContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PersistentTypeContext.java
deleted file mode 100644
index c4d2633945..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PersistentTypeContext.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-public interface PersistentTypeContext extends JpaContextNode
-{
- /**
- * Return the access type that overrides any access specified locally for the
- * owned persistent type, null if there is no such access override
- */
- AccessType getOverridePersistentTypeAccess();
-
- /**
- * Return the default access type to be applied to the owned persistent type,
- * null if no default applies
- */
- 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 499917198d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumn.java
+++ /dev/null
@@ -1,25 +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.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.
- */
-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/Query.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Query.java
deleted file mode 100644
index ecc494398c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Query.java
+++ /dev/null
@@ -1,94 +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.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.
- */
-public interface Query
- extends JpaContextNode
-{
- // **************** 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/QueryHint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/QueryHint.java
deleted file mode 100644
index a4f51c808e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/QueryHint.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.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.
- */
-public interface QueryHint extends JpaContextNode
-{
-
- String getName();
- void setName(String value);
- String NAME_PROPERTY = "nameProperty";
-
- String getValue();
- void setValue(String value);
- String VALUE_PROPERTY = "valueProperty";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/QueryHolder.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/QueryHolder.java
deleted file mode 100644
index 269f6989ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/QueryHolder.java
+++ /dev/null
@@ -1,88 +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;
-
-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.
- */
-public interface QueryHolder extends JpaContextNode
-{
- /**
- * 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 = "namedQueriesList";
-
- /**
- * 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 = "namedNativeQueriesList";
-} \ No newline at end of file
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 6ec2d714f3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/RelationshipMapping.java
+++ /dev/null
@@ -1,59 +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.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.
- */
-public interface RelationshipMapping extends AttributeMapping, Fetchable
-{
- /**
- * Return the entity that owns the relationship mapping.
- */
- Entity getEntity();
-
- /**
- * 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
- */
- boolean isRelationshipOwner();
-
- String getJoinTableDefaultName();
-
-
- // **************** 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$
-
-
- // **************** cascade **************************************
-
- Cascade getCascade();
-
-}
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 f60a0ac964..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SecondaryTable.java
+++ /dev/null
@@ -1,84 +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.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.
- */
-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 = "specifiedPrimaryKeyJoinColumnsList";
-
- /**
- * 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";
-
- /**
- * 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 385f541bcf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SequenceGenerator.java
+++ /dev/null
@@ -1,36 +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.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.
- */
-public interface SequenceGenerator
- extends Generator
-{
- Integer DEFAULT_INITIAL_VALUE = Integer.valueOf(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 4b0962e396..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SingleRelationshipMapping.java
+++ /dev/null
@@ -1,85 +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.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.
- */
-public interface SingleRelationshipMapping extends RelationshipMapping, Nullable
-{
-
- // **************** fetch type **************************************
-
- FetchType DEFAULT_FETCH_TYPE = FetchType.EAGER;
-
- // **************** join columns **************************************
-
- /**
- * 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();
-
- /**
- * Return a list iterator of the specified join columns.
- * This will not be null.
- */
- <T extends JoinColumn> ListIterator<T> specifiedJoinColumns();
- String SPECIFIED_JOIN_COLUMNS_LIST = "specifiedJoinColumnsList";
-
- /**
- * 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";
-
- /**
- * 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);
-
- boolean containsSpecifiedJoinColumns();
-
-} \ 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 1a5a05f8b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Table.java
+++ /dev/null
@@ -1,107 +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.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.
- */
-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();
-
-}
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 85ac530da3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TableGenerator.java
+++ /dev/null
@@ -1,133 +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.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.
- */
-public interface TableGenerator
- extends Generator
-{
- Integer DEFAULT_INITIAL_VALUE = Integer.valueOf(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 938ffb8fc2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TemporalConverter.java
+++ /dev/null
@@ -1,30 +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 TemporalConverter extends Converter
-{
- TemporalType getTemporalType();
- void setTemporalType(TemporalType temporalType);
- String TEMPORAL_TYPE_PROPERTY = "temporalTypeProperty";
-
-}
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 bc10bbb5f4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TemporalType.java
+++ /dev/null
@@ -1,93 +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.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.
- */
-public enum TemporalType {
-
- DATE,
- TIME,
- TIMESTAMP;
-
-
- public static TemporalType fromJavaResourceModel(org.eclipse.jpt.core.resource.java.TemporalType javaTemporalType) {
- if (javaTemporalType == null) {
- return null;
- }
- switch (javaTemporalType) {
- case DATE:
- return DATE;
- case TIME:
- return TIME;
- case TIMESTAMP:
- return TIMESTAMP;
- default:
- throw new IllegalArgumentException("unknown temporal type: " + javaTemporalType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.java.TemporalType toJavaResourceModel(TemporalType temporalType) {
- if (temporalType == null) {
- return null;
- }
- switch (temporalType) {
- case DATE:
- return org.eclipse.jpt.core.resource.java.TemporalType.DATE;
- case TIME:
- return org.eclipse.jpt.core.resource.java.TemporalType.TIME;
- case TIMESTAMP:
- return org.eclipse.jpt.core.resource.java.TemporalType.TIMESTAMP;
- default:
- throw new IllegalArgumentException("unknown temporal type: " + temporalType);
- }
- }
-
-
- public static TemporalType fromOrmResourceModel(org.eclipse.jpt.core.resource.orm.TemporalType ormTemporalType) {
- if (ormTemporalType == null) {
- return null;
- }
- switch (ormTemporalType) {
- case DATE:
- return DATE;
- case TIME:
- return TIME;
- case TIMESTAMP:
- return TIMESTAMP;
- default:
- throw new IllegalArgumentException("unknown temporal type: " + ormTemporalType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.orm.TemporalType toOrmResourceModel(TemporalType temporalType) {
- if (temporalType == null) {
- return null;
- }
- switch (temporalType) {
- case DATE:
- return org.eclipse.jpt.core.resource.orm.TemporalType.DATE;
- case TIME:
- return org.eclipse.jpt.core.resource.orm.TemporalType.TIME;
- case TIMESTAMP:
- return org.eclipse.jpt.core.resource.orm.TemporalType.TIMESTAMP;
- default:
- throw new IllegalArgumentException("unknown temporal type: " + temporalType);
- }
- }
-
-}
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 3ebd4cf788..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TransientMapping.java
+++ /dev/null
@@ -1,25 +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.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.
- */
-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 5939b25349..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TypeMapping.java
+++ /dev/null
@@ -1,146 +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.context;
-
-import java.util.Iterator;
-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.
- */
-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 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'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);
-
- /**
- * Return an Iterator of attributes. The attributes must be BasicMappings or
- * IdMappings found in this type mapping
- */
- <T extends PersistentAttribute> Iterator<T> overridableAttributes();
-
- /**
- * Return an Iterator of attributes names. The attributes must be
- * BasicMappings or IdMappings found in this type mapping
- */
- Iterator<String> overridableAttributeNames();
-
- /**
- * Return an Iterator of attributes. The attributes must be BasicMappings or
- * IdMappings found in any MappedSuperclass in the inheritance hierarchy.
- * See {@link TypeMapping#overridableAttributes()} and
- * {@link PersistentType#inheritanceHierarchy()}
- */
- Iterator<PersistentAttribute> allOverridableAttributes();
-
- /**
- * Return an Iterator of attributes names. The attributes must be
- * BasicMappings or IdMappings found in any MappedSuperclass in the
- * inheritance hierarchy. See
- * {@link TypeMapping#overridableAttributeNames()} and
- * {@link PersistentType#inheritanceHierarchy()}
- */
- Iterator<String> allOverridableAttributeNames();
-
- /**
- * Return an Iterator of associations that can be overriden. The
- * associations must be OneToOneMappings or ManyToOneMappings found in this
- * type mapping
- */
- <T extends PersistentAttribute> Iterator<T> overridableAssociations();
-
- /**
- * Return an Iterator of association names. The associations must be
- * OneToOneMappings or ManyToOneMappings found in any MappedSuperclass in
- * the inheritance hierarchy
- */
- Iterator<String> overridableAssociationNames();
-
- /**
- * Return an Iterator of associations. The associations must be
- * OneToOneMappings or ManyToOneMappings found in any MappedSuperclass in
- * the inheritance hierarchy See
- * {@link TypeMapping#overridableAssociations()} and
- * {@link PersistentType#inheritanceHierarchy()}
- */
- Iterator<PersistentAttribute> allOverridableAssociations();
-
- /**
- * Return an Iterator of association names. The associations must be
- * OneToOneMappings or ManyToOneMappings found in any MappedSuperclass in
- * the inheritance hierarchy See
- * {@link TypeMapping#overridableAssociationNames()} and
- * {@link PersistentType#inheritanceHierarchy()}
- */
- 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);
-}
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 d77ace489c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/UniqueConstraint.java
+++ /dev/null
@@ -1,68 +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;
-
-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.
- */
-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 566512ffcb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/VersionMapping.java
+++ /dev/null
@@ -1,25 +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.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.
- */
-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 6c65ce78c7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/XmlContextNode.java
+++ /dev/null
@@ -1,40 +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;
-
-import java.util.List;
-import org.eclipse.jpt.core.resource.common.JpaXmlResource;
-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.
- */
-public interface XmlContextNode extends JpaContextNode
-{
- /**
- * Return the EMF resource that this context node represents
- */
- JpaXmlResource getEResource();
-
-
- // **************** validation **************************************
-
- /**
- * Add to the list of current validation messages
- */
- void validate(List<IMessage> messages);
-
- TextRange getValidationTextRange();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/DefaultJavaAttributeMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/DefaultJavaAttributeMappingProvider.java
deleted file mode 100644
index 43f3700ba4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/DefaultJavaAttributeMappingProvider.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-
-/**
- * Map a string key to an attribute mapping and its corresponding
- * Java annotation 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.
- */
-public interface DefaultJavaAttributeMappingProvider extends JavaAttributeMappingProvider {
-
- /**
- * Given the IJavaPersistentAttribute return whether the default mapping applies.
- * This will be used to determine the default mapping in the case where no
- * mapping has been specified.
- */
- boolean defaultApplies(JavaPersistentAttribute persistentAttribute);
-
-}
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 ceb50d2e7b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAssociationOverride.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.context.java;
-
-import java.util.ListIterator;
-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.
- */
-public interface JavaAssociationOverride extends AssociationOverride, JavaJpaContextNode
-{
- @SuppressWarnings("unchecked")
- ListIterator<JavaJoinColumn> joinColumns();
- @SuppressWarnings("unchecked")
- ListIterator<JavaJoinColumn> specifiedJoinColumns();
- @SuppressWarnings("unchecked")
- ListIterator<JavaJoinColumn> defaultJoinColumns();
- JavaJoinColumn addSpecifiedJoinColumn(int index);
-
- 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);
-
-}
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 a718008469..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeMapping.java
+++ /dev/null
@@ -1,45 +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.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.AttributeMapping;
-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.
- */
-public interface JavaAttributeMapping extends AttributeMapping, JavaJpaContextNode
-{
- JavaPersistentAttribute getPersistentAttribute();
-
- void initialize(JavaResourcePersistentAttribute jrpa);
-
- /**
- * Update the JavaAttributeMapping context model object to match the JavaResourcePersistentAttribute
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(JavaResourcePersistentAttribute jrpa);
-
- String getAnnotationName();
-
- /**
- * Return all fully qualfied annotation names that are supported with this mapping type.
- * This includes all possible annotations, not just the ones that currently exist on the attribute.
- */
- Iterator<String> correspondingAnnotationNames();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeMappingProvider.java
deleted file mode 100644
index 76a04ed3a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeMappingProvider.java
+++ /dev/null
@@ -1,43 +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.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.
- */
-public interface JavaAttributeMappingProvider {
-
- /**
- * 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);
-
-}
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 d5056fcaff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeOverride.java
+++ /dev/null
@@ -1,36 +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.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.
- */
-public interface JavaAttributeOverride extends AttributeOverride, JavaJpaContextNode, JavaColumn.Owner
-{
- JavaColumn getColumn();
-
- 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);
-
-}
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 10de0a7f99..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBaseColumn.java
+++ /dev/null
@@ -1,43 +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.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.
- */
-public interface JavaBaseColumn extends BaseColumn, JavaNamedColumn
-{
-
- /**
- * Return the (best guess) text location of the column's table.
- */
- TextRange getTableTextRange(CompilationUnit astRoot);
-
- Owner getOwner();
-
- /**
- * 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 58356ff62a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBaseEmbeddedMapping.java
+++ /dev/null
@@ -1,35 +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.context.java;
-
-import java.util.ListIterator;
-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.
- */
-public interface JavaBaseEmbeddedMapping extends JavaAttributeMapping, BaseEmbeddedMapping
-{
- @SuppressWarnings("unchecked")
- ListIterator<JavaAttributeOverride> attributeOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<JavaAttributeOverride> virtualAttributeOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides();
-
- JavaAttributeOverride getAttributeOverrideNamed(String name);
-
-}
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 382af8033a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBaseJoinColumn.java
+++ /dev/null
@@ -1,43 +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.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.
- */
-public interface JavaBaseJoinColumn extends BaseJoinColumn, JavaNamedColumn
-{
-
- /**
- * Return the (best guess) text location of the referenced column name
- */
- TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot);
-
-
- Owner getOwner();
- /**
- * 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 8c2fb881b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBasicMapping.java
+++ /dev/null
@@ -1,30 +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.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.
- */
-public interface JavaBasicMapping
- extends JavaAttributeMapping, BasicMapping, JavaColumnMapping
-{
- //********* covariant overrides **********
- JavaConverter getDefaultConverter();
- JavaConverter getSpecifiedConverter();
-
-}
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 cb717c59b2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaColumn.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.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.
- */
-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);
-
- Owner getOwner();
- /**
- * interface allowing columns to be used in multiple places
- * (e.g. basic mappings and attribute overrides)
- */
- interface Owner extends JavaBaseColumn.Owner
- {
- ColumnAnnotation getResourceColumn();
- }
-
-} \ 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 99d1248b1b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaColumnMapping.java
+++ /dev/null
@@ -1,26 +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.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.
- */
-public interface JavaColumnMapping extends JavaJpaContextNode, ColumnMapping, JavaColumn.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 64abaff8c2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaConverter.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.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 17cd6fc18d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaDiscriminatorColumn.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.context.java;
-
-import org.eclipse.jpt.core.context.DiscriminatorColumn;
-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.
- */
-public interface JavaDiscriminatorColumn extends JavaNamedColumn, DiscriminatorColumn
-{
- void initialize(JavaResourcePersistentMember jrpm);
-
- /**
- * Update the JavaDiscriminatorColumn 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/JavaEmbeddable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddable.java
deleted file mode 100644
index 5d67f223ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddable.java
+++ /dev/null
@@ -1,31 +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.context.java;
-
-import java.util.Iterator;
-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.
- */
-public interface JavaEmbeddable
- extends JavaTypeMapping, Embeddable
-{
- Iterator<JavaPersistentAttribute> overridableAttributes();
-
- Iterator<JavaPersistentAttribute> overridableAssociations();
-
-}
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 81eb4c764d..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * 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.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.
- */
-public interface JavaEmbeddedIdMapping extends JavaBaseEmbeddedMapping, EmbeddedIdMapping
-{
- ListIterator<JavaAttributeOverride> attributeOverrides();
- ListIterator<JavaAttributeOverride> virtualAttributeOverrides();
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides();
-}
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 ef965d21be..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * 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.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.
- */
-public interface JavaEmbeddedMapping extends JavaBaseEmbeddedMapping, EmbeddedMapping
-{
- ListIterator<JavaAttributeOverride> attributeOverrides();
- ListIterator<JavaAttributeOverride> virtualAttributeOverrides();
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides();
-}
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 26df174d34..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEntity.java
+++ /dev/null
@@ -1,72 +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.context.java;
-
-import java.util.Iterator;
-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.
- */
-public interface JavaEntity extends JavaTypeMapping, Entity, JavaGeneratorHolder
-{
- JavaTable getTable();
-
- 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);
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaAttributeOverride> attributeOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<JavaAttributeOverride> virtualAttributeOverrides();
- JavaAttributeOverride getAttributeOverrideNamed(String name);
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaAssociationOverride> associationOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<JavaAssociationOverride> specifiedAssociationOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<JavaAssociationOverride> virtualAssociationOverrides();
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaNamedQuery> namedQueries();
- JavaNamedQuery addNamedQuery(int index);
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaNamedNativeQuery> namedNativeQueries();
- JavaNamedNativeQuery addNamedNativeQuery(int index);
-
- Iterator<JavaPersistentAttribute> overridableAttributes();
-
- Iterator<JavaPersistentAttribute> overridableAssociations();
-
-}
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 92cfd1c74f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEnumeratedConverter.java
+++ /dev/null
@@ -1,29 +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.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 368a554157..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGeneratedValue.java
+++ /dev/null
@@ -1,42 +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.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.
- */
-public interface JavaGeneratedValue extends GeneratedValue, JavaJpaContextNode
-{
-
- /**
- * Return the (best guess) text location of the generator.
- */
- TextRange getGeneratorTextRange(CompilationUnit astRoot);
-
- void initialize(GeneratedValueAnnotation resourceGeneratedValue);
-
- /**
- * Update the JavaGeneratedValue context model object to match the GeneratedValueAnnotation
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(GeneratedValueAnnotation resourceGeneratedValue);
-
-} \ No newline at end of file
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 ccc4d3c8ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGenerator.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.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.
- */
-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/JavaGeneratorHolder.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGeneratorHolder.java
deleted file mode 100644
index 84ede7f98a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGeneratorHolder.java
+++ /dev/null
@@ -1,30 +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.java;
-
-import org.eclipse.jpt.core.context.GeneratorHolder;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 JavaGeneratorHolder extends GeneratorHolder
-{
- JavaSequenceGenerator getSequenceGenerator();
-
- JavaSequenceGenerator addSequenceGenerator();
-
- JavaTableGenerator getTableGenerator();
-
- JavaTableGenerator addTableGenerator();
-} \ No newline at end of file
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 628862c0a8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaIdMapping.java
+++ /dev/null
@@ -1,31 +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.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.
- */
-public interface JavaIdMapping extends JavaAttributeMapping, IdMapping, JavaColumnMapping, JavaGeneratorHolder
-{
- //********* covariant overrides **********
- JavaConverter getDefaultConverter();
- JavaConverter getSpecifiedConverter();
-
- 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 983a28bed7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumn.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.core.context.java;
-
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 JavaJoinColumn extends JoinColumn, JavaBaseJoinColumn, JavaBaseColumn
-{
- void initialize(JoinColumnAnnotation resourceJoinColumn);
-
- /**
- * Update the JavaJoinColumn context model object to match the JoinColumnAnnotation
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(JoinColumnAnnotation resourceJoinColumn);
-
- Owner getOwner();
-
- /**
- * interface allowing join columns to be used in multiple places
- * (e.g. 1:1 mappings and join tables)
- */
- interface Owner extends JoinColumn.Owner, JavaBaseJoinColumn.Owner, JavaBaseColumn.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/JavaJoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinTable.java
deleted file mode 100644
index 751c3b1eaf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinTable.java
+++ /dev/null
@@ -1,65 +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.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.JoinTable;
-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.
- */
-public interface JavaJoinTable extends JoinTable, JavaJpaContextNode
-{
- void initialize(JavaResourcePersistentAttribute jrpa);
-
- /**
- * Update the JavaJoinTable context model object to match the JavaResourcePersistentAttribute
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(JavaResourcePersistentAttribute jrpa);
-
- boolean isSpecified();
-
-
- //****************** covariant overrides *******************
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaJoinColumn> joinColumns();
-
- JavaJoinColumn getDefaultJoinColumn();
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaJoinColumn> specifiedJoinColumns();
-
- JavaJoinColumn addSpecifiedJoinColumn(int index);
-
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaJoinColumn> inverseJoinColumns();
-
- JavaJoinColumn getDefaultInverseJoinColumn();
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaJoinColumn> specifiedInverseJoinColumns();
-
- JavaJoinColumn addSpecifiedInverseJoinColumn(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/JavaJpaContextNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJpaContextNode.java
deleted file mode 100644
index 53faac070e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJpaContextNode.java
+++ /dev/null
@@ -1,48 +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.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;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 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, 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 745fc213b2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaLobConverter.java
+++ /dev/null
@@ -1,29 +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.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 c9c6e68e3b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToManyMapping.java
+++ /dev/null
@@ -1,27 +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.context.java;
-
-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.
- */
-public interface JavaManyToManyMapping
- extends JavaMultiRelationshipMapping, ManyToManyMapping
-{
- // nothing yet
-}
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 ef3411b539..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * 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.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.
- */
-public interface JavaManyToOneMapping
- extends JavaSingleRelationshipMapping, ManyToOneMapping
-{
- // ********** covariant overrides **********
-
- ListIterator<JavaJoinColumn> joinColumns();
-
- ListIterator<JavaJoinColumn> specifiedJoinColumns();
-
-}
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 97b8db2e75..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMappedSuperclass.java
+++ /dev/null
@@ -1,30 +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.context.java;
-
-import java.util.Iterator;
-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.
- */
-public interface JavaMappedSuperclass
- extends JavaTypeMapping, MappedSuperclass
-{
- Iterator<JavaPersistentAttribute> overridableAttributes();
-
- Iterator<JavaPersistentAttribute> overridableAssociations();
-}
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 fb47f8886b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMultiRelationshipMapping.java
+++ /dev/null
@@ -1,27 +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.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.
- */
-public interface JavaMultiRelationshipMapping extends JavaRelationshipMapping, MultiRelationshipMapping
-{
-
- JavaJoinTable getJoinTable();
-}
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 7281b298ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedColumn.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.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.
- */
-public interface JavaNamedColumn extends NamedColumn, JavaJpaContextNode
-{
-
- Owner getOwner();
-
- /**
- * 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 15a3d216b1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedNativeQuery.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.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.
- */
-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 78e77bb613..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedQuery.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.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.
- */
-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 1bdb12383f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToManyMapping.java
+++ /dev/null
@@ -1,27 +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.context.java;
-
-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.
- */
-public interface JavaOneToManyMapping
- extends JavaMultiRelationshipMapping, OneToManyMapping
-{
- // nothing yet
-}
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 8d8a1adcf7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToOneMapping.java
+++ /dev/null
@@ -1,37 +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.context.java;
-
-import java.util.ListIterator;
-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.
- */
-public interface JavaOneToOneMapping
- extends JavaSingleRelationshipMapping, OneToOneMapping
-{
- // ********** covariant overrides **********
-
- ListIterator<JavaJoinColumn> joinColumns();
-
- ListIterator<JavaJoinColumn> specifiedJoinColumns();
-
- @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/JavaPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPersistentAttribute.java
deleted file mode 100644
index 83ebf2f006..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPersistentAttribute.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.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-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.
- */
-public interface JavaPersistentAttribute extends PersistentAttribute, JavaJpaContextNode
-{
-
- JavaAttributeMapping getMapping();
-
- JavaAttributeMapping getSpecifiedMapping();
-
- JavaAttributeMapping getDefaultMapping();
-
- JavaTypeMapping getTypeMapping();
-
- JavaPersistentType getPersistentType();
-
- /**
- * Update the JavaPersistentAttribute context model object to match the JavaResourcePersistentAttribute
- * resource model object passed in to the constructor.
- * see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update();
-
- JavaResourcePersistentAttribute getResourcePersistentAttribute();
-
- boolean mappingIsDefault(JavaAttributeMapping mapping);
-
- /**
- * Return whether the attribute contains the given offset into the text file.
- */
- boolean contains(int offset, CompilationUnit astRoot);
-
-}
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 08859cb61b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPersistentType.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.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PersistentType;
-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.
- */
-public interface JavaPersistentType extends PersistentType, JavaJpaContextNode
-{
- JavaTypeMapping getMapping();
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaPersistentAttribute> attributes();
-
- JavaPersistentAttribute getAttributeNamed(String attributeName);
-
- /**
- * Resolve and return the attribute named <code>attributeName</code> if it
- * is distinct and exists within the context of this type
- */
- PersistentAttribute resolveAttribute(String attributeName);
-
- /**
- * Return whether any attribute in this persistent type contains a mapping annotation
- * @return
- */
- boolean hasAnyAttributeMappingAnnotations();
-
-
- /**
- * Update the JavaPersistentType context model object to match the JavaResourcePersistentType
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(JavaResourcePersistentType jrpt);
-
-} \ No newline at end of file
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 62f06acdb0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPrimaryKeyJoinColumn.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.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.
- */
-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/JavaQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQuery.java
deleted file mode 100644
index 080efe7d5c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQuery.java
+++ /dev/null
@@ -1,37 +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.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.
- */
-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/JavaQueryHint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQueryHint.java
deleted file mode 100644
index 452833bf27..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQueryHint.java
+++ /dev/null
@@ -1,33 +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.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.
- */
-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/JavaRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaRelationshipMapping.java
deleted file mode 100644
index 1d791e8e41..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaRelationshipMapping.java
+++ /dev/null
@@ -1,27 +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.context.java;
-
-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.
- */
-public interface JavaRelationshipMapping
- extends JavaAttributeMapping, RelationshipMapping
-{
- // nothing yet
-}
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 fab4a97cc0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSecondaryTable.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.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.
- */
-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 428324e7e5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSequenceGenerator.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.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.
- */
-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 2c929644cc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSingleRelationshipMapping.java
+++ /dev/null
@@ -1,35 +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.context.java;
-
-import java.util.ListIterator;
-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.
- */
-public interface JavaSingleRelationshipMapping extends JavaRelationshipMapping, SingleRelationshipMapping
-{
- @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/JavaStructureNodes.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaStructureNodes.java
deleted file mode 100644
index 534de78258..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaStructureNodes.java
+++ /dev/null
@@ -1,33 +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.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.
- */
-public interface JavaStructureNodes
-{
- String COMPILATION_UNIT_ID =
- JptCorePlugin.PLUGIN_ID + ".java.compilationUnit";
-
- String PERSISTENT_TYPE_ID =
- JptCorePlugin.PLUGIN_ID + ".java.persistentType";
-
- String PERSISTENT_ATTRIBUTE_ID =
- JptCorePlugin.PLUGIN_ID + ".java.persistentAttribute";
-}
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 6e0511d678..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTable.java
+++ /dev/null
@@ -1,42 +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.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.
- */
-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 9a1273adbf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTableGenerator.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.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.
- */
-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 de0f4c486e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTemporalConverter.java
+++ /dev/null
@@ -1,29 +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.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 9accaaa6a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTransientMapping.java
+++ /dev/null
@@ -1,27 +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.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.
- */
-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 10ef63df07..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTypeMapping.java
+++ /dev/null
@@ -1,46 +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.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.TypeMapping;
-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.
- */
-public interface JavaTypeMapping extends TypeMapping, JavaJpaContextNode
-{
- void initialize(JavaResourcePersistentType jrpt);
-
- /**
- * Update the JavaTypeMapping context model object to match the JavaResourcePersistentType
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(JavaResourcePersistentType jrpt);
-
- String getAnnotationName();
-
- Iterator<String> correspondingAnnotationNames();
-
- JavaPersistentType getPersistentType();
-
- @SuppressWarnings("unchecked")
- Iterator<JavaPersistentAttribute> overridableAttributes();
-
- @SuppressWarnings("unchecked")
- Iterator<JavaPersistentAttribute> overridableAssociations();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTypeMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTypeMappingProvider.java
deleted file mode 100644
index 6225b78cd0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTypeMappingProvider.java
+++ /dev/null
@@ -1,43 +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.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.
- */
-public interface JavaTypeMappingProvider {
-
- /**
- * 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);
-
-}
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 c157e2b096..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaUniqueConstraint.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.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.
- */
-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 81c44e4665..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaVersionMapping.java
+++ /dev/null
@@ -1,30 +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.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.
- */
-public interface JavaVersionMapping
- extends JavaAttributeMapping, VersionMapping, JavaColumnMapping
-{
- //********* covariant overrides **********
- JavaConverter getDefaultConverter();
- JavaConverter getSpecifiedConverter();
-
-}
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 3c63896096..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/EntityMappings.java
+++ /dev/null
@@ -1,141 +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.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.MappingFileRoot;
-import org.eclipse.jpt.core.context.QueryHolder;
-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.
- */
-public interface EntityMappings
- extends MappingFileRoot, OrmPersistentTypeContext, QueryHolder
-{
-
- 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$
-
- 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();
-
- ListIterator<OrmPersistentType> ormPersistentTypes();
- int ormPersistentTypesSize();
- OrmPersistentType addOrmPersistentType(String mappingKey, String className);
- void removeOrmPersistentType(int index);
- void removeOrmPersistentType(OrmPersistentType ormPersistentType);
- //void moveOrmPersistentType(int targetIndex, int sourceIndex);
- boolean containsPersistentType(String className);
- String PERSISTENT_TYPES_LIST = "persistentTypes"; //$NON-NLS-1$
-
- ListIterator<OrmSequenceGenerator> sequenceGenerators();
- int sequenceGeneratorsSize();
- 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$
-
- ListIterator<OrmTableGenerator> tableGenerators();
- int tableGeneratorsSize();
- 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$
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmNamedQuery> namedQueries();
- int namedQueriesSize();
- OrmNamedQuery addNamedQuery(int index);
- void removeNamedQuery(int index);
- void moveNamedQuery(int targetIndex, int sourceIndex);
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmNamedNativeQuery> namedNativeQueries();
- int namedNativeQueriesSize();
- OrmNamedNativeQuery addNamedNativeQuery(int index);
- void removeNamedNativeQuery(int index);
- void moveNamedNativeQuery(int targetIndex, int sourceIndex);
-
- OrmPersistenceUnitDefaults getPersistenceUnitDefaults();
-
- /**
- * Return the {@link OrmPersistentType) listed in this mapping file
- * with the given fullyQualifiedTypeName. Return null if none exists.
- */
- OrmPersistentType getPersistentType(String fullyQualifiedTypeName);
-
- void changeMapping(OrmPersistentType ormPersistentType, OrmTypeMapping oldMapping, OrmTypeMapping newMapping);
-
- // **************** updating ***********************************************
-
- /**
- * Update the EntityMappings context model object to match the XmlEntityMappings
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update();
-
- // *************************************************************************
-
- boolean containsOffset(int textOffset);
-
-}
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 121ebc420c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAssociationOverride.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.core.context.orm;
-
-import java.util.ListIterator;
-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.
- */
-public interface OrmAssociationOverride extends AssociationOverride, XmlContextNode
-{
- @SuppressWarnings("unchecked")
- ListIterator<OrmJoinColumn> joinColumns();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmJoinColumn> defaultJoinColumns();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmJoinColumn> specifiedJoinColumns();
-
- OrmJoinColumn addSpecifiedJoinColumn(int index);
-
- /**
- * 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/OrmAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeMapping.java
deleted file mode 100644
index 3267ae51f7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeMapping.java
+++ /dev/null
@@ -1,98 +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.orm;
-
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-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.
- */
-public interface OrmAttributeMapping extends AttributeMapping, XmlContextNode
-{
- OrmPersistentAttribute getPersistentAttribute();
-
- XmlAttributeMapping getResourceAttributeMapping();
-
- String getName();
- void setName(String newName);
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
-
- JavaPersistentAttribute getJavaPersistentAttribute();
- String JAVA_PERSISTENT_ATTRIBUTE_PROPERTY = "javaPersistentAttribute"; //$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 removeFromResourceModel(AbstractXmlTypeMapping typeMapping);
-
- XmlAttributeMapping addToResourceModel(AbstractXmlTypeMapping typeMapping);
-
-
- 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();
-
-
- //******************* initialization/updating *******************
-
- void initialize(XmlAttributeMapping resourceAttributeMapping);
-
- /**
- * 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/OrmAttributeMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeMappingProvider.java
deleted file mode 100644
index 6465258322..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeMappingProvider.java
+++ /dev/null
@@ -1,33 +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.context.orm;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 OrmAttributeMappingProvider
-{
- String getKey();
-
- OrmAttributeMapping buildMapping(OrmPersistentAttribute parent, JpaFactory factory);
-
- XmlAttributeMapping buildVirtualResourceMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping, JpaFactory 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 79c7b6f1c9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeOverride.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.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.
- */
-public interface OrmAttributeOverride extends AttributeOverride, XmlContextNode
-{
- OrmColumn getColumn();
-
- /**
- * 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);
-} \ 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 ed2b20af5e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBaseColumn.java
+++ /dev/null
@@ -1,43 +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.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.
- */
-public interface OrmBaseColumn extends BaseColumn, OrmNamedColumn
-{
-
- /**
- * Return the (best guess) text location of the column's table.
- */
- TextRange getTableTextRange();
-
- Owner getOwner();
-
- /**
- * 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 584b69c1d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBaseEmbeddedMapping.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.core.context.orm;
-
-import java.util.ListIterator;
-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.
- */
-public interface OrmBaseEmbeddedMapping extends BaseEmbeddedMapping, OrmAttributeMapping
-{
- @SuppressWarnings("unchecked")
- ListIterator<OrmAttributeOverride> attributeOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<OrmAttributeOverride> virtualAttributeOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<OrmAttributeOverride> specifiedAttributeOverrides();
-
- OrmAttributeOverride getAttributeOverrideNamed(String name);
-} \ 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 8f141568a0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBaseJoinColumn.java
+++ /dev/null
@@ -1,42 +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.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.
- */
-public interface OrmBaseJoinColumn extends BaseJoinColumn, OrmNamedColumn
-{
-
- /**
- * Return the (best guess) text location of the referenced column name
- */
- TextRange getReferencedColumnNameTextRange();
-
-
- Owner getOwner();
- /**
- * 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 c72fb16c59..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBasicMapping.java
+++ /dev/null
@@ -1,30 +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.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.
- */
-public interface OrmBasicMapping extends BasicMapping, OrmAttributeMapping, OrmColumnMapping
-{
-
- //********* covariant overrides **********
- OrmConverter getDefaultConverter();
- OrmConverter getSpecifiedConverter();
-
-} \ No newline at end of file
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 0008268442..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmColumn.java
+++ /dev/null
@@ -1,51 +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.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.
- */
-public interface OrmColumn extends Column, OrmBaseColumn
-{
-
- Owner getOwner();
-
- 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 b3ba8d0359..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmColumnMapping.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.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.
- */
-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 b18d6295ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmConverter.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.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 c875e79a40..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmDiscriminatorColumn.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.DiscriminatorColumn;
-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.
- */
-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);
-} \ 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 531356223b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddable.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddable;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 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();
-
- void initialize(XmlEmbeddable mappedSuperclass);
-
- /**
- * Update the OrmEmbeddable context model object to match the XmlEmbeddable
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlEmbeddable mappedSuperclass);
-
- Iterator<OrmPersistentAttribute> overridableAttributes();
-
- Iterator<OrmPersistentAttribute> overridableAssociations();
-} \ No newline at end of file
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 7964f33ae1..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * 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.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.
- */
-public interface OrmEmbeddedIdMapping extends EmbeddedIdMapping, OrmBaseEmbeddedMapping
-{
- ListIterator<OrmAttributeOverride> attributeOverrides();
- ListIterator<OrmAttributeOverride> virtualAttributeOverrides();
- ListIterator<OrmAttributeOverride> specifiedAttributeOverrides();
-
-} \ 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 5b733c18b0..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * 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.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.
- */
-public interface OrmEmbeddedMapping extends EmbeddedMapping, OrmBaseEmbeddedMapping
-{
- ListIterator<OrmAttributeOverride> attributeOverrides();
- ListIterator<OrmAttributeOverride> virtualAttributeOverrides();
- ListIterator<OrmAttributeOverride> specifiedAttributeOverrides();
-} \ 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 f4c065418d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEntity.java
+++ /dev/null
@@ -1,126 +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.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-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.
- */
-public interface OrmEntity
- extends Entity, OrmTypeMapping, OrmGeneratorHolder
-{
- /**
- * Return a list iterator of the virtual(not specified) secondary tables.
- * This will not be null.
- */
- ListIterator<OrmSecondaryTable> virtualSecondaryTables();
- String VIRTUAL_SECONDARY_TABLES_LIST = "virtualSecondaryTablesList";
-
- /**
- * 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();
-
- void initialize(XmlEntity entity);
-
- /**
- * Update the OrmEntity context model object to match the XmlEntity
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlEntity entity);
-
-
- //************ covariant overrides *************
-
- OrmTable getTable();
-
- 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 = "defaultPrimaryKeyJoinColumnsList";
- @SuppressWarnings("unchecked")
- ListIterator<OrmPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns();
- OrmPrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index);
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmAttributeOverride> attributeOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<OrmAttributeOverride> specifiedAttributeOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<OrmAttributeOverride> virtualAttributeOverrides();
- OrmAttributeOverride getAttributeOverrideNamed(String name);
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmAssociationOverride> associationOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<OrmAssociationOverride> specifiedAssociationOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<OrmAssociationOverride> virtualAssociationOverrides();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmNamedQuery> namedQueries();
- OrmNamedQuery addNamedQuery(int index);
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmNamedNativeQuery> namedNativeQueries();
- OrmNamedNativeQuery addNamedNativeQuery(int index);
-
- Iterator<OrmPersistentAttribute> overridableAttributes();
-
- Iterator<OrmPersistentAttribute> overridableAssociations();
-
-} \ No newline at end of file
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 cefc307b77..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmGeneratedValue.java
+++ /dev/null
@@ -1,38 +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.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.
- */
-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);
-} \ No newline at end of file
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 f29e838b6c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmGenerator.java
+++ /dev/null
@@ -1,28 +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.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.
- */
-public interface OrmGenerator extends Generator
-{
- // **************** validation *********************************************
-
- TextRange getNameTextRange();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmGeneratorHolder.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmGeneratorHolder.java
deleted file mode 100644
index da17aff03f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmGeneratorHolder.java
+++ /dev/null
@@ -1,30 +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.orm;
-
-import org.eclipse.jpt.core.context.GeneratorHolder;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 OrmGeneratorHolder extends GeneratorHolder
-{
- OrmSequenceGenerator getSequenceGenerator();
-
- OrmSequenceGenerator addSequenceGenerator();
-
- OrmTableGenerator getTableGenerator();
-
- OrmTableGenerator addTableGenerator();
-} \ No newline at end of file
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 e419e610d8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmIdMapping.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.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.
- */
-public interface OrmIdMapping
- extends IdMapping, OrmColumnMapping, OrmAttributeMapping, OrmGeneratorHolder
-{
-
- //********* covariant overrides **********
-
- OrmConverter getDefaultConverter();
- OrmConverter getSpecifiedConverter();
-
- 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 6c059289c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumn.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 OrmJoinColumn extends JoinColumn, OrmBaseJoinColumn, OrmBaseColumn
-{
- void initializeFrom(JoinColumn oldColumn);
-
- /**
- * Update the OrmJoinColumn context model object to match the XmlJoinColumn
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlJoinColumn resourceJoinColumn);
-
- Owner getOwner();
-
- /**
- * interface allowing join columns to be used in multiple places
- * (e.g. 1:1 mappings and join tables)
- */
- interface Owner extends JoinColumn.Owner, OrmBaseJoinColumn.Owner, OrmBaseColumn.Owner
- {
- // nothing yet
- }
-} \ No newline at end of file
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 26e5975964..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinTable.java
+++ /dev/null
@@ -1,70 +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.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.JoinTable;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 OrmJoinTable extends JoinTable, XmlContextNode
-{
-
- boolean isSpecified();
-
- void initialize(XmlRelationshipMapping relationshipMapping);
-
- /**
- * Update the OrmJoinTable context model object to match the XmlRelationshipMapping
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update();
-
- void initializeFrom(JoinTable oldJoinTable);
-
-
- //****************** covariant overrides *******************
-
- OrmRelationshipMapping getParent();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmJoinColumn> joinColumns();
-
- OrmJoinColumn getDefaultJoinColumn();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmJoinColumn> specifiedJoinColumns();
-
- OrmJoinColumn addSpecifiedJoinColumn(int index);
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmJoinColumn> inverseJoinColumns();
-
- OrmJoinColumn getDefaultInverseJoinColumn();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmJoinColumn> specifiedInverseJoinColumns();
-
- OrmJoinColumn addSpecifiedInverseJoinColumn(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/OrmManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToManyMapping.java
deleted file mode 100644
index 6eef715745..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToManyMapping.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-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.
- */
-public interface OrmManyToManyMapping extends ManyToManyMapping, OrmMultiRelationshipMapping
-{
-
-} \ No newline at end of file
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 0a8c848790..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToOneMapping.java
+++ /dev/null
@@ -1,29 +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.orm;
-
-import java.util.ListIterator;
-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.
- */
-public interface OrmManyToOneMapping extends ManyToOneMapping, OrmSingleRelationshipMapping
-{
- ListIterator<OrmJoinColumn> joinColumns();
-
- ListIterator<OrmJoinColumn> specifiedJoinColumns();
-} \ No newline at end of file
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 38b42defa7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMappedSuperclass.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.MappedSuperclass;
-import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 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();
-
- void initialize(XmlMappedSuperclass mappedSuperclass);
-
- /**
- * Update the OrmMappedSuperclass context model object to match the XmlMappedSuperclass
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlMappedSuperclass mappedSuperclass);
-
- Iterator<OrmPersistentAttribute> overridableAttributes();
-
- Iterator<OrmPersistentAttribute> overridableAssociations();
-} \ No newline at end of file
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 a65523a338..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMultiRelationshipMapping.java
+++ /dev/null
@@ -1,27 +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.orm;
-
-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.
- */
-public interface OrmMultiRelationshipMapping extends OrmRelationshipMapping, MultiRelationshipMapping
-{
-
- OrmJoinTable getJoinTable();
-}
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 d6dadd7146..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedColumn.java
+++ /dev/null
@@ -1,49 +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.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.
- */
-public interface OrmNamedColumn extends NamedColumn, XmlContextNode
-{
-
- Owner getOwner();
-
- /**
- * 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 20b3c204f4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedNativeQuery.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.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.
- */
-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 a5886beaa5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedQuery.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.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.
- */
-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 1cbdf9842b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToManyMapping.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-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.
- */
-public interface OrmOneToManyMapping extends OneToManyMapping, OrmMultiRelationshipMapping
-{
-
-} \ No newline at end of file
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 7629619007..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToOneMapping.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.core.context.orm;
-
-import java.util.ListIterator;
-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.
- */
-public interface OrmOneToOneMapping extends OneToOneMapping, OrmSingleRelationshipMapping
-{
-
- // ********** covariant overrides **********
- ListIterator<OrmJoinColumn> joinColumns();
-
- ListIterator<OrmJoinColumn> specifiedJoinColumns();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns();
-
- OrmPrimaryKeyJoinColumn addPrimaryKeyJoinColumn(int index);
-
-} \ No newline at end of file
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 d08f1c1706..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistenceUnitDefaults.java
+++ /dev/null
@@ -1,67 +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.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;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 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 OrmPersistenceUnitDefaults 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/OrmPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentAttribute.java
deleted file mode 100644
index e8d493b27e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentAttribute.java
+++ /dev/null
@@ -1,94 +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.context.orm;
-
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 OrmPersistentAttribute extends PersistentAttribute, XmlContextNode
-{
-
- /**
- * Overriden to return {@link OrmAttributeMapping}s
- */
- OrmAttributeMapping getMapping();
-
- /**
- * Overriden to return {@link OrmAttributeMapping}s
- */
- OrmAttributeMapping getSpecifiedMapping();
-
- /**
- * Overriden to return {@link OrmTypeMapping}s
- */
- OrmTypeMapping getTypeMapping();
-
- /**
- * Overriden to return {@link OrmPersistentType}s
- */
- OrmPersistentType getPersistentType();
-
- boolean contains(int textOffset);
-
- /**
- * 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);
-
- void nameChanged(String oldName, String newName);
-
-
- //******************* initialization/updating *******************
-
- void initialize(XmlAttributeMapping attributeMapping);
-
- /**
- * Update the OrmPersistentAttribute context model object to match the
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update();
-
-} \ No newline at end of file
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 a40766a7b2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentType.java
+++ /dev/null
@@ -1,157 +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.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;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 OrmPersistentType extends PersistentType, XmlContextNode
-{
- public OrmPersistentTypeContext getContext();
-
- /**
- * Overriden to return {@link OrmPersistentAttribute}s
- */
- @SuppressWarnings("unchecked")
- ListIterator<OrmPersistentAttribute> attributes();
-
- /**
- * Overriden to return an {@link OrmPersistentAttribute}
- */
- OrmPersistentAttribute getAttributeNamed(String attributeName);
-
- /**
- * Overriden to return an {@link OrmTypeMapping}
- */
- 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 addSpecifiedPersistentAttribute(String mappingKey, String attributeName);
- void removeSpecifiedPersistentAttribute(OrmPersistentAttribute ormPersistentAttribute);
-
-
- //***************** 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 containsVirtualPersistentAttribute(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 makePersistentAttributeVirtual(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 makePersistentAttributeSpecified(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 makePersistentAttributeSpecified(OrmPersistentAttribute ormPersistentAttribute, String mappingKey);
-
- //******************* mapping morphing *******************
- void changeMapping(OrmPersistentAttribute ormPersistentAttribute, OrmAttributeMapping oldMapping, OrmAttributeMapping newMapping);
-
-
- //******************* initialization/updating *******************
-
- void initialize(XmlEntity entity);
-
- void initialize(XmlMappedSuperclass mappedSuperclass);
-
- void initialize(XmlEmbeddable embeddable);
-
- /**
- * Update the OrmPersistentType context model object to match the XmlEntity
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlEntity entity);
-
- /**
- * Update the OrmPersistentType context model object to match the XmlMappedSuperclass
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlMappedSuperclass mappedSuperclass);
-
- /**
- * Update the OrmPersistentType context model object to match the XmlEmbeddable
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlEmbeddable embeddable);
-
-
-
- boolean contains(int textOffset);
-
- /**
- * Return whether this {@link OrmPersistentType) applies to the
- * given fullyQualifiedTypeName.
- */
- boolean isFor(String fullyQualifiedTypeName);
-
- 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.
- * @return
- */
- JavaPersistentType getJavaPersistentType();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentTypeContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentTypeContext.java
deleted file mode 100644
index 6693e002e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentTypeContext.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.context.PersistentTypeContext;
-
-public interface OrmPersistentTypeContext extends PersistentTypeContext
-{
- /**
- * 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();
-
- /**
- * Change the type mapping for the persistent type in this context
- */
- void changeMapping(OrmPersistentType ormPersistentType, OrmTypeMapping oldMapping, OrmTypeMapping newMapping);
-}
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 035b6f6085..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPrimaryKeyJoinColumn.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.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.
- */
-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/OrmQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQuery.java
deleted file mode 100644
index b53523231b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQuery.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.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.
- */
-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/OrmQueryHint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQueryHint.java
deleted file mode 100644
index c6efc9a9c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQueryHint.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.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.
- */
-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/OrmRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmRelationshipMapping.java
deleted file mode 100644
index 6e35ea582e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmRelationshipMapping.java
+++ /dev/null
@@ -1,27 +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.orm;
-
-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.
- */
-public interface OrmRelationshipMapping
- extends OrmAttributeMapping, RelationshipMapping
-{
- // nothing yet
-}
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 5b8e1e47e2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSecondaryTable.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.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.
- */
-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 c807079690..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSequenceGenerator.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.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.
- */
-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 bfced13c1c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSingleRelationshipMapping.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.core.context.orm;
-
-import java.util.ListIterator;
-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.
- */
-public interface OrmSingleRelationshipMapping extends OrmRelationshipMapping, SingleRelationshipMapping
-{
- @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/OrmStructureNodes.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmStructureNodes.java
deleted file mode 100644
index f6e5dba9db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmStructureNodes.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.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.
- */
-public interface OrmStructureNodes
-{
-
- String ENTITY_MAPPINGS_ID =
- JptCorePlugin.PLUGIN_ID + ".orm.entityMappings";
-
- String PERSISTENT_TYPE_ID =
- JptCorePlugin.PLUGIN_ID + ".orm.persistentType";
-
- String PERSISTENT_ATTRIBUTE_ID =
- JptCorePlugin.PLUGIN_ID + ".orm.persistentAttribute";
-}
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 2503ccce38..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTable.java
+++ /dev/null
@@ -1,49 +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.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.
- */
-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);
-
- /**
- * Return whether the table is specified in the resource.
- */
- boolean hasSpecifiedResourceTable();
-
-
- //****************** 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 472e97a32c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTableGenerator.java
+++ /dev/null
@@ -1,42 +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.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.
- */
-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 b65ae08829..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTransientMapping.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.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.
- */
-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 bdff141264..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTypeMapping.java
+++ /dev/null
@@ -1,92 +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.orm;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.PersistentTypeContext;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-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.
- */
-public interface OrmTypeMapping extends TypeMapping, XmlContextNode, PersistentTypeContext
-{
- String JAVA_PERSISTENT_TYPE_PROPERTY = "javaPersistentTypeProperty";
-
- String getClass_();
- void setClass(String newClass);
- String CLASS_PROPERTY = "classProperty";
-
- AccessType getAccess();
- AccessType getDefaultAccess();
- String DEFAULT_ACCESS_PROPERTY = "defaultAccessProperty";
-
- AccessType getSpecifiedAccess();
- void setSpecifiedAccess(AccessType newSpecifiedAccess);
- String SPECIFIED_ACCESS_PROPERTY = "specifiedAccessProperty";
-
-
- boolean isMetadataComplete();
- Boolean getSpecifiedMetadataComplete();
- void setSpecifiedMetadataComplete(Boolean newSpecifiedMetadataComplete);
- String SPECIFIED_METADATA_COMPLETE_PROPERTY = "specifiedMetadataCompleteProperty";
-
- boolean isDefaultMetadataComplete();
- String DEFAULT_METADATA_COMPLETE_PROPERTY = "defaultMetadataCompleteProperty";
-
-
- /**
- * 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 removeFromResourceModel(XmlEntityMappings entityMappings);
-
- AbstractXmlTypeMapping addToResourceModel(XmlEntityMappings entityMappings);
-
- void initializeFrom(OrmTypeMapping oldMapping);
-
- AbstractXmlTypeMapping getResourceTypeMapping();
-
- JavaPersistentType getJavaPersistentType();
-
- TextRange getSelectionTextRange();
-
- TextRange getAttributesTextRange();
-
- boolean containsOffset(int textOffset);
-
- OrmPersistentType getPersistentType();
-
- @SuppressWarnings("unchecked")
- Iterator<OrmPersistentAttribute> overridableAttributes();
-
- @SuppressWarnings("unchecked")
- Iterator<OrmPersistentAttribute> overridableAssociations();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTypeMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTypeMappingProvider.java
deleted file mode 100644
index 0fccabd5ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTypeMappingProvider.java
+++ /dev/null
@@ -1,29 +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.context.orm;
-
-import org.eclipse.jpt.core.JpaFactory;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 OrmTypeMappingProvider
-{
- String getKey();
-
- OrmTypeMapping buildMapping(OrmPersistentType parent, JpaFactory 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 3e4a167cf5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmUniqueConstraint.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.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.
- */
-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 a613456c47..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmVersionMapping.java
+++ /dev/null
@@ -1,30 +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.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.
- */
-public interface OrmVersionMapping extends VersionMapping, OrmColumnMapping, OrmAttributeMapping
-{
-
- //********* covariant overrides **********
- OrmConverter getDefaultConverter();
- OrmConverter getSpecifiedConverter();
-
-} \ 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 35999bcd37..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXml.java
+++ /dev/null
@@ -1,55 +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.context.orm;
-
-import org.eclipse.jpt.core.context.MappingFile;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 OrmXml extends XmlContextNode, MappingFile
-{
- // **************** JpaNode override ***************************************
-
- MappingFileRef getParent();
-
-
- // **************** persistence ********************************************
-
- /**
- * String constant associated with changes to the entity-mappings property
- */
- public final static String ENTITY_MAPPINGS_PROPERTY = "entityMappingsProperty";
-
- /**
- * Return the content represented by the root of the orm.xml file.
- * This may be null.
- */
- EntityMappings getEntityMappings();
-
- /**
- * Add a entity-mappings node to the orm.xml file and return the object
- * representing it.
- * Throws {@link IllegalStateException} if a entity-mappings node already exists.
- */
- EntityMappings addEntityMappings();
-
- /**
- * Remove the entity-mappings node from the orm.xml file.
- * Throws {@link IllegalStateException} if a persistence node does not exist.
- */
- void removeEntityMappings();
-}
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 2035ac4a74..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/PersistenceUnitMetadata.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.context.orm;
-
-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.
- */
-public interface PersistenceUnitMetadata extends XmlContextNode
-{
- boolean isXmlMappingMetadataComplete();
- void setXmlMappingMetadataComplete(boolean value);
- String XML_MAPPING_METADATA_COMPLETE_PROPERTY = "xmlMappingMetadataCompleteProperty"; //$NON-NLS-1$
-
- OrmPersistenceUnitDefaults getPersistenceUnitDefaults();
-
- /**
- * Update the PersistenceUnitMetadata 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/persistence/ClassRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/ClassRef.java
deleted file mode 100644
index bba54c7843..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/ClassRef.java
+++ /dev/null
@@ -1,97 +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.context.persistence;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 ClassRef extends XmlContextNode, JpaStructureNode
-{
- /**
- * Return true if the IClassRef matches the fullyQualfiedTypeName
- */
- boolean isFor(String fullyQualifiedTypeName);
-
- /**
- * Return whether this mapping file ref is represented by an entry in the
- * persistence.xml (false) or if it is instead virtual
- */
- boolean isVirtual();
-
-
- // **************** class name *********************************************
-
- /**
- * String constant associated with changes to the class name
- */
- final static String CLASS_NAME_PROPERTY = "className";
-
- /**
- * 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";
-
- /**
- * 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(XmlJavaClassRef classRef);
-
- /**
- * 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/MappingFileRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/MappingFileRef.java
deleted file mode 100644
index 17d4f0e8ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/MappingFileRef.java
+++ /dev/null
@@ -1,84 +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.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;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 MappingFileRef extends XmlContextNode, JpaStructureNode
-{
- /**
- * Return whether this mapping file ref is represented by an entry in the
- * persistence.xml (false) or if it is instead virtual
- */
- boolean isVirtual();
-
-
- // **************** 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);
-
-
- // **************** orm xml ************************************************
-
- String MAPPING_FILE_PROPERTY = "mappingFile"; //$NON-NLS-1$
-
- MappingFile getMappingFile();
-
-
- // **************** udpating ***********************************************
-
- /**
- * Update the MappingFileRef context model object to match the XmlMappingFileRef
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlMappingFileRef mappingFileRef);
-
-
- // *************************************************************************
-
- MappingFilePersistenceUnitDefaults getPersistenceUnitDefaults();
-
- /**
- * Return the PersistentType listed in this mapping file
- * with the given name. Return null if none exists.
- */
- PersistentType getPersistentType(String typeName);
-
- /**
- * 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/Persistence.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/Persistence.java
deleted file mode 100644
index 7efe89e50d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/Persistence.java
+++ /dev/null
@@ -1,90 +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.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;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 Persistence extends XmlContextNode, JpaStructureNode
-{
-
- PersistenceXml getParent();
-
- // **************** persistence units **************************************
-
- /**
- * String constant associated with changes to the persistence units list
- */
- public final static String PERSISTENCE_UNITS_LIST = "persistenceUnits";
-
- /**
- * 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 1a7eefe923..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * 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.
- */
-public interface PersistenceStructureNodes
-{
-
- String PERSISTENCE_ID =
- JptCorePlugin.PLUGIN_ID + ".persistence.persistence";
-
- String PERSISTENCE_UNIT_ID =
- JptCorePlugin.PLUGIN_ID + ".persistence.persistenceUnit";
-
- String CLASS_REF_ID =
- JptCorePlugin.PLUGIN_ID + ".persistence.classRef";
-
- String MAPPING_FILE_REF_ID =
- JptCorePlugin.PLUGIN_ID + ".persistence.mappingFileRef";
-}
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 cbceaea350..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnit.java
+++ /dev/null
@@ -1,491 +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.context.persistence;
-
-import java.util.ListIterator;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.context.AccessType;
-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;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 PersistenceUnit extends XmlContextNode, JpaStructureNode
-{
- // **************** parent *************************************************
-
- Persistence getParent();
-
-
- // **************** name ***************************************************
-
- /**
- * String constant associated with changes to the persistence unit's name
- */
- final static String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Return the name of the persistence unit.
- */
- String getName();
-
- /**
- * Set the name of the persistence unit.
- */
- void setName(String name);
-
-
- // **************** transaction type ***************************************
-
- 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 transaction type of the persistence unit, one of the values of
- * {@link PersistenceUnitTransactionType}
- */
- PersistenceUnitTransactionType getSpecifiedTransactionType();
-
- /**
- * Set the transaction type of the persistence unit, one of the values of
- * {@link PersistenceUnitTransactionType}
- */
- void setSpecifiedTransactionType(PersistenceUnitTransactionType transactionType);
-
- /**
- * String constant associated with changes to the persistence unit's
- * default transaction type (not typically changed)
- */
- final static String DEFAULT_TRANSACTION_TYPE_PROPERTY = "defaultTransactionType"; //$NON-NLS-1$
-
- /**
- * Return the default transaction type
- */
- PersistenceUnitTransactionType getDefaultTransactionType();
-
-
-
- // **************** description ********************************************
-
- /**
- * String constant associated with changes to the persistence unit's description
- */
- final static String DESCRIPTION_PROPERTY = "description"; //$NON-NLS-1$
-
- /**
- * Return the description of the persistence unit.
- */
- String getDescription();
-
- /**
- * Set the description of the persistence unit.
- */
- void setDescription(String description);
-
-
- // **************** provider ********************************************
-
- /**
- * String constant associated with changes to the persistence unit's provider
- */
- final static String PROVIDER_PROPERTY = "provider"; //$NON-NLS-1$
-
- /**
- * Return the provider of the persistence unit.
- */
- String getProvider();
-
- /**
- * Set the provider of the persistence unit.
- */
- void setProvider(String provider);
-
-
- // **************** jta data source ****************************************
-
- /**
- * String constant associated with changes to the persistence unit's JTA data source
- */
- final static String JTA_DATA_SOURCE_PROPERTY = "jtaDataSource"; //$NON-NLS-1$
-
- /**
- * Return the JTA data source of the persistence unit.
- */
- String getJtaDataSource();
-
- /**
- * Set the JTA data source of the persistence unit.
- */
- void setJtaDataSource(String jtaDataSource);
-
-
- // **************** non-jta data source ************************************
-
- /**
- * String constant associated with changes to the persistence unit's non-JTA data source
- */
- final static String NON_JTA_DATA_SOURCE_PROPERTY = "nonJtaDataSource"; //$NON-NLS-1$
-
- /**
- * Return the non-JTA data source of the persistence unit.
- */
- String getNonJtaDataSource();
-
- /**
- * Set the non-JTA data source of the persistence unit.
- */
- void setNonJtaDataSource(String nonJtaDataSource);
-
-
- // **************** mapping file refs **************************************
-
- /**
- * Return an iterator on the list of mapping file refs, whether specified or
- * implied.
- * This will not be null.
- */
- ListIterator<MappingFileRef> mappingFileRefs();
-
- /**
- * Return of mapping file refs, specified and implied.
- */
- int mappingFileRefsSize();
-
- // **************** specified mapping file refs ****************************
-
- /**
- * String constant associated with changes to the specified mapping file refs list
- */
- final static String SPECIFIED_MAPPING_FILE_REFS_LIST = "specifiedMappingFileRefs"; //$NON-NLS-1$
-
- /**
- * Return an iterator on the list of specified mapping file refs.
- * This will not be null.
- */
- ListIterator<MappingFileRef> specifiedMappingFileRefs();
-
- /**
- * Return size of specified mapping file refs.
- */
- int specifiedMappingFileRefsSize();
-
- /**
- * Add a specified mapping file ref to the persistence unit and return the object
- * representing it.
- */
- MappingFileRef addSpecifiedMappingFileRef();
-
- /**
- * Add a specified mapping file ref to the persistence unit at the specified index and
- * return the object representing it.
- */
- 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 implied mapping file ref
- */
- final static String IMPLIED_MAPPING_FILE_REF_PROPERTY = "impliedMappingFileRef"; //$NON-NLS-1$
-
- /**
- * Return the current implied mapping file ref.
- * This may be null.
- */
- MappingFileRef getImpliedMappingFileRef();
-
-
- // **************** class refs *********************************************
-
- /**
- * Return an iterator on the list of class refs, whether specified or implied.
- * This will not be null.
- */
- ListIterator<ClassRef> classRefs();
-
- /**
- * Return the number of specified and implied class refs.
- */
- int classRefsSize();
-
- // **************** specified class refs ***********************************
-
- /**
- * String constant associated with changes to the specified class refs list
- */
- final static String SPECIFIED_CLASS_REFS_LIST = "specifiedClassRefs"; //$NON-NLS-1$
-
- /**
- * Return an iterator on the list of specified class refs.
- * This will not be null.
- */
- ListIterator<ClassRef> specifiedClassRefs();
-
- /**
- * Return the number of specified class refs.
- */
- int specifiedClassRefsSize();
-
- /**
- * Add a specified class ref to the persistence unit and return the object
- * representing it.
- */
- ClassRef addSpecifiedClassRef();
-
- /**
- * Add a specified class ref to the persistence unit at the specified index and
- * return the object representing it.
- */
- 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 implied class refs list
- */
- final static String IMPLIED_CLASS_REFS_LIST = "impliedClassRefs"; //$NON-NLS-1$
-
- /**
- * Return an iterator on the list of implied class refs.
- * This will not be null.
- */
- ListIterator<ClassRef> impliedClassRefs();
-
- /**
- * Return the number of implied class refs.
- */
- int impliedClassRefsSize();
-
-
- // **************** exclude unlisted classes *******************************
-
- /**
- * Return the "exclude unlisted classes" setting of the persistence unit.
- */
- boolean isExcludeUnlistedClasses();
-
- /**
- * String constant associated with changes to the persistence unit's
- * "exclude unlisted classes" setting
- */
- final static String SPECIFIED_EXCLUDE_UNLISTED_CLASSES_PROPERTY = "specifiedExcludeUnlistedClasses"; //$NON-NLS-1$
-
- /**
- * Return the "exclude unlisted classes" setting of the persistence unit.
- */
- Boolean getSpecifiedExcludeUnlistedClasses();
-
- /**
- * Set the "exclude unlisted classes" setting of the persistence unit.
- */
- void setSpecifiedExcludeUnlistedClasses(Boolean excludeUnlistedClasses);
-
- /**
- * String constant associated with changes to the persistence unit's
- * default "exclude unlisted classes" setting (not typically changed)
- */
- final static String DEFAULT_EXCLUDE_UNLISTED_CLASSES_PROPERTY = "defaultExcludeUnlistedClasses"; //$NON-NLS-1$
-
- /**
- * Return the default "exclude unlisted classes" setting
- */
- boolean getDefaultExcludeUnlistedClasses();
-
-
- // **************** properties *********************************************
-
- /**
- * String constant associated with changes to the properties list
- */
- final static String PROPERTIES_LIST = "properties"; //$NON-NLS-1$
-
- /**
- * Return an iterator on the list of properties.
- * This will not be null.
- */
- ListIterator<Property> properties();
-
- int propertiesSize();
-
- /**
- * Add a property to the persistence unit and return the object
- * representing it.
- */
- Property addProperty();
-
- Property addProperty(int index);
-
- Property getProperty(String key);
-
- Property getProperty(String key, String value);
-
- ListIterator<Property> propertiesWithPrefix(String keyPrefix);
-
- void putProperty(String key, String value, boolean allowDuplicates);
-
- void replacePropertyValue(String key, String oldValue, String newValue);
-
- boolean containsProperty(String key);
-
- /**
- * Remove the property from the persistence unit.
- */
- void removeProperty(Property property);
-
- /**
- * Remove the property with the given key from the persistence unit.
- */
- void removeProperty(String key);
-
- /**
- * Remove the property with the given key and valuefrom the persistence unit.
- */
- void removeProperty(String key, String value);
-
-
- // **************** OrmPersistenceUnitDefaults ********************************
-
- AccessType getDefaultAccess();
- String DEFAULT_ACCESS_PROPERTY = "defaultAccess"; //$NON-NLS-1$
-
- String getDefaultCatalog();
- String DEFAULT_CATALOG_PROPERTY = "defaultCatalog"; //$NON-NLS-1$
-
- String getDefaultSchema();
- String DEFAULT_SCHEMA_PROPERTY = "defaultSchema"; //$NON-NLS-1$
-
- boolean getDefaultCascadePersist();
- String DEFAULT_CASCADE_PERSIST_PROPERTY = "defaultCascadePersist"; //$NON-NLS-1$
-
-
- // **************** generators *********************
-
- /**
- * Identifier for changes to the list of global generators.
- * Note that there are no granular changes to this list. There is only
- * notification that the entire list has changed.
- */
- String GENERATORS_LIST = "generators"; //$NON-NLS-1$
-
- /**
- * Add the generator (defined elsewhere) to the list of generators defined
- * within this persistence unit.
- * Note that this should only be called during the process of updating the
- * local generator definition.
- * No change notification accompanies this action specifically.
- */
- void addGenerator(Generator generator);
-
- /**
- * Return an iterator on all generators defined within this persistence unit,
- * included duplicately named generators.
- */
- ListIterator<Generator> allGenerators();
-
- /**
- * Return an array of the names of the generators defined in the persistence
- * unit, with duplicates removed.
- */
- String[] uniqueGeneratorNames();
-
-
- // **************** queries *********************
-
- /**
- * Identifier for changes to the list of global queries.
- * Note that there are no granular changes to this list. There is only
- * notification that the entire list has changed.
- */
- String QUERIES_LIST = "queries"; //$NON-NLS-1$
-
- /**
- * Add the query (defined elsewhere) to the list of queries defined
- * within this persistence unit.
- * Note that this should only be called during the process of updating the
- * local query definition.
- * No change notification accompanies this action specifically.
- */
- void addQuery(Query query);
-
- /**
- * Return an iterator on all queries defined within this persistence unit,
- * included duplicately named queries.
- */
- ListIterator<Query> allQueries();
-
-
- // **************** 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);
-
-
- // *************************************************************************
-
- /**
- * Return the PersistentType specified in this PersistenceUnit with the given
- * fully qualified type name
- */
- PersistentType getPersistentType(String fullyQualifiedTypeName);
-
- /**
- * Return the Entity specified in this PersistenceUnit with the given
- * fully qualified type name. Will return null if there is no persistentType
- * with this name or if the persistentType is not mapped as an entity.
- * @see MappingKeys.ENTITY_TYPE_MAPPING_KEY
- */
- Entity getEntity(String fullyQualifiedTypeName);
-
- /**
- * 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/PersistenceUnitTransactionType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnitTransactionType.java
deleted file mode 100644
index 55f52fd535..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnitTransactionType.java
+++ /dev/null
@@ -1,58 +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.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.
- */
-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);
- }
- }
-
- 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);
- }
- }
-}
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 2c2bcf9ad2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceXml.java
+++ /dev/null
@@ -1,61 +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.context.persistence;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.resource.persistence.PersistenceResource;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 PersistenceXml extends XmlContextNode, JpaStructureNode
-{
- // **************** persistence *******************************************
-
- /**
- * String constant associated with changes to the persistence property
- */
- public final static String PERSISTENCE_PROPERTY = "persistence";
-
- /**
- * Return the content represented by the root of the persistence.xml file.
- * This may be null.
- */
- Persistence getPersistence();
-
- /**
- * Add a persistence node to the persistence.xml file and return the object
- * representing it.
- * Throws {@link IllegalStateException} if a persistence node already exists.
- */
- Persistence addPersistence();
-
- /**
- * Remove the persistence node from the persistence.xml file.
- * Throws {@link IllegalStateException} if a persistence node does not exist.
- */
- void removePersistence();
-
-
- // **************** updating **********************************************
-
- /**
- * Update the PersistenceXml context model object to match the PersistenceResource
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(PersistenceResource persistenceResource);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/Property.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/Property.java
deleted file mode 100644
index 96a25e8736..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/Property.java
+++ /dev/null
@@ -1,51 +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.context.persistence;
-
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.resource.persistence.XmlProperty;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 Property extends XmlContextNode
-{
- // **************** name ***************************************************
-
- final static String NAME_PROPERTY = "name";
-
- String getName();
-
- void setName(String name);
-
-
- // **************** value **************************************************
-
- final static String VALUE_PROPERTY = "value";
-
- void setValue(String value);
-
- String getValue();
-
-
- // **************** updating ***********************************************
-
- /**
- * Update the Property context model object to match the XmlProperty
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlProperty property);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaFile.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaFile.java
deleted file mode 100644
index 302f991402..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaFile.java
+++ /dev/null
@@ -1,151 +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;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.ResourceModelListener;
-import org.eclipse.jpt.utility.internal.ListenerList;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-
-/**
- * The transition between a JPA project and the resource model associated
- * with a file.
- * Maintain a list of resource model listeners (namely, the JPA project).
- * Hold the associated root structure nodes, which are hooks to the
- * context model.
- */
-public abstract class AbstractJpaFile
- extends AbstractJpaNode
- implements JpaFile
-{
- private final IFile file;
-
- private final Hashtable<Object, JpaStructureNode> rootStructureNodes;
-
- private final ResourceModelListener resourceModelListener;
-
- private final ListenerList<ResourceModelListener> resourceModelListenerList;
-
-
- // ********** construction **********
-
- protected AbstractJpaFile(JpaProject jpaProject, IFile file) {
- super(jpaProject);
- this.file = file;
- this.rootStructureNodes = new Hashtable<Object, JpaStructureNode>();
- this.resourceModelListener = this.buildResourceModelListener();
- this.resourceModelListenerList = new ListenerList<ResourceModelListener>(ResourceModelListener.class);
- }
-
- /**
- * Changes to ROOT_STRUCTURE_NODES_COLLECTION do not need to trigger a
- * project update. Only the UI cares about the root structure nodes.
- * If an 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);
- }
-
- protected ResourceModelListener buildResourceModelListener() {
- return new ResourceModelListener() {
- public void resourceModelChanged() {
- AbstractJpaFile.this.resourceModelChanged();
- }
- };
- }
-
-
- // ********** file **********
-
- public IFile getFile() {
- return this.file;
- }
-
-
- // ********** resource model listeners **********
-
- protected ResourceModelListener getResourceModelListener() {
- return this.resourceModelListener;
- }
-
- public void addResourceModelListener(ResourceModelListener listener) {
- this.resourceModelListenerList.add(listener);
- }
-
- public void removeResourceModelListener(ResourceModelListener listener) {
- this.resourceModelListenerList.remove(listener);
- }
-
- protected void resourceModelChanged() {
- for (ResourceModelListener listener : this.resourceModelListenerList.getListeners()) {
- listener.resourceModelChanged();
- }
- }
-
-
- // ********** root structure nodes **********
-
- public Iterator<JpaStructureNode> rootStructureNodes() {
- return new CloneIterator<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) {
- synchronized (this.rootStructureNodes) {
- for (JpaStructureNode rootNode : this.rootStructureNodes.values()) {
- 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.getResourceType());
- sb.append(']');
- }
-
-}
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 f5f31e8d77..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaNode.java
+++ /dev/null
@@ -1,171 +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;
-
-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.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:
- * - containment hierarchy
- * - update triggers
- */
-public abstract class AbstractJpaNode
- extends AbstractModel
- implements JpaNode, CallbackChangeSupport.Source
-{
- 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);
- }
-
-
- // ********** IAdaptable implementation **********
-
- @SuppressWarnings("unchecked")
- 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 JpaFactory getJpaFactory() {
- return this.getJpaPlatform().getJpaFactory();
- }
-
- 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 name is not null
- */
- protected Catalog getDbCatalog(String catalog) {
- Database database = this.getDatabase();
- return (database == null) ? null : database.getCatalogForIdentifier(catalog);
- }
-
-
- // ********** CallbackChangeSupport.Source implementation **********
-
- public void aspectChanged(String aspectName) {
- if (this.aspectTriggersUpdate(aspectName)) {
- // System.out.println(Thread.currentThread() + " \"update\" change: " + this + ": " + aspectName);
- 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/AsynchronousJpaProjectUpdater.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AsynchronousJpaProjectUpdater.java
deleted file mode 100644
index a6877581cc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AsynchronousJpaProjectUpdater.java
+++ /dev/null
@@ -1,121 +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;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.osgi.util.NLS;
-
-/**
- * This updater will "update" the project in a job that executes in a separate
- * thread and allows calls to #update() to return immediately.
- */
-public class AsynchronousJpaProjectUpdater implements JpaProject.Updater {
- protected final UpdateJob job;
-
- public AsynchronousJpaProjectUpdater(JpaProject jpaProject) {
- super();
- this.job = this.buildJob(jpaProject);
- }
-
- protected UpdateJob buildJob(JpaProject jpaProject) {
- return new UpdateJob(jpaProject);
- }
-
- /**
- * Allow the job to be scheduled, but delay the first "update" until requested.
- */
- public void start() {
- this.job.start();
- }
-
- /**
- * Let the job run to completion (i.e. do not cancel it).
- * This should reduce the number of times the job is re-scheduled.
- */
- public void update() {
- this.job.schedule();
- }
-
- public void dispose() {
- this.job.dispose();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.job);
- }
-
-
- /**
- * This is the job that gets scheduled by the asynchronous updater.
- * When the job is run it tells the JPA project to "update".
- * Only a single instance of this job per project can run at a time.
- */
- protected static class UpdateJob extends Job {
- protected final JpaProject jpaProject;
-
- /**
- * When this flag is set to false, the job does not stop immediately;
- * but it cannot be scheduled to run again.
- */
- protected boolean shouldSchedule;
-
- protected UpdateJob(JpaProject jpaProject) {
- super(buildName(jpaProject));
- this.jpaProject = jpaProject;
- this.shouldSchedule = false;
- this.setRule(jpaProject.getProject());
- }
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- return this.jpaProject.update(monitor);
- }
-
- @Override
- public boolean shouldSchedule() {
- return this.shouldSchedule;
- }
-
- protected void start() {
- if (this.shouldSchedule) {
- throw new IllegalStateException("The Updater was not stopped."); //$NON-NLS-1$
- }
- this.shouldSchedule = true;
- }
-
- /**
- * Prevent the job from running again and wait for the current
- * execution, if there is any, to end before returning.
- */
- protected void dispose() {
- // 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 job thread was interrupted while waiting - ignore
- }
- }
-
- protected static String buildName(JpaProject jpaProject) {
- return NLS.bind(JptCoreMessages.UPDATE_JOB_NAME, jpaProject.getName());
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaDataSource.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaDataSource.java
deleted file mode 100644
index 2dea43ccbc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaDataSource.java
+++ /dev/null
@@ -1,225 +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;
-
-import org.eclipse.jpt.core.JpaDataSource;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-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.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));
- }
- }
-
- 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(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.getJpaPlatform().getDatabaseFinder());
- }
-
- 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(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);
- // bug 232225 - also update project setting when connection profile
- // name has changed
- JptCorePlugin.setConnectionProfileName(getJpaProject().getProject(), 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/GenericJpaModel.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaModel.java
deleted file mode 100644
index f443c64402..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaModel.java
+++ /dev/null
@@ -1,512 +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;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.resources.IResourceProxyVisitor;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaModel;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.JpaProject.Config;
-import org.eclipse.jpt.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.core.internal.resource.orm.OrmResourceModelProvider;
-import org.eclipse.jpt.core.internal.resource.persistence.PersistenceResourceModelProvider;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.events.IProjectFacetActionEvent;
-
-/**
- * The JPA model is synchronized so all changes to the list of JPA projects
- * are thread-safe.
- *
- * The JPA model holds on to a list of JPA project configs and only instantiates
- * their associated JPA projects when necessary. Other than performance,
- * this should be transparent to clients.
- */
-public class GenericJpaModel
- extends AbstractModel
- implements JpaModel
-{
-
- /** maintain a list of all the current JPA projects */
- private final ArrayList<JpaProjectHolder> jpaProjectHolders = new ArrayList<JpaProjectHolder>();
-
-
- // ********** constructor **********
-
- /**
- * Construct a JPA model and populate it with JPA projects for all the
- * current Eclipse projects with JPA facets.
- * The JPA model can only be instantiated by the JPA model manager.
- */
- GenericJpaModel() throws CoreException {
- super();
- ResourcesPlugin.getWorkspace().getRoot().accept(new ResourceProxyVisitor(), IResource.NONE);
- }
-
-
- // ********** IJpaModel implementation **********
-
- /**
- * This will trigger the instantiation of the JPA project associated with the
- * specified Eclipse project.
- */
- public synchronized JpaProject getJpaProject(IProject project) throws CoreException {
- return this.getJpaProjectHolder(project).jpaProject();
- }
-
- /**
- * We can answer this question without instantiating the
- * associated JPA project.
- */
- public synchronized boolean containsJpaProject(IProject project) {
- return this.getJpaProjectHolder(project).holdsJpaProjectFor(project);
- }
-
- /**
- * This will trigger the instantiation of all the JPA projects.
- */
- public synchronized Iterator<JpaProject> jpaProjects() throws CoreException {
- // force the CoreException to occur here (instead of later, in Iterator#next())
- ArrayList<JpaProject> jpaProjects = new ArrayList<JpaProject>(this.jpaProjectHolders.size());
- for (JpaProjectHolder holder : this.jpaProjectHolders) {
- jpaProjects.add(holder.jpaProject());
- }
- return jpaProjects.iterator();
- }
-
- /**
- * We can answer this question without instantiating any JPA projects.
- */
- public synchronized int jpaProjectsSize() {
- return this.jpaProjectHolders.size();
- }
-
- /**
- * This will trigger the instantiation of the JPA project associated with the
- * specified file.
- */
- public synchronized JpaFile getJpaFile(IFile file) throws CoreException {
- JpaProject jpaProject = this.getJpaProject(file.getProject());
- return (jpaProject == null) ? null : jpaProject.getJpaFile(file);
- }
-
-
- // ********** internal methods **********
-
- /**
- * never return null
- */
- private JpaProjectHolder getJpaProjectHolder(IProject project) {
- for (JpaProjectHolder holder : this.jpaProjectHolders) {
- if (holder.holdsJpaProjectFor(project)) {
- return holder;
- }
- }
- return NullJpaProjectHolder.instance();
- }
-
- private JpaProject.Config buildJpaProjectConfig(IProject project) {
- SimpleJpaProjectConfig config = new SimpleJpaProjectConfig();
- config.setProject(project);
- config.setJpaPlatform(JptCorePlugin.getJpaPlatform(project));
- config.setConnectionProfileName(JptCorePlugin.getConnectionProfileName(project));
- config.setUserOverrideDefaultSchemaName(JptCorePlugin.getUserOverrideDefaultSchemaName(project));
- config.setDiscoverAnnotatedClasses(JptCorePlugin.discoverAnnotatedClasses(project));
- return config;
- }
-
- /* private */ void addJpaProject(IProject project) {
- this.addJpaProject(this.buildJpaProjectConfig(project));
- }
-
- /**
- * Add a JPA project to the JPA model for the specified Eclipse project.
- * JPA projects can only be added by the JPA model manager.
- * The JPA project will only be instantiated later, on demand.
- */
- private void addJpaProject(JpaProject.Config config) {
- dumpStackTrace(); // figure out exactly when JPA projects are added
- this.jpaProjectHolders.add(this.getJpaProjectHolder(config.getProject()).buildJpaProjectHolder(this, config));
- }
-
- /**
- * Remove the JPA project corresponding to the specified Eclipse project
- * from the JPA model. Return whether the removal actually happened.
- * JPA projects can only be removed by the JPA model manager.
- */
- private void removeJpaProject(IProject project) {
- dumpStackTrace(); // figure out exactly when JPA projects are removed
- this.getJpaProjectHolder(project).remove();
- }
-
-
- // ********** Resource events **********
-
- /**
- * A project is being deleted. Remove its corresponding
- * JPA project if appropriate.
- */
- synchronized void projectPreDelete(IProject project) {
- this.removeJpaProject(project);
- }
-
- /**
- * Forward the specified resource delta to the JPA project corresponding
- * to the specified Eclipse project.
- */
- synchronized void synchronizeFiles(IProject project, IResourceDelta delta) throws CoreException {
- this.getJpaProjectHolder(project).synchronizeJpaFiles(delta);
- }
-
-
- // ********** Resource and/or Facet events **********
-
- /**
- * Check whether the JPA facet has been added or removed.
- */
- synchronized void checkForTransition(IProject project) {
- boolean jpaFacet = JptCorePlugin.projectHasJpaFacet(project);
- boolean jpaProject = this.containsJpaProject(project);
-
- if (jpaFacet) {
- if ( ! jpaProject) { // JPA facet added
- this.addJpaProject(project);
- }
- } else {
- if (jpaProject) { // JPA facet removed
- this.removeJpaProject(project);
- }
- }
- }
-
-
- // ********** Facet events **********
-
- synchronized void jpaFacetedProjectPostInstall(IProjectFacetActionEvent event) {
- IProject project = event.getProject().getProject();
- IDataModel dataModel = (IDataModel) event.getActionConfig();
-
- boolean buildOrmXml = dataModel.getBooleanProperty(JpaFacetDataModelProperties.CREATE_ORM_XML);
- this.createProjectXml(project, buildOrmXml);
-
- // assume(?) this is the first event to indicate we need to add the JPA project to the JPA model
- this.addJpaProject(project);
- }
-
- private void createProjectXml(IProject project, boolean buildOrmXml) {
- this.createPersistenceXml(project);
-
- if (buildOrmXml) {
- this.createOrmXml(project);
- }
-
- }
-
- private void createPersistenceXml(IProject project) {
- PersistenceResourceModelProvider modelProvider =
- PersistenceResourceModelProvider.getDefaultModelProvider(project);
- try {
- modelProvider.createResource();
- }
- catch (Exception e) {
- JptCorePlugin.log(e);
- }
- }
-
- private void createOrmXml(IProject project) {
- OrmResourceModelProvider modelProvider =
- OrmResourceModelProvider.getDefaultModelProvider(project);
- try {
- modelProvider.createResource();
- }
- catch (Exception e) {
- JptCorePlugin.log(e);
- }
- }
-
- // TODO remove classpath items? persistence.xml? orm.xml?
- synchronized void jpaFacetedProjectPreUninstall(IProjectFacetActionEvent event) {
- // assume(?) this is the first event to indicate we need to remove the JPA project to the JPA model
- this.removeJpaProject(event.getProject().getProject());
- }
-
-
- // ********** Java events **********
-
- /**
- * Forward the Java element changed event to all the JPA projects
- * because the event could affect multiple projects.
- */
- synchronized void javaElementChanged(ElementChangedEvent event) {
- for (JpaProjectHolder jpaProjectHolder : this.jpaProjectHolders) {
- jpaProjectHolder.javaElementChanged(event);
- }
- }
-
-
- // ********** miscellaneous **********
-
- /**
- * 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).
- */
- synchronized void rebuildJpaProject(IProject project) {
- this.removeJpaProject(project);
- this.addJpaProject(project);
- }
-
- /**
- * Dispose the JPA model by disposing and removing all its JPA projects.
- * The JPA model can only be disposed by the JPA model manager.
- */
- synchronized void dispose() {
- // clone the list to prevent concurrent modification exceptions
- JpaProjectHolder[] holders = this.jpaProjectHolders.toArray(new JpaProjectHolder[this.jpaProjectHolders.size()]);
- for (JpaProjectHolder holder : holders) {
- holder.remove();
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append("JPA projects size: " + this.jpaProjectsSize()); //$NON-NLS-1$
- }
-
-
- // ********** holder callbacks **********
-
- /**
- * called by the JPA project holder when the JPA project is actually
- * instantiated
- */
- /* private */ void jpaProjectBuilt(JpaProject jpaProject) {
- this.fireItemAdded(JPA_PROJECTS_COLLECTION, jpaProject);
- }
-
- /**
- * called by the JPA project holder if the JPA project has been
- * instantiated and we need to remove it
- */
- /* private */ void jpaProjectRemoved(JpaProject jpaProject) {
- this.fireItemRemoved(JPA_PROJECTS_COLLECTION, jpaProject);
- }
-
- /**
- * called by the JPA project holder
- */
- /* private */ void removeJpaProjectHolder(JpaProjectHolder jpaProjectHolder) {
- this.jpaProjectHolders.remove(jpaProjectHolder);
- }
-
-
- // ********** JPA project holders **********
-
- private interface JpaProjectHolder {
-
- boolean holdsJpaProjectFor(IProject project);
-
- JpaProject jpaProject() throws CoreException;
-
- void synchronizeJpaFiles(IResourceDelta delta) throws CoreException;
-
- void javaElementChanged(ElementChangedEvent event);
-
- JpaProjectHolder buildJpaProjectHolder(GenericJpaModel jpaModel, JpaProject.Config config);
-
- void remove();
-
- }
-
- private static class NullJpaProjectHolder implements JpaProjectHolder {
- private static final JpaProjectHolder INSTANCE = new NullJpaProjectHolder();
-
- static JpaProjectHolder instance() {
- return INSTANCE;
- }
-
- // ensure single instance
- private NullJpaProjectHolder() {
- super();
- }
-
- public boolean holdsJpaProjectFor(IProject project) {
- return false;
- }
-
- public JpaProject jpaProject() throws CoreException {
- return null;
- }
-
- public void synchronizeJpaFiles(IResourceDelta delta) throws CoreException {
- // do nothing
- }
-
- public void javaElementChanged(ElementChangedEvent event) {
- // do nothing
- }
-
- public JpaProjectHolder buildJpaProjectHolder(GenericJpaModel jpaModel, Config config) {
- return new DefaultJpaProjectHolder(jpaModel, config);
- }
-
- public void remove() {
- // do nothing
- }
-
- @Override
- public String toString() {
- return ClassTools.shortClassNameForObject(this);
- }
- }
-
- /**
- * Pair a JPA project config with its lazily-initialized JPA project.
- */
- private static class DefaultJpaProjectHolder implements JpaProjectHolder {
- private final GenericJpaModel jpaModel;
- private final JpaProject.Config config;
- private JpaProject jpaProject;
-
- DefaultJpaProjectHolder(GenericJpaModel jpaModel, JpaProject.Config config) {
- super();
- this.jpaModel = jpaModel;
- this.config = config;
- }
-
- public boolean holdsJpaProjectFor(IProject project) {
- return this.config.getProject().equals(project);
- }
-
- public JpaProject jpaProject() throws CoreException {
- if (this.jpaProject == null) {
- this.jpaProject = this.buildJpaProject();
- // notify listeners of the JPA model
- this.jpaModel.jpaProjectBuilt(this.jpaProject);
- }
- return this.jpaProject;
- }
-
- private JpaProject buildJpaProject() throws CoreException {
- JpaProject result = this.config.getJpaPlatform().getJpaFactory().buildJpaProject(this.config);
- result.setUpdater(new AsynchronousJpaProjectUpdater(result));
- return result;
- }
-
- public void synchronizeJpaFiles(IResourceDelta delta) throws CoreException {
- if (this.jpaProject != null) {
- this.jpaProject.synchronizeJpaFiles(delta);
- }
- }
-
- public void javaElementChanged(ElementChangedEvent event) {
- if (this.jpaProject != null) {
- this.jpaProject.javaElementChanged(event);
- }
- }
-
- public JpaProjectHolder buildJpaProjectHolder(GenericJpaModel jm, Config c) {
- throw new IllegalArgumentException(c.getProject().getName());
- }
-
- public void remove() {
- this.jpaModel.removeJpaProjectHolder(this);
- if (this.jpaProject != null) {
- this.jpaModel.jpaProjectRemoved(this.jpaProject);
- this.jpaProject.dispose();
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.config.getProject().getName());
- }
-
- }
-
-
- // ********** resource proxy visitor **********
-
- /**
- * Visit the workspace resource tree, adding a JPA project to the
- * JPA model for each open Eclipse project that has a JPA facet.
- */
- private class ResourceProxyVisitor implements IResourceProxyVisitor {
-
- ResourceProxyVisitor() {
- super();
- }
-
- public boolean visit(IResourceProxy resourceProxy) throws CoreException {
- switch (resourceProxy.getType()) {
- case IResource.ROOT :
- return true; // all projects are in the "root"
- case IResource.PROJECT :
- this.checkProject(resourceProxy);
- return false; // no nested projects
- default :
- return false;
- }
- }
-
- private void checkProject(IResourceProxy resourceProxy) {
- if (resourceProxy.isAccessible()) { // the project exists and is open
- IProject project = (IProject) resourceProxy.requestResource();
- if (JptCorePlugin.projectHasJpaFacet(project)) {
- GenericJpaModel.this.addJpaProject(project);
- }
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-
- // ********** DEBUG **********
-
- // @see JpaModelTests#testDEBUG()
- private static final boolean DEBUG = false;
-
- private static void dumpStackTrace() {
- if (DEBUG) {
- // lock System.out so the stack elements are printed out contiguously
- synchronized (System.out) {
- 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/internal/GenericJpaProject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaProject.java
deleted file mode 100644
index ca5f8f1f0a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaProject.java
+++ /dev/null
@@ -1,749 +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;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.resources.IResourceProxyVisitor;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-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.JptCorePlugin;
-import org.eclipse.jpt.core.ResourceModelListener;
-import org.eclipse.jpt.core.context.JpaRootContextNode;
-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.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.CommandExecutorProvider;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- *
- */
-public class GenericJpaProject extends AbstractJpaNode implements JpaProject {
-
- /**
- * 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 data source that wraps the DTP model.
- */
- 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;
-
- /**
- * The JPA files associated with the JPA project:
- * java
- * persistence.xml
- * orm.xml
- */
- protected final Vector<JpaFile> jpaFiles;
-
- /**
- * The root of the model representing the collated resources associated with
- * the JPA project.
- */
- protected JpaRootContextNode rootContextNode;
-
- /**
- * Support for modifying documents shared with the UI.
- */
- protected final ThreadLocal<CommandExecutor> threadLocalModifySharedDocumentCommandExecutor;
- protected final CommandExecutorProvider modifySharedDocumentCommandExecutorProvider;
-
- /**
- * 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;
-
- /**
- * Resource models notify this listener when they change. A project update
- * should occur any time a resource model changes.
- */
- protected ResourceModelListener resourceModelListener;
-
-
- // ********** constructor/initialization **********
-
- public GenericJpaProject(JpaProject.Config config) throws CoreException {
- 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.jpaFiles = this.buildEmptyJpaFiles();
-
- this.threadLocalModifySharedDocumentCommandExecutor = this.buildThreadLocalModifySharedDocumentCommandExecutor();
- this.modifySharedDocumentCommandExecutorProvider = this.buildModifySharedDocumentCommandExecutorProvider();
-
- this.resourceModelListener = this.buildResourceModelListener();
- // build the JPA files corresponding to the Eclipse project's files
- this.project.accept(this.buildInitialResourceProxyVisitor(), IResource.NONE);
-
- this.rootContextNode = this.buildRootContextNode();
-
- // "update" the project before returning
- this.setUpdater_(new SynchronousJpaProjectUpdater(this));
- }
-
- @Override
- protected boolean requiresParent() {
- return false;
- }
-
- @Override
- public IResource getResource() {
- return getProject();
- }
-
- protected Vector<JpaFile> buildEmptyJpaFiles() {
- return new Vector<JpaFile>();
- }
-
- protected ResourceDeltaVisitor buildResourceDeltaVisitor() {
- return new ResourceDeltaVisitor();
- }
-
- protected ThreadLocal<CommandExecutor> buildThreadLocalModifySharedDocumentCommandExecutor() {
- return new ThreadLocal<CommandExecutor>();
- }
-
- protected CommandExecutorProvider buildModifySharedDocumentCommandExecutorProvider() {
- return new ModifySharedDocumentCommandExecutorProvider();
- }
-
- protected ResourceModelListener buildResourceModelListener() {
- return new DefaultResourceModelListener();
- }
-
- protected IResourceProxyVisitor buildInitialResourceProxyVisitor() {
- return new InitialResourceProxyVisitor();
- }
-
- protected JpaRootContextNode buildRootContextNode() {
- return this.getJpaFactory().buildRootContextNode(this);
- }
-
- // ***** inner class
- protected class InitialResourceProxyVisitor implements IResourceProxyVisitor {
- protected InitialResourceProxyVisitor() {
- super();
- }
- // add a JPA file for every [appropriate] file encountered by the visitor
- public boolean visit(IResourceProxy resource) throws CoreException {
- switch (resource.getType()) {
- case IResource.ROOT : // shouldn't happen
- case IResource.PROJECT :
- case IResource.FOLDER :
- return true; // visit children
- case IResource.FILE :
- GenericJpaProject.this.addJpaFile_((IFile) resource.requestResource());
- return false; // no children
- default :
- return false; // no children
- }
- }
- }
-
-
- // ********** 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;
- }
-
-
- // ********** database **********
-
- @Override
- public JpaDataSource getDataSource() {
- return this.dataSource;
- }
-
- public ConnectionProfile getConnectionProfile() {
- return this.dataSource.getConnectionProfile();
- }
-
- 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() {
- Catalog dbCatalog = this.getDatabaseDefaultDbCatalog();
- return (dbCatalog == null ) ? null : dbCatalog.getIdentifier();
- }
-
- protected Catalog getDatabaseDefaultDbCatalog() {
- Database db = this.getDatabase();
- return (db == null ) ? null : db.getDefaultCatalog();
- }
-
- /**
- * If we don't have a catalog (i.e. we don't even have a *default* 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) {
- Catalog dbCatalog = this.getDbCatalog(catalog);
- if (dbCatalog != null) {
- Schema dbSchema = dbCatalog.getDefaultSchema();
- if (dbSchema != null) {
- return dbSchema.getIdentifier();
- }
- }
- }
- // if there is no default catalog,
- // the database probably does not support catalogs;
- // return the database's default schema
- return this.getDatabaseDefaultSchema();
- }
-
- protected String getDatabaseDefaultSchema() {
- Schema schema = this.getDatabaseDefaultDbSchema();
- return (schema == null ) ? null : schema.getIdentifier();
- }
-
- protected Schema getDatabaseDefaultDbSchema() {
- Database db = this.getDatabase();
- return (db == null ) ? null : db.getDefaultSchema();
- }
-
-
- // **************** user override default catalog **********************
-
- public String getUserOverrideDefaultCatalog() {
- return this.userOverrideDefaultCatalog;
- }
-
- public void setUserOverrideDefaultCatalog(String catalog) {
- String old = this.userOverrideDefaultCatalog;
- this.userOverrideDefaultCatalog = 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;
- 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;
- this.firePropertyChanged(DISCOVERS_ANNOTATED_CLASSES_PROPERTY, old, discoversAnnotatedClasses);
- }
-
-
- // ********** JPA files **********
-
- public Iterator<JpaFile> jpaFiles() {
- return new CloneIterator<JpaFile>(this.jpaFiles); // read-only
- }
-
- public int jpaFilesSize() {
- return this.jpaFiles.size();
- }
-
- @Override
- public JpaFile getJpaFile(IFile file) {
- synchronized (this.jpaFiles) {
- for (JpaFile jpaFile : this.jpaFiles) {
- 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 = this.getJpaPlatform().buildJpaFile(this, file);
- if (jpaFile == null) {
- return null;
- }
- jpaFile.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) {
- synchronized (this.jpaFiles) {
- JpaFile jpaFile = this.getJpaFile(file);
- if (jpaFile != null) { // a JpaFile is not added for every IFile
- this.removeJpaFile(jpaFile);
- return true;
- }
- return false;
- }
- }
-
- /**
- * Remove the JPA file and dispose of it
- */
- protected void removeJpaFile(JpaFile jpaFile) {
- jpaFile.removeResourceModelListener(this.resourceModelListener);
- if ( ! this.removeItemFromCollection(jpaFile, this.jpaFiles, JPA_FILES_COLLECTION)) {
- throw new IllegalArgumentException(jpaFile.toString());
- }
- }
-
- protected boolean containsJpaFile(IFile file) {
- return (this.getJpaFile(file) != null);
- }
-
-
- // ********** context model **********
-
- public JpaRootContextNode getRootContextNode() {
- return this.rootContextNode;
- }
-
-
- // ********** more queries **********
-
- public Iterator<String> annotatedClassNames() {
- return new TransformationIterator<JavaResourcePersistentType, String>(this.persistedJavaResourcePersistentTypes()) {
- @Override
- protected String transform(JavaResourcePersistentType jrpt) {
- return jrpt.getQualifiedName();
- }
- };
- }
-
- protected Iterator<JavaResourcePersistentType> persistedJavaResourcePersistentTypes() {
- return new FilteringIterator<JavaResourcePersistentType, JavaResourcePersistentType>(this.persistableJavaResourcePersistentTypes()) {
- @Override
- protected boolean accept(JavaResourcePersistentType jrpt) {
- return jrpt.isPersisted();
- }
- };
- }
-
- protected Iterator<JavaResourcePersistentType> persistableJavaResourcePersistentTypes() {
- return new CompositeIterator<JavaResourcePersistentType>(this.persistableJavaResourcePersistentTypeIterators());
- }
-
- protected Iterator<Iterator<JavaResourcePersistentType>> persistableJavaResourcePersistentTypeIterators() {
- return new TransformationIterator<JpaFile, Iterator<JavaResourcePersistentType>>(this.jpaFiles()) {
- @Override
- protected Iterator<JavaResourcePersistentType> transform(JpaFile jpaFile) {
- return jpaFile.persistableTypes();
- }
- };
- }
-
- public JavaResourcePersistentType getJavaResourcePersistentType(String typeName) {
- for (Iterator<JavaResourcePersistentType> stream = this.persistableJavaResourcePersistentTypes(); stream.hasNext(); ) {
- JavaResourcePersistentType pt = stream.next();
- if (pt.getQualifiedName().equals(typeName)) {
- return pt;
- }
- }
-// this.javaProject().findType(typeName);
- return null;
- }
-
-
- // ********** Java change **********
-
- public void javaElementChanged(ElementChangedEvent event) {
- for (Iterator<JpaFile> stream = this.jpaFiles(); stream.hasNext(); ) {
- stream.next().javaElementChanged(event);
- }
- }
-
-
- // ********** validation **********
-
- public Iterator<IMessage> validationMessages() {
- List<IMessage> messages = new ArrayList<IMessage>();
- this.validate(messages);
- return messages.iterator();
- }
-
- protected void validate(List<IMessage> messages) {
- this.validateConnection(messages);
- this.rootContextNode.validate(messages);
- }
-
- 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
- )
- );
- }
- }
-
-
- // ********** root deploy location **********
-
- protected static final String WEB_PROJECT_ROOT_DEPLOY_LOCATION = J2EEConstants.WEB_INF_CLASSES;
-
- public String getRootDeployLocation() {
- return this.isWebProject() ? WEB_PROJECT_ROOT_DEPLOY_LOCATION : ""; //$NON-NLS-1$
- }
-
- protected static final String JST_WEB_MODULE = IModuleConstants.JST_WEB_MODULE;
-
- protected boolean isWebProject() {
- return JptCorePlugin.projectHasWebFacet(this.project);
- }
-
-
- // ********** dispose **********
-
- public void dispose() {
- this.updater.dispose();
- this.dataSource.dispose();
- }
-
-
- // ********** resource model listener **********
-
- protected class DefaultResourceModelListener implements ResourceModelListener {
- protected DefaultResourceModelListener() {
- super();
- }
- public void resourceModelChanged() {
- GenericJpaProject.this.update();
- }
- }
-
-
- // ********** handling resource deltas **********
-
- public void synchronizeJpaFiles(IResourceDelta delta) throws CoreException {
- ResourceDeltaVisitor resourceDeltaVisitor = this.buildResourceDeltaVisitor();
- delta.accept(resourceDeltaVisitor);
- if (resourceDeltaVisitor.jpaFilesChanged()) {
- for (Iterator<JpaFile> stream = this.jpaFiles(); stream.hasNext(); ) {
- stream.next().jpaFilesChanged();
- }
- }
- }
-
- /**
- * 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 :
- case IResourceDelta.ADDED_PHANTOM :
- case IResourceDelta.REMOVED_PHANTOM :
- default :
- break; // only worried about added and removed files
- }
-
- return false;
- }
-
- // ***** inner class
- /**
- * add or remove a JPA file for every [appropriate] file encountered by the visitor
- */
- protected class ResourceDeltaVisitor implements IResourceDeltaVisitor {
- private boolean jpaFilesChanged = false;
-
- protected ResourceDeltaVisitor() {
- super();
- }
-
- public boolean visit(IResourceDelta delta) throws CoreException {
- IResource res = delta.getResource();
- switch (res.getType()) {
- case IResource.ROOT :
- case IResource.PROJECT :
- case IResource.FOLDER :
- return true; // visit children
- case IResource.FILE :
- if (GenericJpaProject.this.synchronizeJpaFiles((IFile) res, delta.getKind())) {
- this.jpaFilesChanged = true;
- }
- return false; // no children
- default :
- return false; // no children
- }
- }
-
- /**
- * Return whether the collection of JPA files was modified while
- * traversing the IResourceDelta (i.e. a JPA file was added or removed).
- */
- protected boolean jpaFilesChanged() {
- return this.jpaFilesChanged;
- }
-
- }
-
-
- // ********** support for modifying documents shared with the UI **********
-
- /**
- * If there is no thread-specific command executor, use the default
- * implementation, which simply executes the command directly.
- */
- protected CommandExecutor getThreadLocalModifySharedDocumentCommandExecutor() {
- CommandExecutor ce = this.threadLocalModifySharedDocumentCommandExecutor.get();
- return (ce != null) ? ce : CommandExecutor.Default.instance();
- }
-
- public void setThreadLocalModifySharedDocumentCommandExecutor(CommandExecutor commandExecutor) {
- this.threadLocalModifySharedDocumentCommandExecutor.set(commandExecutor);
- }
-
- public CommandExecutorProvider getModifySharedDocumentCommandExecutorProvider() {
- return this.modifySharedDocumentCommandExecutorProvider;
- }
-
- // ***** inner class
- protected class ModifySharedDocumentCommandExecutorProvider implements CommandExecutorProvider {
- protected ModifySharedDocumentCommandExecutorProvider() {
- super();
- }
- public CommandExecutor getCommandExecutor() {
- return GenericJpaProject.this.getThreadLocalModifySharedDocumentCommandExecutor();
- }
- }
-
-
- // ********** project "update" **********
-
- public Updater getUpdater() {
- return this.updater;
- }
-
- public void setUpdater(Updater updater) {
- if (updater == null) {
- throw new NullPointerException();
- }
- this.updater.dispose();
- 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) {
- try {
- this.rootContextNode.update(monitor);
- } catch (OperationCanceledException ex) {
- return Status.CANCEL_STATUS;
- } catch (Throwable ex) {
- // Exceptions can occur when the update is running and changes are
- // made concurrently to the Java source. When that happens, our
- // model might be in an inconsistent state because it is not yet in
- // sync with the changed Java source.
- // Log these exceptions and assume they won't happen when the
- // update runs again as a result of the concurrent Java source changes.
- JptCorePlugin.log(ex);
- }
- return Status.OK_STATUS;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JavaJpaFile.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JavaJpaFile.java
deleted file mode 100644
index 969d84ff6c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JavaJpaFile.java
+++ /dev/null
@@ -1,74 +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;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.internal.resource.java.JpaCompilationUnitImpl;
-import org.eclipse.jpt.core.internal.utility.jdt.DefaultAnnotationEditFormatter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.JpaCompilationUnit;
-
-/**
- * JPA file for a compilation unit.
- */
-public class JavaJpaFile
- extends AbstractJpaFile
-{
- private final JpaCompilationUnit jpaCompilationUnit;
-
-
- public JavaJpaFile(JpaProject jpaProject, IFile file) {
- super(jpaProject, file);
- this.jpaCompilationUnit = this.buildJpaCompilationUnit();
- }
-
- protected JpaCompilationUnit buildJpaCompilationUnit() {
- return new JpaCompilationUnitImpl(
- JavaCore.createCompilationUnitFrom(this.getFile()),
- this.getJpaPlatform().getAnnotationProvider(),
- this.getJpaProject().getModifySharedDocumentCommandExecutorProvider(),
- DefaultAnnotationEditFormatter.instance(),
- this.getResourceModelListener()
- );
- }
-
- public Iterator<JavaResourcePersistentType> persistableTypes() {
- return this.jpaCompilationUnit.persistableTypes();
- }
-
- public String getResourceType() {
- return JAVA_RESOURCE_TYPE;
- }
-
- public void jpaFilesChanged() {
- this.jpaCompilationUnit.resolveTypes();
- }
-
-
- // ********** events **********
-
- @Override
- protected void resourceModelChanged() {
- if (this.jpaCompilationUnit == null) {
- throw new IllegalStateException("Change events should not be fired during construction."); //$NON-NLS-1$
- }
- super.resourceModelChanged();
- }
-
- public void javaElementChanged(ElementChangedEvent event) {
- this.jpaCompilationUnit.javaElementChanged(event);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JavaJpaFileProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JavaJpaFileProvider.java
deleted file mode 100644
index bbab063b57..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JavaJpaFileProvider.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.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaFileProvider;
-import org.eclipse.jpt.core.JpaProject;
-
-/**
- * Java source code
- */
-public class JavaJpaFileProvider
- implements JpaFileProvider
-{
-
- // singleton
- private static final JavaJpaFileProvider INSTANCE = new JavaJpaFileProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaJpaFileProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private JavaJpaFileProvider() {
- super();
- }
-
- public String getContentId() {
- return JavaCore.JAVA_SOURCE_CONTENT_TYPE;
- }
-
- public JpaFile buildJpaFile(JpaProject jpaProject, IFile file, JpaFactory factory) {
- return factory.buildJavaJpaFile(jpaProject, file);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaConstants.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaConstants.java
deleted file mode 100644
index 42d45bc1e4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaConstants.java
+++ /dev/null
@@ -1,27 +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;
-
-public interface JpaConstants
-{
- String XML_NS = "xmlns"; //$NON-NLS-1$
- String XML_NS_XSI = "xmlns:xsi"; //$NON-NLS-1$
- String XSI_SCHEMA_LOCATION = "xsi:schemaLocation"; //$NON-NLS-1$
- String XSI_NS_URL = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$
-
- String PERSISTENCE_NS_URL = "http://java.sun.com/xml/ns/persistence"; //$NON-NLS-1$
- String PERSISTENCE_SCHEMA_LOC_1_0 = "http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"; //$NON-NLS-1$
-
- String ORM_NS_URL = "http://java.sun.com/xml/ns/persistence/orm"; //$NON-NLS-1$
- String ORM_SCHEMA_LOC_1_0 = "http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"; //$NON-NLS-1$
-
- String VERSION_1_0_TEXT = "1.0"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaModelManager.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaModelManager.java
deleted file mode 100644
index 941febe59d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaModelManager.java
+++ /dev/null
@@ -1,564 +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;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
-import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.IElementChangedListener;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaElementDelta;
-import org.eclipse.jdt.core.IOpenable;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaModel;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.prefs.JpaPreferenceConstants;
-import org.eclipse.jpt.utility.internal.BitTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-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;
-
-/**
- * "Internal" global stuff.
- * Provide access via a singleton.
- * Hold and manage the JPA model (which holds all the JPA projects)
- * and the various global listeners. We attempt to determine whether events
- * are relevant before forwarding them to the JPA model.
- *
- * Various things that cause us to add or remove a JPA project:
- * - Startup of the Dali plug-in will trigger all the JPA projects to be added
- *
- * - Project created and facet installed
- * facet POST_INSTALL
- * - Project facet uninstalled
- * facet PRE_UNINSTALL
- *
- * - Project opened
- * facet PROJECT_MODIFIED
- * - Project closed
- * facet PROJECT_MODIFIED
- *
- * - Pre-existing project imported (created and opened)
- * resource POST_CHANGE -> PROJECT -> CHANGED -> OPEN
- * - Project deleted
- * resource PRE_DELETE
- *
- * - Project facet installed by editing the facets settings file directly
- * facet PROJECT_MODIFIED
- * - Project facet uninstalled by editing the facets settings file directly
- * facet PROJECT_MODIFIED
- */
-public class JpaModelManager {
-
- /**
- * The JPA model - null until the plug-in is started.
- */
- private GenericJpaModel jpaModel;
-
- /**
- * Listen for changes to projects and files.
- */
- private final IResourceChangeListener resourceChangeListener;
-
- /**
- * Listen for the JPA facet being added or removed from a project.
- */
- private final IFacetedProjectListener facetedProjectListener;
-
- /**
- * Listen for Java changes and forward them to the JPA model,
- * which will forward them to the JPA projects.
- */
- private final IElementChangedListener javaElementChangeListener;
-
- /**
- * Listen for changes to the "Default JPA Lib" preference
- * so we can update the corresponding classpath variable.
- */
- private final IPropertyChangeListener preferencesListener;
-
-
- // ********** singleton **********
-
- private static final JpaModelManager INSTANCE = new JpaModelManager();
-
- /**
- * Return the singleton JPA model manager.
- */
- public static JpaModelManager instance() {
- return INSTANCE;
- }
-
-
- // ********** constructor **********
-
- /**
- * Private - ensure single instance.
- */
- private JpaModelManager() {
- super();
- this.resourceChangeListener = new ResourceChangeListener();
- this.facetedProjectListener = new FacetedProjectListener();
- this.javaElementChangeListener = new JavaElementChangeListener();
- this.preferencesListener = new PreferencesListener();
- }
-
-
- // ********** plug-in controlled life-cycle **********
-
- /**
- * internal - called by JptCorePlugin
- */
- public synchronized void start() throws Exception {
- debug("*** START JPA model manager ***"); //$NON-NLS-1$
- try {
- this.jpaModel = new GenericJpaModel();
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this.resourceChangeListener);
- FacetedProjectFramework.addListener(this.facetedProjectListener, IFacetedProjectEvent.Type.values());
- JavaCore.addElementChangedListener(this.javaElementChangeListener);
- JptCorePlugin.instance().getPluginPreferences().addPropertyChangeListener(this.preferencesListener);
- } catch (RuntimeException ex) {
- this.log(ex);
- this.stop();
- }
- }
-
- /**
- * internal - called by JptCorePlugin
- */
- public synchronized void stop() throws Exception {
- debug("*** STOP JPA model manager ***"); //$NON-NLS-1$
- JptCorePlugin.instance().getPluginPreferences().removePropertyChangeListener(this.preferencesListener);
- JavaCore.removeElementChangedListener(this.javaElementChangeListener);
- FacetedProjectFramework.removeListener(this.facetedProjectListener);
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(this.resourceChangeListener);
- this.jpaModel.dispose();
- this.jpaModel = null;
- }
-
-
- // ********** API **********
-
- /**
- * Return the workspace-wide JPA model.
- */
- public JpaModel getJpaModel() {
- return this.jpaModel;
- }
-
- /**
- * Return the JPA project corresponding to the specified Eclipse project,
- * or null if unable to associate the specified project with a
- * JPA project.
- */
- public JpaProject getJpaProject(IProject project) throws CoreException {
- return this.jpaModel.getJpaProject(project);
- }
-
- /**
- * Return the JPA file corresponding to the specified Eclipse file,
- * or null if unable to associate the specified file with a JPA file.
- */
- public JpaFile getJpaFile(IFile file) throws CoreException {
- return this.jpaModel.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 void rebuildJpaProject(IProject project) {
- this.jpaModel.rebuildJpaProject(project);
- }
-
- /**
- * Log the specified status.
- */
- public void log(IStatus status) {
- JptCorePlugin.log(status);
- }
-
- /**
- * Log the specified message.
- */
- public void log(String msg) {
- JptCorePlugin.log(msg);
- }
-
- /**
- * Log the specified exception or error.
- */
- public void log(Throwable throwable) {
- JptCorePlugin.log(throwable);
- }
-
-
- // ********** resource changed **********
-
- /**
- * Check for:
- * - project close/delete
- * - file add/remove
- */
- /* private */ void resourceChanged(IResourceChangeEvent event) {
- if (! (event.getSource() instanceof IWorkspace)) {
- return; // this probably shouldn't happen...
- }
- switch (event.getType()){
- case IResourceChangeEvent.PRE_DELETE : // project-only event
- this.resourcePreDelete(event);
- break;
- case IResourceChangeEvent.POST_CHANGE :
- this.resourcePostChange(event);
- break;
- case IResourceChangeEvent.PRE_CLOSE : // project-only event
- case IResourceChangeEvent.PRE_BUILD :
- case IResourceChangeEvent.POST_BUILD :
- default :
- break;
- }
- }
-
- /**
- * A project is being deleted. Remove its corresponding
- * JPA project if appropriate.
- */
- private void resourcePreDelete(IResourceChangeEvent event) {
- debug("Resource (Project) PRE_DELETE: " + event.getResource()); //$NON-NLS-1$
- this.jpaModel.projectPreDelete((IProject) event.getResource());
- }
-
- /**
- * A resource has changed somehow.
- * Check for files being added or removed.
- * (The JPA project only handles added and removed files here, ignoring
- * changed files.)
- */
- private void resourcePostChange(IResourceChangeEvent event) {
- debug("Resource POST_CHANGE"); //$NON-NLS-1$
- this.synchronizeFiles(event.getDelta());
- this.checkForOpenedProjects(event.getDelta());
- }
-
- private void synchronizeFiles(IResourceDelta delta) {
- IResource resource = delta.getResource();
- switch (resource.getType()) {
- case IResource.ROOT :
- this.synchronizeFiles(delta.getAffectedChildren()); // recurse
- break;
- case IResource.PROJECT :
- this.synchronizeFiles((IProject) resource, delta);
- break;
- case IResource.FILE :
- case IResource.FOLDER :
- default :
- break;
- }
- }
-
- private void synchronizeFiles(IResourceDelta[] deltas) {
- for (int i = 0; i < deltas.length; i++) {
- this.synchronizeFiles(deltas[i]); // recurse
- }
- }
-
- /**
- * Checked exceptions bite.
- */
- private void synchronizeFiles(IProject project, IResourceDelta delta) {
- try {
- this.jpaModel.synchronizeFiles(project, delta);
- } catch (CoreException ex) {
- this.log(ex); // problem traversing the project's resources - not much we can do
- }
- }
-
- /**
- * Crawl the specified delta, looking for projects being opened.
- * Projects being deleted are handled in IResourceChangeEvent.PRE_DELETE.
- * Projects being closed are handled in IFacetedProjectEvent.Type.PROJECT_MODIFIED.
- */
- private void checkForOpenedProjects(IResourceDelta delta) {
- IResource resource = delta.getResource();
- switch (resource.getType()) {
- case IResource.ROOT :
- this.checkForOpenedProjects(delta.getAffectedChildren()); // recurse
- break;
- case IResource.PROJECT :
- this.checkForOpenedProject((IProject) resource, delta);
- break;
- case IResource.FILE :
- case IResource.FOLDER :
- default :
- break;
- }
- }
-
- private void checkForOpenedProjects(IResourceDelta[] deltas) {
- for (int i = 0; i < deltas.length; i++) {
- this.checkForOpenedProjects(deltas[i]); // recurse
- }
- }
-
- private void checkForOpenedProject(IProject project, IResourceDelta delta) {
- switch (delta.getKind()) {
- case IResourceDelta.CHANGED :
- this.checkDeltaFlagsForOpenedProject(project, delta);
- break;
- case IResourceDelta.REMOVED : // already handled with the PRE_DELETE event
- case IResourceDelta.ADDED : // all but project rename handled with the facet POST_INSTALL event
- this.checkDeltaFlagsForRenamedProject(project, delta);
- break;
- case IResourceDelta.ADDED_PHANTOM : // ignore
- case IResourceDelta.REMOVED_PHANTOM : // ignore
- default :
- break;
- }
- }
-
- /**
- * We don't get any events from the Facets Framework when a pre-existing
- * project is imported, so we need to check for the newly imported project here.
- *
- * This event also occurs when a project is simply opened. Project opening
- * also triggers a Facet PROJECT_MODIFIED event and that is where we add
- * the JPA project, not here
- */
- private void checkDeltaFlagsForOpenedProject(IProject project, IResourceDelta delta) {
- if (BitTools.flagIsSet(delta.getFlags(), IResourceDelta.OPEN) && project.isOpen()) {
- debug("\tProject CHANGED - OPEN: " + project.getName()); //$NON-NLS-1$
- this.jpaModel.checkForTransition(project);
- }
- }
-
- /**
- * We don't get any events from the Facets Framework when a project is renamed,
- * so we need to check for the renamed projects here.
- */
- private void checkDeltaFlagsForRenamedProject(IProject project, IResourceDelta delta) {
- if (BitTools.flagIsSet(delta.getFlags(), IResourceDelta.MOVED_FROM) && project.isOpen()) {
- debug("\tProject ADDED - MOVED_FROM: " + delta.getMovedFromPath()); //$NON-NLS-1$
- this.jpaModel.checkForTransition(project);
- }
- }
-
-
- // ********** faceted project changed **********
-
- /**
- * Check for:
- * - install of JPA facet
- * - un-install of JPA facet
- * - any other appearance or disappearance of the JPA facet
- */
- /* private */ void facetedProjectChanged(IFacetedProjectEvent event) {
- switch (event.getType()) {
- case POST_INSTALL :
- this.facetedProjectPostInstall((IProjectFacetActionEvent) event);
- break;
- case PRE_UNINSTALL :
- this.facetedProjectPreUninstall((IProjectFacetActionEvent) event);
- break;
- case PROJECT_MODIFIED :
- this.facetedProjectModified(event.getProject().getProject());
- break;
- default :
- break;
- }
- }
-
- private void facetedProjectPostInstall(IProjectFacetActionEvent event) {
- debug("Facet POST_INSTALL: " + event.getProjectFacet()); //$NON-NLS-1$
- if (event.getProjectFacet().getId().equals(JptCorePlugin.FACET_ID)) {
- this.jpaModel.jpaFacetedProjectPostInstall(event);
- }
- }
-
- private void facetedProjectPreUninstall(IProjectFacetActionEvent event) {
- debug("Facet PRE_UNINSTALL: " + event.getProjectFacet()); //$NON-NLS-1$
- if (event.getProjectFacet().getId().equals(JptCorePlugin.FACET_ID)) {
- this.jpaModel.jpaFacetedProjectPreUninstall(event);
- }
- }
-
- /**
- * This event is triggered for any change to a faceted project.
- * We use the event to watch for the following:
- * - an open project is closed
- * - a closed project is opened
- * - one of a project's (facet) metadata files is edited directly
- */
- private void facetedProjectModified(IProject project) {
- debug("Facet PROJECT_MODIFIED: " + project.getName()); //$NON-NLS-1$
- this.jpaModel.checkForTransition(project);
- }
-
-
- // ********** Java element changed **********
-
- /**
- * Forward the event to the JPA model.
- */
- /* private */ void javaElementChanged(ElementChangedEvent event) {
- if (this.eventIndicatesProjectAddedButNotOpen(event)) {
- return;
- }
- this.jpaModel.javaElementChanged(event);
- }
-
- //209275 - This particular event only causes problems in a clean workspace the first time a JPA project
- //is created through the JPA wizard. The second time a JPA project is created, this event occurs, but
- //it occurs as the wizard is closing so it does not cause a deadlock.
- private boolean eventIndicatesProjectAddedButNotOpen(ElementChangedEvent event) {
- IJavaElementDelta delta = event.getDelta();
- if (delta.getKind() == IJavaElementDelta.CHANGED) {
- if (delta.getElement().getElementType() == IJavaElement.JAVA_MODEL) {
- IJavaElementDelta[] children = delta.getAffectedChildren();
- if (children.length == 1) {
- IJavaElementDelta childDelta = children[0];
- if (childDelta.getKind() == IJavaElementDelta.ADDED) {
- IJavaElement childElement = childDelta.getElement();
- if (childElement.getElementType() == IJavaElement.JAVA_PROJECT) {
- if (childDelta.getAffectedChildren().length == 0) {
- if (!((IOpenable) childElement).isOpen()) {
- return true;
- }
- }
- }
- }
- }
- }
- }
- return false;
- }
-
- // ********** preference changed **********
-
- /**
- * When the "Default JPA Lib" preference changes,
- * update the appropriate JDT Core classpath variable.
- */
- /* private */ void preferenceChanged(PropertyChangeEvent event) {
- if (event.getProperty() == JpaPreferenceConstants.PREF_DEFAULT_JPA_LIB) {
- try {
- JavaCore.setClasspathVariable("DEFAULT_JPA_LIB", new Path((String) event.getNewValue()), null); //$NON-NLS-1$
- } catch (JavaModelException ex) {
- this.log(ex); // not sure what would cause this...
- }
- }
- }
-
-
- // ********** resource change listener **********
-
- /**
- * Forward the Resource change event back to the JPA model manager.
- */
- private class ResourceChangeListener implements IResourceChangeListener {
- ResourceChangeListener() {
- super();
- }
- public void resourceChanged(IResourceChangeEvent event) {
- JpaModelManager.this.resourceChanged(event);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-
- // ********** faceted project listener **********
-
- /**
- * Forward the Faceted project change event back to the JPA model manager.
- */
- private class FacetedProjectListener implements IFacetedProjectListener {
- FacetedProjectListener() {
- super();
- }
- public void handleEvent(IFacetedProjectEvent event) {
- JpaModelManager.this.facetedProjectChanged(event);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-
- // ********** Java element change listener **********
-
- /**
- * Forward the Java element change event back to the JPA model manager.
- */
- private class JavaElementChangeListener implements IElementChangedListener {
- JavaElementChangeListener() {
- super();
- }
- public void elementChanged(ElementChangedEvent event) {
- JpaModelManager.this.javaElementChanged(event);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-
- // ********** preferences listener **********
-
- /**
- * Forward the Preferences change event back to the JPA model manager.
- */
- private class PreferencesListener implements IPropertyChangeListener {
- PreferencesListener() {
- super();
- }
- public void propertyChange(PropertyChangeEvent event) {
- JpaModelManager.this.preferenceChanged(event);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-
- // ********** debug **********
-
- // @see JpaModelTests#testDEBUG()
- private static final boolean DEBUG = false;
-
- private static void debug(String message) {
- if (DEBUG) {
- System.out.println(Thread.currentThread().getName() + ": " + message); //$NON-NLS-1$
- }
- }
-
-}
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 17236d7b80..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaPlatformTester.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.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;
- }
- IProject project = null;
- if (receiver instanceof IResource) {
- project = ((IResource) receiver).getProject();
- }
- else if (receiver instanceof IJavaElement) {
- project = ((IJavaElement) receiver).getResource().getProject();
- }
-
- if (project == null) {
- return false;
- }
-
- String platformId = JptCorePlugin.getJpaPlatformId(project);
-
- return platformId == null ? false : platformId.equals(expectedValue);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaProjectAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaProjectAdapterFactory.java
deleted file mode 100644
index 3244d67704..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaProjectAdapterFactory.java
+++ /dev/null
@@ -1,44 +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;
-
-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;
-
-public class JpaProjectAdapterFactory
- implements IAdapterFactory
-{
- private static Class[] PROPERTIES= new Class[] {
- JpaProject.class
- };
-
- public Class[] getAdapterList() {
- return PROPERTIES;
- }
-
- public Object getAdapter(Object element, Class key) {
- IProject project;
-
- if (element instanceof IProject) {
- project = (IProject) element;
- }
- else if (element instanceof IJavaProject) {
- project = ((IJavaProject) element).getProject();
- }
- else {
- return null;
- }
-
- return JptCorePlugin.getJpaProject(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 11313fee1b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JptCoreMessages.java
+++ /dev/null
@@ -1,58 +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;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Localized messages used by Dali core.
- */
-public class JptCoreMessages {
-
- public static String NONE;
- 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_ORM_FILE_ALREADY_EXISTS;
- 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_CONNECTION_NOT_SPECIFIED;
- public static String VALIDATE_CONNECTION_INVALID;
- public static String VALIDATE_CONNECTION_NOT_CONNECTED;
- public static String VALIDATE_DEFAULT_SCHEMA_NOT_SPECIFIED;
- 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 RESOURCE_MODEL_PROVIDER_REGISTRY_MISSING_ATTRIBUTE;
- public static String RESOURCE_MODEL_PROVIDER_REGISTRY_DUPLICATE_FILE_CONTENT_TYPE;
- public static String RESOURCE_MODEL_PROVIDER_REGISTRY_FAILED_INSTANTIATION;
- public static String UPDATE_JOB_NAME;
-
- 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/OrmJpaFileProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/OrmJpaFileProvider.java
deleted file mode 100644
index 91eaa802b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/OrmJpaFileProvider.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.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaFileProvider;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-
-/**
- * orm.xml
- */
-public class OrmJpaFileProvider
- implements JpaFileProvider
-{
-
- // singleton
- private static final OrmJpaFileProvider INSTANCE = new OrmJpaFileProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmJpaFileProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private OrmJpaFileProvider() {
- super();
- }
-
- public String getContentId() {
- return JptCorePlugin.ORM_XML_CONTENT_TYPE;
- }
-
- public JpaFile buildJpaFile(JpaProject jpaProject, IFile file, JpaFactory factory) {
- return factory.buildOrmJpaFile(jpaProject, file);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/PersistenceJpaFileProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/PersistenceJpaFileProvider.java
deleted file mode 100644
index 50363ae897..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/PersistenceJpaFileProvider.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.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaFileProvider;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-
-/**
- * persistence.xml
- */
-public class PersistenceJpaFileProvider
- implements JpaFileProvider
-{
-
- // singleton
- private static final PersistenceJpaFileProvider INSTANCE = new PersistenceJpaFileProvider();
-
- /**
- * Return the singleton.
- */
- public static PersistenceJpaFileProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private PersistenceJpaFileProvider() {
- super();
- }
-
- public String getContentId() {
- return JptCorePlugin.PERSISTENCE_XML_CONTENT_TYPE;
- }
-
- public JpaFile buildJpaFile(JpaProject jpaProject, IFile file, JpaFactory factory) {
- return factory.buildPersistenceJpaFile(jpaProject, file);
- }
-
-}
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 c4d7745b09..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SimpleJpaProjectConfig.java
+++ /dev/null
@@ -1,85 +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;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Straightforward implementation of the JPA project config.
- */
-public class SimpleJpaProjectConfig implements JpaProject.Config {
- protected IProject project;
- protected JpaPlatform jpaPlatform;
- protected String connectionProfileName;
- protected String userOverrideDefaultCatalog;
- protected String userOverrideDefaultSchema;
- protected boolean discoverAnnotatedClasses;
-
- 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 setUserOverrideDefaultSchemaName(String userOverrideDefaultSchemaName) {
- this.userOverrideDefaultSchema = userOverrideDefaultSchemaName;
- }
-
- public String getUserOverrideDefaultCatalog() {
- return this.userOverrideDefaultCatalog;
- }
-
- public void setUserOverrideDefaultCatalogName(String userOverrideDefaultCatalogName) {
- this.userOverrideDefaultCatalog = userOverrideDefaultCatalogName;
- }
-
- public boolean discoverAnnotatedClasses() {
- return this.discoverAnnotatedClasses;
- }
-
- public void setDiscoverAnnotatedClasses(boolean discoverAnnotatedClasses) {
- this.discoverAnnotatedClasses = discoverAnnotatedClasses;
- }
-
- @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 2b4f0ed24a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SynchronousJpaProjectUpdater.java
+++ /dev/null
@@ -1,142 +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;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.SynchronizedBoolean;
-
-/**
- * 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 implements JpaProject.Updater {
- protected final JpaProject jpaProject;
- protected final SynchronizedFlags flags;
-
- protected static final IProgressMonitor NULL_PROGRESS_MONITOR = new NullProgressMonitor();
-
- public SynchronousJpaProjectUpdater(JpaProject jpaProject) {
- super();
- this.jpaProject = jpaProject;
- this.flags = new SynchronizedFlags();
- }
-
- /**
- * Initialize the flags and execute an "update".
- */
- public void start() {
- this.flags.start();
- this.update();
- }
-
- // recursion: we come back here when IJpaProject#update() is called during the "update"
- public void update() {
- if (this.flags.updateCanStart()) {
- do {
- this.jpaProject.update(NULL_PROGRESS_MONITOR);
- } while (this.flags.updateMustExecuteAgain());
- }
- }
-
- public void dispose() {
- this.flags.dispose();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.jpaProject);
- }
-
-
- /**
- * synchronize access to the pair of 'updating' and 'again' flags
- */
- protected static class SynchronizedFlags {
- protected SynchronizedBoolean updating = new SynchronizedBoolean(false, this);
- protected boolean again = false;
- protected boolean stop = true;
-
- /**
- * Simply clear the 'stop' flag.
- */
- protected synchronized void start() {
- if ( ! this.stop) {
- throw new IllegalStateException("The Updater was not stopped."); //$NON-NLS-1$
- }
- this.stop = false;
- }
-
- /**
- * A client has requested an "update";
- * return whether the updater can start an "update".
- * Side-effects:
- * - If we are supposed to stop, both the 'updating' and 'again' flags are cleared in #dispose().
- * - If we are currently "updating", set the 'again' flag.
- * - If we are not currently "updating", set the 'updating' flag and clear the 'again' flag.
- */
- protected synchronized boolean updateCanStart() {
- if (this.stop) {
- return false;
- }
- if (this.updating.isTrue()) {
- this.again = true;
- return false;
- }
- this.updating.setTrue();
- this.again = false;
- return true;
- }
-
- /**
- * The "update" has finished;
- * return whether the updater must execute another "update".
- * Side-effects:
- * - If we are supposed to stop,
- * the 'again' flag was cleared in #dispose();
- * clear the 'updating' flag so #dispose() can complete.
- * - If we have to "update" again, clear the 'again' flag and leave the 'updating' flag set.
- * - If we are finished (i.e. no recursive "update" requests occurred), clear the 'updating' flag.
- */
- protected synchronized boolean updateMustExecuteAgain() {
- if (this.stop) {
- this.updating.setFalse();
- return false;
- }
- if (this.again) {
- this.again = false;
- return true;
- }
- this.updating.setFalse();
- return false;
- }
-
- /**
- * Restore our start-up state and wait for any current update to complete.
- */
- protected synchronized void dispose() {
- this.stop = true;
- this.again = false;
- try {
- this.updating.waitUntilFalse();
- } catch (InterruptedException ex) {
- // the "update" thread was interrupted while waiting - ignore
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/XmlJpaFile.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/XmlJpaFile.java
deleted file mode 100644
index 05af6a8b5e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/XmlJpaFile.java
+++ /dev/null
@@ -1,56 +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;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.resource.common.JpaXmlResource;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 XmlJpaFile
- extends AbstractJpaFile
-{
- private final JpaXmlResource resource;
-
-
- public XmlJpaFile(JpaProject jpaProject, IFile file, JpaXmlResource resource) {
- super(jpaProject, file);
- this.resource = resource;
- this.resource.setResourceModelListener(this.getResourceModelListener());
- }
-
- public Iterator<JavaResourcePersistentType> persistableTypes() {
- return EmptyIterator.<JavaResourcePersistentType>instance();
- }
-
- public String getResourceType() {
- return this.resource.getType();
- }
-
- public void javaElementChanged(ElementChangedEvent event) {
- // nothing to do yet
- }
-
- public void jpaFilesChanged() {
- // nothing to do yet
- }
-
-}
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 952387dbfe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/AbstractJpaContextNode.java
+++ /dev/null
@@ -1,92 +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.jpt.core.JpaNode;
-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 **********
-
- /**
- * Overridden in GenericPersistence and GenericPersistenceXml to throw
- * UnsupportedOperationException.
- * Overridden in GenericRootContextNode to return null.
- * Overridden in GenericPersistenceUnit to return itself.
- */
- public PersistenceUnit getPersistenceUnit() {
- return this.getParent().getPersistenceUnit();
- }
-
- 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 *default* 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();
- }
-
- public Catalog getContextDefaultDbCatalog() {
- String catalog = this.getContextDefaultCatalog();
- if (catalog == null) {
- return null; // not even a default catalog (i.e. database probably does not support catalogs)
- }
- return this.getDbCatalog(catalog);
- }
-
- protected String getContextDefaultCatalog() {
- MappingFileRoot mfr = this.getMappingFileRoot();
- return (mfr != null) ? mfr.getCatalog() : this.getPersistenceUnit().getDefaultCatalog();
- }
-}
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 6b247b9e35..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/AbstractXmlContextNode.java
+++ /dev/null
@@ -1,51 +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 java.util.List;
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.resource.common.JpaXmlResource;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public abstract class AbstractXmlContextNode
- extends AbstractJpaContextNode
- implements XmlContextNode
-{
-
- // ********** constructor **********
-
- protected AbstractXmlContextNode(JpaContextNode parent) {
- super(parent);
- }
-
-
- /**
- * It is the responsibility of any root XML context nodes to override this
- * behavior.
- *
- * @see XmlContextNode#getEResource()
- */
- public JpaXmlResource getEResource() {
- return ((XmlContextNode) getParent()).getEResource();
- }
-
-
- // ********** validation **********
-
- /**
- * All subclass implementations {@link #validate(List<IMessage>)}
- * should be preceded by a "super" call to this method
- */
- public void validate(List<IMessage> messages) {
- // do nothing by default
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/GenericRootContextNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/GenericRootContextNode.java
deleted file mode 100644
index baf1258bfa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/GenericRootContextNode.java
+++ /dev/null
@@ -1,241 +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 java.util.List;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.jpt.core.context.JpaRootContextNode;
-import org.eclipse.jpt.core.context.MappingFile;
-import org.eclipse.jpt.core.context.MappingFileRoot;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-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.persistence.PersistenceResourceModelProvider;
-import org.eclipse.jpt.core.internal.utility.jdt.JDTTools;
-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.PersistenceResource;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.wst.common.internal.emfworkbench.WorkbenchResourceHelper;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class GenericRootContextNode extends AbstractJpaContextNode
- implements JpaRootContextNode
-{
- /* This object has no parent, so it must point to the JPA project */
- protected final JpaProject jpaProject;
-
- /* Main context object */
- protected PersistenceXml persistenceXml;
-
-
- public GenericRootContextNode(JpaProject jpaProject) {
- super(null);
- if (jpaProject == null) {
- throw new IllegalArgumentException("The JPA project must not be null"); //$NON-NLS-1$
- }
- this.jpaProject = jpaProject;
-
- PersistenceResourceModelProvider modelProvider =
- PersistenceResourceModelProvider.getDefaultModelProvider(jpaProject.getProject());
- PersistenceResource resource = modelProvider.getResource();
- if (resource.exists()) {
- this.persistenceXml = this.buildPersistenceXml(resource);
- }
- }
-
- @Override
- protected boolean requiresParent() {
- return false;
- }
-
-
- // **************** JpaNode impl *******************************************
-
- @Override
- public JpaProject getJpaProject() {
- return this.jpaProject;
- }
-
- @Override
- public IResource getResource() {
- return this.getProject();
- }
-
- protected IProject getProject() {
- return this.jpaProject.getProject();
- }
-
- @Override
- public JpaContextNode getParent() {
- return null;
- }
-
-
- // **************** JpaContextNode impl ************************************
-
- @Override
- public PersistenceUnit getPersistenceUnit() {
- // No PersistenceUnit in this context
- return null;
- }
-
- @Override
- public MappingFileRoot getMappingFileRoot() {
- // No MappingFileRoot in this context
- 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);
- }
-
- public PersistenceXml addPersistenceXml() {
- if (this.persistenceXml != null) {
- throw new IllegalStateException();
- }
- PersistenceResourceModelProvider modelProvider =
- PersistenceResourceModelProvider.getDefaultModelProvider(this.getProject());
- PersistenceResource resource = modelProvider.getResource();
- modelProvider.modify(new Runnable() {
- public void run() {
- // any modification will save file
- }
- });
- PersistenceXml px = this.buildPersistenceXml(resource);
- this.setPersistenceXml(px);
- return px;
- }
-
- public void removePersistenceXml() {
- if (this.persistenceXml == null) {
- throw new IllegalStateException();
- }
- this.persistenceXml.dispose();
- PersistenceResourceModelProvider modelProvider =
- PersistenceResourceModelProvider.getDefaultModelProvider(jpaProject.getProject());
- PersistenceResource resource = modelProvider.getResource();
- try {
- WorkbenchResourceHelper.deleteResource(resource);
- }
- catch (CoreException ce) {
- JptCorePlugin.log(ce);
- }
-
- if (! resource.exists()) {
- setPersistenceXml(null);
- }
- }
-
-
- // **************** updating ***********************************************
-
- public void update(IProgressMonitor monitor) {
- PersistenceResourceModelProvider modelProvider =
- PersistenceResourceModelProvider.getDefaultModelProvider(jpaProject.getProject());
- PersistenceResource resource = modelProvider.getResource();
-
- if (resource.exists()) {
- if (this.persistenceXml != null) {
- this.persistenceXml.update(resource);
- }
- else {
- setPersistenceXml(this.buildPersistenceXml(resource));
- }
- }
- else {
- setPersistenceXml(null);
- }
- }
-
- protected PersistenceXml buildPersistenceXml(PersistenceResource persistenceResource) {
- return this.getJpaFactory().buildPersistenceXml(this, persistenceResource);
- }
-
-
- // **************** Validation *********************************************
-
- public void validate(List<IMessage> messages) {
- if (this.persistenceXml == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PROJECT_NO_PERSISTENCE_XML,
- this
- )
- );
- return;
- }
- if ( ! this.jpaProject.discoversAnnotatedClasses()) {
- this.validateOrphanClasses(messages);
- }
- this.persistenceXml.validate(messages);
- }
-
- protected void validateOrphanClasses(List<IMessage> messages) {
- Persistence persistence = this.persistenceXml.getPersistence();
- if (persistence == null) {
- // handled with other validation
- return;
- }
- if (persistence.persistenceUnitsSize() != 1) {
- // the context model currently only supports 1 persistence unit
- return;
- }
- PersistenceUnit persistenceUnit = persistence.persistenceUnits().next();
- HashBag<String> orphans = CollectionTools.bag(this.jpaProject.annotatedClassNames());
- for (String javaTypeName : CollectionTools.iterable(this.jpaProject.annotatedClassNames())) {
- for (ClassRef classRef : CollectionTools.iterable(persistenceUnit.specifiedClassRefs())) {
- if (classRef.isFor(javaTypeName)) {
- orphans.remove(javaTypeName);
- }
- }
- for (MappingFileRef mappingFileRef : CollectionTools.iterable(persistenceUnit.mappingFileRefs())) {
- MappingFile mappingFile = mappingFileRef.getMappingFile();
- if (mappingFile != null && mappingFile.getPersistentType(javaTypeName) != null) {
- orphans.remove(javaTypeName);
- }
- }
- }
-
- for (String orphan : orphans) {
- JavaResourcePersistentType jrpt = this.jpaProject.getJavaResourcePersistentType(orphan);
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENT_TYPE_UNSPECIFIED_CONTEXT,
- new String[] {persistenceUnit.getName()},
- jrpt.getJpaCompilationUnit().getCompilationUnit().getResource(),
- jrpt.getMappingAnnotation().getTextRange(JDTTools.buildASTRoot(jrpt.getJpaCompilationUnit().getCompilationUnit()))
- )
- );
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/JpaContextNodeAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/JpaContextNodeAdapterFactory.java
deleted file mode 100644
index eadbca2144..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/JpaContextNodeAdapterFactory.java
+++ /dev/null
@@ -1,50 +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.context;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jpt.core.context.JpaContextNode;
-
-public class JpaContextNodeAdapterFactory
- implements IAdapterFactory
-{
- private static Class[] PROPERTIES =
- new Class[] { IResource.class, IFile.class };
-
-
- public Class[] getAdapterList() {
- return PROPERTIES;
- }
-
- public Object getAdapter(Object element, Class key) {
- JpaContextNode node;
-
- if (element instanceof JpaContextNode) {
- node = (JpaContextNode) element;
- }
- else {
- return null;
- }
-
- IResource resource = node.getResource();
-
- if (key.equals(IResource.class)) {
- return resource;
- }
- else if (key.equals(IFile.class) && resource != null && resource.getType() == IResource.FILE) {
- return (IFile) resource;
- }
-
- return null;
- }
-} \ No newline at end of file
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 93d7446225..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/MappingTools.java
+++ /dev/null
@@ -1,189 +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.context;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.ColumnMapping;
-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.PersistentAttribute;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.db.Table;
-
-/**
- * Gather some of the behavior common to the Java and XML models. :-(
- */
-public class MappingTools {
-
- /**
- * Default join table name from the JPA spec:
- * The concatenated names of the two associated primary
- * entity tables, separated by a underscore.
- *
- * [owning table name]_[target table name]
- *
- * NB: The *names* are concatenated, *not* the *identifiers*.
- * E.g. the join table for "Foo" and "baR" (where the "delimited" identifier
- * is required) is
- * "Foo_baR"
- * not
- * "Foo"_"baR"
- * As a result, we cannot honestly calculate the default name without a
- * database connection.
- */
- public static String buildJoinTableDefaultName(RelationshipMapping relationshipMapping) {
- if ( ! relationshipMapping.isRelationshipOwner()) {
- return null;
- }
- if (relationshipMapping.getJpaProject().getDataSource().connectionProfileIsActive()) {
- return buildDbJoinTableDefaultName(relationshipMapping);
- }
- // continue with a "best effort":
- String owningTableName = relationshipMapping.getTypeMapping().getPrimaryTableName();
- if (owningTableName == 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(RelationshipMapping relationshipMapping) {
- Table owningTable = relationshipMapping.getTypeMapping().getPrimaryDbTable();
- if (owningTable == 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);
- }
-
- /**
- * 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 = joinColumn.getOwner();
- RelationshipMapping relationshipMapping = owner.getRelationshipMapping();
- if (relationshipMapping == null) {
- return null;
- }
- if ( ! relationshipMapping.isRelationshipOwner()) {
- return null;
- }
- if (owner.joinColumnsSize() != 1) {
- return null;
- }
- String prefix = owner.getAttributeName();
- if (prefix == null) {
- Entity targetEntity = owner.getTargetEntity();
- 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
- * target entity.
- */
- public static String buildJoinColumnDefaultReferencedColumnName(JoinColumn.Owner joinColumnOwner) {
- RelationshipMapping relationshipMapping = joinColumnOwner.getRelationshipMapping();
- if (relationshipMapping == null) {
- return null;
- }
- if ( ! relationshipMapping.isRelationshipOwner()) {
- return null;
- }
- if (joinColumnOwner.joinColumnsSize() != 1) {
- return null;
- }
- Entity targetEntity = joinColumnOwner.getTargetEntity();
- if (targetEntity == null) {
- return null;
- }
- return targetEntity.getPrimaryKeyColumnName();
- }
-
-
- public static Embeddable getEmbeddableFor(JavaPersistentAttribute persistentAttribute) {
- String qualifiedTypeName = persistentAttribute.getResourcePersistentAttribute().getQualifiedTypeName();
- if (qualifiedTypeName == null) {
- return null;
- }
- PersistentType persistentType = persistentAttribute.getPersistenceUnit().getPersistentType(qualifiedTypeName);
- if (persistentType == null) {
- return null;
- }
- if (persistentType.getMappingKey() == MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY) {
- return (Embeddable) persistentType.getMapping();
- }
- return null;
- }
-
- public static ColumnMapping getColumnMapping(String attributeName, Embeddable embeddable) {
- if (attributeName == null || embeddable == null) {
- return null;
- }
- for (Iterator<PersistentAttribute> stream = embeddable.getPersistentType().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;
- }
-
-}
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/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 bc9bfd72f7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaAttributeMapping.java
+++ /dev/null
@@ -1,184 +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.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.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-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.db.Table;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- *
- */
-public abstract class AbstractJavaAttributeMapping<T extends JavaResourceNode>
- extends AbstractJavaJpaContextNode
- implements JavaAttributeMapping
-{
- protected JavaResourcePersistentAttribute resourcePersistentAttribute;
-
-
- protected AbstractJavaAttributeMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- @SuppressWarnings("unchecked")
- protected T getResourceMapping() {
- if (this.isDefault()) {
- return (T) this.resourcePersistentAttribute.getNullMappingAnnotation(getAnnotationName());
- }
- return (T) this.resourcePersistentAttribute.getMappingAnnotation(getAnnotationName());
- }
-
- public GenericJavaPersistentAttribute getPersistentAttribute() {
- return (GenericJavaPersistentAttribute) this.getParent();
- }
-
- protected JavaResourcePersistentAttribute getResourcePersistentAttribute() {
- return this.resourcePersistentAttribute;
- }
-
- /**
- * the persistent attribute can tell whether there is a "specified" mapping
- * or a "default" one
- */
- public boolean isDefault() {
- return this.getPersistentAttribute().mappingIsDefault(this);
- }
-
- protected boolean embeddableOwned() {
- return this.getTypeMapping().getKey() == MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY;
- }
-
- protected boolean ownerIsEntity() {
- return this.getTypeMapping().getKey() == MappingKeys.ENTITY_TYPE_MAPPING_KEY;
- }
-
- public TypeMapping getTypeMapping() {
- return this.getPersistentAttribute().getTypeMapping();
- }
-
- protected String getAttributeName() {
- 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 isIdMapping() {
- return false;
- }
-
- public void initialize(JavaResourcePersistentAttribute javaResourcePersistentAttribute) {
- this.resourcePersistentAttribute = javaResourcePersistentAttribute;
- initialize(getResourceMapping());
- }
-
- protected void initialize(@SuppressWarnings("unused") T resourceMapping) {
- // do nothing by default
- }
-
- public void update(JavaResourcePersistentAttribute javaResourcePersistentAttribute) {
- this.resourcePersistentAttribute = javaResourcePersistentAttribute;
- this.update(getResourceMapping());
- }
-
- protected void update(@SuppressWarnings("unused") T resourceMapping) {
- // do nothing by default
- }
-
-
- //************ Validation *************************
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- this.validateModifiers(messages, astRoot);
- this.validateMappingType(messages, astRoot);
- }
-
- protected void validateModifiers(List<IMessage> messages, CompilationUnit astRoot) {
- if (this.getPersistentAttribute().getMappingKey() == MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY) {
- return;
- }
-
- if (this.resourcePersistentAttribute.isForField()) {
- if (this.resourcePersistentAttribute.isFinal()) {
- messages.add(this.buildAttributeMessage(JpaValidationMessages.PERSISTENT_ATTRIBUTE_FINAL_FIELD, astRoot));
- }
-
- if (this.resourcePersistentAttribute.isPublic()) {
- messages.add(this.buildAttributeMessage(JpaValidationMessages.PERSISTENT_ATTRIBUTE_PUBLIC_FIELD, astRoot));
- }
- }
- }
-
- protected IMessage buildAttributeMessage(String msgID, CompilationUnit astRoot) {
- JavaPersistentAttribute attribute = this.getPersistentAttribute();
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- msgID,
- new String[] {attribute.getName()},
- attribute,
- attribute.getValidationTextRange(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.getPersistentAttribute().getName()},
- this,
- this.getValidationTextRange(astRoot)
- )
- );
- }
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getResourceMappingTextRange(astRoot);
- return (textRange != null) ? textRange : this.getPersistentAttribute().getValidationTextRange(astRoot);
- }
-
- protected TextRange getResourceMappingTextRange(CompilationUnit astRoot) {
- T resourceMapping = this.getResourceMapping();
- return (resourceMapping == null) ? null : resourceMapping.getTextRange(astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getAttributeName());
- }
-
-}
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 c5f8302157..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaBaseColumn.java
+++ /dev/null
@@ -1,302 +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.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.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.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-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.defaultTable();
- this.specifiedTable = this.specifiedTable(column);
- this.specifiedUnique = this.specifiedUnique(column);
- this.specifiedNullable = this.specifiedNullable(column);
- this.specifiedInsertable = this.specifiedInsertable(column);
- this.specifiedUpdatable = this.specifiedUpdatable(column);
- }
-
- @Override
- public JavaBaseColumn.Owner getOwner() {
- return (JavaBaseColumn.Owner) super.getOwner();
- }
-
- //************** IAbstractColumn implementation *******************
-
-
- 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);
- }
-
- public Boolean getUnique() {
- return (this.getSpecifiedUnique() == null) ? this.getDefaultUnique() : this.getSpecifiedUnique();
- }
-
- public Boolean getDefaultUnique() {
- 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);
- }
-
- public Boolean getNullable() {
- return (this.getSpecifiedNullable() == null) ? this.getDefaultNullable() : this.getSpecifiedNullable();
- }
-
- public Boolean getDefaultNullable() {
- 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);
- }
-
- public Boolean getInsertable() {
- return (this.getSpecifiedInsertable() == null) ? this.getDefaultInsertable() : this.getSpecifiedInsertable();
- }
-
- public Boolean getDefaultInsertable() {
- 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);
- }
-
- public Boolean getUpdatable() {
- return (this.getSpecifiedUpdatable() == null) ? this.getDefaultUpdatable() : this.getSpecifiedUpdatable();
- }
-
- public Boolean getDefaultUpdatable() {
- 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);
- }
-
- @Override
- protected String getTableName() {
- return this.getTable();
- }
-
- 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);
- }
-
- private Iterator<String> candidateTableNames() {
- return this.tableIsAllowed() ? this.getOwner().getTypeMapping().associatedTableNamesIncludingInherited() : EmptyIterator.<String> instance();
- }
-
- private Iterator<String> candidateTableNames(Filter<String> filter) {
- return new FilteringIterator<String, String>(this.candidateTableNames(), filter);
- }
-
- private Iterator<String> javaCandidateTableNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.candidateTableNames(filter));
- }
-
- /**
- * Return whether the 'table' element is allowed. It is not allowed for
- * join columns inside of join tables.
- */
- public abstract boolean tableIsAllowed();
-
- @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;
- }
-
- @Override
- protected void update(T column) {
- super.update(column);
- this.setDefaultTable(this.defaultTable());
- this.setSpecifiedTable_(this.specifiedTable(column));
- this.setSpecifiedUnique_(this.specifiedUnique(column));
- this.setSpecifiedNullable_(this.specifiedNullable(column));
- this.setSpecifiedInsertable_(this.specifiedInsertable(column));
- this.setSpecifiedUpdatable_(this.specifiedUpdatable(column));
- }
-
- protected String defaultTable() {
- return this.getOwner().getDefaultTableName();
- }
-
- protected String specifiedTable(BaseColumnAnnotation column) {
- return column.getTable();
- }
-
- protected Boolean specifiedUnique(BaseColumnAnnotation column) {
- return column.getUnique();
- }
-
- protected Boolean specifiedNullable(BaseColumnAnnotation column) {
- return column.getNullable();
- }
-
- protected Boolean specifiedInsertable(BaseColumnAnnotation column) {
- return column.getInsertable();
- }
-
- protected Boolean specifiedUpdatable(BaseColumnAnnotation column) {
- return column.getUpdatable();
- }
-}
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 b3d040f692..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaBaseEmbeddedMapping.java
+++ /dev/null
@@ -1,367 +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.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.AttributeOverride;
-import org.eclipse.jpt.core.context.BaseEmbeddedMapping;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.ColumnMapping;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-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.internal.context.MappingTools;
-import org.eclipse.jpt.core.internal.resource.java.NullColumn;
-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.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeListIterator;
-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;
-
-
-public abstract class AbstractJavaBaseEmbeddedMapping<T extends JavaResourceNode> extends AbstractJavaAttributeMapping<T>
- implements JavaBaseEmbeddedMapping
-{
- protected final List<JavaAttributeOverride> specifiedAttributeOverrides;
-
- protected final List<JavaAttributeOverride> virtualAttributeOverrides;
-
- private Embeddable embeddable;
-
- protected AbstractJavaBaseEmbeddedMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.specifiedAttributeOverrides = new ArrayList<JavaAttributeOverride>();
- this.virtualAttributeOverrides = new ArrayList<JavaAttributeOverride>();
- }
-
- //****************** JavaAttributeMapping implemenation *******************
-
- public Iterator<String> correspondingAnnotationNames() {
- return new ArrayIterator<String>(
- JPA.ATTRIBUTE_OVERRIDE,
- JPA.ATTRIBUTE_OVERRIDES);
- }
-
- //****************** AttributeOverride.Owner implemenation *******************
-
- public ColumnMapping getColumnMapping(String attributeName) {
- return MappingTools.getColumnMapping(attributeName, getEmbeddable());
- }
-
- public boolean isVirtual(BaseOverride override) {
- return this.virtualAttributeOverrides.contains(override);
- }
-
- public BaseOverride setVirtual(boolean virtual, BaseOverride override) {
- // Add a new attribute override
- if (virtual) {
- return setAttributeOverrideVirtual((JavaAttributeOverride) override);
- }
- return setAttributeOverrideSpecified((JavaAttributeOverride) override);
- }
-
- protected JavaAttributeOverride setAttributeOverrideVirtual(JavaAttributeOverride 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 udpate. This causes the UI to be flaky, since change notification might not occur in the correct order
- JavaAttributeOverride virtualAttributeOverride = null;
- if (attributeOverrideName != null) {
- for (PersistentAttribute persistentAttribute : CollectionTools.iterable(allOverridableAttributes())) {
- if (persistentAttribute.getName().equals(attributeOverrideName)) {
- //store the virtualAttributeOverride so we can fire change notification later
- virtualAttributeOverride = buildVirtualAttributeOverride(getResourcePersistentAttribute(), persistentAttribute.getName());
- this.virtualAttributeOverrides.add(virtualAttributeOverride);
- break;
- }
- }
- }
-
- getResourcePersistentAttribute().removeSupportingAnnotation(index, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- fireItemRemoved(Entity.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, attributeOverride);
-
- if (virtualAttributeOverride != null) {
- fireItemAdded(Entity.VIRTUAL_ATTRIBUTE_OVERRIDES_LIST, virtualAttributeOverridesSize() - 1, virtualAttributeOverride);
- }
- return virtualAttributeOverride;
- }
-
- protected JavaAttributeOverride setAttributeOverrideSpecified(JavaAttributeOverride oldAttributeOverride) {
- int index = specifiedAttributeOverridesSize();
- JavaAttributeOverride newAttributeOverride = getJpaFactory().buildJavaAttributeOverride(this, this);
- this.specifiedAttributeOverrides.add(index, newAttributeOverride);
-
- AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) getResourcePersistentAttribute().addSupportingAnnotation(index, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- newAttributeOverride.initialize(attributeOverrideResource);
-
- int defaultIndex = this.virtualAttributeOverrides.indexOf(oldAttributeOverride);
- this.virtualAttributeOverrides.remove(defaultIndex);
-
- newAttributeOverride.setName(oldAttributeOverride.getName());
- newAttributeOverride.getColumn().setSpecifiedName(oldAttributeOverride.getColumn().getName());
-
- this.fireItemRemoved(Entity.VIRTUAL_ATTRIBUTE_OVERRIDES_LIST, defaultIndex, oldAttributeOverride);
- this.fireItemAdded(Entity.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, newAttributeOverride);
-
- return newAttributeOverride;
- }
-
-
- //****************** BaseEmbeddedMapping implemenation *******************
-
- @SuppressWarnings("unchecked")
- public ListIterator<JavaAttributeOverride> attributeOverrides() {
- return new CompositeListIterator<JavaAttributeOverride>(this.specifiedAttributeOverrides(), this.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 void addSpecifiedAttributeOverride(int index, JavaAttributeOverride attributeOverride) {
- addItemToList(index, attributeOverride, this.specifiedAttributeOverrides, BaseEmbeddedMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- protected void addSpecifiedAttributeOverride(JavaAttributeOverride attributeOverride) {
- addSpecifiedAttributeOverride(this.specifiedAttributeOverrides.size(), attributeOverride);
- }
-
- protected void removeSpecifiedAttributeOverride_(JavaAttributeOverride attributeOverride) {
- removeItemFromList(attributeOverride, this.specifiedAttributeOverrides, BaseEmbeddedMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public void moveSpecifiedAttributeOverride(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedAttributeOverrides, targetIndex, sourceIndex);
- getResourcePersistentAttribute().moveSupportingAnnotation(targetIndex, sourceIndex, AttributeOverridesAnnotation.ANNOTATION_NAME);
- fireItemMoved(BaseEmbeddedMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, targetIndex, sourceIndex);
- }
-
- protected void addVirtualAttributeOverride(JavaAttributeOverride attributeOverride) {
- addItemToList(attributeOverride, this.virtualAttributeOverrides, BaseEmbeddedMapping.VIRTUAL_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- protected void removeVirtualAttributeOverride(JavaAttributeOverride attributeOverride) {
- removeItemFromList(attributeOverride, this.virtualAttributeOverrides, BaseEmbeddedMapping.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;
- }
-
- public Embeddable getEmbeddable() {
- return this.embeddable;
- }
-
-
-
- @Override
- public void initialize(JavaResourcePersistentAttribute resourcePersistentAttribute) {
- super.initialize(resourcePersistentAttribute);
- this.initializeAttributeOverrides(resourcePersistentAttribute);
- this.initializeDefaultAttributeOverrides(resourcePersistentAttribute);
- this.embeddable = MappingTools.getEmbeddableFor(getPersistentAttribute());
- }
-
- protected void initializeAttributeOverrides(JavaResourcePersistentAttribute resourcePersistentAttribute) {
- ListIterator<NestableAnnotation> annotations = resourcePersistentAttribute.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- while(annotations.hasNext()) {
- JavaAttributeOverride attributeOverride = getJpaFactory().buildJavaAttributeOverride(this, this);
- attributeOverride.initialize((AttributeOverrideAnnotation) annotations.next());
- this.specifiedAttributeOverrides.add(attributeOverride);
- }
- }
-
- protected void initializeDefaultAttributeOverrides(JavaResourcePersistentAttribute resourcePersistentAttribute) {
- for (Iterator<String> i = allOverridableAttributeNames(); i.hasNext(); ) {
- String attributeName = i.next();
- JavaAttributeOverride attributeOverride = getAttributeOverrideNamed(attributeName);
- if (attributeOverride == null) {
- this.virtualAttributeOverrides.add(buildVirtualAttributeOverride(resourcePersistentAttribute, attributeName));
- }
- }
- } @Override
- public void update(JavaResourcePersistentAttribute resourcePersistentAttribute) {
- super.update(resourcePersistentAttribute);
- this.embeddable = MappingTools.getEmbeddableFor(getPersistentAttribute());
- this.updateSpecifiedAttributeOverrides(resourcePersistentAttribute);
- this.updateVirtualAttributeOverrides(resourcePersistentAttribute);
-
- }
- protected void updateSpecifiedAttributeOverrides(JavaResourcePersistentAttribute resourcePersistentAttribute) {
- ListIterator<JavaAttributeOverride> attributeOverrides = specifiedAttributeOverrides();
- ListIterator<NestableAnnotation> resourceAttributeOverrides = resourcePersistentAttribute.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- 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 JavaAttributeOverride buildAttributeOverride(AttributeOverrideAnnotation attributeOverrideResource) {
- JavaAttributeOverride attributeOverride = getJpaFactory().buildJavaAttributeOverride(this, this);
- attributeOverride.initialize(attributeOverrideResource);
- return attributeOverride;
- }
-
- protected JavaAttributeOverride buildVirtualAttributeOverride(JavaResourcePersistentAttribute resourcePersistentAttribute, String attributeName) {
- return buildAttributeOverride(buildVirtualAttributeOverrideResource(resourcePersistentAttribute, attributeName));
- }
-
- protected VirtualAttributeOverride buildVirtualAttributeOverrideResource(JavaResourcePersistentAttribute resourcePersistentAttribute, String attributeName) {
- ColumnMapping columnMapping = (ColumnMapping) this.getEmbeddable().getPersistentType().getAttributeNamed(attributeName).getMapping();
- return new VirtualAttributeOverride(resourcePersistentAttribute, attributeName, columnMapping.getColumn());
- }
-
- protected void updateVirtualAttributeOverrides(JavaResourcePersistentAttribute resourcePersistentAttribute) {
- for (Iterator<String> i = allOverridableAttributeNames(); i.hasNext(); ) {
- String attributeName = i.next();
- JavaAttributeOverride attributeOverride = getAttributeOverrideNamed(attributeName);
- if (attributeOverride == null) {
- addVirtualAttributeOverride(buildVirtualAttributeOverride(resourcePersistentAttribute, attributeName));
- }
- else if (attributeOverride.isVirtual()) {
- attributeOverride.getColumn().update(new NullColumn(resourcePersistentAttribute));
- }
- }
-
- 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);
- }
- }
- }
-
-
- public Iterator<String> allOverridableAttributeNames() {
- return new TransformationIterator<PersistentAttribute, String>(this.allOverridableAttributes()) {
- @Override
- protected String transform(PersistentAttribute attribute) {
- return attribute.getName();
- }
- };
- }
-
- public Iterator<PersistentAttribute> allOverridableAttributes() {
- if (this.getEmbeddable() == null) {
- return EmptyIterator.instance();
- }
- return new FilteringIterator<PersistentAttribute, PersistentAttribute>(this.getEmbeddable().getPersistentType().attributes()) {
- @Override
- protected boolean accept(PersistentAttribute o) {
- return o.isOverridableAttribute();
- }
- };
- }
-
- @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 (AttributeOverride override : CollectionTools.iterable(this.attributeOverrides())) {
- result = ((JavaAttributeOverride) override).javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
-
- //******** Validation ******************
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
-
- for (Iterator<JavaAttributeOverride> stream = attributeOverrides(); stream.hasNext();) {
- stream.next().validate(messages, astRoot);
- }
- }
-} \ No newline at end of file
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 41c6504a79..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * 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 Integer getInitialValue() {
- return (this.specifiedInitialValue != null) ? this.specifiedInitialValue : 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 Integer getAllocationSize() {
- return (this.specifiedAllocationSize != null) ? this.specifiedAllocationSize : 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 Integer 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 **********
-
- public void initialize(GeneratorAnnotation generatorAnnotation) {
- this.resourceGenerator = generatorAnnotation;
- this.name = generatorAnnotation.getName();
- this.specifiedInitialValue = generatorAnnotation.getInitialValue();
- this.specifiedAllocationSize = generatorAnnotation.getAllocationSize();
- getPersistenceUnit().addGenerator(this);
- }
-
- 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 *default* 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();
-
- public Catalog getDbCatalog() {
- String catalog = this.getCatalog();
- if (catalog == null) {
- return null; // not even a default catalog (i.e. database probably does not support catalogs)
- }
- return 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/AbstractJavaJpaContextNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaJpaContextNode.java
deleted file mode 100644
index d3c32d7e4c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaJpaContextNode.java
+++ /dev/null
@@ -1,63 +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.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.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.internal.context.AbstractJpaContextNode;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public abstract class AbstractJavaJpaContextNode
- extends AbstractJpaContextNode
- implements JavaJpaContextNode
-{
- // ********** constructor **********
-
- protected AbstractJavaJpaContextNode(JpaContextNode parent) {
- super(parent);
- }
-
- 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, CompilationUnit astRoot) {
- // do nothing by default
- }
-
-}
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 519a420cbb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMultiRelationshipMapping.java
+++ /dev/null
@@ -1,457 +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.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.MultiRelationshipMapping;
-import org.eclipse.jpt.core.context.NonOwningMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.core.resource.java.OrderByAnnotation;
-import org.eclipse.jpt.core.resource.java.RelationshipMappingAnnotation;
-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;
-
-
-public abstract class AbstractJavaMultiRelationshipMapping<T extends RelationshipMappingAnnotation>
- extends AbstractJavaRelationshipMapping<T> implements MultiRelationshipMapping
-{
-
- protected String mappedBy;
-
- protected String orderBy;
-
- protected boolean isNoOrdering;
-
- protected boolean isPkOrdering;
-
- protected boolean isCustomOrdering;
-
- //TODO should this be null if this is the non-owning side of the relationship??
- protected final JavaJoinTable joinTable;
-
- protected String mapKey;
-
- protected AbstractJavaMultiRelationshipMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.joinTable = getJpaFactory().buildJavaJoinTable(this);
- }
-
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String newMappedBy) {
- String oldMappedBy = this.mappedBy;
- this.mappedBy = newMappedBy;
- this.setMappedByOnResourceModel(newMappedBy);
- firePropertyChanged(NonOwningMapping.MAPPED_BY_PROPERTY, oldMappedBy, newMappedBy);
- }
-
- protected void setMappedBy_(String newMappedBy) {
- String oldMappedBy = this.mappedBy;
- this.mappedBy = newMappedBy;
- firePropertyChanged(NonOwningMapping.MAPPED_BY_PROPERTY, oldMappedBy, newMappedBy);
- }
-
- protected abstract void setMappedByOnResourceModel(String mappedBy);
-
- public String getOrderBy() {
- return this.orderBy;
- }
-
- public void setOrderBy(String newOrderBy) {
- String oldOrderBy = this.orderBy;
- this.orderBy = newOrderBy;
- if (newOrderBy == null) {
- if (getResourceOrderBy() != null) {
- removeResourceOrderBy();
- }
- }
- else {
- if (getResourceOrderBy() == null) {
- addResourceOrderBy();
- }
- getResourceOrderBy().setValue(newOrderBy);
- }
- firePropertyChanged(MultiRelationshipMapping.ORDER_BY_PROPERTY, oldOrderBy, newOrderBy);
- }
-
- protected void setOrderBy_(String newOrderBy) {
- String oldOrderBy = this.orderBy;
- this.orderBy = newOrderBy;
- firePropertyChanged(MultiRelationshipMapping.ORDER_BY_PROPERTY, oldOrderBy, newOrderBy);
- }
-
- protected OrderByAnnotation getResourceOrderBy() {
- return (OrderByAnnotation) getResourcePersistentAttribute().getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- }
-
- protected OrderByAnnotation addResourceOrderBy() {
- return (OrderByAnnotation) getResourcePersistentAttribute().addSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- }
-
- protected void removeResourceOrderBy() {
- getResourcePersistentAttribute().removeSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- }
-
- public boolean isNoOrdering() {
- return this.isNoOrdering;
- }
-
- public void setNoOrdering(boolean newNoOrdering) {
- boolean oldNoOrdering = this.isNoOrdering;
- this.isNoOrdering = newNoOrdering;
- if (newNoOrdering) {
- if (getResourceOrderBy() != null) {
- removeResourceOrderBy();
- }
- }
- else {
- //??
- }
- firePropertyChanged(NO_ORDERING_PROPERTY, oldNoOrdering, newNoOrdering);
- }
-
- protected void setNoOrdering_(boolean newNoOrdering) {
- boolean oldNoOrdering = this.isNoOrdering;
- this.isNoOrdering = newNoOrdering;
- firePropertyChanged(NO_ORDERING_PROPERTY, oldNoOrdering, newNoOrdering);
- }
-
- public boolean isPkOrdering() {
- return this.isPkOrdering;
- }
-
- public void setPkOrdering(boolean newPkOrdering) {
- boolean oldPkOrdering = this.isPkOrdering;
- this.isPkOrdering = newPkOrdering;
- if (newPkOrdering) {
- if (getResourceOrderBy() == null) {
- addResourceOrderBy();
- }
- else {
- getResourceOrderBy().setValue(null);
- }
- }
- firePropertyChanged(PK_ORDERING_PROPERTY, oldPkOrdering, newPkOrdering);
- }
-
- protected void setPkOrdering_(boolean newPkOrdering) {
- boolean oldPkOrdering = this.isPkOrdering;
- this.isPkOrdering = newPkOrdering;
- firePropertyChanged(PK_ORDERING_PROPERTY, oldPkOrdering, newPkOrdering);
- }
-
- public boolean isCustomOrdering() {
- return this.isCustomOrdering;
- }
-
- public void setCustomOrdering(boolean newCustomOrdering) {
- boolean oldCustomOrdering = this.isCustomOrdering;
- this.isCustomOrdering = newCustomOrdering;
- if (newCustomOrdering) {
- setOrderBy(""); //$NON-NLS-1$
- }
- firePropertyChanged(CUSTOM_ORDERING_PROPERTY, oldCustomOrdering, newCustomOrdering);
- }
-
- protected void setCustomOrdering_(boolean newCustomOrdering) {
- boolean oldCustomOrdering = this.isCustomOrdering;
- this.isCustomOrdering = newCustomOrdering;
- firePropertyChanged(CUSTOM_ORDERING_PROPERTY, oldCustomOrdering, newCustomOrdering);
- }
-
- public FetchType getDefaultFetch() {
- return MultiRelationshipMapping.DEFAULT_FETCH_TYPE;
- }
-
- public JavaJoinTable getJoinTable() {
- return this.joinTable;
- }
-
- public boolean joinTableIsSpecified() {
- return this.joinTable.isSpecified();
- }
-
- public boolean isRelationshipOwner() {
- return getMappedBy() == null;
- }
-
- public String getMapKey() {
- return this.mapKey;
- }
-
- public void setMapKey(String newMapKey) {
- String oldMapKey = this.mapKey;
- this.mapKey = newMapKey;
- if (oldMapKey != newMapKey) {
- if (this.getMapKeyResource(getResourcePersistentAttribute()) != null) {
- if (newMapKey != null) {
- this.getMapKeyResource(getResourcePersistentAttribute()).setName(newMapKey);
- }
- else {
- getResourcePersistentAttribute().removeSupportingAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- }
- }
- else if (newMapKey != null) {
- getResourcePersistentAttribute().addSupportingAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- getMapKeyResource(getResourcePersistentAttribute()).setName(newMapKey);
- }
- }
- firePropertyChanged(MultiRelationshipMapping.MAP_KEY_PROPERTY, oldMapKey, newMapKey);
- }
-
- protected void setMapKey_(String newMapKey) {
- String oldMapKey = this.mapKey;
- this.mapKey = newMapKey;
- firePropertyChanged(MultiRelationshipMapping.MAP_KEY_PROPERTY, oldMapKey, newMapKey);
- }
-
-//TODO default orderBy - this wasn't supported in 1.0 either
-// public void refreshDefaults(DefaultsContext defaultsContext) {
-// super.refreshDefaults(defaultsContext);
-// // if (isOrderByPk()) {
-// // refreshDefaultOrderBy(defaultsContext);
-// // }
-// }
-//
-// //primary key ordering when just the @OrderBy annotation is present
-// protected void refreshDefaultOrderBy(DefaultsContext defaultsContext) {
-// IEntity targetEntity = getResolvedTargetEntity();
-// if (targetEntity != null) {
-// setOrderBy(targetEntity.primaryKeyAttributeName() + " ASC");
-// }
-// }
-
- @Override
- protected String buildDefaultTargetEntity(JavaResourcePersistentAttribute jrpa) {
- if (!jrpa.typeIsContainer()) {
- return null;
- }
- return jrpa.getQualifiedReferenceEntityElementTypeName();
- }
-
- protected abstract boolean mappedByTouches(int pos, CompilationUnit astRoot);
-
- protected boolean mapKeyNameTouches(int pos, CompilationUnit astRoot) {
- if (getMapKeyResource(getResourcePersistentAttribute()) != null) {
- return getMapKeyResource(getResourcePersistentAttribute()).nameTouches(pos, astRoot);
- }
- return false;
- }
-
- protected MapKeyAnnotation getMapKeyResource(JavaResourcePersistentAttribute jrpa) {
- return (MapKeyAnnotation) jrpa.getSupportingAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- }
-
- public Iterator<String> candidateMapKeyNames() {
- return this.allTargetEntityAttributeNames();
- }
-
- protected Iterator<String> candidateMapKeyNames(Filter<String> filter) {
- return new FilteringIterator<String, String>(this.candidateMapKeyNames(), filter);
- }
-
- protected Iterator<String> javaCandidateMapKeyNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.candidateMapKeyNames(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;
- }
- result = this.joinTable.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.mappedByTouches(pos, astRoot)) {
- return this.javaCandidateMappedByAttributeNames(filter);
- }
- if (this.mapKeyNameTouches(pos, astRoot)) {
- return this.javaCandidateMapKeyNames(filter);
- }
- return null;
- }
-
- @Override
- public void initialize(JavaResourcePersistentAttribute jrpa) {
- super.initialize(jrpa);
- MapKeyAnnotation mapKeyAnnotation = this.getMapKeyResource(jrpa);
- if (mapKeyAnnotation != null) {
- this.mapKey = mapKeyAnnotation.getName();
- }
- this.initializeOrderBy(this.getResourceOrderBy());
- this.joinTable.initialize(jrpa);
- }
-
- @Override
- protected void initialize(T relationshipMapping) {
- super.initialize(relationshipMapping);
- this.mappedBy = this.mappedBy(relationshipMapping);
- }
-
- protected void initializeOrderBy(OrderByAnnotation orderByAnnotation) {
- if (orderByAnnotation != null) {
- this.orderBy = orderByAnnotation.getValue();
- if (orderByAnnotation.getValue() == null) {
- this.isPkOrdering = true;
- }
- else {
- this.isCustomOrdering = true;
- }
- }
- else {
- this.isNoOrdering = true;
- }
- }
-
- @Override
- public void update(JavaResourcePersistentAttribute jrpa) {
- super.update(jrpa);
- this.updateMapKey(jrpa);
- this.updateOrderBy(this.getResourceOrderBy());
- this.joinTable.update(jrpa);
- }
-
- @Override
- protected void update(T relationshipMapping) {
- super.update(relationshipMapping);
- this.setMappedBy_(this.mappedBy(relationshipMapping));
- }
-
- protected void updateMapKey(JavaResourcePersistentAttribute jrpa) {
- MapKeyAnnotation mapKeyAnnotation = this.getMapKeyResource(jrpa);
- if (mapKeyAnnotation != null) {
- setMapKey_(mapKeyAnnotation.getName());
- }
- else {
- setMapKey_(null);
- }
- }
-
- protected void updateOrderBy(OrderByAnnotation orderByAnnotation) {
- if (orderByAnnotation != null) {
- setOrderBy_(orderByAnnotation.getValue());
- if (orderByAnnotation.getValue() == null) {
- setPkOrdering_(true);
- setCustomOrdering_(false);
- setNoOrdering_(false);
- }
- else {
- setPkOrdering_(false);
- setCustomOrdering_(true);
- setNoOrdering_(false);
- }
- }
- else {
- setOrderBy_(null);
- setPkOrdering_(false);
- setCustomOrdering_(false);
- setNoOrdering_(true);
- }
- }
-
- protected abstract String mappedBy(T relationshipMapping);
-
-
- // ********** validation **********
-
- public abstract TextRange getMappedByTextRange(CompilationUnit astRoot);
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
-
- if (this.ownerIsEntity() && (this.joinTableIsSpecified() || this.isRelationshipOwner())) {
- this.joinTable.validate(messages, astRoot);
- }
- if (this.getMappedBy() != null) {
- this.validateMappedBy(messages, astRoot);
- }
- }
-
- protected void validateMappedBy(List<IMessage> messages, CompilationUnit astRoot) {
- if (this.joinTableIsSpecified()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAPPING_MAPPED_BY_WITH_JOIN_TABLE,
- this.joinTable,
- this.joinTable.getValidationTextRange(astRoot)
- )
- );
- }
-
- Entity targetEntity = this.getResolvedTargetEntity();
-
- if (targetEntity == null) {
- // already have validation messages for that
- return;
- }
-
- PersistentAttribute attribute = targetEntity.getPersistentType().resolveAttribute(this.mappedBy);
-
- if (attribute == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAPPING_UNRESOLVED_MAPPED_BY,
- new String[] {this.mappedBy},
- this,
- this.getMappedByTextRange(astRoot)
- )
- );
- return;
- }
-
- AttributeMapping mappedByMapping = attribute.getMapping();
- if ( ! this.mappedByIsValid(mappedByMapping)) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAPPING_INVALID_MAPPED_BY,
- new String[] {this.mappedBy},
- this,
- this.getMappedByTextRange(astRoot)
- )
- );
- return;
- }
-
- if ((mappedByMapping instanceof NonOwningMapping)
- && ((NonOwningMapping) mappedByMapping).getMappedBy() != null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAPPING_MAPPED_BY_ON_BOTH_SIDES,
- this,
- this.getMappedByTextRange(astRoot)
- )
- );
- }
- }
-
-}
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 f3da5a39ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaNamedColumn.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.core.internal.context.java;
-
-import java.util.Iterator;
-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.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-
-public abstract class AbstractJavaNamedColumn<T extends NamedColumnAnnotation> extends AbstractJavaJpaContextNode
- implements JavaNamedColumn
-{
-
- protected Owner owner;
-
- protected String specifiedName;
-
- protected String defaultName;
-
- protected String columnDefinition;
-
- protected AbstractJavaNamedColumn(JavaJpaContextNode parent, Owner owner) {
- super(parent);
- this.owner = owner;
- }
-
- // ******************* initialization from java resource model ********************
-
- protected void initialize(T column) {
- this.specifiedName = column.getName();
- this.defaultName = this.buildDefaultName();
- this.columnDefinition = column.getColumnDefinition();
- }
-
-
- protected abstract T getResourceColumn();
-
-
- //************** INamedColumn implementation *****************
- 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;
- 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);
- }
-
- 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.getTableName());
- }
-
- /**
- * Return the name of the column's table.
- */
- protected abstract String getTableName();
-
- 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.javaCandidateNames(filter);
- }
- return null;
- }
-
- private Iterator<String> javaCandidateNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.candidateNames(filter));
- }
-
- private Iterator<String> candidateNames(Filter<String> filter) {
- return new FilteringIterator<String, String>(this.candidateNames(), filter);
- }
-
- private Iterator<String> candidateNames() {
- Table dbTable = this.getDbTable();
- return (dbTable != null) ? dbTable.sortedColumnIdentifiers() : EmptyIterator.<String> instance();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
-
- // ******************* update from java resource model ********************
-
- protected void update(T column) {
- this.setSpecifiedName_(column.getName());
- this.setDefaultName(this.buildDefaultName());
- this.setColumnDefinition_(column.getColumnDefinition());
- }
-
- /**
- * Return the default column name.
- */
- protected String buildDefaultName() {
- return this.getOwner().getDefaultColumnName();
- }
-
-}
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 f9598ffbd9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOverride.java
+++ /dev/null
@@ -1,126 +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.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.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 BaseOverride
-{
-
- protected String name;
-
- protected final Owner owner;
-
- protected OverrideAnnotation resourceOverride;
-
- public AbstractJavaOverride(JavaJpaContextNode parent, Owner owner) {
- super(parent);
- this.owner = owner;
- }
-
- protected void initialize(OverrideAnnotation resourceOverride) {
- this.resourceOverride = resourceOverride;
- this.name = this.name(resourceOverride);
- }
-
- protected OverrideAnnotation getResourceOverride() {
- return this.resourceOverride;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.resourceOverride.setName(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- protected void setName_(String newName) {
- String oldName = this.name;
- this.name = newName;
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- protected void update(OverrideAnnotation overrideResource) {
- this.resourceOverride = overrideResource;
- this.setName_(this.name(overrideResource));
- }
-
- protected String name(OverrideAnnotation overrideResource) {
- return overrideResource.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, 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.resourceOverride.nameTouches(pos, astRoot);
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.resourceOverride.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/AbstractJavaQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaQuery.java
deleted file mode 100644
index f0e0a2bf92..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaQuery.java
+++ /dev/null
@@ -1,201 +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.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-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.QueryAnnotation;
-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 List<JavaQueryHint> hints;
-
- protected QueryAnnotation resourceQuery;
-
- protected AbstractJavaQuery(JavaJpaContextNode parent) {
- super(parent);
- this.hints = new ArrayList<JavaQueryHint>();
- }
-
- protected QueryAnnotation getResourceQuery() {
- return this.resourceQuery;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.resourceQuery.setName(newName);
- firePropertyChanged(Query.NAME_PROPERTY, oldName, newName);
- }
-
- protected void setName_(String newName) {
- String oldName = this.name;
- this.name = 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.resourceQuery.setQuery(newQuery);
- firePropertyChanged(Query.QUERY_PROPERTY, oldQuery, newQuery);
- }
-
- protected void setQuery_(String newQuery) {
- String oldQuery = this.query;
- this.query = newQuery;
- firePropertyChanged(Query.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(Query.HINTS_LIST, index, hint);
- return hint;
- }
-
- protected void addHint(int index, JavaQueryHint hint) {
- addItemToList(index, hint, this.hints, Query.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(Query.HINTS_LIST, index, removedHint);
- }
-
- protected void removeHint_(JavaQueryHint hint) {
- removeItemFromList(hint, this.hints, Query.HINTS_LIST);
- }
-
- public void moveHint(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.hints, targetIndex, sourceIndex);
- this.getResourceQuery().moveHint(targetIndex, sourceIndex);
- fireItemMoved(Query.HINTS_LIST, targetIndex, sourceIndex);
- }
-
- protected void initialize(QueryAnnotation queryAnnotation) {
- this.resourceQuery = queryAnnotation;
- this.name = queryAnnotation.getName();
- this.query = queryAnnotation.getQuery();
- this.initializeQueryHints(queryAnnotation);
- getPersistenceUnit().addQuery(this);
- }
-
- protected void update(QueryAnnotation queryAnnotation) {
- this.resourceQuery = queryAnnotation;
- this.setName_(queryAnnotation.getName());
- this.setQuery_(queryAnnotation.getQuery());
- this.updateQueryHints(queryAnnotation);
- getPersistenceUnit().addQuery(this);
- }
-
- protected void initializeQueryHints(QueryAnnotation queryAnnotation) {
- ListIterator<QueryHintAnnotation> annotations = queryAnnotation.hints();
-
- while(annotations.hasNext()) {
- this.hints.add(createQueryHint(annotations.next()));
- }
- }
-
- protected void updateQueryHints(QueryAnnotation queryAnnotation) {
- ListIterator<JavaQueryHint> contextHints = hints();
- ListIterator<QueryHintAnnotation> resourceHints = 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.resourceQuery.getTextRange(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.resourceQuery.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 eb57863dcc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaRelationshipMapping.java
+++ /dev/null
@@ -1,208 +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.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaRelationshipMapping;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.RelationshipMappingAnnotation;
-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;
-
-/**
- *
- */
-public abstract class AbstractJavaRelationshipMapping<T extends RelationshipMappingAnnotation>
- extends AbstractJavaAttributeMapping<T>
- implements JavaRelationshipMapping
-{
-
- protected String specifiedTargetEntity;
- protected String defaultTargetEntity;
- protected Entity resolvedTargetEntity;
-
- protected final JavaCascade cascade;
-
- protected FetchType specifiedFetch;
-
-
- protected AbstractJavaRelationshipMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.cascade = new JavaCascade(this);
- }
-
-
- // ********** 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.getResourceMapping().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 entity) {
- Entity old = this.resolvedTargetEntity;
- this.resolvedTargetEntity = entity;
- this.firePropertyChanged(RESOLVED_TARGET_ENTITY_PROPERTY, old, entity);
- }
-
-
- // ********** cascade **********
-
- public JavaCascade 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.getResourceMapping().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);
- }
-
-
- // ********** resource => context **********
-
- @Override
- public void initialize(JavaResourcePersistentAttribute jrpa) {
- this.defaultTargetEntity = this.buildDefaultTargetEntity(jrpa);
- super.initialize(jrpa);
- }
-
- @Override
- public void update(JavaResourcePersistentAttribute jrpa) {
- this.setDefaultTargetEntity(this.buildDefaultTargetEntity(jrpa));
- super.update(jrpa);
- }
-
- @Override
- protected void initialize(T relationshipMappingAnnotation) {
- this.specifiedFetch = this.buildFetch(relationshipMappingAnnotation);
- this.cascade.initialize(relationshipMappingAnnotation);
- this.specifiedTargetEntity = this.buildSpecifiedTargetEntity(relationshipMappingAnnotation);
- this.resolvedTargetEntity = this.buildResolvedTargetEntity(relationshipMappingAnnotation);
- }
-
- @Override
- protected void update(T relationshipMappingAnnotation) {
- super.update(relationshipMappingAnnotation);
- this.setSpecifiedFetch_(this.buildFetch(relationshipMappingAnnotation));
- this.cascade.update(relationshipMappingAnnotation);
- this.setSpecifiedTargetEntity_(this.buildSpecifiedTargetEntity(relationshipMappingAnnotation));
- this.setResolvedTargetEntity(this.buildResolvedTargetEntity(relationshipMappingAnnotation));
- }
-
- protected FetchType buildFetch(T relationshipMappingAnnotation) {
- return FetchType.fromJavaResourceModel(relationshipMappingAnnotation.getFetch());
- }
-
- protected String buildSpecifiedTargetEntity(T relationshipMappingAnnotation) {
- return relationshipMappingAnnotation.getTargetEntity();
- }
-
- protected abstract String buildDefaultTargetEntity(JavaResourcePersistentAttribute jrpa);
-
- protected Entity buildResolvedTargetEntity(T relationshipMappingAnnotation) {
- String qualifiedTargetEntity = getDefaultTargetEntity();
- if (getSpecifiedTargetEntity() != null) {
- qualifiedTargetEntity = relationshipMappingAnnotation.getFullyQualifiedTargetEntity();
- }
- if (qualifiedTargetEntity == null) {
- return null;
- }
- return getPersistenceUnit().getEntity(qualifiedTargetEntity);
- }
-
-
- // ********** RelationshipMapping implementation **********
-
- public Entity getEntity() {
- TypeMapping typeMapping = this.getTypeMapping();
- return (typeMapping instanceof Entity) ? (Entity) typeMapping : null;
- }
-
- public String getJoinTableDefaultName() {
- return MappingTools.buildJoinTableDefaultName(this);
- }
-
-
- // ********** convenience methods **********
-
- protected Iterator<String> allTargetEntityAttributeNames() {
- Entity targetEntity = this.getResolvedTargetEntity();
- return (targetEntity == null) ? EmptyIterator.<String> instance() : targetEntity.getPersistentType().allAttributeNames();
- }
-
- public Iterator<String> candidateMappedByAttributeNames() {
- return this.allTargetEntityAttributeNames();
- }
-
- protected Iterator<String> candidateMappedByAttributeNames(Filter<String> filter) {
- return new FilteringIterator<String, String>(this.candidateMappedByAttributeNames(), filter);
- }
-
- protected Iterator<String> javaCandidateMappedByAttributeNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.candidateMappedByAttributeNames(filter));
- }
-
-}
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 473378dab8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaSingleRelationshipMapping.java
+++ /dev/null
@@ -1,457 +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.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.FetchType;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.Nullable;
-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.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaSingleRelationshipMapping;
-import org.eclipse.jpt.core.internal.resource.java.NullJoinColumn;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-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.resource.java.RelationshipMappingAnnotation;
-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;
-
-/**
- *
- */
-public abstract class AbstractJavaSingleRelationshipMapping<T extends RelationshipMappingAnnotation>
- extends AbstractJavaRelationshipMapping<T>
- implements JavaSingleRelationshipMapping
-{
-
- protected final List<JavaJoinColumn> specifiedJoinColumns;
- protected JavaJoinColumn defaultJoinColumn;
-
- protected Boolean specifiedOptional;
-
-
- protected AbstractJavaSingleRelationshipMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.specifiedJoinColumns = new ArrayList<JavaJoinColumn>();
- }
-
-
- // ********** join columns **********
-
- public ListIterator<JavaJoinColumn> joinColumns() {
- return this.containsSpecifiedJoinColumns() ? this.specifiedJoinColumns() : this.defaultJoinColumns();
- }
-
- public int joinColumnsSize() {
- return this.containsSpecifiedJoinColumns() ? this.specifiedJoinColumnsSize() : this.defaultJoinColumnsSize();
- }
-
- public ListIterator<JavaJoinColumn> specifiedJoinColumns() {
- return new CloneListIterator<JavaJoinColumn>(this.specifiedJoinColumns);
- }
-
- public int specifiedJoinColumnsSize() {
- return this.specifiedJoinColumns.size();
- }
-
- public boolean containsSpecifiedJoinColumns() {
- return ! this.specifiedJoinColumns.isEmpty();
- }
-
- public JavaJoinColumn addSpecifiedJoinColumn(int index) {
- JavaJoinColumn 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;
- }
- JavaJoinColumn joinColumn = this.getJpaFactory().buildJavaJoinColumn(this, this.createJoinColumnOwner());
- this.specifiedJoinColumns.add(index, joinColumn);
- JoinColumnAnnotation joinColumnAnnotation = (JoinColumnAnnotation) this.getResourcePersistentAttribute().addSupportingAnnotation(index, JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
- joinColumn.initialize(joinColumnAnnotation);
- this.fireItemAdded(SPECIFIED_JOIN_COLUMNS_LIST, index, joinColumn);
- if (oldDefaultJoinColumn != null) {
- this.firePropertyChanged(DEFAULT_JOIN_COLUMN, oldDefaultJoinColumn, 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.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(new NullJoinColumn(this.getResourcePersistentAttribute()));
- }
- this.getResourcePersistentAttribute().removeSupportingAnnotation(index, JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
- 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.getResourcePersistentAttribute().moveSupportingAnnotation(targetIndex, sourceIndex, JoinColumnsAnnotation.ANNOTATION_NAME);
- this.fireItemMoved(SPECIFIED_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- public JavaJoinColumn getDefaultJoinColumn() {
- return this.defaultJoinColumn;
- }
-
- protected void setDefaultJoinColumn(JavaJoinColumn column) {
- JavaJoinColumn old = this.defaultJoinColumn;
- this.defaultJoinColumn = column;
- this.firePropertyChanged(DEFAULT_JOIN_COLUMN, 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;
- }
-
-
- // ********** optional **********
-
- public Boolean getOptional() {
- return (this.specifiedOptional != null) ? this.specifiedOptional : this.getDefaultOptional();
- }
-
- public Boolean getSpecifiedOptional() {
- return this.specifiedOptional;
- }
-
- public void setSpecifiedOptional(Boolean optional) {
- Boolean old = this.specifiedOptional;
- this.specifiedOptional = optional;
- this.setOptionalOnResourceModel(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 getDefaultOptional() {
- return Nullable.DEFAULT_OPTIONAL;
- }
-
- protected abstract void setOptionalOnResourceModel(Boolean newOptional);
-
-
- // ********** resource => context **********
-
- @Override
- public void initialize(JavaResourcePersistentAttribute javaResourcePersistentAttribute) {
- super.initialize(javaResourcePersistentAttribute);
- this.initializeSpecifiedJoinColumns(javaResourcePersistentAttribute);
- this.initializeDefaultJoinColumn(javaResourcePersistentAttribute);
- }
-
- @Override
- protected void initialize(T relationshipMapping) {
- super.initialize(relationshipMapping);
- this.specifiedOptional = this.buildSpecifiedOptional(relationshipMapping);
- }
-
- protected void initializeSpecifiedJoinColumns(JavaResourcePersistentAttribute javaResourcePersistentAttribute) {
- ListIterator<NestableAnnotation> annotations = javaResourcePersistentAttribute.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
-
- while(annotations.hasNext()) {
- this.specifiedJoinColumns.add(buildJoinColumn((JoinColumnAnnotation) annotations.next()));
- }
- }
-
- protected void initializeDefaultJoinColumn(JavaResourcePersistentAttribute javaResourcePersistentAttribute) {
- if (this.shouldBuildDefaultJoinColumn()) {
- this.defaultJoinColumn = this.buildJoinColumn(new NullJoinColumn(javaResourcePersistentAttribute));
- }
- }
-
- protected boolean shouldBuildDefaultJoinColumn() {
- return ! this.containsSpecifiedJoinColumns() && this.isRelationshipOwner();
- }
-
- @Override
- public void update(JavaResourcePersistentAttribute javaResourcePersistentAttribute) {
- super.update(javaResourcePersistentAttribute);
- this.updateSpecifiedJoinColumns(javaResourcePersistentAttribute);
- this.updateDefaultJoinColumn(javaResourcePersistentAttribute);
- }
-
- @Override
- protected void update(T relationshipMapping) {
- super.update(relationshipMapping);
- this.setSpecifiedOptional_(this.buildSpecifiedOptional(relationshipMapping));
- }
-
- protected abstract Boolean buildSpecifiedOptional(T relationshipMapping);
-
-
- protected void updateSpecifiedJoinColumns(JavaResourcePersistentAttribute javaResourcePersistentAttribute) {
- ListIterator<JavaJoinColumn> joinColumns = specifiedJoinColumns();
- ListIterator<NestableAnnotation> resourceJoinColumns = javaResourcePersistentAttribute.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
-
- while (joinColumns.hasNext()) {
- JavaJoinColumn joinColumn = joinColumns.next();
- if (resourceJoinColumns.hasNext()) {
- joinColumn.update((JoinColumnAnnotation) resourceJoinColumns.next());
- }
- else {
- removeSpecifiedJoinColumn_(joinColumn);
- }
- }
-
- while (resourceJoinColumns.hasNext()) {
- addSpecifiedJoinColumn(buildJoinColumn((JoinColumnAnnotation) resourceJoinColumns.next()));
- }
- }
-
- protected void updateDefaultJoinColumn(JavaResourcePersistentAttribute javaResourcePersistentAttribute) {
- if (this.shouldBuildDefaultJoinColumn()) {
- JoinColumnAnnotation jcAnnotation = new NullJoinColumn(javaResourcePersistentAttribute);
- if (this.defaultJoinColumn == null) {
- this.setDefaultJoinColumn(this.buildJoinColumn(jcAnnotation));
- } else {
- this.defaultJoinColumn.update(jcAnnotation);
- }
- } else {
- this.setDefaultJoinColumn(null);
- }
- }
-
- protected JavaJoinColumn buildJoinColumn(JoinColumnAnnotation joinColumnResource) {
- JavaJoinColumn joinColumn = getJpaFactory().buildJavaJoinColumn(this, createJoinColumnOwner());
- joinColumn.initialize(joinColumnResource);
- return joinColumn;
- }
-
- protected JavaJoinColumn.Owner createJoinColumnOwner() {
- return new JoinColumnOwner();
- }
-
- /**
- * eliminate any "container" types
- */
- @Override
- protected String buildDefaultTargetEntity(JavaResourcePersistentAttribute jrpa) {
- if (jrpa.typeIsContainer()) {
- return null;
- }
- return jrpa.getQualifiedReferenceEntityTypeName();
- }
-
-
- // ********** Fetchable implementation **********
-
- public FetchType getDefaultFetch() {
- return DEFAULT_FETCH_TYPE;
- }
-
-
- // ********** 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, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
-
- if (this.connectionProfileIsActive()) {
- this.validateJoinColumns(messages, astRoot);
- }
- }
-
- // 192287 - We don't want join column validation errors on the non-owning side
- // of a bidirectional relationship. This is a low risk fix for RC3, but a better
- // solution would be to not have the default join columns on the non-owning side.
- // This would fix another bug that we show default join columns in this situation.
- protected void validateJoinColumns(List<IMessage> messages, CompilationUnit astRoot) {
- if (this.ownerIsEntity() && this.isRelationshipOwner()) {
- for (Iterator<JavaJoinColumn> stream = this.joinColumns(); stream.hasNext(); ) {
- this.validateJoinColumn(stream.next(), messages, astRoot);
- }
- }
- }
-
- protected void validateJoinColumn(JavaJoinColumn joinColumn, List<IMessage> messages, CompilationUnit astRoot) {
- if (this.getTypeMapping().tableNameIsInvalid(joinColumn.getTable())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_TABLE,
- new String[] {joinColumn.getTable(), joinColumn.getName()},
- joinColumn,
- joinColumn.getTableTextRange(astRoot)
- )
- );
- return;
- }
-
- if ( ! joinColumn.isResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {joinColumn.getName()},
- joinColumn,
- joinColumn.getNameTextRange(astRoot)
- )
- );
- }
-
- if ( ! joinColumn.isReferencedColumnResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME,
- new String[] {joinColumn.getReferencedColumnName(), joinColumn.getName()},
- joinColumn,
- joinColumn.getReferencedColumnNameTextRange(astRoot)
- )
- );
- }
- }
-
-
- // ********** join column owner adapter **********
-
- public class JoinColumnOwner implements JavaJoinColumn.Owner {
-
- public JoinColumnOwner() {
- super();
- }
-
- /**
- * by default, the join column is in the type mapping's primary table
- */
- public String getDefaultTableName() {
- return AbstractJavaSingleRelationshipMapping.this.getTypeMapping().getPrimaryTableName();
- }
-
- public Entity getTargetEntity() {
- return AbstractJavaSingleRelationshipMapping.this.getResolvedTargetEntity();
- }
-
- public String getAttributeName() {
- return AbstractJavaSingleRelationshipMapping.this.getPersistentAttribute().getName();
- }
-
- public RelationshipMapping getRelationshipMapping() {
- return AbstractJavaSingleRelationshipMapping.this;
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return AbstractJavaSingleRelationshipMapping.this.getTypeMapping().tableNameIsInvalid(tableName);
- }
-
- /**
- * the join column can be on a secondary table
- */
- public boolean tableIsAllowed() {
- return true;
- }
-
- public TypeMapping getTypeMapping() {
- return AbstractJavaSingleRelationshipMapping.this.getTypeMapping();
- }
-
- public Table getDbTable(String tableName) {
- return getTypeMapping().getDbTable(tableName);
- }
-
- public Table getReferencedColumnDbTable() {
- Entity targetEntity = getTargetEntity();
- return (targetEntity == null) ? null : targetEntity.getPrimaryDbTable();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return AbstractJavaSingleRelationshipMapping.this.defaultJoinColumn == joinColumn;
- }
-
- public String getDefaultColumnName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return AbstractJavaSingleRelationshipMapping.this.getValidationTextRange(astRoot);
- }
-
- public int joinColumnsSize() {
- return AbstractJavaSingleRelationshipMapping.this.joinColumnsSize();
- }
-
- }
-
-}
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 84f6670559..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaTable.java
+++ /dev/null
@@ -1,501 +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.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.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.TableAnnotation;
-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.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-/**
- *
- */
-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 List<JavaUniqueConstraint> uniqueConstraints;
-
-
- // ********** constructor **********
-
- protected AbstractJavaTable(JavaJpaContextNode parent) {
- super(parent);
- this.uniqueConstraints = new ArrayList<JavaUniqueConstraint>();
- }
-
-
- // ********** 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 TableAnnotation getResourceTable();
-
- /**
- * Return the fully qualified 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.getResourceTable().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.getResourceTable().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.getResourceTable().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.getResourceTable().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.getResourceTable().removeUniqueConstraint(index);
- fireItemRemoved(UNIQUE_CONSTRAINTS_LIST, index, removedUniqueConstraint);
- }
-
- public void moveUniqueConstraint(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.uniqueConstraints, targetIndex, sourceIndex);
- this.getResourceTable().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);
- }
-
-
- // ********** 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.getResourceTable().getNameTextRange(astRoot), astRoot);
- }
-
- protected boolean nameTouches(int pos, CompilationUnit astRoot) {
- return this.getResourceTable().nameTouches(pos, astRoot);
- }
-
- protected TextRange getSchemaTextRange(CompilationUnit astRoot) {
- return this.getTextRange(this.getResourceTable().getSchemaTextRange(astRoot), astRoot);
- }
-
- protected boolean schemaTouches(int pos, CompilationUnit astRoot) {
- return this.getResourceTable().schemaTouches(pos, astRoot);
- }
-
- protected TextRange getCatalogTextRange(CompilationUnit astRoot) {
- return this.getTextRange(this.getResourceTable().getCatalogTextRange(astRoot), astRoot);
- }
-
- protected boolean catalogTouches(int pos, CompilationUnit astRoot) {
- return this.getResourceTable().catalogTouches(pos, astRoot);
- }
-
-
- // ********** resource => context **********
-
- protected void initialize(TableAnnotation tableAnnotation) {
- this.defaultName = this.buildDefaultName();
- this.specifiedName = tableAnnotation.getName();
-
- this.defaultSchema = this.buildDefaultSchema();
- this.specifiedSchema = tableAnnotation.getSchema();
-
- this.defaultCatalog = this.buildDefaultCatalog();
- this.specifiedCatalog = tableAnnotation.getCatalog();
-
- this.initializeUniqueConstraints(tableAnnotation);
- }
-
- protected void initializeUniqueConstraints(TableAnnotation tableAnnotation) {
- for (UniqueConstraintAnnotation uniqueConstraintAnnotation : CollectionTools.iterable(tableAnnotation.uniqueConstraints())) {
- this.uniqueConstraints.add(buildUniqueConstraint(uniqueConstraintAnnotation));
- }
- }
-
- protected void update(TableAnnotation tableAnnotation) {
- this.setDefaultName(this.buildDefaultName());
- this.setSpecifiedName_(tableAnnotation.getName());
-
- this.setDefaultSchema(this.buildDefaultSchema());
- this.setSpecifiedSchema_(tableAnnotation.getSchema());
-
- this.setDefaultCatalog(this.buildDefaultCatalog());
- this.setSpecifiedCatalog_(tableAnnotation.getCatalog());
-
- this.updateUniqueConstraints(tableAnnotation);
- }
-
- protected void updateUniqueConstraints(TableAnnotation tableAnnotation) {
- ListIterator<UniqueConstraintAnnotation> resourceConstraints = tableAnnotation.uniqueConstraints();
- ListIterator<JavaUniqueConstraint> contextConstraints = this.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 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 *default* 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();
- }
-
- public Catalog getDbCatalog() {
- String catalog = this.getCatalog();
- if (catalog == null) {
- return null; // not even a default catalog (i.e. database probably does not support catalogs)
- }
- return this.getDbCatalog(catalog);
- }
-
- public boolean isResolved() {
- return this.getDbTable() != null;
- }
-
- public boolean hasResolvedSchema() {
- return this.getDbSchema() != null;
- }
-
- public boolean hasResolvedCatalog() {
- String catalog = this.getCatalog();
- if (catalog == null) {
- return true; // not even a default catalog (i.e. database probably does not support catalogs)
- }
- return this.getDbCatalog(catalog) != null;
- }
-
-
- // ********** UniqueConstraint.Owner implementation **********
-
- public Iterator<String> candidateUniqueConstraintColumnNames() {
- org.eclipse.jpt.db.Table dbTable = this.getDbTable();
- return (dbTable != null) ? dbTable.sortedColumnIdentifiers() : EmptyIterator.<String>instance();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.getTextRange(this.getResourceTable().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.javaCandidateNames(filter);
- }
- if (this.schemaTouches(pos, astRoot)) {
- return this.javaCandidateSchemata(filter);
- }
- if (this.catalogTouches(pos, astRoot)) {
- return this.javaCandidateCatalogs(filter);
- }
- return null;
- }
-
- protected Iterator<String> javaCandidateNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.candidateNames(filter));
- }
-
- protected Iterator<String> candidateNames(Filter<String> filter) {
- return new FilteringIterator<String, String>(this.candidateNames(), filter);
- }
-
- protected Iterator<String> candidateNames() {
- Schema dbSchema = this.getDbSchema();
- return (dbSchema != null) ? dbSchema.sortedTableIdentifiers() : EmptyIterator.<String> instance();
- }
-
- protected Iterator<String> javaCandidateSchemata(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.candidateSchemata(filter));
- }
-
- protected Iterator<String> candidateSchemata(Filter<String> filter) {
- return new FilteringIterator<String, String>(this.candidateSchemata(), filter);
- }
-
- protected Iterator<String> candidateSchemata() {
- return this.getDbSchemaContainer().sortedSchemaIdentifiers();
- }
-
- protected Iterator<String> javaCandidateCatalogs(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.candidateCatalogs(filter));
- }
-
- protected Iterator<String> candidateCatalogs(Filter<String> filter) {
- return new FilteringIterator<String, String>(this.candidateCatalogs(), filter);
- }
-
- protected Iterator<String> candidateCatalogs() {
- Database db = this.getDatabase();
- return (db != null) ? db.sortedCatalogIdentifiers() : EmptyIterator.<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 fe05318c27..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaTypeMapping.java
+++ /dev/null
@@ -1,135 +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.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.Table;
-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.JavaResourceNode;
-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.iterators.EmptyIterator;
-
-
-public abstract class AbstractJavaTypeMapping extends AbstractJavaJpaContextNode
- implements JavaTypeMapping
-{
- protected JavaResourcePersistentType javaResourcePersistentType;
-
-
- protected AbstractJavaTypeMapping(JavaPersistentType parent) {
- super(parent);
- }
-
- protected JavaResourceNode getResourceMapping() {
- return this.javaResourcePersistentType.getMappingAnnotation(getAnnotationName());
- }
-
- //***************** ITypeMapping implementation *****************
-
- public JavaPersistentType getPersistentType() {
- return (JavaPersistentType) getParent();
- }
-
- 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 Iterator<JavaPersistentAttribute> overridableAttributes() {
- return EmptyIterator.instance();
- }
-
- public Iterator<PersistentAttribute> allOverridableAttributes() {
- return EmptyIterator.instance();
- }
-
- public Iterator<String> overridableAttributeNames() {
- return EmptyIterator.instance();
- }
-
- public Iterator<String> allOverridableAttributeNames() {
- return EmptyIterator.instance();
- }
-
- public Iterator<JavaPersistentAttribute> overridableAssociations() {
- return EmptyIterator.instance();
- }
-
- public Iterator<String> overridableAssociationNames() {
- return EmptyIterator.instance();
- }
-
- public Iterator<PersistentAttribute> allOverridableAssociations() {
- return EmptyIterator.instance();
- }
-
- public Iterator<String> allOverridableAssociationNames() {
- return EmptyIterator.instance();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return false;
- }
-
- //******************** updatating *********************
- public void initialize(JavaResourcePersistentType jrpt) {
- this.javaResourcePersistentType = jrpt;
- }
-
- public void update(JavaResourcePersistentType jrpt) {
- this.javaResourcePersistentType = jrpt;
- }
-
- //******************** validation *********************
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getResourceMapping().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/GenericJavaAssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaAssociationOverride.java
deleted file mode 100644
index 40892db3b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaAssociationOverride.java
+++ /dev/null
@@ -1,362 +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.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.AssociationOverride;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-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.JavaAssociationOverride;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-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.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 GenericJavaAssociationOverride extends AbstractJavaOverride
- implements JavaAssociationOverride
-{
-
- protected final List<JavaJoinColumn> specifiedJoinColumns;
-
- protected final List<JavaJoinColumn> defaultJoinColumns;
-
-
- public GenericJavaAssociationOverride(JavaJpaContextNode parent, AssociationOverride.Owner owner) {
- super(parent, owner);
- this.specifiedJoinColumns = new ArrayList<JavaJoinColumn>();
- this.defaultJoinColumns = new ArrayList<JavaJoinColumn>();
- }
-
- @Override
- public JavaAssociationOverride setVirtual(boolean virtual) {
- return (JavaAssociationOverride) super.setVirtual(virtual);
- }
-
- @Override
- protected AssociationOverrideAnnotation getResourceOverride() {
- return (AssociationOverrideAnnotation) super.getResourceOverride();
- }
-
- @Override
- public AssociationOverride.Owner getOwner() {
- return (AssociationOverride.Owner) super.getOwner();
- }
-
- public ListIterator<JavaJoinColumn> joinColumns() {
- return this.specifiedJoinColumns.isEmpty() ? this.defaultJoinColumns() : this.specifiedJoinColumns();
- }
-
- public int joinColumnsSize() {
- return this.specifiedJoinColumns.isEmpty() ? this.defaultJoinColumnsSize() : this.specifiedJoinColumnsSize();
- }
-
- public ListIterator<JavaJoinColumn> defaultJoinColumns() {
- return new CloneListIterator<JavaJoinColumn>(this.defaultJoinColumns);
- }
-
- public int defaultJoinColumnsSize() {
- return this.defaultJoinColumns.size();
- }
-
- public ListIterator<JavaJoinColumn> specifiedJoinColumns() {
- return new CloneListIterator<JavaJoinColumn>(this.specifiedJoinColumns);
- }
-
- public int specifiedJoinColumnsSize() {
- return this.specifiedJoinColumns.size();
- }
-
- public JavaJoinColumn addSpecifiedJoinColumn(int index) {
- JavaJoinColumn joinColumn = getJpaFactory().buildJavaJoinColumn(this, createJoinColumnOwner());
- this.specifiedJoinColumns.add(index, joinColumn);
- JoinColumnAnnotation joinColumnResource = getResourceOverride().addJoinColumn(index);
- joinColumn.initialize(joinColumnResource);
- this.fireItemAdded(AssociationOverride.SPECIFIED_JOIN_COLUMNS_LIST, index, joinColumn);
- return joinColumn;
- }
-
- protected JavaJoinColumn.Owner createJoinColumnOwner() {
- return new JoinColumnOwner();
- }
-
- protected void addSpecifiedJoinColumn(int index, JavaJoinColumn joinColumn) {
- addItemToList(index, joinColumn, this.specifiedJoinColumns, AssociationOverride.SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- protected void addSpecifiedJoinColumn(JavaJoinColumn joinColumn) {
- this.addSpecifiedJoinColumn(this.specifiedJoinColumns.size(), joinColumn);
- }
-
- public void removeSpecifiedJoinColumn(int index) {
- JavaJoinColumn removedJoinColumn = this.specifiedJoinColumns.remove(index);
- getResourceOverride().removeJoinColumn(index);
- fireItemRemoved(Entity.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, index, removedJoinColumn);
- }
-
- protected void removeSpecifiedJoinColumn(JavaJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.specifiedJoinColumns, AssociationOverride.SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedJoinColumn(int targetIndex, int sourceIndex) {
- getResourceOverride().moveJoinColumn(targetIndex, sourceIndex);
- moveItemInList(targetIndex, sourceIndex, this.specifiedJoinColumns, AssociationOverride.SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public boolean containsSpecifiedJoinColumns() {
- return !this.specifiedJoinColumns.isEmpty();
- }
-
-
- @Override
- protected Iterator<String> candidateNames() {
- return this.getOwner().getTypeMapping().allOverridableAssociationNames();
- }
-
- @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;
- }
-
- public void initialize(AssociationOverrideAnnotation associationOverride) {
- super.initialize(associationOverride);
- this.name = associationOverride.getName();
- initializeSpecifiedJoinColumns(associationOverride);
- }
-
- protected void initializeSpecifiedJoinColumns(AssociationOverrideAnnotation associationOverride) {
- ListIterator<JoinColumnAnnotation> annotations = associationOverride.joinColumns();
-
- while(annotations.hasNext()) {
- this.specifiedJoinColumns.add(createJoinColumn(annotations.next()));
- }
- }
-
- public void update(AssociationOverrideAnnotation associationOverride) {
- super.update(associationOverride);
- updateSpecifiedJoinColumns(associationOverride);
- }
-
- protected void updateSpecifiedJoinColumns(AssociationOverrideAnnotation associationOverride) {
- ListIterator<JavaJoinColumn> joinColumns = specifiedJoinColumns();
- ListIterator<JoinColumnAnnotation> resourceJoinColumns = associationOverride.joinColumns();
-
- while (joinColumns.hasNext()) {
- JavaJoinColumn joinColumn = joinColumns.next();
- if (resourceJoinColumns.hasNext()) {
- joinColumn.update(resourceJoinColumns.next());
- }
- else {
- removeSpecifiedJoinColumn(joinColumn);
- }
- }
-
- while (resourceJoinColumns.hasNext()) {
- addSpecifiedJoinColumn(createJoinColumn(resourceJoinColumns.next()));
- }
- }
-
-
- protected JavaJoinColumn createJoinColumn(JoinColumnAnnotation joinColumnResource) {
- JavaJoinColumn joinColumn = getJpaFactory().buildJavaJoinColumn(this, createJoinColumnOwner());
- joinColumn.initialize(joinColumnResource);
- return joinColumn;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- if (this.connectionProfileIsActive()) {
- this.validateJoinColumns(messages, astRoot);
- }
- }
-
- protected void validateJoinColumns(List<IMessage> messages, CompilationUnit astRoot) {
- for (Iterator<JavaJoinColumn> stream = this.joinColumns(); stream.hasNext(); ) {
- this.validateJoinColumn(stream.next(), messages, astRoot);
- }
- }
-
- protected void validateJoinColumn(JavaJoinColumn joinColumn, List<IMessage> messages, CompilationUnit astRoot) {
- String tableName = joinColumn.getTable();
- if (this.getOwner().getTypeMapping().tableNameIsInvalid(tableName)) {
- if (this.isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_TABLE,
- new String[] {this.getName(), tableName, joinColumn.getName()},
- joinColumn,
- joinColumn.getTableTextRange(astRoot)
- )
- );
- } else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_TABLE,
- new String[] {tableName, joinColumn.getName()},
- joinColumn,
- joinColumn.getTableTextRange(astRoot)
- )
- );
- }
- return;
- }
-
- if ( ! joinColumn.isResolved()) {
- if (this.isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {this.getName(), joinColumn.getName()},
- joinColumn,
- joinColumn.getNameTextRange(astRoot)
- )
- );
- } else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {joinColumn.getName()},
- joinColumn,
- joinColumn.getNameTextRange(astRoot)
- )
- );
- }
- }
-
- if ( ! joinColumn.isReferencedColumnResolved()) {
- if (this.isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME,
- new String[] {this.getName(), joinColumn.getReferencedColumnName(), joinColumn.getName()},
- joinColumn,
- joinColumn.getReferencedColumnNameTextRange(astRoot)
- )
- );
- } else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME,
- new String[] {joinColumn.getReferencedColumnName(), joinColumn.getName()},
- joinColumn,
- joinColumn.getReferencedColumnNameTextRange(astRoot)
- )
- );
- }
- }
- }
-
-
- // ********** JavaJoinColumn.Owner implementation **********
-
- public class JoinColumnOwner implements JavaJoinColumn.Owner
- {
-
- public JoinColumnOwner() {
- super();
- }
-
- /**
- * by default, the join column is in the type mapping's primary table
- */
- public String getDefaultTableName() {
- return GenericJavaAssociationOverride.this.owner.getTypeMapping().getPrimaryTableName();
- }
-
- public String getDefaultColumnName() {
- return null;
- }
-
- public Entity getTargetEntity() {
- RelationshipMapping relationshipMapping = getRelationshipMapping();
- return relationshipMapping == null ? null : relationshipMapping.getResolvedTargetEntity();
- }
-
- public String getAttributeName() {
- return GenericJavaAssociationOverride.this.getName();
- }
-
- public RelationshipMapping getRelationshipMapping() {
- return GenericJavaAssociationOverride.this.getOwner().getRelationshipMapping(GenericJavaAssociationOverride.this.getName());
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getTypeMapping().tableNameIsInvalid(tableName);
- }
-
- /**
- * the join column can be on a secondary table
- */
- public boolean tableIsAllowed() {
- return true;
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public TypeMapping getTypeMapping() {
- return GenericJavaAssociationOverride.this.owner.getTypeMapping();
- }
-
- public Table getDbTable(String tableName) {
- return getTypeMapping().getDbTable(tableName);
- }
-
- public Table getReferencedColumnDbTable() {
- Entity targetEntity = getTargetEntity();
- return (targetEntity == null) ? null : targetEntity.getPrimaryDbTable();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return GenericJavaAssociationOverride.this.defaultJoinColumns.contains(joinColumn);
- }
-
- public int joinColumnsSize() {
- return GenericJavaAssociationOverride.this.joinColumnsSize();
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaAttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaAttributeOverride.java
deleted file mode 100644
index 641058777f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaAttributeOverride.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.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.AttributeOverride;
-import org.eclipse.jpt.core.context.ColumnMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericJavaAttributeOverride extends AbstractJavaOverride
- implements JavaAttributeOverride
-{
-
- protected final JavaColumn column;
-
-
- public GenericJavaAttributeOverride(JavaJpaContextNode parent, AttributeOverride.Owner owner) {
- super(parent, owner);
- this.column = getJpaFactory().buildJavaColumn(this, this);
- }
-
- @Override
- public JavaAttributeOverride setVirtual(boolean virtual) {
- return (JavaAttributeOverride) super.setVirtual(virtual);
- }
-
- @Override
- protected AttributeOverrideAnnotation getResourceOverride() {
- return (AttributeOverrideAnnotation) super.getResourceOverride();
- }
-
- @Override
- public AttributeOverride.Owner getOwner() {
- return (AttributeOverride.Owner) super.getOwner();
- }
-
- public ColumnAnnotation getResourceColumn() {
- return this.getResourceOverride().getNonNullColumn();
- }
-
- public String getDefaultColumnName() {
- ColumnMapping columnMapping = getColumnMapping();
- if (columnMapping == null) {
- return null;
- }
- return columnMapping.getColumn().getName();
- }
-
- public String getDefaultTableName() {
- ColumnMapping columnMapping = getColumnMapping();
- if (columnMapping == null) {
- return null;
- }
- String tableName = columnMapping.getColumn().getSpecifiedTable();
- if (tableName != null) {
- return tableName;
- }
- return getOwner().getTypeMapping().getPrimaryTableName();
- }
-
- protected ColumnMapping getColumnMapping() {
- return getOwner().getColumnMapping(getName());
- }
-
- //************* IColumn.Owner implementation **************
- public TypeMapping getTypeMapping() {
- return this.getOwner().getTypeMapping();
- }
-
- public Table getDbTable(String tableName) {
- return this.getTypeMapping().getDbTable(tableName);
- }
-
- //************* IAttributeOverride implementation **************
-
- public JavaColumn getColumn() {
- return this.column;
- }
-
- //************* JavaOverride implementation **************
-
- @Override
- protected Iterator<String> candidateNames() {
- return this.getOwner().getTypeMapping().allOverridableAttributeNames();
- }
-
- //************* java resource model -> java context model **************
- public void initialize(AttributeOverrideAnnotation attributeOverrideResource) {
- super.initialize(attributeOverrideResource);
- this.column.initialize(this.getResourceColumn());
- }
-
- public void update(AttributeOverrideAnnotation attributeOverrideResource) {
- super.update(attributeOverrideResource);
- this.column.update(this.getResourceColumn());
- }
-
- @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, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- if (this.connectionProfileIsActive()) {
- this.validateColumn(messages, astRoot);
- }
- }
-
- protected void validateColumn(List<IMessage> messages, CompilationUnit astRoot) {
- String tableName = this.column.getTable();
- if (this.getTypeMapping().tableNameIsInvalid(tableName)) {
- if (this.isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_TABLE,
- new String[] {this.getName(), tableName, this.column.getName()},
- this.column,
- this.column.getTableTextRange(astRoot)
- )
- );
- } else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_TABLE,
- new String[] {tableName, this.column.getName()},
- this.column,
- this.column.getTableTextRange(astRoot)
- )
- );
- }
- return;
- }
-
- if ( ! this.column.isResolved()) {
- if (this.isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME,
- new String[] {this.getName(), this.column.getName()},
- this.column,
- this.column.getNameTextRange(astRoot)
- )
- );
- } else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {this.column.getName()},
- this.column,
- this.column.getNameTextRange(astRoot)
- )
- );
- }
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaBasicMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaBasicMapping.java
deleted file mode 100644
index a706f45e36..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaBasicMapping.java
+++ /dev/null
@@ -1,322 +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.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.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.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.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.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.LobAnnotation;
-import org.eclipse.jpt.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericJavaBasicMapping extends AbstractJavaAttributeMapping<BasicAnnotation> implements JavaBasicMapping
-{
- protected FetchType specifiedFetch;
-
- protected Boolean specifiedOptional;
-
- protected final JavaColumn column;
-
- protected final JavaConverter defaultConverter;
-
- protected JavaConverter specifiedConverter;
-
-
- public GenericJavaBasicMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.column = createJavaColumn();
- this.defaultConverter = new GenericJavaNullConverter(this);
- }
-
- protected JavaColumn createJavaColumn() {
- return getJpaFactory().buildJavaColumn(this, this);
- }
-
- @Override
- public void initialize(JavaResourcePersistentAttribute jrpa) {
- super.initialize(jrpa);
- this.column.initialize(this.getResourceColumn());
- this.specifiedConverter = this.buildSpecifiedConverter(this.specifiedConverterType(jrpa));
- }
-
- @Override
- protected void initialize(BasicAnnotation basicResource) {
- this.specifiedFetch = this.specifiedFetchType(basicResource);
- this.specifiedOptional = this.specifiedOptional(basicResource);
- }
-
- public ColumnAnnotation getResourceColumn() {
- return (ColumnAnnotation) getResourcePersistentAttribute().getNonNullSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME);
- }
-
- //************** AttributeMapping implementation ***************
- public String getKey() {
- return MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY;
- }
-
- //************** JavaAttributeMapping implementation ***************
- public String getAnnotationName() {
- return BasicAnnotation.ANNOTATION_NAME;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return new ArrayIterator<String>(
- JPA.COLUMN,
- JPA.LOB,
- JPA.TEMPORAL,
- JPA.ENUMERATED);
- }
-
- public String getDefaultColumnName() {
- return getAttributeName();
- }
-
- public String getDefaultTableName() {
- return getTypeMapping().getPrimaryTableName();
- }
-
- //************** BasicMapping implementation ***************
-
- public JavaColumn getColumn() {
- return this.column;
- }
-
- 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.getResourceMapping().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 getOptional() {
- return (this.getSpecifiedOptional() == null) ? this.getDefaultOptional() : this.getSpecifiedOptional();
- }
-
- public Boolean getDefaultOptional() {
- return Nullable.DEFAULT_OPTIONAL;
- }
-
- public Boolean getSpecifiedOptional() {
- return this.specifiedOptional;
- }
-
- public void setSpecifiedOptional(Boolean newSpecifiedOptional) {
- Boolean oldOptional = this.specifiedOptional;
- this.specifiedOptional = newSpecifiedOptional;
- this.getResourceMapping().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 getSpecifiedConverter() == null ? getDefaultConverter() : getSpecifiedConverter();
- }
-
- public JavaConverter getDefaultConverter() {
- return this.defaultConverter;
- }
-
- public JavaConverter getSpecifiedConverter() {
- return this.specifiedConverter;
- }
-
- protected String getSpecifedConverterType() {
- if (this.specifiedConverter == null) {
- return Converter.NO_CONVERTER;
- }
- return this.specifiedConverter.getType();
- }
-
- public void setSpecifiedConverter(String converterType) {
- if (getSpecifedConverterType() == converterType) {
- return;
- }
- JavaConverter oldConverter = this.specifiedConverter;
- JavaConverter newConverter = buildSpecifiedConverter(converterType);
- this.specifiedConverter = null;
- if (oldConverter != null) {
- oldConverter.removeFromResourceModel();
- }
- this.specifiedConverter = newConverter;
- if (newConverter != null) {
- newConverter.addToResourceModel();
- }
- firePropertyChanged(SPECIFIED_CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- protected void setSpecifiedConverter(JavaConverter newConverter) {
- JavaConverter oldConverter = this.specifiedConverter;
- this.specifiedConverter = newConverter;
- firePropertyChanged(SPECIFIED_CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- @Override
- public void update(JavaResourcePersistentAttribute jrpa) {
- super.update(jrpa);
- this.column.update(this.getResourceColumn());
- if (specifiedConverterType(jrpa) == getSpecifedConverterType()) {
- getSpecifiedConverter().update(jrpa);
- }
- else {
- JavaConverter javaConverter = buildSpecifiedConverter(specifiedConverterType(jrpa));
- setSpecifiedConverter(javaConverter);
- }
- }
-
- @Override
- protected void update(BasicAnnotation basicResource) {
- this.setSpecifiedFetch_(this.specifiedFetchType(basicResource));
- this.setSpecifiedOptional_(this.specifiedOptional(basicResource));
- }
-
- protected FetchType specifiedFetchType(BasicAnnotation basic) {
- return FetchType.fromJavaResourceModel(basic.getFetch());
- }
-
- protected Boolean specifiedOptional(BasicAnnotation basic) {
- return basic.getOptional();
- }
-
- protected JavaConverter buildSpecifiedConverter(String converterType) {
- if (converterType == Converter.ENUMERATED_CONVERTER) {
- return getJpaFactory().buildJavaEnumeratedConverter(this, this.resourcePersistentAttribute);
- }
- else if (converterType == Converter.TEMPORAL_CONVERTER) {
- return getJpaFactory().buildJavaTemporalConverter(this, this.resourcePersistentAttribute);
- }
- else if (converterType == Converter.LOB_CONVERTER) {
- return getJpaFactory().buildJavaLobConverter(this, this.resourcePersistentAttribute);
- }
- return null;
- }
-
- protected String specifiedConverterType(JavaResourcePersistentAttribute jrpa) {
- if (jrpa.getSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME) != null) {
- return Converter.ENUMERATED_CONVERTER;
- }
- else if (jrpa.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME) != null) {
- return Converter.TEMPORAL_CONVERTER;
- }
- else if (jrpa.getSupportingAnnotation(LobAnnotation.ANNOTATION_NAME) != null) {
- return Converter.LOB_CONVERTER;
- }
-
- return null;
- }
-
- @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;
- }
- return null;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages ,astRoot);
- if (this.ownerIsEntity() && this.connectionProfileIsActive()) {
- this.validateColumn(messages, astRoot);
- }
- if (this.specifiedConverter != null) {
- this.specifiedConverter.validate(messages, astRoot);
- }
- }
-
- protected void validateColumn(List<IMessage> messages, CompilationUnit astRoot) {
- if (this.getTypeMapping().tableNameIsInvalid(this.column.getTable())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_TABLE,
- new String[] {this.column.getTable(), this.column.getName()},
- this.column,
- this.column.getTableTextRange(astRoot)
- )
- );
- return;
- }
-
- if ( ! this.column.isResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {this.column.getName()},
- this.column,
- this.column.getNameTextRange(astRoot)
- )
- );
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaColumn.java
deleted file mode 100644
index dca29f0fbe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaColumn.java
+++ /dev/null
@@ -1,154 +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.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericJavaColumn extends AbstractJavaBaseColumn<ColumnAnnotation> implements JavaColumn
-{
-
- protected Integer specifiedLength;
-
- protected Integer specifiedPrecision;
-
- protected Integer specifiedScale;
-
- public GenericJavaColumn(JavaJpaContextNode parent, JavaColumn.Owner owner) {
- super(parent, owner);
- }
-
- @Override
- public void initialize(ColumnAnnotation column) {
- super.initialize(column);
- this.specifiedLength = this.specifiedLength(column);
- this.specifiedPrecision = this.specifiedPrecision(column);
- this.specifiedScale = this.specifiedScale(column);
- }
-
- @Override
- public JavaColumn.Owner getOwner() {
- return (JavaColumn.Owner) super.getOwner();
- }
-
- @Override
- protected ColumnAnnotation getResourceColumn() {
- return this.getOwner().getResourceColumn();
- }
-
- public Integer getLength() {
- return (this.getSpecifiedLength() == null) ? getDefaultLength() : this.getSpecifiedLength();
- }
-
- public Integer 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);
- }
-
- public Integer getPrecision() {
- return (this.getSpecifiedPrecision() == null) ? getDefaultPrecision() : this.getSpecifiedPrecision();
- }
-
- public Integer 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);
- }
-
- public Integer getScale() {
- return (this.getSpecifiedScale() == null) ? getDefaultScale() : this.getSpecifiedScale();
- }
-
- public Integer 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);
- }
-
- @Override
- public boolean tableIsAllowed() {
- return true;
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = getResourceColumn().getTextRange(astRoot);
- return (textRange != null) ? textRange : this.getOwner().getValidationTextRange(astRoot);
- }
-
- @Override
- public void update(ColumnAnnotation column) {
- super.update(column);
- this.setSpecifiedLength_(this.specifiedLength(column));
- this.setSpecifiedPrecision_(this.specifiedPrecision(column));
- this.setSpecifiedScale_(this.specifiedScale(column));
- }
-
- protected Integer specifiedLength(ColumnAnnotation column) {
- return column.getLength();
- }
-
- protected Integer specifiedPrecision(ColumnAnnotation column) {
- return column.getPrecision();
- }
-
- protected Integer specifiedScale(ColumnAnnotation column) {
- return column.getScale();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaDiscriminatorColumn.java
deleted file mode 100644
index 306ff5a101..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaDiscriminatorColumn.java
+++ /dev/null
@@ -1,151 +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.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-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.context.java.JavaNamedColumn;
-import org.eclipse.jpt.core.resource.java.DiscriminatorColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericJavaDiscriminatorColumn extends AbstractJavaNamedColumn<DiscriminatorColumnAnnotation>
- implements JavaDiscriminatorColumn
-{
-
- protected DiscriminatorType specifiedDiscriminatorType;
-
- protected Integer specifiedLength;
-
- protected JavaResourcePersistentMember persistenceResource;
-
- public GenericJavaDiscriminatorColumn(JavaEntity parent, JavaNamedColumn.Owner owner) {
- super(parent, owner);
- }
-
- public void initialize(JavaResourcePersistentMember persistentResource) {
- this.persistenceResource = persistentResource;
- this.initialize(this.getResourceColumn());
- }
-
- @Override
- public void initialize(DiscriminatorColumnAnnotation column) {
- super.initialize(column);
- this.specifiedDiscriminatorType = this.discriminatorType(column);
- this.specifiedLength = this.length(column);
- }
-
- protected JavaEntity getJavaEntity() {
- return (JavaEntity) super.getParent();
- }
-
- @Override
- protected DiscriminatorColumnAnnotation getResourceColumn() {
- return (DiscriminatorColumnAnnotation) this.persistenceResource.getNonNullSupportingAnnotation(DiscriminatorColumnAnnotation.ANNOTATION_NAME);
- }
-
- public DiscriminatorType getDiscriminatorType() {
- return (this.getSpecifiedDiscriminatorType() == null) ? this.getDefaultDiscriminatorType() : this.getSpecifiedDiscriminatorType();
- }
-
- public DiscriminatorType getDefaultDiscriminatorType() {
- return DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE;
- }
-
- 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 Integer getLength() {
- return (this.getSpecifiedLength() == null) ? this.getDefaultLength() : this.getSpecifiedLength();
- }
-
- public Integer getDefaultLength() {
- return DiscriminatorColumn.DEFAULT_LENGTH;
- }
-
- 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);
- }
-
- @Override
- protected String getTableName() {
- return getJavaEntity().getPrimaryTableName();
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = getResourceColumn().getTextRange(astRoot);
- return (textRange != null) ? textRange : this.getOwner().getValidationTextRange(astRoot);
- }
-
-
- // ********** java annotations -> persistence model **********
-
- public void update(JavaResourcePersistentMember persistentResource) {
- this.persistenceResource = persistentResource;
- this.update(this.getResourceColumn());
- }
-
- @Override
- public void update(DiscriminatorColumnAnnotation discriminatorColumn) {
- super.update(discriminatorColumn);
- this.setSpecifiedDiscriminatorType_(this.discriminatorType(discriminatorColumn));
- this.setSpecifiedLength_(this.length(discriminatorColumn));
- }
-
- protected DiscriminatorType discriminatorType(DiscriminatorColumnAnnotation discriminatorColumn) {
- return DiscriminatorType.fromJavaResourceModel(discriminatorColumn.getDiscriminatorType());
- }
-
- protected Integer length(DiscriminatorColumnAnnotation discriminatorColumn) {
- return discriminatorColumn.getLength();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEmbeddable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEmbeddable.java
deleted file mode 100644
index 21d2bcab97..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEmbeddable.java
+++ /dev/null
@@ -1,46 +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.java;
-
-import java.util.Iterator;
-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.iterators.EmptyIterator;
-
-
-public class GenericJavaEmbeddable extends AbstractJavaTypeMapping implements JavaEmbeddable
-{
- public GenericJavaEmbeddable(JavaPersistentType parent) {
- super(parent);
- }
-
- public String getKey() {
- return MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return EmbeddableAnnotation.ANNOTATION_NAME;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return EmptyIterator.instance();
- }
-
- public boolean isMapped() {
- return true;
- }
-
- @Override
- public boolean attributeMappingKeyAllowed(String attributeMappingKey) {
- return attributeMappingKey == MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY || attributeMappingKey == MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEmbeddedIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEmbeddedIdMapping.java
deleted file mode 100644
index 4ae4b5648f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEmbeddedIdMapping.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.EmbeddedIdAnnotation;
-
-
-public class GenericJavaEmbeddedIdMapping extends AbstractJavaBaseEmbeddedMapping<EmbeddedIdAnnotation>
- implements JavaEmbeddedIdMapping
-{
-
- public GenericJavaEmbeddedIdMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- //****************** IJavaAttributeMapping implemenation *******************
-
- public String getKey() {
- return MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return EmbeddedIdAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- public boolean isIdMapping() {
- return true;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEmbeddedMapping.java
deleted file mode 100644
index b0fe9c987b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEmbeddedMapping.java
+++ /dev/null
@@ -1,33 +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.java;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.EmbeddedAnnotation;
-
-
-public class GenericJavaEmbeddedMapping extends AbstractJavaBaseEmbeddedMapping<EmbeddedAnnotation> implements JavaEmbeddedMapping
-{
- public GenericJavaEmbeddedMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- //****************** IJavaAttributeMapping implemenation *******************
-
- public String getKey() {
- return MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return EmbeddedAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEntity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEntity.java
deleted file mode 100644
index 87aaec3957..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEntity.java
+++ /dev/null
@@ -1,2028 +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.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.context.AssociationOverride;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.ColumnMapping;
-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.Generator;
-import org.eclipse.jpt.core.context.IdClass;
-import org.eclipse.jpt.core.context.InheritanceType;
-import org.eclipse.jpt.core.context.NamedNativeQuery;
-import org.eclipse.jpt.core.context.NamedQuery;
-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.Query;
-import org.eclipse.jpt.core.context.QueryHolder;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-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.JavaBaseJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaDiscriminatorColumn;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaGenerator;
-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.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaQuery;
-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.internal.resource.java.NullAssociationOverride;
-import org.eclipse.jpt.core.internal.resource.java.NullPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-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.DiscriminatorValueAnnotation;
-import org.eclipse.jpt.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.core.resource.java.IdClassAnnotation;
-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.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.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.resource.java.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.core.resource.java.TableGeneratorAnnotation;
-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.iterators.ArrayIterator;
-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.SingleElementListIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericJavaEntity
- extends AbstractJavaTypeMapping
- implements JavaEntity
-{
- protected EntityAnnotation entityResource;
-
- protected String specifiedName;
-
- protected String defaultName;
-
- protected final JavaTable table;
-
- protected final List<JavaSecondaryTable> specifiedSecondaryTables;
-
- protected final List<JavaPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns;
-
- protected JavaPrimaryKeyJoinColumn defaultPrimaryKeyJoinColumn;
-
- protected InheritanceType specifiedInheritanceStrategy;
-
- protected InheritanceType defaultInheritanceStrategy;
-
- protected String defaultDiscriminatorValue;
-
- protected boolean discriminatorValueAllowed;
-
- protected String specifiedDiscriminatorValue;
-
- protected final JavaDiscriminatorColumn discriminatorColumn;
-
- protected JavaSequenceGenerator sequenceGenerator;
-
- protected JavaTableGenerator tableGenerator;
-
- protected final List<JavaAttributeOverride> specifiedAttributeOverrides;
-
- protected final List<JavaAttributeOverride> virtualAttributeOverrides;
-
- protected final List<JavaAssociationOverride> specifiedAssociationOverrides;
-
- protected final List<JavaAssociationOverride> virtualAssociationOverrides;
-
- protected final List<JavaNamedQuery> namedQueries;
-
- protected final List<JavaNamedNativeQuery> namedNativeQueries;
-
- protected String idClass;
-
-
- public GenericJavaEntity(JavaPersistentType parent) {
- super(parent);
- this.table = getJpaFactory().buildJavaTable(this);
- this.discriminatorColumn = buildJavaDiscriminatorColumn();
- this.specifiedSecondaryTables = new ArrayList<JavaSecondaryTable>();
- this.specifiedPrimaryKeyJoinColumns = new ArrayList<JavaPrimaryKeyJoinColumn>();
- this.specifiedAttributeOverrides = new ArrayList<JavaAttributeOverride>();
- this.virtualAttributeOverrides = new ArrayList<JavaAttributeOverride>();
- this.namedQueries = new ArrayList<JavaNamedQuery>();
- this.namedNativeQueries = new ArrayList<JavaNamedNativeQuery>();
- this.specifiedAssociationOverrides = new ArrayList<JavaAssociationOverride>();
- this.virtualAssociationOverrides = new ArrayList<JavaAssociationOverride>();
- }
-
- protected JavaBaseJoinColumn.Owner createPrimaryKeyJoinColumnOwner() {
- return new PrimaryKeyJoinColumnOwner();
- }
-
- protected JavaDiscriminatorColumn buildJavaDiscriminatorColumn() {
- return getJpaFactory().buildJavaDiscriminatorColumn(this, buildDiscriminatorColumnOwner());
- }
-
- protected JavaNamedColumn.Owner buildDiscriminatorColumnOwner() {
- return new JavaNamedColumn.Owner(){
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- return GenericJavaEntity.this.getDbTable(tableName);
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return GenericJavaEntity.this.getValidationTextRange(astRoot);
- }
-
- public TypeMapping getTypeMapping() {
- return GenericJavaEntity.this;
- }
-
- public String getDefaultColumnName() {
- return DiscriminatorColumn.DEFAULT_NAME;
- }
- };
- }
-
- @Override
- public void initialize(JavaResourcePersistentType resourcePersistentType) {
- super.initialize(resourcePersistentType);
- this.entityResource = (EntityAnnotation) resourcePersistentType.getMappingAnnotation(EntityAnnotation.ANNOTATION_NAME);
-
- this.specifiedName = this.specifiedName(this.entityResource);
- this.defaultName = this.buildDefaultName(resourcePersistentType);
- this.defaultInheritanceStrategy = this.defaultInheritanceStrategy();
- this.specifiedInheritanceStrategy = this.specifiedInheritanceStrategy(getResourceInheritance());
- this.specifiedDiscriminatorValue = this.getResourceDiscriminatorValue().getValue();
- this.defaultDiscriminatorValue = this.javaDefaultDiscriminatorValue();
- this.discriminatorValueAllowed = this.discriminatorValueIsAllowed(resourcePersistentType);
- this.discriminatorColumn.initialize(resourcePersistentType);
- this.table.initialize(resourcePersistentType);
- this.initializeSecondaryTables(resourcePersistentType);
- this.initializeTableGenerator(resourcePersistentType);
- this.initializeSequenceGenerator(resourcePersistentType);
- this.initializePrimaryKeyJoinColumns(resourcePersistentType);
- this.initializeDefaultPrimaryKeyJoinColumn(resourcePersistentType);
- this.initializeSpecifiedAttributeOverrides(resourcePersistentType);
- this.initializeVirtualAttributeOverrides(resourcePersistentType);
- this.initializeSpecifiedAssociationOverrides(resourcePersistentType);
- this.initializeDefaultAssociationOverrides(resourcePersistentType);
- this.initializeNamedQueries(resourcePersistentType);
- this.initializeNamedNativeQueries(resourcePersistentType);
- this.initializeIdClass(resourcePersistentType);
- }
-
- protected void initializeSecondaryTables(JavaResourcePersistentType resourcePersistentType) {
- for (ListIterator<NestableAnnotation> stream = resourcePersistentType.supportingAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME); stream.hasNext(); ) {
- this.specifiedSecondaryTables.add(buildSecondaryTable((SecondaryTableAnnotation) stream.next()));
- }
- }
-
- protected void initializeTableGenerator(JavaResourcePersistentType resourcePersistentType) {
- TableGeneratorAnnotation tableGeneratorResource = tableGenerator(resourcePersistentType);
- if (tableGeneratorResource != null) {
- this.tableGenerator = buildTableGenerator(tableGeneratorResource);
- }
- }
-
- protected void initializeSequenceGenerator(JavaResourcePersistentType resourcePersistentType) {
- SequenceGeneratorAnnotation sequenceGeneratorResource = sequenceGenerator(resourcePersistentType);
- if (sequenceGeneratorResource != null) {
- this.sequenceGenerator = buildSequenceGenerator(sequenceGeneratorResource);
- }
- }
-
- protected void initializePrimaryKeyJoinColumns(JavaResourcePersistentType resourcePersistentType) {
- for (ListIterator<NestableAnnotation> stream = resourcePersistentType.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME); stream.hasNext(); ) {
- this.specifiedPrimaryKeyJoinColumns.add(buildPrimaryKeyJoinColumn((PrimaryKeyJoinColumnAnnotation) stream.next()));
- }
- }
-
- protected boolean shouldBuildDefaultPrimaryKeyJoinColumn() {
- return !containsSpecifiedPrimaryKeyJoinColumns();
- }
-
- protected void initializeDefaultPrimaryKeyJoinColumn(JavaResourcePersistentType persistentTypeResource) {
- if (!shouldBuildDefaultPrimaryKeyJoinColumn()) {
- return;
- }
- this.defaultPrimaryKeyJoinColumn = buildPrimaryKeyJoinColumn(new NullPrimaryKeyJoinColumn(persistentTypeResource));
- }
-
- protected void initializeSpecifiedAttributeOverrides(JavaResourcePersistentType persistentTypeResource) {
- for (ListIterator<NestableAnnotation> stream = persistentTypeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME); stream.hasNext(); ) {
- this.specifiedAttributeOverrides.add(buildAttributeOverride((AttributeOverrideAnnotation) stream.next()));
- }
- }
-
- protected void initializeVirtualAttributeOverrides(JavaResourcePersistentType persistentTypeResource) {
- for (PersistentAttribute persistentAttribute : CollectionTools.iterable(allOverridableAttributes())) {
- JavaAttributeOverride attributeOverride = getAttributeOverrideNamed(persistentAttribute.getName());
- if (attributeOverride == null) {
- this.virtualAttributeOverrides.add(buildVirtualAttributeOverride(persistentTypeResource, persistentAttribute));
- }
- }
- }
-
- protected void initializeSpecifiedAssociationOverrides(JavaResourcePersistentType resourcePersistentType) {
- for (ListIterator<NestableAnnotation> stream = resourcePersistentType.supportingAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME); stream.hasNext(); ) {
- this.specifiedAssociationOverrides.add(buildAssociationOverride((AssociationOverrideAnnotation) stream.next()));
- }
- }
-
- protected void initializeDefaultAssociationOverrides(JavaResourcePersistentType resourcePersistentType) {
- for (Iterator<String> i = allOverridableAssociationNames(); i.hasNext(); ) {
- String associationName = i.next();
- JavaAssociationOverride associationOverride = getAssociationOverrideNamed(associationName);
- if (associationOverride == null) {
- this.virtualAssociationOverrides.add(buildAssociationOverride(new NullAssociationOverride(resourcePersistentType, associationName)));
- }
- }
- }
-
- protected void initializeNamedQueries(JavaResourcePersistentType resourcePersistentType) {
- for (ListIterator<NestableAnnotation> stream = resourcePersistentType.supportingAnnotations(NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME); stream.hasNext(); ) {
- this.namedQueries.add(buildNamedQuery((NamedQueryAnnotation) stream.next()));
- }
- }
-
- protected void initializeNamedNativeQueries(JavaResourcePersistentType resourcePersistentType) {
- for (ListIterator<NestableAnnotation> stream = resourcePersistentType.supportingAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME); stream.hasNext(); ) {
- this.namedNativeQueries.add(buildNamedNativeQuery((NamedNativeQueryAnnotation) stream.next()));
- }
- }
-
- //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.getNonNullSupportingAnnotation(InheritanceAnnotation.ANNOTATION_NAME);
- }
-
- protected DiscriminatorValueAnnotation getResourceDiscriminatorValue() {
- return (DiscriminatorValueAnnotation) this.javaResourcePersistentType.getNonNullSupportingAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME);
- }
-
- protected void initializeIdClass(JavaResourcePersistentType jrpt) {
- IdClassAnnotation resourceIdClass = (IdClassAnnotation) jrpt.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- if (resourceIdClass != null) {
- this.idClass = resourceIdClass.getValue();
- }
- }
-
- //****************** ITypeMapping implemenation *******************
-
- public String getKey() {
- return MappingKeys.ENTITY_TYPE_MAPPING_KEY;
- }
-
- public boolean isMapped() {
- return true;
- }
-
- @Override
- public String getPrimaryTableName() {
- return this.getTable().getName();
- }
-
- @Override
- public org.eclipse.jpt.db.Table getPrimaryDbTable() {
- return getTable().getDbTable();
- }
-
- private static final org.eclipse.jpt.db.Table[] EMPTY_DB_TABLE_ARRAY = new org.eclipse.jpt.db.Table[0];
-
- @Override
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- // the JPA platform searches database objects for us
- return this.getDataSource().selectDatabaseObjectForIdentifier(
- CollectionTools.array(this.associatedDbTablesIncludingInherited(), EMPTY_DB_TABLE_ARRAY),
- tableName
- );
- }
-
- protected Iterator<org.eclipse.jpt.db.Table> associatedDbTablesIncludingInherited() {
- return new FilteringIterator<org.eclipse.jpt.db.Table, org.eclipse.jpt.db.Table>(this.associatedDbTablesIncludingInherited_()) {
- @Override
- protected boolean accept(org.eclipse.jpt.db.Table t) {
- return t != null;
- }
- };
- }
-
- protected Iterator<org.eclipse.jpt.db.Table> associatedDbTablesIncludingInherited_() {
- return new TransformationIterator<Table, org.eclipse.jpt.db.Table>(this.associatedTablesIncludingInherited()) {
- @Override
- protected org.eclipse.jpt.db.Table transform(Table t) {
- return t.getDbTable();
- }
- };
- }
-
- @Override
- public Schema getDbSchema() {
- return getTable().getDbSchema();
- }
-
-
- //****************** IJavaTypeMapping implemenation *******************
-
- public String getAnnotationName() {
- return EntityAnnotation.ANNOTATION_NAME;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return new ArrayIterator<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);
- }
-
- //****************** IEntity implemenation *******************
-
- 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.entityResource.setName(newSpecifiedName);
- firePropertyChanged(Entity.SPECIFIED_NAME_PROPERTY, oldSpecifiedName, newSpecifiedName);
- }
-
- protected void setSpecifiedName_(String newSpecifiedName) {
- String oldSpecifiedName = this.specifiedName;
- this.specifiedName = newSpecifiedName;
- firePropertyChanged(Entity.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(Entity.DEFAULT_NAME_PROPERTY, oldDefaultName, newDefaultName);
- }
-
- 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.addSupportingAnnotation(index, SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME);
- secondaryTable.initialize(secondaryTableResource);
- fireItemAdded(Entity.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, Entity.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.removeSupportingAnnotation(index, SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME);
- fireItemRemoved(Entity.SPECIFIED_SECONDARY_TABLES_LIST, index, removedSecondaryTable);
- }
-
- protected void removeSpecifiedSecondaryTable_(JavaSecondaryTable secondaryTable) {
- removeItemFromList(secondaryTable, this.specifiedSecondaryTables, Entity.SPECIFIED_SECONDARY_TABLES_LIST);
- }
-
- public void moveSpecifiedSecondaryTable(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedSecondaryTables, targetIndex, sourceIndex);
- this.javaResourcePersistentType.moveSupportingAnnotation(targetIndex, sourceIndex, SecondaryTablesAnnotation.ANNOTATION_NAME);
- fireItemMoved(Entity.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 isDiscriminatorValueAllowed() {
- return this.discriminatorValueAllowed;
- }
-
- protected void setDiscriminatorValueAllowed(boolean newDiscriminatorValueAllowed) {
- boolean oldDiscriminatorValueAllowed = this.discriminatorValueAllowed;
- this.discriminatorValueAllowed = newDiscriminatorValueAllowed;
- firePropertyChanged(Entity.DISCRIMINATOR_VALUE_ALLOWED_PROPERTY, oldDiscriminatorValueAllowed, newDiscriminatorValueAllowed);
- }
-
- public JavaTableGenerator addTableGenerator() {
- if (getTableGenerator() != null) {
- throw new IllegalStateException("tableGenerator already exists"); //$NON-NLS-1$
- }
- this.tableGenerator = getJpaFactory().buildJavaTableGenerator(this);
- TableGeneratorAnnotation tableGeneratorResource = (TableGeneratorAnnotation) this.javaResourcePersistentType.addSupportingAnnotation(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.javaResourcePersistentType.removeSupportingAnnotation(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.javaResourcePersistentType.addSupportingAnnotation(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.javaResourcePersistentType.removeSupportingAnnotation(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);
- }
-
- 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 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(Entity.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, createPrimaryKeyJoinColumnOwner());
- this.specifiedPrimaryKeyJoinColumns.add(index, primaryKeyJoinColumn);
- PrimaryKeyJoinColumnAnnotation pkJoinColumnResource = (PrimaryKeyJoinColumnAnnotation) this.javaResourcePersistentType.addSupportingAnnotation(index, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- primaryKeyJoinColumn.initialize(pkJoinColumnResource);
- this.fireItemAdded(Entity.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, index, primaryKeyJoinColumn);
- if (oldDefaultPkJoinColumn != null) {
- this.firePropertyChanged(Entity.DEFAULT_PRIMARY_KEY_JOIN_COLUMN, oldDefaultPkJoinColumn, null);
- }
- return primaryKeyJoinColumn;
- }
-
- protected void addSpecifiedPrimaryKeyJoinColumn(int index, JavaPrimaryKeyJoinColumn primaryKeyJoinColumn) {
- addItemToList(index, primaryKeyJoinColumn, this.specifiedPrimaryKeyJoinColumns, Entity.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 NullPrimaryKeyJoinColumn(this.javaResourcePersistentType));
- }
- this.javaResourcePersistentType.removeSupportingAnnotation(index, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- fireItemRemoved(Entity.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, Entity.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedPrimaryKeyJoinColumn(int targetIndex, int sourceIndex) {
- this.javaResourcePersistentType.moveSupportingAnnotation(targetIndex, sourceIndex, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- moveItemInList(targetIndex, sourceIndex, this.specifiedPrimaryKeyJoinColumns, Entity.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- @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.javaResourcePersistentType.addSupportingAnnotation(index, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- attributeOverride.initialize(attributeOverrideResource);
- this.fireItemAdded(Entity.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 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 udpate. This causes the UI to be flaky, since change notification might not occur in the correct order
- JavaAttributeOverride virtualAttributeOverride = null;
- if (attributeOverrideName != null) {
- for (PersistentAttribute persistentAttribute : CollectionTools.iterable(allOverridableAttributes())) {
- if (persistentAttribute.getName().equals(attributeOverrideName)) {
- //store the virtualAttributeOverride so we can fire change notification later
- virtualAttributeOverride = buildVirtualAttributeOverride(this.javaResourcePersistentType, persistentAttribute);
- this.virtualAttributeOverrides.add(virtualAttributeOverride);
- break;
- }
- }
- }
-
- this.javaResourcePersistentType.removeSupportingAnnotation(index, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- fireItemRemoved(Entity.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, attributeOverride);
-
- if (virtualAttributeOverride != null) {
- fireItemAdded(Entity.VIRTUAL_ATTRIBUTE_OVERRIDES_LIST, virtualAttributeOverridesSize() - 1, virtualAttributeOverride);
- }
- return virtualAttributeOverride;
- }
-
- protected JavaAttributeOverride setAttributeOverrideSpecified(JavaAttributeOverride oldAttributeOverride) {
- int index = specifiedAttributeOverridesSize();
- JavaAttributeOverride newAttributeOverride = getJpaFactory().buildJavaAttributeOverride(this, createAttributeOverrideOwner());
- this.specifiedAttributeOverrides.add(index, newAttributeOverride);
-
- AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) this.javaResourcePersistentType.addSupportingAnnotation(index, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- newAttributeOverride.initialize(attributeOverrideResource);
-
- int defaultIndex = this.virtualAttributeOverrides.indexOf(oldAttributeOverride);
- this.virtualAttributeOverrides.remove(defaultIndex);
-
- newAttributeOverride.setName(oldAttributeOverride.getName());
- newAttributeOverride.getColumn().setSpecifiedName(oldAttributeOverride.getColumn().getName());
-
- this.fireItemRemoved(Entity.VIRTUAL_ATTRIBUTE_OVERRIDES_LIST, defaultIndex, oldAttributeOverride);
- this.fireItemAdded(Entity.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, newAttributeOverride);
-
- return newAttributeOverride;
- }
-
- protected AttributeOverride.Owner createAttributeOverrideOwner() {
- return new AttributeOverrideOwner();
- }
-
- protected void addSpecifiedAttributeOverride(int index, JavaAttributeOverride attributeOverride) {
- addItemToList(index, attributeOverride, this.specifiedAttributeOverrides, Entity.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- protected void addSpecifiedAttributeOverride(JavaAttributeOverride attributeOverride) {
- this.addSpecifiedAttributeOverride(this.specifiedAttributeOverrides.size(), attributeOverride);
- }
-
- protected void removeSpecifiedAttributeOverride_(JavaAttributeOverride attributeOverride) {
- removeItemFromList(attributeOverride, this.specifiedAttributeOverrides, Entity.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public void moveSpecifiedAttributeOverride(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedAttributeOverrides, targetIndex, sourceIndex);
- this.javaResourcePersistentType.moveSupportingAnnotation(targetIndex, sourceIndex, AttributeOverridesAnnotation.ANNOTATION_NAME);
- fireItemMoved(Entity.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, targetIndex, sourceIndex);
- }
-
- protected void addVirtualAttributeOverride(JavaAttributeOverride attributeOverride) {
- addItemToList(attributeOverride, this.virtualAttributeOverrides, Entity.VIRTUAL_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- protected void removeVirtualAttributeOverride(JavaAttributeOverride attributeOverride) {
- removeItemFromList(attributeOverride, this.virtualAttributeOverrides, Entity.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());
- }
-
- 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;
- }
-
-
- @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.javaResourcePersistentType.addSupportingAnnotation(index, AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME);
- associationOverride.initialize(associationOverrideResource);
- this.fireItemAdded(Entity.SPECIFIED_ASSOCIATION_OVERRIDES_LIST, index, associationOverride);
- return associationOverride;
- }
-
- protected AssociationOverride.Owner createAssociationOverrideOwner() {
- return new AssociationOverrideOwner();
- }
-
- protected void addSpecifiedAssociationOverride(int index, JavaAssociationOverride associationOverride) {
- addItemToList(index, associationOverride, this.specifiedAssociationOverrides, Entity.SPECIFIED_ASSOCIATION_OVERRIDES_LIST);
- }
-
- protected void addSpecifiedAssociationOverride(JavaAssociationOverride associationOverride) {
- this.addSpecifiedAssociationOverride(this.specifiedAssociationOverrides.size(), associationOverride);
- }
-
- protected void removeSpecifiedAssociationOverride_(JavaAssociationOverride associationOverride) {
- removeItemFromList(associationOverride, this.specifiedAssociationOverrides, Entity.SPECIFIED_ASSOCIATION_OVERRIDES_LIST);
- }
-
- public void moveSpecifiedAssociationOverride(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedAssociationOverrides, targetIndex, sourceIndex);
- this.javaResourcePersistentType.moveSupportingAnnotation(targetIndex, sourceIndex, AssociationOverridesAnnotation.ANNOTATION_NAME);
- fireItemMoved(Entity.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 udpate. This causes the UI to be flaky, since change notification might not occur in the correct order
- JavaAssociationOverride virtualAssociationOverride = null;
- if (associationOverrideName != null) {
- for (PersistentAttribute persistentAttribute : CollectionTools.iterable(allOverridableAssociations())) {
- if (persistentAttribute.getName().equals(associationOverrideName)) {
- //store the virtualAssociationOverride so we can fire change notification later
- virtualAssociationOverride = buildAssociationOverride(new NullAssociationOverride(this.javaResourcePersistentType, associationOverrideName));
- this.virtualAssociationOverrides.add(virtualAssociationOverride);
- break;
- }
- }
- }
-
- this.javaResourcePersistentType.removeSupportingAnnotation(index, AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME);
- fireItemRemoved(Entity.SPECIFIED_ASSOCIATION_OVERRIDES_LIST, index, associationOverride);
-
- if (virtualAssociationOverride != null) {
- fireItemAdded(Entity.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.javaResourcePersistentType.addSupportingAnnotation(index, AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME);
- newAssociationOverride.initialize(attributeOverrideResource);
-
- int virtualIndex = this.virtualAssociationOverrides.indexOf(oldAssociationOverride);
- this.virtualAssociationOverrides.remove(virtualIndex);
-
- newAssociationOverride.setName(oldAssociationOverride.getName());
-
- this.fireItemRemoved(Entity.VIRTUAL_ASSOCIATION_OVERRIDES_LIST, virtualIndex, oldAssociationOverride);
- this.fireItemAdded(Entity.SPECIFIED_ASSOCIATION_OVERRIDES_LIST, index, newAssociationOverride);
-
- return newAssociationOverride;
- }
-
- protected void addVirtualAssociationOverride(JavaAssociationOverride associationOverride) {
- addItemToList(associationOverride, this.virtualAssociationOverrides, Entity.VIRTUAL_ASSOCIATION_OVERRIDES_LIST);
- }
-
- protected void removeVirtualAssociationOverride(JavaAssociationOverride associationOverride) {
- removeItemFromList(associationOverride, this.virtualAssociationOverrides, Entity.VIRTUAL_ASSOCIATION_OVERRIDES_LIST);
- }
-
- 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.javaResourcePersistentType.addSupportingAnnotation(index, NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME);
- namedQuery.initialize(namedQueryAnnotation);
- fireItemAdded(QueryHolder.NAMED_QUERIES_LIST, index, namedQuery);
- return namedQuery;
- }
-
- protected void addNamedQuery(int index, JavaNamedQuery namedQuery) {
- addItemToList(index, namedQuery, this.namedQueries, QueryHolder.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.javaResourcePersistentType.removeSupportingAnnotation(index, NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME);
- fireItemRemoved(QueryHolder.NAMED_QUERIES_LIST, index, removedNamedQuery);
- }
-
- protected void removeNamedQuery_(JavaNamedQuery namedQuery) {
- removeItemFromList(namedQuery, this.namedQueries, QueryHolder.NAMED_QUERIES_LIST);
- }
-
- public void moveNamedQuery(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.namedQueries, targetIndex, sourceIndex);
- this.javaResourcePersistentType.moveSupportingAnnotation(targetIndex, sourceIndex, NamedQueriesAnnotation.ANNOTATION_NAME);
- fireItemMoved(QueryHolder.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.javaResourcePersistentType.addSupportingAnnotation(index, NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME);
- namedNativeQuery.initialize(namedNativeQueryAnnotation);
- fireItemAdded(QueryHolder.NAMED_NATIVE_QUERIES_LIST, index, namedNativeQuery);
- return namedNativeQuery;
- }
-
- protected void addNamedNativeQuery(int index, JavaNamedNativeQuery namedNativeQuery) {
- addItemToList(index, namedNativeQuery, this.namedNativeQueries, QueryHolder.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.javaResourcePersistentType.removeSupportingAnnotation(index, NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME);
- fireItemRemoved(QueryHolder.NAMED_NATIVE_QUERIES_LIST, index, removedNamedNativeQuery);
- }
-
- protected void removeNamedNativeQuery_(JavaNamedNativeQuery namedNativeQuery) {
- removeItemFromList(namedNativeQuery, this.namedNativeQueries, QueryHolder.NAMED_NATIVE_QUERIES_LIST);
- }
-
- public void moveNamedNativeQuery(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.namedNativeQueries, targetIndex, sourceIndex);
- this.javaResourcePersistentType.moveSupportingAnnotation(targetIndex, sourceIndex, NamedNativeQueriesAnnotation.ANNOTATION_NAME);
- fireItemMoved(QueryHolder.NAMED_NATIVE_QUERIES_LIST, targetIndex, sourceIndex);
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<JavaQuery> queries() {
- return new CompositeIterator<JavaQuery>(this.namedNativeQueries(), this.namedQueries());
- }
-
- public String getIdClass() {
- return this.idClass;
- }
-
- public void setIdClass(String newIdClass) {
- String oldIdClass = this.idClass;
- this.idClass = newIdClass;
- if (newIdClass != oldIdClass) {
- if (newIdClass != null) {
- if (getResourceIdClass() == null) {
- addResourceIdClass();
- }
- getResourceIdClass().setValue(newIdClass);
- }
- else {
- removeResourceIdClass();
- }
- }
- firePropertyChanged(IdClass.ID_CLASS_PROPERTY, oldIdClass, newIdClass);
- }
-
- protected void setIdClass_(String newIdClass) {
- String oldIdClass = this.idClass;
- this.idClass = newIdClass;
- firePropertyChanged(IdClass.ID_CLASS_PROPERTY, oldIdClass, newIdClass);
- }
-
- protected IdClassAnnotation getResourceIdClass() {
- return (IdClassAnnotation) this.javaResourcePersistentType.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- }
-
- protected void addResourceIdClass() {
- this.javaResourcePersistentType.addSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- }
-
- protected void removeResourceIdClass() {
- this.javaResourcePersistentType.removeSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- }
-
- public Entity getParentEntity() {
- for (Iterator<PersistentType> stream = getPersistentType().ancestors(); stream.hasNext();) {
- TypeMapping typeMapping = stream.next().getMapping();
- if (typeMapping instanceof Entity) {
- return (Entity) typeMapping;
- }
- }
- return this;
- }
-
- public Entity getRootEntity() {
- Entity rootEntity = this;
- for (Iterator<PersistentType> stream = getPersistentType().inheritanceHierarchy(); stream.hasNext();) {
- PersistentType persistentType = stream.next();
- if (persistentType.getMapping() instanceof Entity) {
- rootEntity = (Entity) persistentType.getMapping();
- }
- }
- return rootEntity;
- }
-
- /**
- * 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.
- */
- public String getDefaultTableName() {
- return this.isSingleTableDescendant() ?
- this.getRootEntity().getTable().getName()
- :
- this.getName();
- }
-
- public String getDefaultSchema() {
- return this.isSingleTableDescendant() ?
- this.getRootEntity().getTable().getSchema()
- :
- this.getContextDefaultSchema();
- }
-
- public String getDefaultCatalog() {
- return this.isSingleTableDescendant() ?
- this.getRootEntity().getTable().getCatalog()
- :
- 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 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.
- */
- protected boolean isRoot() {
- return this == this.getRootEntity();
- }
-
- public String getPrimaryKeyColumnName() {
- return getPrimaryKeyColumnName(getPersistentType().allAttributes());
- }
-
- //copied in GenericOrmEntity to avoid an API change for fixing bug 229423 in RC1
- public String getPrimaryKeyColumnName(Iterator<PersistentAttribute> attributes) {
- String pkColumnName = null;
- for (Iterator<PersistentAttribute> stream = attributes; stream.hasNext();) {
- PersistentAttribute attribute = stream.next();
- String name = attribute.getPrimaryKeyColumnName();
- if (name != null) {
- //if the attribute is a primary key then we need to check if there is an attribute override
- //and use its column name instead (bug 229423)
- AttributeOverride attributeOverride = getAttributeOverrideNamed(attribute.getName());
- if (attributeOverride != null) {
- name = attributeOverride.getColumn().getName();
- }
- }
- 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;
- }
-
- @Override
- public boolean tableNameIsInvalid(String tableName) {
- return ! CollectionTools.contains(this.associatedTableNamesIncludingInherited(), tableName);
- }
-
- @Override
- public Iterator<Table> associatedTables() {
- return new CompositeIterator<Table>(this.getTable(), this.secondaryTables());
- }
-
- @Override
- public Iterator<Table> associatedTablesIncludingInherited() {
- return new CompositeIterator<Table>(new TransformationIterator<TypeMapping, Iterator<Table>>(this.inheritanceHierarchy()) {
- @Override
- protected Iterator<Table> transform(TypeMapping mapping) {
- return new FilteringIterator<Table, Table>(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, 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> inheritanceHierarchy() {
- return new TransformationIterator<PersistentType, TypeMapping>(getPersistentType().inheritanceHierarchy()) {
- @Override
- protected TypeMapping transform(PersistentType type) {
- return type.getMapping();
- }
- };
- }
-
- @Override
- 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();
- }
- });
- }
-
-
- @Override
- public Iterator<PersistentAttribute> allOverridableAttributes() {
- return new CompositeIterator<PersistentAttribute>(new TransformationIterator<TypeMapping, Iterator<PersistentAttribute>>(this.inheritanceHierarchy()) {
- @Override
- protected Iterator<PersistentAttribute> transform(TypeMapping mapping) {
- return mapping.overridableAttributes();
- }
- });
- }
-
- @Override
- public Iterator<PersistentAttribute> allOverridableAssociations() {
- return new CompositeIterator<PersistentAttribute>(new TransformationIterator<TypeMapping, Iterator<PersistentAttribute>>(this.inheritanceHierarchy()) {
- @Override
- protected Iterator<PersistentAttribute> transform(TypeMapping mapping) {
- return mapping.overridableAssociations();
- }
- });
- }
-
- @Override
- 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();
- }
- });
- }
-
- @Override
- public void update(JavaResourcePersistentType resourcePersistentType) {
- super.update(resourcePersistentType);
- this.entityResource = (EntityAnnotation) resourcePersistentType.getMappingAnnotation(EntityAnnotation.ANNOTATION_NAME);
-
- this.setSpecifiedName_(this.specifiedName(this.entityResource));
- this.setDefaultName(this.buildDefaultName(resourcePersistentType));
-
- this.updateInheritance(getResourceInheritance());
- this.updateDiscriminatorColumn(resourcePersistentType);
- this.updateDiscriminatorValue(getResourceDiscriminatorValue());
- this.setDiscriminatorValueAllowed(discriminatorValueIsAllowed(resourcePersistentType));
- this.updateTable(resourcePersistentType);
- this.updateSecondaryTables(resourcePersistentType);
- this.updateTableGenerator(resourcePersistentType);
- this.updateSequenceGenerator(resourcePersistentType);
- this.updateSpecifiedPrimaryKeyJoinColumns(resourcePersistentType);
- this.updateDefaultPrimaryKeyJoinColumn(resourcePersistentType);
- this.updateSpecifiedAttributeOverrides(resourcePersistentType);
- this.updateVirtualAttributeOverrides(resourcePersistentType);
- this.updateSpecifiedAssociationOverrides(resourcePersistentType);
- this.updateVirtualAssociationOverrides(resourcePersistentType);
- this.updateNamedQueries(resourcePersistentType);
- this.updateNamedNativeQueries(resourcePersistentType);
- this.updateIdClass(resourcePersistentType);
- }
-
- protected String specifiedName(EntityAnnotation entityAnnotation) {
- return entityAnnotation.getName();
- }
-
- protected String buildDefaultName(JavaResourcePersistentType persistentTypeResource) {
- return persistentTypeResource.getName();
- }
-
- protected void updateTable(JavaResourcePersistentType persistentTypeResource) {
- getTable().update(persistentTypeResource);
- }
-
- protected void updateInheritance(InheritanceAnnotation inheritanceResource) {
- this.setSpecifiedInheritanceStrategy_(this.specifiedInheritanceStrategy(inheritanceResource));
- this.setDefaultInheritanceStrategy(this.defaultInheritanceStrategy());
- }
-
- protected InheritanceType specifiedInheritanceStrategy(InheritanceAnnotation inheritanceResource) {
- return InheritanceType.fromJavaResourceModel(inheritanceResource.getStrategy());
- }
-
- protected InheritanceType defaultInheritanceStrategy() {
- return this.isRoot() ? InheritanceType.SINGLE_TABLE : this.getRootEntity().getInheritanceStrategy();
- }
-
- protected void updateDiscriminatorColumn(JavaResourcePersistentType persistentTypeResource) {
- getDiscriminatorColumn().update(persistentTypeResource);
- }
-
- protected void updateDiscriminatorValue(DiscriminatorValueAnnotation discriminatorValueResource) {
- this.setSpecifiedDiscriminatorValue_(discriminatorValueResource.getValue());
- this.setDefaultDiscriminatorValue(this.javaDefaultDiscriminatorValue());
- }
-
- /**
- * 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 javaDefaultDiscriminatorValue() {
- if (this.javaResourcePersistentType.isAbstract()) {
- return null;
- }
- if (this.getDiscriminatorType() != DiscriminatorType.STRING) {
- return null;
- }
- return this.getName();
- }
-
- protected DiscriminatorType getDiscriminatorType() {
- return this.getDiscriminatorColumn().getDiscriminatorType();
- }
-
- protected boolean discriminatorValueIsAllowed(JavaResourcePersistentType persistentTypeResource) {
- return !persistentTypeResource.isAbstract();
- }
-
- protected void updateSecondaryTables(JavaResourcePersistentType persistentTypeResource) {
- ListIterator<JavaSecondaryTable> secondaryTables = specifiedSecondaryTables();
- ListIterator<NestableAnnotation> resourceSecondaryTables = persistentTypeResource.supportingAnnotations(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 updateTableGenerator(JavaResourcePersistentType persistentTypeResource) {
- TableGeneratorAnnotation tableGeneratorResource = tableGenerator(persistentTypeResource);
- 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 tableGenerator(JavaResourcePersistentType persistentTypeResource) {
- return (TableGeneratorAnnotation) persistentTypeResource.getSupportingAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME);
- }
-
- protected void updateSequenceGenerator(JavaResourcePersistentType persistentTypeResource) {
- SequenceGeneratorAnnotation sequenceGeneratorResource = sequenceGenerator(persistentTypeResource);
- 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 sequenceGenerator(JavaResourcePersistentType persistentTypeResource) {
- return (SequenceGeneratorAnnotation) persistentTypeResource.getSupportingAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME);
- }
-
-
- protected void updateSpecifiedPrimaryKeyJoinColumns(JavaResourcePersistentType persistentTypeResource) {
- ListIterator<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns = specifiedPrimaryKeyJoinColumns();
- ListIterator<NestableAnnotation> resourcePrimaryKeyJoinColumns = persistentTypeResource.supportingAnnotations(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, createPrimaryKeyJoinColumnOwner());
- primaryKeyJoinColumn.initialize(primaryKeyJoinColumnResource);
- return primaryKeyJoinColumn;
- }
-
- protected void updateDefaultPrimaryKeyJoinColumn(JavaResourcePersistentType persistentTypeResource) {
- if (!shouldBuildDefaultPrimaryKeyJoinColumn()) {
- setDefaultPrimaryKeyJoinColumn(null);
- return;
- }
- if (getDefaultPrimaryKeyJoinColumn() == null) {
- this.setDefaultPrimaryKeyJoinColumn(buildPrimaryKeyJoinColumn(new NullPrimaryKeyJoinColumn(this.javaResourcePersistentType)));
- }
- else {
- this.defaultPrimaryKeyJoinColumn.update(new NullPrimaryKeyJoinColumn(persistentTypeResource));
- }
- }
-
- protected void updateSpecifiedAttributeOverrides(JavaResourcePersistentType persistentTypeResource) {
- ListIterator<JavaAttributeOverride> attributeOverrides = specifiedAttributeOverrides();
- ListIterator<NestableAnnotation> resourceAttributeOverrides = persistentTypeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- 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 JavaAttributeOverride buildAttributeOverride(AttributeOverrideAnnotation attributeOverrideResource) {
- JavaAttributeOverride attributeOverride = getJpaFactory().buildJavaAttributeOverride(this, createAttributeOverrideOwner());
- attributeOverride.initialize(attributeOverrideResource);
- return attributeOverride;
- }
-
- protected JavaAttributeOverride buildVirtualAttributeOverride(JavaResourcePersistentType resourcePersistentType, PersistentAttribute attribute) {
- return buildAttributeOverride(buildVirtualAttributeOverrideResource(resourcePersistentType, attribute));
- }
-
- protected VirtualAttributeOverride buildVirtualAttributeOverrideResource(JavaResourcePersistentType resourcePersistentType, PersistentAttribute attribute) {
- ColumnMapping columnMapping = (ColumnMapping) attribute.getMapping();
- return new VirtualAttributeOverride(resourcePersistentType, attribute.getName(), columnMapping.getColumn());
- }
-
- protected void updateVirtualAttributeOverrides(JavaResourcePersistentType resourcePersistentType) {
- for (PersistentAttribute persistentAttribute : CollectionTools.iterable(allOverridableAttributes())) {
- JavaAttributeOverride attributeOverride = getAttributeOverrideNamed(persistentAttribute.getName());
- if (attributeOverride == null) {
- addVirtualAttributeOverride(buildVirtualAttributeOverride(resourcePersistentType, persistentAttribute));
- }
- else if (attributeOverride.isVirtual()) {
- attributeOverride.update(buildVirtualAttributeOverrideResource(resourcePersistentType, persistentAttribute));
- }
- }
-
- 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);
- }
- }
- }
-
- protected void updateSpecifiedAssociationOverrides(JavaResourcePersistentType resourcePersistentType) {
- ListIterator<JavaAssociationOverride> associationOverrides = specifiedAssociationOverrides();
- ListIterator<NestableAnnotation> resourceAssociationOverrides = resourcePersistentType.supportingAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME);
-
- 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 JavaAssociationOverride buildAssociationOverride(AssociationOverrideAnnotation associationOverrideResource) {
- JavaAssociationOverride associationOverride = getJpaFactory().buildJavaAssociationOverride(this, createAssociationOverrideOwner());
- associationOverride.initialize(associationOverrideResource);
- return associationOverride;
- }
-
- protected void updateVirtualAssociationOverrides(JavaResourcePersistentType resourcePersistentType) {
- for (Iterator<String> i = allOverridableAssociationNames(); i.hasNext(); ) {
- String associationName = i.next();
- JavaAssociationOverride associationOverride = getAssociationOverrideNamed(associationName);
- if (associationOverride == null) {
- associationOverride = buildAssociationOverride(new NullAssociationOverride(resourcePersistentType, associationName));
- addVirtualAssociationOverride(associationOverride);
- }
- else if (associationOverride.isVirtual()) {
- associationOverride.update(new NullAssociationOverride(resourcePersistentType, associationName));
- }
- }
-
- 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);
- }
- }
- }
-
- protected void updateNamedQueries(JavaResourcePersistentType resourcePersistentType) {
- ListIterator<JavaNamedQuery> queries = namedQueries();
- ListIterator<NestableAnnotation> resourceNamedQueries = resourcePersistentType.supportingAnnotations(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(JavaResourcePersistentType resourcePersistentType) {
- ListIterator<JavaNamedNativeQuery> queries = namedNativeQueries();
- ListIterator<NestableAnnotation> resourceNamedNativeQueries = resourcePersistentType.supportingAnnotations(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()));
- }
- }
-
-
- 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;
- }
-
- protected void updateIdClass(JavaResourcePersistentType resourcePersistentType) {
- IdClassAnnotation annotation = (IdClassAnnotation) resourcePersistentType.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- if (annotation != null) {
- setIdClass_(annotation.getValue());
- }
- else {
- setIdClass_(null);
- }
- }
-
-
- //******************** 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;
- }
- }
- for (JavaAttributeOverride override : CollectionTools.iterable(this.attributeOverrides())) {
- result = override.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;
- }
- }
- result = this.getDiscriminatorColumn().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, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
-
- this.table.validate(messages, astRoot);
- this.validateId(messages, astRoot);
- this.validateGenerators(messages, astRoot);
- this.validateQueries(messages, astRoot);
-
- for (Iterator<JavaSecondaryTable> stream = this.specifiedSecondaryTables(); stream.hasNext();) {
- stream.next().validate(messages, astRoot);
- }
-
- for (Iterator<JavaAttributeOverride> stream = this.attributeOverrides(); stream.hasNext();) {
- stream.next().validate(messages, astRoot);
- }
-
- for (Iterator<JavaAssociationOverride> stream = this.associationOverrides(); stream.hasNext();) {
- stream.next().validate(messages, astRoot);
- }
-
- }
-
- protected void validateId(List<IMessage> messages, CompilationUnit astRoot) {
- if (this.entityHasNoId()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ENTITY_NO_ID,
- new String[] {this.getName()},
- this,
- this.getValidationTextRange(astRoot)
- )
- );
- }
- }
-
- protected boolean entityHasNoId() {
- return ! this.entityHasId();
- }
-
- protected boolean entityHasId() {
- for (Iterator<PersistentAttribute> stream = getPersistentType().allAttributes(); stream.hasNext(); ) {
- if (stream.next().isIdAttribute()) {
- return true;
- }
- }
- return false;
- }
-
- 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().allGenerators(); 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 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().allQueries(); 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))
- );
- }
- }
- }
- }
-
-
- // ********** pk join column owner **********
-
- class PrimaryKeyJoinColumnOwner implements JavaBaseJoinColumn.Owner
- {
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return GenericJavaEntity.this.getValidationTextRange(astRoot);
- }
-
- public TypeMapping getTypeMapping() {
- return GenericJavaEntity.this;
- }
-
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- return GenericJavaEntity.this.getDbTable(tableName);
- }
-
- public org.eclipse.jpt.db.Table getReferencedColumnDbTable() {
- Entity parentEntity = GenericJavaEntity.this.getParentEntity();
- return (parentEntity == null) ? null : parentEntity.getPrimaryDbTable();
- }
-
- public int joinColumnsSize() {
- return GenericJavaEntity.this.primaryKeyJoinColumnsSize();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return GenericJavaEntity.this.defaultPrimaryKeyJoinColumn == joinColumn;
- }
-
- public String getDefaultColumnName() {
- if (joinColumnsSize() != 1) {
- return null;
- }
- return GenericJavaEntity.this.getParentEntity().getPrimaryKeyColumnName();
- }
- }
-
-
- // ********** attribute override owner **********
-
- class AttributeOverrideOwner implements AttributeOverride.Owner {
-
- public ColumnMapping getColumnMapping(String attributeName) {
- if (attributeName == null) {
- return null;
- }
- for (Iterator<PersistentAttribute> stream = getPersistentType().allAttributes(); stream.hasNext();) {
- PersistentAttribute persAttribute = stream.next();
- if (attributeName.equals(persAttribute.getName())) {
- if (persAttribute.getMapping() instanceof ColumnMapping) {
- return (ColumnMapping) persAttribute.getMapping();
- }
- }
- }
- return null;
- }
-
- public boolean isVirtual(BaseOverride override) {
- return GenericJavaEntity.this.virtualAttributeOverrides.contains(override);
- }
-
- public BaseOverride setVirtual(boolean virtual, BaseOverride attributeOverride) {
- return GenericJavaEntity.this.setAttributeOverrideVirtual(virtual, (JavaAttributeOverride) attributeOverride);
- }
-
- public TypeMapping getTypeMapping() {
- return GenericJavaEntity.this;
- }
-
- public TextRange validationTextRange(CompilationUnit astRoot) {
- // TODO Auto-generated method stub
- return null;
- }
- }
-
-
- // ********** association override owner **********
-
- class AssociationOverrideOwner implements AssociationOverride.Owner {
-
- public RelationshipMapping getRelationshipMapping(String attributeName) {
- if (attributeName == null) {
- return null;
- }
- for (Iterator<PersistentAttribute> stream = getPersistentType().allAttributes(); stream.hasNext();) {
- PersistentAttribute persAttribute = stream.next();
- if (attributeName.equals(persAttribute.getName())) {
- if (persAttribute.getMapping() instanceof RelationshipMapping) {
- return (RelationshipMapping) persAttribute.getMapping();
- }
- }
- }
- return null;
- }
-
- public boolean isVirtual(BaseOverride override) {
- return GenericJavaEntity.this.virtualAssociationOverrides.contains(override);
- }
-
- public BaseOverride setVirtual(boolean virtual, BaseOverride attributeOverride) {
- return GenericJavaEntity.this.setAssociationOverrideVirtual(virtual, (JavaAssociationOverride) attributeOverride);
- }
-
- public TypeMapping getTypeMapping() {
- return GenericJavaEntity.this;
- }
-
- public TextRange validationTextRange(CompilationUnit astRoot) {
- // TODO Auto-generated method stub
- return null;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEnumeratedConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEnumeratedConverter.java
deleted file mode 100644
index aac714d36f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEnumeratedConverter.java
+++ /dev/null
@@ -1,101 +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.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.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
-{
- private EnumType specifiedEnumType;
-
- private 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.addSupportingAnnotation(getAnnotationName());
- }
-
- public void removeFromResourceModel() {
- this.resourcePersistenceAttribute.removeSupportingAnnotation(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.getSupportingAnnotation(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/context/java/GenericJavaGeneratedValue.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaGeneratedValue.java
deleted file mode 100644
index a1253ce55e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaGeneratedValue.java
+++ /dev/null
@@ -1,114 +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.java;
-
-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.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaGeneratedValue;
-import org.eclipse.jpt.core.resource.java.GeneratedValueAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-public class GenericJavaGeneratedValue extends AbstractJavaJpaContextNode implements JavaGeneratedValue
-{
- protected GenerationType strategy;
-
- protected String generator;
-
- protected String defaultGenerator;
-
- protected GeneratedValueAnnotation generatedValueResource;
-
- public GenericJavaGeneratedValue(JavaAttributeMapping parent) {
- super(parent);
- }
-
- public void initialize(GeneratedValueAnnotation generatedValue) {
- this.generatedValueResource = generatedValue;
- this.strategy = this.strategy(generatedValue);
- this.generator = this.generator(generatedValue);
- }
-
- public GenerationType getStrategy() {
- return (this.getSpecifiedStrategy() == null) ? this.getDefaultStrategy() : this.getSpecifiedStrategy();
- }
-
- public GenerationType getDefaultStrategy() {
- return GeneratedValue.DEFAULT_STRATEGY;
- }
-
- public GenerationType getSpecifiedStrategy() {
- return this.strategy;
- }
-
- public void setSpecifiedStrategy(GenerationType newStrategy) {
- GenerationType oldStrategy = this.strategy;
- this.strategy = newStrategy;
- this.generatedValueResource.setStrategy(GenerationType.toJavaResourceModel(newStrategy));
- firePropertyChanged(GeneratedValue.SPECIFIED_STRATEGY_PROPERTY, oldStrategy, newStrategy);
- }
-
- protected void setSpecifiedStrategy_(GenerationType newStrategy) {
- GenerationType oldStrategy = this.strategy;
- this.strategy = newStrategy;
- firePropertyChanged(GeneratedValue.SPECIFIED_STRATEGY_PROPERTY, oldStrategy, newStrategy);
- }
-
- public String getGenerator() {
- return (this.getSpecifiedGenerator() == null) ? this.getDefaultGenerator() : this.getSpecifiedGenerator();
- }
-
- public String getSpecifiedGenerator() {
- return this.generator;
- }
-
- public String getDefaultGenerator() {
- return this.defaultGenerator;
- }
-
- public void setSpecifiedGenerator(String newGenerator) {
- String oldGenerator = this.generator;
- this.generator = newGenerator;
- this.generatedValueResource.setGenerator(newGenerator);
- firePropertyChanged(GeneratedValue.SPECIFIED_GENERATOR_PROPERTY, oldGenerator, newGenerator);
- }
-
- protected void setSpecifiedGenerator_(String newGenerator) {
- String oldGenerator = this.generator;
- this.generator = newGenerator;
- firePropertyChanged(GeneratedValue.SPECIFIED_GENERATOR_PROPERTY, oldGenerator, newGenerator);
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.generatedValueResource.getTextRange(astRoot);
- }
-
- public TextRange getGeneratorTextRange(CompilationUnit astRoot) {
- return this.generatedValueResource.getGeneratorTextRange(astRoot);
- }
-
- // ********** resource model -> java context model **********
-
- public void update(GeneratedValueAnnotation generatedValue) {
- this.generatedValueResource = generatedValue;
- this.setSpecifiedStrategy_(this.strategy(generatedValue));
- this.setSpecifiedGenerator_(this.generator(generatedValue));
- }
-
- protected GenerationType strategy(GeneratedValueAnnotation generatedValue) {
- return GenerationType.fromJavaResourceModel(generatedValue.getStrategy());
- }
-
- protected String generator(GeneratedValueAnnotation generatedValue) {
- return generatedValue.getGenerator();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaIdMapping.java
deleted file mode 100644
index 3f64d54555..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaIdMapping.java
+++ /dev/null
@@ -1,511 +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.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.Converter;
-import org.eclipse.jpt.core.context.Generator;
-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.JavaGenerator;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaSequenceGenerator;
-import org.eclipse.jpt.core.context.java.JavaTableGenerator;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-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.JavaResourcePersistentAttribute;
-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.utility.Filter;
-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.SingleElementIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericJavaIdMapping
- extends AbstractJavaAttributeMapping<IdAnnotation>
- implements JavaIdMapping
-{
- protected final JavaColumn column;
-
- protected JavaGeneratedValue generatedValue;
-
- protected JavaTableGenerator tableGenerator;
-
- protected JavaSequenceGenerator sequenceGenerator;
-
- protected final JavaConverter defaultConverter;
-
- protected JavaConverter specifiedConverter;
-
-
- public GenericJavaIdMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.column = createJavaColumn();
- this.defaultConverter = new GenericJavaNullConverter(this);
- }
-
- protected JavaColumn createJavaColumn() {
- return getJpaFactory().buildJavaColumn(this, this);
- }
-
- @Override
- public void initialize(JavaResourcePersistentAttribute jrpa) {
- super.initialize(jrpa);
- this.column.initialize(this.getResourceColumn());
- this.initializeTableGenerator(jrpa);
- this.initializeSequenceGenerator(jrpa);
- this.initializeGeneratedValue(jrpa);
- this.specifiedConverter = this.buildSpecifiedConverter(this.specifiedConverterType(jrpa));
- }
-
- protected void initializeTableGenerator(JavaResourcePersistentAttribute jrpa) {
- TableGeneratorAnnotation resourceTableGenerator = getResourceTableGenerator(jrpa);
- if (resourceTableGenerator != null) {
- this.tableGenerator = buildTableGenerator(resourceTableGenerator);
- }
- }
-
- protected void initializeSequenceGenerator(JavaResourcePersistentAttribute jrpa) {
- SequenceGeneratorAnnotation resourceSequenceGenerator = getResourceSequenceGenerator(jrpa);
- if (resourceSequenceGenerator != null) {
- this.sequenceGenerator = buildSequenceGenerator(resourceSequenceGenerator);
- }
- }
-
- protected void initializeGeneratedValue(JavaResourcePersistentAttribute jrpa) {
- GeneratedValueAnnotation resourceGeneratedValue = getResourceGeneratedValue(jrpa);
- if (resourceGeneratedValue != null) {
- this.generatedValue = buildGeneratedValue(resourceGeneratedValue);
- }
- }
-
- public ColumnAnnotation getResourceColumn() {
- return (ColumnAnnotation) getResourcePersistentAttribute().getNonNullSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME);
- }
-
- //************** JavaAttributeMapping implementation ***************
-
- public String getKey() {
- return MappingKeys.ID_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return IdAnnotation.ANNOTATION_NAME;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return new ArrayIterator<String>(
- JPA.COLUMN,
- JPA.GENERATED_VALUE,
- JPA.TEMPORAL,
- JPA.TABLE_GENERATOR,
- JPA.SEQUENCE_GENERATOR);
- }
-
- public String getDefaultColumnName() {
- return getAttributeName();
- }
-
- public String getDefaultTableName() {
- return getTypeMapping().getPrimaryTableName();
- }
-
- //************** 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().addSupportingAnnotation(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().removeSupportingAnnotation(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 JavaTableGenerator addTableGenerator() {
- if (getTableGenerator() != null) {
- throw new IllegalStateException("tableGenerator already exists"); //$NON-NLS-1$
- }
- this.tableGenerator = getJpaFactory().buildJavaTableGenerator(this);
- TableGeneratorAnnotation tableGeneratorResource = (TableGeneratorAnnotation) getResourcePersistentAttribute().addSupportingAnnotation(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;
- getResourcePersistentAttribute().removeSupportingAnnotation(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) getResourcePersistentAttribute().addSupportingAnnotation(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;
- getResourcePersistentAttribute().removeSupportingAnnotation(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);
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<JavaGenerator> generators() {
- return new CompositeIterator<JavaGenerator>(
- (getSequenceGenerator() == null) ? EmptyIterator.instance() : new SingleElementIterator(getSequenceGenerator()),
- (getTableGenerator() == null) ? EmptyIterator.instance() : new SingleElementIterator(getTableGenerator()));
- }
-
- public JavaConverter getConverter() {
- return getSpecifiedConverter() == null ? getDefaultConverter() : getSpecifiedConverter();
- }
-
- public JavaConverter getDefaultConverter() {
- return this.defaultConverter;
- }
-
- public JavaConverter getSpecifiedConverter() {
- return this.specifiedConverter;
- }
-
- protected String getSpecifedConverterType() {
- if (this.specifiedConverter == null) {
- return Converter.NO_CONVERTER;
- }
- return this.specifiedConverter.getType();
- }
-
- public void setSpecifiedConverter(String converterType) {
- if (getSpecifedConverterType() == converterType) {
- return;
- }
- JavaConverter oldConverter = this.specifiedConverter;
- JavaConverter newConverter = buildSpecifiedConverter(converterType);
- this.specifiedConverter = null;
- if (oldConverter != null) {
- oldConverter.removeFromResourceModel();
- }
- this.specifiedConverter = newConverter;
- if (newConverter != null) {
- newConverter.addToResourceModel();
- }
- firePropertyChanged(SPECIFIED_CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- protected void setSpecifiedConverter(JavaConverter newConverter) {
- JavaConverter oldConverter = this.specifiedConverter;
- this.specifiedConverter = newConverter;
- firePropertyChanged(SPECIFIED_CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- @Override
- public void update(JavaResourcePersistentAttribute jrpa) {
- super.update(jrpa);
- this.column.update(this.getResourceColumn());
- this.updateTableGenerator(jrpa);
- this.updateSequenceGenerator(jrpa);
- this.updateGeneratedValue(jrpa);
- if (specifiedConverterType(jrpa) == getSpecifedConverterType()) {
- getSpecifiedConverter().update(jrpa);
- }
- else {
- JavaConverter javaConverter = buildSpecifiedConverter(specifiedConverterType(jrpa));
- setSpecifiedConverter(javaConverter);
- }
- }
-
- protected void updateTableGenerator(JavaResourcePersistentAttribute jrpa) {
- TableGeneratorAnnotation resourceTableGenerator = getResourceTableGenerator(jrpa);
- if (resourceTableGenerator == null) {
- if (getTableGenerator() != null) {
- setTableGenerator(null);
- }
- }
- else {
- if (getTableGenerator() == null) {
- setTableGenerator(buildTableGenerator(resourceTableGenerator));
- }
- else {
- getTableGenerator().update(resourceTableGenerator);
- }
- }
- }
-
- protected JavaTableGenerator buildTableGenerator(TableGeneratorAnnotation resourceTableGenerator) {
- JavaTableGenerator generator = getJpaFactory().buildJavaTableGenerator(this);
- generator.initialize(resourceTableGenerator);
- return generator;
- }
-
- protected void updateSequenceGenerator(JavaResourcePersistentAttribute jrpa) {
- SequenceGeneratorAnnotation sequenceGeneratorResource = getResourceSequenceGenerator(jrpa);
- if (sequenceGeneratorResource == null) {
- if (getSequenceGenerator() != null) {
- setSequenceGenerator(null);
- }
- }
- else {
- if (getSequenceGenerator() == null) {
- setSequenceGenerator(buildSequenceGenerator(sequenceGeneratorResource));
- }
- else {
- getSequenceGenerator().update(sequenceGeneratorResource);
- }
- }
- }
-
- protected JavaSequenceGenerator buildSequenceGenerator(SequenceGeneratorAnnotation resourceSequenceGenerator) {
- JavaSequenceGenerator generator = getJpaFactory().buildJavaSequenceGenerator(this);
- generator.initialize(resourceSequenceGenerator);
- return generator;
- }
-
- protected void updateGeneratedValue(JavaResourcePersistentAttribute jrpa) {
- GeneratedValueAnnotation resourceGeneratedValue = getResourceGeneratedValue(jrpa);
- 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(JavaResourcePersistentAttribute jrpa) {
- return (TableGeneratorAnnotation) jrpa.getSupportingAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME);
- }
-
- protected SequenceGeneratorAnnotation getResourceSequenceGenerator(JavaResourcePersistentAttribute jrpa) {
- return (SequenceGeneratorAnnotation) jrpa.getSupportingAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME);
- }
-
- protected GeneratedValueAnnotation getResourceGeneratedValue(JavaResourcePersistentAttribute jrpa) {
- return (GeneratedValueAnnotation) jrpa.getSupportingAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME);
- }
-
- protected JavaConverter buildSpecifiedConverter(String converterType) {
- if (converterType == Converter.TEMPORAL_CONVERTER) {
- return getJpaFactory().buildJavaTemporalConverter(this, this.resourcePersistentAttribute);
- }
- return null;
- }
-
- protected String specifiedConverterType(JavaResourcePersistentAttribute jrpa) {
- if (jrpa.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME) != null) {
- return Converter.TEMPORAL_CONVERTER;
- }
-
- 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 = this.getColumn().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- return null;
- }
-
- @Override
- public String getPrimaryKeyColumnName() {
- return this.getColumn().getName();
- }
-
- @Override
- public boolean isOverridableAttributeMapping() {
- return true;
- }
-
- @Override
- public boolean isIdMapping() {
- return true;
- }
-
- //*********** Validation ************
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
-
- if (this.ownerIsEntity() && this.connectionProfileIsActive()) {
- this.validateColumn(messages, astRoot);
- }
- this.validateGeneratedValue(messages, astRoot);
- this.validateGenerators(messages, astRoot);
- if (this.specifiedConverter != null) {
- this.specifiedConverter.validate(messages, astRoot);
- }
- }
-
- protected void validateColumn(List<IMessage> messages, CompilationUnit astRoot) {
- if (this.getTypeMapping().tableNameIsInvalid(this.column.getTable())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_TABLE,
- new String[] {this.column.getTable(), this.column.getName()},
- this.column,
- this.column.getTableTextRange(astRoot)
- )
- );
- return;
- }
-
- if ( ! this.column.isResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {this.column.getName()},
- this.column,
- this.column.getNameTextRange(astRoot)
- )
- );
- }
- }
-
- protected void validateGeneratedValue(List<IMessage> messages, CompilationUnit astRoot) {
- if (this.generatedValue == null) {
- return;
- }
-
- String generatorName = this.generatedValue.getGenerator();
- if (generatorName == null) {
- return;
- }
-
- for (Iterator<Generator> stream = this.getPersistenceUnit().allGenerators(); stream.hasNext(); ) {
- if (generatorName.equals(stream.next().getName())) {
- return;
- }
- }
-
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ID_MAPPING_UNRESOLVED_GENERATOR_NAME,
- new String[] {generatorName},
- this,
- this.generatedValue.getGeneratorTextRange(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().allGenerators(); 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))
- );
- }
- }
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinColumn.java
deleted file mode 100644
index c4b0ca30ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinColumn.java
+++ /dev/null
@@ -1,214 +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.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.RelationshipMapping;
-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.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-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.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericJavaJoinColumn extends AbstractJavaBaseColumn<JoinColumnAnnotation> implements JavaJoinColumn
-{
-
- protected String specifiedReferencedColumnName;
-
- protected String defaultReferencedColumnName;
-
- protected JoinColumnAnnotation joinColumn;
-
- public GenericJavaJoinColumn(JavaJpaContextNode parent, JavaJoinColumn.Owner owner) {
- super(parent, owner);
- }
-
- @Override
- protected JoinColumnAnnotation getResourceColumn() {
- return this.joinColumn;
- }
-
- 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.joinColumn.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);
- }
-
- protected Table getReferencedColumnDbTable() {
- return getOwner().getReferencedColumnDbTable();
- }
-
- public Column getReferencedDbColumn() {
- Table table = this.getReferencedColumnDbTable();
- return (table == null) ? null : table.getColumnForIdentifier(this.getReferencedColumnName());
- }
-
- @Override
- public boolean tableIsAllowed() {
- return this.getOwner().tableIsAllowed();
- }
-
- 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.javaCandidateReferencedColumnNames(filter);
- }
- return null;
- }
-
- private Iterator<String> javaCandidateReferencedColumnNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.candidateReferencedColumnNames(filter));
- }
-
- private Iterator<String> candidateReferencedColumnNames(Filter<String> filter) {
- return new FilteringIterator<String, String>(this.candidateReferencedColumnNames(), filter);
- }
-
- private Iterator<String> candidateReferencedColumnNames() {
- Table table = this.getOwner().getReferencedColumnDbTable();
- return (table != null) ? table.sortedColumnIdentifiers() : EmptyIterator.<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);
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void initialize(JoinColumnAnnotation annotation) {
- this.joinColumn = annotation;
- super.initialize(annotation);
- this.specifiedReferencedColumnName = annotation.getReferencedColumnName();
- this.defaultReferencedColumnName = this.buildDefaultReferencedColumnName();
- }
-
- @Override
- public void update(JoinColumnAnnotation annotation) {
- this.joinColumn = annotation;
- super.update(annotation);
- this.setSpecifiedReferencedColumnName_(annotation.getReferencedColumnName());
- this.setDefaultReferencedColumnName(this.buildDefaultReferencedColumnName());
- }
-
- @Override
- protected String buildDefaultName() {
- return MappingTools.buildJoinColumnDefaultName(this);
- }
-
- protected String buildDefaultReferencedColumnName() {
- return MappingTools.buildJoinColumnDefaultReferencedColumnName(this.getOwner());
- }
-
- @Override
- protected String defaultTable() {
- RelationshipMapping relationshipMapping = getOwner().getRelationshipMapping();
- if (relationshipMapping == null) {
- return null;
- }
- if (!getOwner().getRelationshipMapping().isRelationshipOwner()) {
- return null;
- }
- return super.defaultTable();
- }
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- if ( ! this.isResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {this.getName()},
- this,
- this.getNameTextRange(astRoot)
- )
- );
- }
-
- if ( ! this.isReferencedColumnResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME,
- new String[] {this.getReferencedColumnName(), this.getName()},
- this,
- this.getReferencedColumnNameTextRange(astRoot)
- )
- );
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinTable.java
deleted file mode 100644
index c3f231dda0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinTable.java
+++ /dev/null
@@ -1,726 +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.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.AttributeMapping;
-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.NonOwningMapping;
-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.JavaRelationshipMapping;
-import org.eclipse.jpt.core.internal.resource.java.NullJoinColumn;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-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.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.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;
-
-/**
- *
- */
-public class GenericJavaJoinTable
- extends AbstractJavaTable
- implements JavaJoinTable
-{
- protected final List<JavaJoinColumn> specifiedJoinColumns;
-
- protected JavaJoinColumn defaultJoinColumn;
-
- protected final List<JavaJoinColumn> specifiedInverseJoinColumns;
-
- protected JavaJoinColumn defaultInverseJoinColumn;
-
- protected JavaResourcePersistentAttribute resourceAttribute;
-
- public GenericJavaJoinTable(JavaRelationshipMapping parent) {
- super(parent);
- this.specifiedJoinColumns = new ArrayList<JavaJoinColumn>();
- this.specifiedInverseJoinColumns = new ArrayList<JavaJoinColumn>();
- }
-
- @Override
- public JavaRelationshipMapping getParent() {
- return (JavaRelationshipMapping) super.getParent();
- }
-
- //******************* AbstractJavaTable implementation *****************
-
- @Override
- protected String getAnnotationName() {
- return JoinTableAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected String buildDefaultName() {
- return this.getRelationshipMapping().getJoinTableDefaultName();
- }
-
- /**
- * if the join table is on the "mappedBy" side, it's bogus;
- * so don't give it a default catalog
- */
- @Override
- protected String buildDefaultCatalog() {
- return this.getRelationshipMapping().isRelationshipOwner() ? this.getContextDefaultCatalog() : null;
- }
-
- /**
- * 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.getRelationshipMapping().isRelationshipOwner() ? this.getContextDefaultSchema() : null;
- }
-
- @Override
- protected JoinTableAnnotation getResourceTable() {
- return (JoinTableAnnotation) this.resourceAttribute.getNonNullSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- }
-
- /**
- * Return the join table java resource, null if the annotation does not exist.
- * Use getResourceTable() if you want a non null implementation
- */
- protected JoinTableAnnotation getResourceJoinTable() {
- return (JoinTableAnnotation) this.resourceAttribute.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- }
-
- protected void addResourceJoinTable() {
- this.resourceAttribute.addSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- }
-
-
- //******************* IJoinTable implementation *****************
-
- public ListIterator<JavaJoinColumn> joinColumns() {
- return this.containsSpecifiedJoinColumns() ? this.specifiedJoinColumns() : this.defaultJoinColumns();
- }
-
- public int joinColumnsSize() {
- return this.containsSpecifiedJoinColumns() ? this.specifiedJoinColumnsSize() : this.defaultJoinColumnsSize();
- }
-
- public JavaJoinColumn getDefaultJoinColumn() {
- return this.defaultJoinColumn;
- }
-
- protected void setDefaultJoinColumn(JavaJoinColumn newJoinColumn) {
- JavaJoinColumn oldJoinColumn = this.defaultJoinColumn;
- this.defaultJoinColumn = newJoinColumn;
- firePropertyChanged(JoinTable.DEFAULT_JOIN_COLUMN, oldJoinColumn, newJoinColumn);
- }
-
- 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;
- }
-
- public ListIterator<JavaJoinColumn> specifiedJoinColumns() {
- return new CloneListIterator<JavaJoinColumn>(this.specifiedJoinColumns);
- }
-
- public int specifiedJoinColumnsSize() {
- return this.specifiedJoinColumns.size();
- }
-
- public boolean containsSpecifiedJoinColumns() {
- return !this.specifiedJoinColumns.isEmpty();
- }
-
- public JavaJoinColumn addSpecifiedJoinColumn(int index) {
- JoinColumn oldDefaultJoinColumn = this.getDefaultJoinColumn();
- 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;
- }
- if (getResourceJoinTable() == null) {
- //Add the JoinTable before creating the specifiedJoinColumn.
- //Otherwise we will remove it and create another during an update
- //from the java resource model
- addResourceJoinTable();
- }
- JavaJoinColumn joinColumn = getJpaFactory().buildJavaJoinColumn(this, createJoinColumnOwner());
- this.specifiedJoinColumns.add(index, joinColumn);
- JoinColumnAnnotation joinColumnResource = this.getResourceTable().addJoinColumn(index);
- joinColumn.initialize(joinColumnResource);
- this.fireItemAdded(JoinTable.SPECIFIED_JOIN_COLUMNS_LIST, index, joinColumn);
- if (oldDefaultJoinColumn != null) {
- this.firePropertyChanged(JoinTable.DEFAULT_JOIN_COLUMN, oldDefaultJoinColumn, null);
- }
- return joinColumn;
- }
-
- protected void addSpecifiedJoinColumn(int index, JavaJoinColumn joinColumn) {
- addItemToList(index, joinColumn, this.specifiedJoinColumns, JoinTable.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 (!containsSpecifiedJoinColumns()) {
- //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(new NullJoinColumn(getResourceTable()));
- }
- this.getResourceTable().removeJoinColumn(index);
- fireItemRemoved(JoinTable.SPECIFIED_JOIN_COLUMNS_LIST, index, removedJoinColumn);
- if (this.defaultJoinColumn != null) {
- //fire change notification if a defaultJoinColumn was created above
- this.firePropertyChanged(JoinTable.DEFAULT_JOIN_COLUMN, null, this.defaultJoinColumn);
- }
- }
-
- protected void removeSpecifiedJoinColumn_(JavaJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.specifiedJoinColumns, JoinTable.SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedJoinColumns, targetIndex, sourceIndex);
- this.getResourceTable().moveJoinColumn(targetIndex, sourceIndex);
- fireItemMoved(JoinTable.SPECIFIED_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- public ListIterator<JavaJoinColumn> inverseJoinColumns() {
- return this.containsSpecifiedInverseJoinColumns() ? this.specifiedInverseJoinColumns() : this.defaultInverseJoinColumns();
- }
-
- public int inverseJoinColumnsSize() {
- return this.containsSpecifiedInverseJoinColumns() ? this.specifiedInverseJoinColumnsSize() : this.defaultInverseJoinColumnsSize();
- }
-
- public JavaJoinColumn getDefaultInverseJoinColumn() {
- return this.defaultInverseJoinColumn;
- }
-
- protected void setDefaultInverseJoinColumn(JavaJoinColumn newInverseJoinColumn) {
- JavaJoinColumn oldInverseJoinColumn = this.defaultInverseJoinColumn;
- this.defaultInverseJoinColumn = newInverseJoinColumn;
- firePropertyChanged(JoinTable.DEFAULT_INVERSE_JOIN_COLUMN, oldInverseJoinColumn, newInverseJoinColumn);
- }
-
- 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;
- }
-
- public ListIterator<JavaJoinColumn> specifiedInverseJoinColumns() {
- return new CloneListIterator<JavaJoinColumn>(this.specifiedInverseJoinColumns);
- }
-
- public int specifiedInverseJoinColumnsSize() {
- return this.specifiedInverseJoinColumns.size();
- }
-
- public boolean containsSpecifiedInverseJoinColumns() {
- return !this.specifiedInverseJoinColumns.isEmpty();
- }
-
- public JavaJoinColumn addSpecifiedInverseJoinColumn(int index) {
- JoinColumn oldDefaultInverseJoinColumn = this.getDefaultInverseJoinColumn();
- if (oldDefaultInverseJoinColumn != 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.defaultInverseJoinColumn = null;
- }
- if (getResourceJoinTable() == null) {
- //Add the JoinTable before creating the specifiedJoinColumn.
- //Otherwise we will remove it and create another during an update
- //from the java resource model
- addResourceJoinTable();
- }
- JavaJoinColumn inverseJoinColumn = getJpaFactory().buildJavaJoinColumn(this, createInverseJoinColumnOwner());
- this.specifiedInverseJoinColumns.add(index, inverseJoinColumn);
- JoinColumnAnnotation joinColumnResource = this.getResourceTable().addInverseJoinColumn(index);
- inverseJoinColumn.initialize(joinColumnResource);
- this.fireItemAdded(JoinTable.SPECIFIED_INVERSE_JOIN_COLUMNS_LIST, index, inverseJoinColumn);
- if (oldDefaultInverseJoinColumn != null) {
- this.firePropertyChanged(JoinTable.DEFAULT_INVERSE_JOIN_COLUMN, oldDefaultInverseJoinColumn, null);
- }
- return inverseJoinColumn;
- }
-
- protected void addSpecifiedInverseJoinColumn(int index, JavaJoinColumn inverseJoinColumn) {
- addItemToList(index, inverseJoinColumn, this.specifiedInverseJoinColumns, JoinTable.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 (!containsSpecifiedInverseJoinColumns()) {
- //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 = buildInverseJoinColumn(new NullJoinColumn(getResourceTable()));
- }
- this.getResourceTable().removeInverseJoinColumn(index);
- fireItemRemoved(JoinTable.SPECIFIED_INVERSE_JOIN_COLUMNS_LIST, index, removedJoinColumn);
- if (this.defaultInverseJoinColumn != null) {
- //fire change notification if a defaultJoinColumn was created above
- this.firePropertyChanged(JoinTable.DEFAULT_INVERSE_JOIN_COLUMN, null, this.defaultInverseJoinColumn);
- }
- }
-
- protected void removeSpecifiedInverseJoinColumn_(JavaJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.specifiedInverseJoinColumns, JoinTable.SPECIFIED_INVERSE_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedInverseJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedInverseJoinColumns, targetIndex, sourceIndex);
- this.getResourceTable().moveInverseJoinColumn(targetIndex, sourceIndex);
- fireItemMoved(JoinTable.SPECIFIED_INVERSE_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
-
- public RelationshipMapping getRelationshipMapping() {
- return this.getParent();
- }
-
- public boolean isSpecified() {
- return getResourceJoinTable() != 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;
- }
- for (JavaJoinColumn column : CollectionTools.iterable(this.joinColumns())) {
- result = column.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;
- }
-
- protected JavaJoinColumn.Owner createJoinColumnOwner() {
- return new JoinColumnOwner();
- }
-
- protected JavaJoinColumn.Owner createInverseJoinColumnOwner() {
- return new InverseJoinColumnOwner();
- }
-
- public void initialize(JavaResourcePersistentAttribute jrpa) {
- this.resourceAttribute = jrpa;
- JoinTableAnnotation joinTable = getResourceTable();
- this.initialize(joinTable);
- this.initializeSpecifiedJoinColumns(joinTable);
- this.initializeDefaultJoinColumn(joinTable);
- this.initializeSpecifiedInverseJoinColumns(joinTable);
- this.initializeDefaultInverseJoinColumn(joinTable);
- }
-
- protected void initializeSpecifiedJoinColumns(JoinTableAnnotation joinTableResource) {
- ListIterator<JoinColumnAnnotation> annotations = joinTableResource.joinColumns();
-
- while(annotations.hasNext()) {
- this.specifiedJoinColumns.add(buildJoinColumn(annotations.next()));
- }
- }
-
- protected boolean shouldBuildDefaultJoinColumn() {
- return !containsSpecifiedJoinColumns() && getRelationshipMapping().isRelationshipOwner();
- }
-
- protected void initializeDefaultJoinColumn(JoinTableAnnotation joinTable) {
- if (!shouldBuildDefaultJoinColumn()) {
- return;
- }
- this.defaultJoinColumn = buildJoinColumn(new NullJoinColumn(joinTable));
- }
-
- protected void initializeSpecifiedInverseJoinColumns(JoinTableAnnotation joinTableResource) {
- ListIterator<JoinColumnAnnotation> annotations = joinTableResource.inverseJoinColumns();
-
- while(annotations.hasNext()) {
- this.specifiedInverseJoinColumns.add(buildInverseJoinColumn(annotations.next()));
- }
- }
-
- protected boolean shouldBuildDefaultInverseJoinColumn() {
- return !containsSpecifiedInverseJoinColumns() && getRelationshipMapping().isRelationshipOwner();
- }
-
- protected void initializeDefaultInverseJoinColumn(JoinTableAnnotation joinTable) {
- if (!shouldBuildDefaultInverseJoinColumn()) {
- return;
- }
- this.defaultInverseJoinColumn = buildInverseJoinColumn(new NullJoinColumn(joinTable));
- }
-
- public void update(JavaResourcePersistentAttribute jrpa) {
- this.resourceAttribute = jrpa;
- JoinTableAnnotation joinTable = getResourceTable();
- this.update(joinTable);
- this.updateSpecifiedJoinColumns(joinTable);
- this.updateDefaultJoinColumn(joinTable);
- this.updateSpecifiedInverseJoinColumns(joinTable);
- this.updateDefaultInverseJoinColumn(joinTable);
- }
-
- protected void updateSpecifiedJoinColumns(JoinTableAnnotation joinTableResource) {
- ListIterator<JavaJoinColumn> joinColumns = specifiedJoinColumns();
- ListIterator<JoinColumnAnnotation> resourceJoinColumns = joinTableResource.joinColumns();
-
- 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(JoinTableAnnotation joinTable) {
- if (!shouldBuildDefaultJoinColumn()) {
- setDefaultJoinColumn(null);
- return;
- }
- if (getDefaultJoinColumn() == null) {
- this.setDefaultJoinColumn(buildJoinColumn(new NullJoinColumn(joinTable)));
- }
- else {
- this.defaultJoinColumn.update(new NullJoinColumn(joinTable));
- }
- }
-
- protected void updateSpecifiedInverseJoinColumns(JoinTableAnnotation joinTableResource) {
- ListIterator<JavaJoinColumn> joinColumns = specifiedInverseJoinColumns();
- ListIterator<JoinColumnAnnotation> resourceJoinColumns = joinTableResource.inverseJoinColumns();
-
- while (joinColumns.hasNext()) {
- JavaJoinColumn joinColumn = joinColumns.next();
- if (resourceJoinColumns.hasNext()) {
- joinColumn.update(resourceJoinColumns.next());
- }
- else {
- removeSpecifiedInverseJoinColumn_(joinColumn);
- }
- }
-
- while (resourceJoinColumns.hasNext()) {
- addSpecifiedInverseJoinColumn(buildInverseJoinColumn(resourceJoinColumns.next()));
- }
- }
-
- protected void updateDefaultInverseJoinColumn(JoinTableAnnotation joinTable) {
- if (!shouldBuildDefaultInverseJoinColumn()) {
- setDefaultInverseJoinColumn(null);
- return;
- }
- if (getDefaultInverseJoinColumn() == null) {
- this.setDefaultInverseJoinColumn(buildInverseJoinColumn(new NullJoinColumn(joinTable)));
- }
- else {
- this.defaultInverseJoinColumn.update(new NullJoinColumn(joinTable));
- }
- }
-
- protected JavaJoinColumn buildJoinColumn(JoinColumnAnnotation joinColumnResource) {
- JavaJoinColumn joinColumn = getJpaFactory().buildJavaJoinColumn(this, createJoinColumnOwner());
- joinColumn.initialize(joinColumnResource);
- return joinColumn;
- }
-
- protected JavaJoinColumn buildInverseJoinColumn(JoinColumnAnnotation joinColumnResource) {
- JavaJoinColumn joinColumn = getJpaFactory().buildJavaJoinColumn(this, createInverseJoinColumnOwner());
- joinColumn.initialize(joinColumnResource);
- return joinColumn;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, 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.JOIN_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.JOIN_TABLE_UNRESOLVED_SCHEMA,
- new String[] {this.getSchema(), this.getName()},
- this,
- this.getSchemaTextRange(astRoot)
- )
- );
- return;
- }
-
- if ( ! this.isResolved()) {
- String attributeName = this.getRelationshipMapping().getPersistentAttribute().getName();
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_TABLE_CANNOT_BE_DETERMINED,
- new String[] {attributeName},
- this,
- this.getNameTextRange(astRoot)
- )
- );
- return;
- }
-
- this.validateJoinColumns(this.joinColumns(), messages, astRoot);
- this.validateJoinColumns(this.inverseJoinColumns(), messages, astRoot);
- }
-
- protected void validateJoinColumns(Iterator<JavaJoinColumn> joinColumns, List<IMessage> messages, CompilationUnit astRoot) {
- while (joinColumns.hasNext()) {
- joinColumns.next().validate(messages, astRoot);
- }
- }
-
-
- // ********** join column owner adapters **********
-
- /**
- * just a little common behavior
- */
- abstract class AbstractJoinColumnOwner implements JavaJoinColumn.Owner
- {
- AbstractJoinColumnOwner() {
- super();
- }
-
- public TypeMapping getTypeMapping() {
- return getRelationshipMapping().getTypeMapping();
- }
-
- public RelationshipMapping getRelationshipMapping() {
- return GenericJavaJoinTable.this.getRelationshipMapping();
- }
-
- /**
- * 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 join table itself
- */
- public boolean tableIsAllowed() {
- return false;
- }
-
- 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);
- }
- }
-
-
- /**
- * owner for "forward-pointer" JoinColumns;
- * these point at the target/inverse entity
- */
- class InverseJoinColumnOwner extends AbstractJoinColumnOwner
- {
- public InverseJoinColumnOwner() {
- super();
- }
-
- public Entity getTargetEntity() {
- return GenericJavaJoinTable.this.getRelationshipMapping().getResolvedTargetEntity();
- }
-
- public String getAttributeName() {
- return GenericJavaJoinTable.this.getRelationshipMapping().getPersistentAttribute().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 targetEntity = getTargetEntity();
- return (targetEntity == null) ? null : targetEntity.getDbTable(tableName);
- }
-
- public org.eclipse.jpt.db.Table getReferencedColumnDbTable() {
- Entity targetEntity = getTargetEntity();
- return (targetEntity == null) ? null : targetEntity.getPrimaryDbTable();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return GenericJavaJoinTable.this.defaultInverseJoinColumn == joinColumn;
- }
-
- public String getDefaultColumnName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public int joinColumnsSize() {
- return GenericJavaJoinTable.this.inverseJoinColumnsSize();
- }
- }
-
-
- /**
- * owner for "back-pointer" JoinColumns;
- * these point at the source/owning entity
- */
- class JoinColumnOwner extends AbstractJoinColumnOwner
- {
- public JoinColumnOwner() {
- super();
- }
-
- public Entity getTargetEntity() {
- return GenericJavaJoinTable.this.getRelationshipMapping().getEntity();
- }
-
- public String getAttributeName() {
- Entity targetEntity = GenericJavaJoinTable.this.getRelationshipMapping().getResolvedTargetEntity();
- if (targetEntity == null) {
- return null;
- }
- String attributeName = GenericJavaJoinTable.this.getRelationshipMapping().getPersistentAttribute().getName();
- for (Iterator<PersistentAttribute> stream = targetEntity.getPersistentType().allAttributes(); stream.hasNext();) {
- PersistentAttribute attribute = stream.next();
- AttributeMapping mapping = attribute.getMapping();
- if (mapping instanceof NonOwningMapping) {
- String mappedBy = ((NonOwningMapping) mapping).getMappedBy();
- if ((mappedBy != null) && mappedBy.equals(attributeName)) {
- return attribute.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 GenericJavaJoinTable.this.defaultJoinColumn == joinColumn;
- }
-
- public String getDefaultColumnName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public int joinColumnsSize() {
- return GenericJavaJoinTable.this.joinColumnsSize();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaLobConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaLobConverter.java
deleted file mode 100644
index d79986e395..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaLobConverter.java
+++ /dev/null
@@ -1,68 +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.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.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
-{
- private 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.addSupportingAnnotation(getAnnotationName());
- }
-
- public void removeFromResourceModel() {
- this.resourcePersistentAttribute.removeSupportingAnnotation(getAnnotationName());
- }
-
- protected TemporalAnnotation getResourceLob() {
- return (TemporalAnnotation) this.resourcePersistentAttribute.getSupportingAnnotation(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/context/java/GenericJavaManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaManyToManyMapping.java
deleted file mode 100644
index df07fc3570..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaManyToManyMapping.java
+++ /dev/null
@@ -1,83 +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.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.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericJavaManyToManyMapping extends AbstractJavaMultiRelationshipMapping<ManyToManyAnnotation>
- implements JavaManyToManyMapping
-{
-
- public GenericJavaManyToManyMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return ManyToManyAnnotation.ANNOTATION_NAME;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return new ArrayIterator<String>(
- JPA.ORDER_BY,
- JPA.MAP_KEY,
- JPA.JOIN_TABLE);
- }
-
- // ********** JavaMultiRelationshipMapping implementation **********
-
- @Override
- protected boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- return this.getResourceMapping().mappedByTouches(pos, astRoot);
- }
-
-
- @Override
- protected void setMappedByOnResourceModel(String mappedBy) {
- getResourceMapping().setMappedBy(mappedBy);
- }
-
- @Override
- protected String mappedBy(ManyToManyAnnotation relationshipMapping) {
- return relationshipMapping.getMappedBy();
- }
-
- // ********** INonOwningMapping implementation **********
-
- public boolean mappedByIsValid(AttributeMapping mappedByMapping) {
- String mappedByKey = mappedByMapping.getKey();
- return (mappedByKey == MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- }
-
- @Override
- public TextRange getMappedByTextRange(CompilationUnit astRoot) {
- return this.getResourceMapping().getMappedByTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaManyToOneMapping.java
deleted file mode 100644
index acb5583cbf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaManyToOneMapping.java
+++ /dev/null
@@ -1,76 +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.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.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- *
- */
-public class GenericJavaManyToOneMapping
- extends AbstractJavaSingleRelationshipMapping<ManyToOneAnnotation>
- implements JavaManyToOneMapping
-{
-
- public GenericJavaManyToOneMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return new ArrayIterator<String>(
- JPA.JOIN_COLUMN,
- JPA.JOIN_COLUMNS,
- JPA.JOIN_TABLE
- );
- }
-
- public String getAnnotationName() {
- return ManyToOneAnnotation.ANNOTATION_NAME;
- }
-
- public String getKey() {
- return MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- public boolean isOverridableAssociationMapping() {
- return true;
- }
-
- @Override
- protected void setOptionalOnResourceModel(Boolean newOptional) {
- this.getResourceMapping().setOptional(newOptional);
- }
-
- @Override
- protected Boolean buildSpecifiedOptional(ManyToOneAnnotation relationshipMapping) {
- return relationshipMapping.getOptional();
- }
-
- //ManyToOne mapping is always the owning side
- public boolean isRelationshipOwner() {
- return true;
- }
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaMappedSuperclass.java
deleted file mode 100644
index 099dbed1d4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaMappedSuperclass.java
+++ /dev/null
@@ -1,170 +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.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.IdClass;
-import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-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.resource.java.MappedSuperclassAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-public class GenericJavaMappedSuperclass extends AbstractJavaTypeMapping
- implements JavaMappedSuperclass
-{
-
- protected String idClass;
-
- public GenericJavaMappedSuperclass(JavaPersistentType parent) {
- super(parent);
- }
-
- public boolean isMapped() {
- return true;
- }
-
- public String getKey() {
- return MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return MappedSuperclassAnnotation.ANNOTATION_NAME;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return new ArrayIterator<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);
- }
-
- public String getIdClass() {
- return this.idClass;
- }
-
- public void setIdClass(String newIdClass) {
- String oldIdClass = this.idClass;
- this.idClass = newIdClass;
- if (newIdClass != oldIdClass) {
- if (newIdClass != null) {
- if (getIdClassResource() == null) {
- addResourceIdClass();
- }
- getIdClassResource().setValue(newIdClass);
- }
- else {
- removeResourceIdClass();
- }
- }
- firePropertyChanged(IdClass.ID_CLASS_PROPERTY, oldIdClass, newIdClass);
- }
-
- protected void setIdClass_(String newIdClass) {
- String oldIdClass = this.idClass;
- this.idClass = newIdClass;
- firePropertyChanged(IdClass.ID_CLASS_PROPERTY, oldIdClass, newIdClass);
- }
-
- protected IdClassAnnotation getIdClassResource() {
- return (IdClassAnnotation) this.javaResourcePersistentType.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- }
-
- protected void addResourceIdClass() {
- this.javaResourcePersistentType.addSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- }
-
- protected void removeResourceIdClass() {
- this.javaResourcePersistentType.removeSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- }
-
- @Override
- public Iterator<String> overridableAttributeNames() {
- return this.namesOf(this.overridableAttributes());
- }
-
- @Override
- public Iterator<JavaPersistentAttribute> overridableAttributes() {
- return new FilteringIterator<JavaPersistentAttribute, JavaPersistentAttribute>(this.getPersistentType().attributes()) {
- @Override
- protected boolean accept(JavaPersistentAttribute o) {
- return o.isOverridableAttribute();
- }
- };
- }
-
- @Override
- public Iterator<String> overridableAssociationNames() {
- return this.namesOf(this.overridableAssociations());
- }
-
- @Override
- public Iterator<JavaPersistentAttribute> overridableAssociations() {
- return new FilteringIterator<JavaPersistentAttribute, JavaPersistentAttribute>(this.getPersistentType().attributes()) {
- @Override
- protected boolean accept(JavaPersistentAttribute o) {
- return o.isOverridableAssociation();
- }
- };
- }
-
- protected Iterator<String> namesOf(Iterator<JavaPersistentAttribute> attributes) {
- return new TransformationIterator<JavaPersistentAttribute, String>(attributes) {
- @Override
- protected String transform(JavaPersistentAttribute attribute) {
- return attribute.getName();
- }
- };
- }
-
- @Override
- public void initialize(JavaResourcePersistentType persistentTypeResource) {
- super.initialize(persistentTypeResource);
- this.initializeIdClass(persistentTypeResource);
- }
-
- protected void initializeIdClass(JavaResourcePersistentType typeResource) {
- IdClassAnnotation idClassResource = (IdClassAnnotation) typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- if (idClassResource != null) {
- this.idClass = idClassResource.getValue();
- }
- }
-
- @Override
- public void update(JavaResourcePersistentType persistentTypeResource) {
- super.update(persistentTypeResource);
- this.updateIdClass(persistentTypeResource);
- }
-
- protected void updateIdClass(JavaResourcePersistentType typeResource) {
- IdClassAnnotation idClass = (IdClassAnnotation) typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- if (idClass != null) {
- setIdClass_(idClass.getValue());
- }
- else {
- setIdClass_(null);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNamedNativeQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNamedNativeQuery.java
deleted file mode 100644
index f0a1514e05..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNamedNativeQuery.java
+++ /dev/null
@@ -1,81 +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.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.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 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/context/java/GenericJavaNamedQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNamedQuery.java
deleted file mode 100644
index 278cd169ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNamedQuery.java
+++ /dev/null
@@ -1,37 +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.java;
-
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaNamedQuery;
-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/context/java/GenericJavaNullAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNullAttributeMapping.java
deleted file mode 100644
index c3c43657ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNullAttributeMapping.java
+++ /dev/null
@@ -1,50 +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.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.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-
-public class GenericJavaNullAttributeMapping extends AbstractJavaAttributeMapping<JavaResourceNode>
-{
- public GenericJavaNullAttributeMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return null;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return EmptyIterator.instance();
- }
-
- @Override
- protected JavaResourceNode getResourceMapping() {
- return null;
- }
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNullConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNullConverter.java
deleted file mode 100644
index 4b5c29ce93..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNullConverter.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.internal.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.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() {
-
- }
-
- public void removeFromResourceModel() {
-
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public void update(JavaResourcePersistentAttribute jrpa) {
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaOneToManyMapping.java
deleted file mode 100644
index 7858eb3ec0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaOneToManyMapping.java
+++ /dev/null
@@ -1,86 +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.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.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericJavaOneToManyMapping extends AbstractJavaMultiRelationshipMapping<OneToManyAnnotation>
- implements JavaOneToManyMapping
-{
-
- public GenericJavaOneToManyMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return new ArrayIterator<String>(
- JPA.ORDER_BY,
- JPA.MAP_KEY,
- JPA.JOIN_TABLE,
- JPA.JOIN_COLUMN,
- JPA.JOIN_COLUMNS);
- }
-
-
- public String getKey() {
- return MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return OneToManyAnnotation.ANNOTATION_NAME;
- }
-
- // ********** JavaMultiRelationshipMapping implementation **********
-
- @Override
- protected boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- return this.getResourceMapping().mappedByTouches(pos, astRoot);
- }
-
- @Override
- protected void setMappedByOnResourceModel(String mappedBy) {
- this.getResourceMapping().setMappedBy(mappedBy);
- }
-
- @Override
- protected String mappedBy(OneToManyAnnotation relationshipMapping) {
- return relationshipMapping.getMappedBy();
- }
-
-
- // ********** NonOwningMapping implementation **********
- public boolean mappedByIsValid(AttributeMapping mappedByMapping) {
- String mappedByKey = mappedByMapping.getKey();
- return (mappedByKey == MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- }
-
- @Override
- public TextRange getMappedByTextRange(CompilationUnit astRoot) {
- return this.getResourceMapping().getMappedByTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaOneToOneMapping.java
deleted file mode 100644
index ca24e7be58..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaOneToOneMapping.java
+++ /dev/null
@@ -1,327 +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.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.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.NonOwningMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.OneToOneAnnotation;
-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.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- *
- */
-public class GenericJavaOneToOneMapping
- extends AbstractJavaSingleRelationshipMapping<OneToOneAnnotation>
- implements JavaOneToOneMapping
-{
- protected String mappedBy;
-
- protected final List<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns;
-
-
- public GenericJavaOneToOneMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.primaryKeyJoinColumns = new ArrayList<JavaPrimaryKeyJoinColumn>();
- }
-
-
- // ********** mapped by **********
-
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String mappedBy) {
- String old = this.mappedBy;
- this.mappedBy = mappedBy;
- this.getResourceMapping().setMappedBy(mappedBy);
- this.firePropertyChanged(NonOwningMapping.MAPPED_BY_PROPERTY, old, mappedBy);
- }
-
- protected void setMappedBy_(String mappedBy) {
- String old = this.mappedBy;
- this.mappedBy = mappedBy;
- this.firePropertyChanged(NonOwningMapping.MAPPED_BY_PROPERTY, old, mappedBy);
- }
-
- public boolean mappedByIsValid(AttributeMapping mappedByMapping) {
- return mappedByMapping.getKey() == MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
-
- // ********** primary key join columns **********
-
- public ListIterator<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns() {
- return new CloneListIterator<JavaPrimaryKeyJoinColumn>(this.primaryKeyJoinColumns);
- }
-
- public int primaryKeyJoinColumnsSize() {
- return this.primaryKeyJoinColumns.size();
- }
-
- public JavaPrimaryKeyJoinColumn addPrimaryKeyJoinColumn(int index) {
- JavaPrimaryKeyJoinColumn pkJoinColumn = this.getJpaFactory().buildJavaPrimaryKeyJoinColumn(this, this.createJoinColumnOwner());
- this.primaryKeyJoinColumns.add(index, pkJoinColumn);
- PrimaryKeyJoinColumnAnnotation pkJoinColumnAnnotation = (PrimaryKeyJoinColumnAnnotation) this.getResourcePersistentAttribute().addSupportingAnnotation(index, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- pkJoinColumn.initialize(pkJoinColumnAnnotation);
- this.fireItemAdded(PRIMARY_KEY_JOIN_COLUMNS_LIST, index, pkJoinColumn);
- return pkJoinColumn;
- }
-
- protected void addPrimaryKeyJoinColumn(int index, JavaPrimaryKeyJoinColumn joinColumn) {
- this.addItemToList(index, joinColumn, this.primaryKeyJoinColumns, PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- protected void addPrimaryKeyJoinColumn(JavaPrimaryKeyJoinColumn joinColumn) {
- this.addPrimaryKeyJoinColumn(this.primaryKeyJoinColumns.size(), joinColumn);
- }
-
- public void removePrimaryKeyJoinColumn(PrimaryKeyJoinColumn pkJoinColumn) {
- this.removePrimaryKeyJoinColumn(this.primaryKeyJoinColumns.indexOf(pkJoinColumn));
- }
-
- public void removePrimaryKeyJoinColumn(int index) {
- JavaPrimaryKeyJoinColumn pkJoinColumn = this.primaryKeyJoinColumns.remove(index);
- this.getResourcePersistentAttribute().removeSupportingAnnotation(index, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- this.fireItemRemoved(PRIMARY_KEY_JOIN_COLUMNS_LIST, index, pkJoinColumn);
- }
-
- protected void removePrimaryKeyJoinColumn_(JavaPrimaryKeyJoinColumn joinColumn) {
- this.removeItemFromList(joinColumn, this.primaryKeyJoinColumns, PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- public void movePrimaryKeyJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.primaryKeyJoinColumns, targetIndex, sourceIndex);
- this.getResourcePersistentAttribute().moveSupportingAnnotation(targetIndex, sourceIndex, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- this.fireItemMoved(PRIMARY_KEY_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- public boolean containsPrimaryKeyJoinColumns() {
- return ! this.primaryKeyJoinColumns.isEmpty();
- }
-
-
- // ********** JavaAttributeMapping implementation **********
-
- public Iterator<String> correspondingAnnotationNames() {
- return new ArrayIterator<String>(
- JPA.PRIMARY_KEY_JOIN_COLUMN,
- JPA.PRIMARY_KEY_JOIN_COLUMNS,
- JPA.JOIN_COLUMN,
- JPA.JOIN_COLUMNS,
- JPA.JOIN_TABLE);
- }
-
- public String getAnnotationName() {
- return OneToOneAnnotation.ANNOTATION_NAME;
- }
-
-
- // ********** AttributeMapping implementation **********
-
- public String getKey() {
- return MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
-
- // ********** RelationshipMapping implementation **********
-
- public boolean isRelationshipOwner() {
- return this.getMappedBy() == null;
- }
-
-
- // ********** AbstractJavaSingleRelationshipMapping implementation **********
-
- @Override
- protected void setOptionalOnResourceModel(Boolean newOptional) {
- this.getResourceMapping().setOptional(newOptional);
- }
-
- @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.mappedByTouches(pos, astRoot)) {
- return this.javaCandidateMappedByAttributeNames(filter);
- }
- return null;
- }
-
- protected boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- return this.getResourceMapping().mappedByTouches(pos, astRoot);
- }
-
- @Override
- public boolean isOverridableAssociationMapping() {
- return true;
- }
-
- @Override
- protected void initialize(OneToOneAnnotation resourceOneToOne) {
- super.initialize(resourceOneToOne);
- this.mappedBy = resourceOneToOne.getMappedBy();
- }
-
- @Override
- protected Boolean buildSpecifiedOptional(OneToOneAnnotation oneToOneResource) {
- return oneToOneResource.getOptional();
- }
-
-
- // ********** resource => context **********
-
- @Override
- public void initialize(JavaResourcePersistentAttribute javaResourcePersistentAttribute) {
- super.initialize(javaResourcePersistentAttribute);
- this.initializePrimaryKeyJoinColumns(javaResourcePersistentAttribute);
- }
-
- protected void initializePrimaryKeyJoinColumns(JavaResourcePersistentAttribute javaResourcePersistentAttribute) {
- for (ListIterator<NestableAnnotation> stream = javaResourcePersistentAttribute.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME); stream.hasNext(); ) {
- this.primaryKeyJoinColumns.add(buildPrimaryKeyJoinColumn((PrimaryKeyJoinColumnAnnotation) stream.next()));
- }
- }
-
- protected JavaPrimaryKeyJoinColumn buildPrimaryKeyJoinColumn(PrimaryKeyJoinColumnAnnotation primaryKeyJoinColumnResource) {
- JavaPrimaryKeyJoinColumn pkJoinColumn = getJpaFactory().buildJavaPrimaryKeyJoinColumn(this, createJoinColumnOwner());
- pkJoinColumn.initialize(primaryKeyJoinColumnResource);
- return pkJoinColumn;
- }
-
- @Override
- protected void update(OneToOneAnnotation resourceOneToOne) {
- super.update(resourceOneToOne);
- this.setMappedBy_(resourceOneToOne.getMappedBy());
- }
-
- @Override
- public void update(JavaResourcePersistentAttribute javaResourcePersistentAttribute) {
- super.update(javaResourcePersistentAttribute);
- this.updatePrimaryKeyJoinColumns(javaResourcePersistentAttribute);
- }
-
- protected void updatePrimaryKeyJoinColumns(JavaResourcePersistentAttribute javaResourcePersistentAttribute) {
- ListIterator<JavaPrimaryKeyJoinColumn> contextPkJoinColumns = primaryKeyJoinColumns();
- ListIterator<NestableAnnotation> resourcePkJoinColumns = javaResourcePersistentAttribute.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
-
- while (contextPkJoinColumns.hasNext()) {
- JavaPrimaryKeyJoinColumn pkJoinColumn = contextPkJoinColumns.next();
- if (resourcePkJoinColumns.hasNext()) {
- pkJoinColumn.update((PrimaryKeyJoinColumnAnnotation) resourcePkJoinColumns.next());
- }
- else {
- removePrimaryKeyJoinColumn_(pkJoinColumn);
- }
- }
-
- while (resourcePkJoinColumns.hasNext()) {
- addPrimaryKeyJoinColumn(buildPrimaryKeyJoinColumn((PrimaryKeyJoinColumnAnnotation) resourcePkJoinColumns.next()));
- }
- }
-
-
- // ********** Validation **********
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
-
- if (this.mappedBy != null) {
- this.validateMappedBy(messages ,astRoot);
- }
- }
-
- @Override
- protected void validateJoinColumns(List<IMessage> messages, CompilationUnit astRoot) {
- if (this.primaryKeyJoinColumns.isEmpty() || this.containsSpecifiedJoinColumns()) {
- super.validateJoinColumns(messages, astRoot);
- }
- }
-
- protected void validateMappedBy(List<IMessage> messages, CompilationUnit astRoot) {
- Entity targetEntity = this.getResolvedTargetEntity();
- if (targetEntity == null) {
- return; // null target entity is validated elsewhere
- }
-
- PersistentAttribute attribute = targetEntity.getPersistentType().resolveAttribute(this.mappedBy);
-
- if (attribute == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAPPING_UNRESOLVED_MAPPED_BY,
- new String[] {this.mappedBy},
- this,
- this.getMappedByTextRange(astRoot)
- )
- );
- return;
- }
-
- AttributeMapping mappedByMapping = attribute.getMapping();
- if ( ! this.mappedByIsValid(mappedByMapping)) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAPPING_INVALID_MAPPED_BY,
- new String[] {this.mappedBy},
- this,
- this.getMappedByTextRange(astRoot)
- )
- );
- return;
- }
-
- if ((mappedByMapping instanceof NonOwningMapping)
- && ((NonOwningMapping) mappedByMapping).getMappedBy() != null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAPPING_MAPPED_BY_ON_BOTH_SIDES,
- this,
- this.getMappedByTextRange(astRoot)
- )
- );
- }
- }
-
- protected TextRange getMappedByTextRange(CompilationUnit astRoot) {
- return this.getResourceMapping().getMappedByTextRange(astRoot);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPersistentAttribute.java
deleted file mode 100644
index fbca4f0426..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPersistentAttribute.java
+++ /dev/null
@@ -1,338 +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.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.JpaStructureNode;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-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.JavaStructureNodes;
-import org.eclipse.jpt.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.core.internal.utility.jdt.JDTTools;
-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.CollectionTools;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- *
- */
-public class GenericJavaPersistentAttribute
- extends AbstractJavaJpaContextNode
- implements JavaPersistentAttribute
-{
- protected String name;
-
- protected JavaAttributeMapping defaultMapping;
-
- protected JavaAttributeMapping specifiedMapping;
-
- protected JavaResourcePersistentAttribute resourcePersistentAttribute;
-
-
- public GenericJavaPersistentAttribute(JavaPersistentType parent, JavaResourcePersistentAttribute jrpa) {
- super(parent);
- this.initialize(jrpa);
- }
-
- public String getId() {
- return JavaStructureNodes.PERSISTENT_ATTRIBUTE_ID;
- }
-
- protected void initialize(JavaResourcePersistentAttribute jrpa) {
- this.resourcePersistentAttribute = jrpa;
- this.name = this.name(jrpa);
- initializeDefaultMapping(jrpa);
- initializeSpecifiedMapping(jrpa);
- }
-
- protected void initializeDefaultMapping(JavaResourcePersistentAttribute jrpa) {
- this.defaultMapping = getJpaPlatform().buildDefaultJavaAttributeMapping(this);
- this.defaultMapping.initialize(jrpa);
- }
-
- protected void initializeSpecifiedMapping(JavaResourcePersistentAttribute jrpa) {
- String javaMappingAnnotationName = this.javaMappingAnnotationName(jrpa);
- this.specifiedMapping = createJavaAttributeMappingFromAnnotation(javaMappingAnnotationName, jrpa);
- }
-
- public JavaResourcePersistentAttribute getResourcePersistentAttribute() {
- return this.resourcePersistentAttribute;
- }
-
- public JavaPersistentType getPersistentType() {
- return (JavaPersistentType) this.getParent();
- }
-
- public JavaTypeMapping getTypeMapping() {
- return this.getPersistentType().getMapping();
- }
-
- public String getPrimaryKeyColumnName() {
- return this.getMapping().getPrimaryKeyColumnName();
- }
-
- public boolean isOverridableAttribute() {
- return this.getMapping().isOverridableAttributeMapping();
- }
-
- public boolean isOverridableAssociation() {
- return this.getMapping().isOverridableAssociationMapping();
- }
-
- public boolean isIdAttribute() {
- return this.getMapping().isIdMapping();
- }
-
- public boolean isVirtual() {
- return false;
- }
-
- public String getName() {
- return this.name;
- }
-
- protected void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public JavaAttributeMapping getDefaultMapping() {
- return this.defaultMapping;
- }
-
- /**
- * clients do not set the "default" mapping
- */
- protected void setDefaultMapping(JavaAttributeMapping newDefaultMapping) {
- JavaAttributeMapping oldMapping = this.defaultMapping;
- this.defaultMapping = newDefaultMapping;
- firePropertyChanged(PersistentAttribute.DEFAULT_MAPPING_PROPERTY, oldMapping, newDefaultMapping);
- }
-
- public JavaAttributeMapping getSpecifiedMapping() {
- return this.specifiedMapping;
- }
-
- /**
- * clients do not set the "specified" mapping;
- * use #setMappingKey(String)
- */
- protected void setSpecifiedMapping(JavaAttributeMapping newSpecifiedMapping) {
- JavaAttributeMapping oldMapping = this.specifiedMapping;
- this.specifiedMapping = newSpecifiedMapping;
- firePropertyChanged(PersistentAttribute.SPECIFIED_MAPPING_PROPERTY, oldMapping, newSpecifiedMapping);
- }
-
-
- public JavaAttributeMapping getMapping() {
- return (this.specifiedMapping != null) ? this.specifiedMapping : this.defaultMapping;
- }
-
- public String getMappingKey() {
- return this.getMapping().getKey();
- }
-
- /**
- * return null if there is no "default" mapping for the attribute
- */
- public String getDefaultMappingKey() {
- return this.defaultMapping.getKey();
- }
-
- /**
- * return null if there is no "specified" mapping for the attribute
- */
- public 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 newKey) {
- if (newKey == getSpecifiedMappingKey()) {
- return;
- }
- JavaAttributeMapping oldMapping = getMapping();
- JavaAttributeMapping newMapping = createJavaAttributeMappingFromMappingKey(newKey);
-
- this.specifiedMapping = newMapping;
- if (newMapping != null) {
- this.resourcePersistentAttribute.setMappingAnnotation(newMapping.getAnnotationName());
- }
- else {
- this.resourcePersistentAttribute.setMappingAnnotation(null);
- }
- firePropertyChanged(PersistentAttribute.SPECIFIED_MAPPING_PROPERTY, oldMapping, newMapping);
-
- if (oldMapping != null) {
- Collection<String> annotationsToRemove = CollectionTools.collection(oldMapping.correspondingAnnotationNames());
- if (getMapping() != null) {
- CollectionTools.removeAll(annotationsToRemove, getMapping().correspondingAnnotationNames());
- }
-
- for (String annotationName : annotationsToRemove) {
- this.resourcePersistentAttribute.removeSupportingAnnotation(annotationName);
- }
- }
- }
-
- public JpaStructureNode getStructureNode(int textOffset) {
- return this;
- }
-
- 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);
- }
-
-
- public TextRange getFullTextRange(CompilationUnit astRoot) {
- return this.resourcePersistentAttribute.getTextRange(astRoot);
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.getSelectionTextRange(astRoot);
- }
-
- public TextRange getSelectionTextRange(CompilationUnit astRoot) {
- return this.resourcePersistentAttribute.getNameTextRange(astRoot);
- }
-
- public TextRange getSelectionTextRange() {
- return getSelectionTextRange(this.buildASTRoot());
- }
-
- protected CompilationUnit buildASTRoot() {
- return JDTTools.buildASTRoot(this.resourcePersistentAttribute.getJpaCompilationUnit().getCompilationUnit());
- }
-
- public void update() {
- this.setName(this.name(this.resourcePersistentAttribute));
- this.updateDefaultMapping(this.resourcePersistentAttribute);
- this.updateSpecifiedMapping(this.resourcePersistentAttribute);
- }
-
- protected String name(JavaResourcePersistentAttribute jrpa) {
- return jrpa.getName();
- }
-
- public String specifiedMappingAnnotationName() {
- return (this.specifiedMapping == null) ? null : this.specifiedMapping.getAnnotationName();
- }
-
- protected void updateSpecifiedMapping(JavaResourcePersistentAttribute jrpa) {
- String javaMappingAnnotationName = this.javaMappingAnnotationName(jrpa);
- if (specifiedMappingAnnotationName() != javaMappingAnnotationName) {
- setSpecifiedMapping(createJavaAttributeMappingFromAnnotation(javaMappingAnnotationName, jrpa));
- }
- else {
- if (getSpecifiedMapping() != null) {
- getSpecifiedMapping().update(jrpa);
- }
- }
- }
-
- protected void updateDefaultMapping(JavaResourcePersistentAttribute jrpa) {
- String defaultMappingKey = getJpaPlatform().getDefaultJavaAttributeMappingKey(this);
- if (getDefaultMapping().getKey() != defaultMappingKey) {
- JavaAttributeMapping oldDefaultMapping = this.defaultMapping;
- this.defaultMapping = getJpaPlatform().buildDefaultJavaAttributeMapping(this);
- this.defaultMapping.initialize(jrpa);
- firePropertyChanged(PersistentAttribute.DEFAULT_MAPPING_PROPERTY, oldDefaultMapping, this.defaultMapping);
- }
- else {
- getDefaultMapping().update(jrpa);
- }
- }
-
- protected String javaMappingAnnotationName(JavaResourcePersistentAttribute jrpa) {
- Annotation mappingAnnotation = (Annotation) jrpa.getMappingAnnotation();
- if (mappingAnnotation != null) {
- return mappingAnnotation.getAnnotationName();
- }
- return null;
- }
-
- protected JavaAttributeMapping createJavaAttributeMappingFromMappingKey(String key) {
- if (key == MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY) {
- return null;
- }
- return getJpaPlatform().buildJavaAttributeMappingFromMappingKey(key, this);
- }
-
- protected JavaAttributeMapping createJavaAttributeMappingFromAnnotation(String annotationName, JavaResourcePersistentAttribute jrpa) {
- if (annotationName == null) {
- return null;
- }
- JavaAttributeMapping mapping = getJpaPlatform().buildJavaAttributeMappingFromAnnotation(annotationName, this);
- mapping.initialize(jrpa);
- return mapping;
- }
-
- /**
- * the mapping might be "default", but it still might be a "null" mapping...
- */
- public boolean mappingIsDefault(JavaAttributeMapping mapping) {
- return this.defaultMapping == mapping;
- }
-
- @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);
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
-
- if (this.specifiedMapping != null) {
- this.specifiedMapping.validate(messages, astRoot);
- }
- else if (this.defaultMapping != null) {
- this.defaultMapping.validate(messages, astRoot);
- }
- }
-
-
- // ********** misc **********
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(this.name);
- }
-
- public void dispose() {
- //nothing to dispose
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPersistentType.java
deleted file mode 100644
index b52ed5a7d4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPersistentType.java
+++ /dev/null
@@ -1,551 +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.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.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.PersistentTypeContext;
-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.internal.utility.jdt.JDTTools;
-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.TextRange;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-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.wst.validation.internal.provisional.core.IMessage;
-
-public class GenericJavaPersistentType extends AbstractJavaJpaContextNode implements JavaPersistentType
-{
- protected String name;
-
- protected JavaTypeMapping mapping;
-
- protected final List<JavaPersistentAttribute> attributes;
-
- protected AccessType access;
-
- protected PersistentType parentPersistentType;
-
- protected JavaResourcePersistentType resourcePersistentType;
-
- public GenericJavaPersistentType(PersistentTypeContext parent, JavaResourcePersistentType jrpt) {
- super(parent);
- this.attributes = new ArrayList<JavaPersistentAttribute>();
- this.initialize(jrpt);
- }
-
- @Override
- public IResource getResource() {
- return this.resourcePersistentType.getJpaCompilationUnit().getCompilationUnit().getResource();
- }
-
- //****************** JpaStructureNode implementation *******************
-
- public String getId() {
- return JavaStructureNodes.PERSISTENT_TYPE_ID;
- }
-
- //****************** PersistentType implementation *******************
-
- public PersistentTypeContext getContext() {
- return (PersistentTypeContext) getParent();
- }
-
- public String getName() {
- return this.name;
- }
-
- public String getShortName(){
- return getName().substring(getName().lastIndexOf('.') + 1);
- }
-
- protected void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public JavaTypeMapping getMapping() {
- return this.mapping;
- }
-
- public String getMappingKey() {
- return getMapping().getKey();
- }
-
- public void setMappingKey(String key) {
- if (key == getMapping().getKey()) {
- return;
- }
- JavaTypeMapping oldMapping = getMapping();
- JavaTypeMapping newMapping = createJavaTypeMappingFromMappingKey(key);
-
- this.mapping = newMapping;
- this.resourcePersistentType.setMappingAnnotation(newMapping.getAnnotationName());
- firePropertyChanged(PersistentType.MAPPING_PROPERTY, oldMapping, newMapping);
-
- if (oldMapping != null) {
- Collection<String> annotationsToRemove = CollectionTools.collection(oldMapping.correspondingAnnotationNames());
- if (getMapping() != null) {
- CollectionTools.removeAll(annotationsToRemove, getMapping().correspondingAnnotationNames());
- }
-
- for (String annotationName : annotationsToRemove) {
- this.resourcePersistentType.removeSupportingAnnotation(annotationName);
- }
- }
- }
-
- protected void setMapping(JavaTypeMapping newMapping) {
- JavaTypeMapping oldMapping = this.mapping;
- this.mapping = newMapping;
- firePropertyChanged(PersistentType.MAPPING_PROPERTY, oldMapping, newMapping);
- }
-
- public boolean isMapped() {
- return getMapping().isMapped();
- }
-
- public AccessType getAccess() {
- return this.access;
- }
-
- protected void setAccess(AccessType newAccess) {
- AccessType oldAccess = this.access;
- this.access = newAccess;
- firePropertyChanged(PersistentType.ACCESS_PROPERTY, oldAccess, newAccess);
- }
-
- protected Iterator<JavaPersistentAttribute> attributesNamed(final String attributeName) {
- return new FilteringIterator<JavaPersistentAttribute, JavaPersistentAttribute>(attributes()) {
- @Override
- protected boolean accept(JavaPersistentAttribute o) {
- return attributeName.equals(o.getName());
- }
- };
- }
-
- public JavaPersistentAttribute getAttributeNamed(String attributeName) {
- Iterator<JavaPersistentAttribute> stream = attributesNamed(attributeName);
- return (stream.hasNext()) ? stream.next() : null;
- }
-
- public PersistentAttribute resolveAttribute(String attributeName) {
- Iterator<JavaPersistentAttribute> stream = attributesNamed(attributeName);
- if (stream.hasNext()) {
- JavaPersistentAttribute attribute = stream.next();
- return (stream.hasNext()) ? null /*more than one*/: attribute;
- }
- return (getParentPersistentType() == null) ? null : getParentPersistentType().resolveAttribute(attributeName);
- }
-
- public ListIterator<JavaPersistentAttribute> attributes() {
- return new CloneListIterator<JavaPersistentAttribute>(this.attributes);
- }
-
- public int attributesSize() {
- return this.attributes.size();
- }
-
- private void addAttribute(int index, JavaPersistentAttribute attribute) {
- addItemToList(index, attribute, this.attributes, PersistentType.SPECIFIED_ATTRIBUTES_LIST);
- }
-
- private void removeAttribute(JavaPersistentAttribute attribute) {
- removeItemFromList(attribute, this.attributes, PersistentType.SPECIFIED_ATTRIBUTES_LIST);
- }
-
- private void moveAttribute(int index, JavaPersistentAttribute attribute) {
- moveItemInList(index, this.attributes.indexOf(attribute), this.attributes, PersistentType.SPECIFIED_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 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());
- }
-
- @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 (Iterator<JavaPersistentAttribute> stream = attributes(); stream.hasNext();) {
- values = stream.next().javaCompletionProposals(pos, filter, astRoot);
- if (values != null) {
- return values;
- }
- }
- return EmptyIterator.instance();
- }
-
- // 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 (Iterator<JavaPersistentAttribute> stream = this.attributes(); stream.hasNext();) {
- JavaPersistentAttribute persistentAttribute = stream.next();
- if (persistentAttribute.contains(offset, astRoot)) {
- return persistentAttribute;
- }
- }
- return this;
- }
- return null;
- }
-
- protected CompilationUnit buildASTRoot() {
- return JDTTools.buildASTRoot(this.resourcePersistentType.getJpaCompilationUnit().getCompilationUnit());
- }
-
- public 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 getValidationTextRange(CompilationUnit astRoot) {
- return this.getSelectionTextRange(astRoot);
- }
-
- public TextRange getSelectionTextRange(CompilationUnit astRoot) {
- return this.resourcePersistentType.getNameTextRange(astRoot);
- }
-
- public TextRange getSelectionTextRange() {
- return this.getSelectionTextRange(this.buildASTRoot());
- }
-
-
- public Iterator<PersistentType> inheritanceHierarchy() {
- // using a chain iterator to traverse up the inheritance tree
- return new ChainIterator<PersistentType>(this) {
- @Override
- protected PersistentType nextLink(PersistentType pt) {
- return pt.getParentPersistentType();
- }
- };
- }
-
- public Iterator<PersistentType> ancestors() {
- // using a chain iterator to traverse up the inheritance tree
- return new ChainIterator<PersistentType>(this.getParentPersistentType()) {
- @Override
- protected PersistentType nextLink(PersistentType pt) {
- return pt.getParentPersistentType();
- }
- };
- }
-
- public PersistentType getParentPersistentType() {
- return this.parentPersistentType;
- }
-
- public void setParentPersistentType(PersistentType newParentPersistentType) {
- if (attributeValueHasNotChanged(this.parentPersistentType, newParentPersistentType)) {
- return;
- }
- PersistentType oldParentPersistentType = this.parentPersistentType;
- this.parentPersistentType = newParentPersistentType;
- firePropertyChanged(PersistentType.PARENT_PERSISTENT_TYPE_PROPERTY, oldParentPersistentType, newParentPersistentType);
- }
-
- public boolean hasAnyAttributeMappingAnnotations() {
- return this.resourcePersistentType.hasAnyAttributeAnnotations();
- }
-
- // ******************** Updating **********************
- protected void initialize(JavaResourcePersistentType jrpt) {
- this.resourcePersistentType = jrpt;
- this.parentPersistentType = this.parentPersistentType(jrpt);
- this.access = this.access(jrpt);
- this.name = this.name(jrpt);
- this.initializeMapping(jrpt);
- this.initializePersistentAttributes(jrpt);
- }
-
- protected void initializeMapping(JavaResourcePersistentType jrpt) {
- this.mapping = getJpaPlatform().buildJavaTypeMappingFromAnnotation(this.javaMappingAnnotationName(jrpt), this);
- this.mapping.initialize(jrpt);
- }
-
- protected void initializePersistentAttributes(JavaResourcePersistentType jrpt) {
- for (Iterator<JavaResourcePersistentAttribute> stream = this.persistentAttributes(jrpt); stream.hasNext(); ) {
- this.attributes.add(this.createAttribute(stream.next()));
- }
- }
-
- protected Iterator<JavaResourcePersistentAttribute> persistentAttributes(JavaResourcePersistentType jrpt) {
- return (this.getAccess() == AccessType.PROPERTY) ? jrpt.persistableProperties() : jrpt.persistableFields();
- }
-
- public void update(JavaResourcePersistentType jrpt) {
- this.resourcePersistentType = jrpt;
- getJpaFile(this.resourcePersistentType.getFile()).addRootStructureNode(this.resourcePersistentType.getQualifiedName(), this);
- updateParentPersistentType(jrpt);
- updateAccess(jrpt);
- updateName(jrpt);
- updateMapping(jrpt);
- updatePersistentAttributes(jrpt);
- }
-
- protected void updateAccess(JavaResourcePersistentType jrpt) {
- this.setAccess(this.access(jrpt));
- }
-
- /**
- * Check the access "specified" by the java resource model.
- * Check xml mapping specified access first
- * If still null check java annotations if the xml is not metadata-complete = true
- * If still null then set to parentPersistentType access.
- * If still null check entity-mappings specified access setting if this persistent-type is listed in an orm.xml file
- * If still null check the persistence-unit default Access
- * Default to FIELD if all else fails.
- */
- protected AccessType access(JavaResourcePersistentType jrpt) {
- AccessType javaAccess = getContext().getOverridePersistentTypeAccess();
- if (javaAccess == null) {
- javaAccess = AccessType.fromJavaResourceModel(jrpt.getAccess());
- }
- if (javaAccess == null) {
- if (getParentPersistentType() != null) {
- javaAccess = getParentPersistentType().getAccess();
- }
- }
- if (javaAccess == null) {
- javaAccess = getContext().getDefaultPersistentTypeAccess();
- }
- if (javaAccess == null) {
- // last ditch attempt to allow the user to annotate *something*
- javaAccess = AccessType.FIELD;
- }
- return javaAccess;
- }
-
- protected void updateName(JavaResourcePersistentType jrpt) {
- this.setName(this.name(jrpt));
- }
-
- protected String name(JavaResourcePersistentType jrpt) {
- return jrpt.getQualifiedName();
- }
-
- protected void updateMapping(JavaResourcePersistentType jrpt) {
- String javaMappingAnnotationName = this.javaMappingAnnotationName(jrpt);
- if (getMapping().getAnnotationName() != javaMappingAnnotationName) {
- setMapping(createJavaTypeMappingFromAnnotation(javaMappingAnnotationName, jrpt));
- }
- else {
- getMapping().update(jrpt);
- }
- }
-
- protected JavaTypeMapping createJavaTypeMappingFromMappingKey(String key) {
- return getJpaPlatform().buildJavaTypeMappingFromMappingKey(key, this);
- }
-
- protected JavaTypeMapping createJavaTypeMappingFromAnnotation(String annotationName, JavaResourcePersistentType jrpt) {
- JavaTypeMapping typeMapping = getJpaPlatform().buildJavaTypeMappingFromAnnotation(annotationName, this);
- typeMapping.initialize(jrpt);
- return typeMapping;
- }
-
- protected String javaMappingAnnotationName(JavaResourcePersistentType jrpt) {
- Annotation mappingAnnotation = (Annotation) jrpt.getMappingAnnotation();
- if (mappingAnnotation != null) {
- return mappingAnnotation.getAnnotationName();
- }
- return null;
- }
-
- protected void updatePersistentAttributes(JavaResourcePersistentType jrpt) {
- Collection<JavaPersistentAttribute> contextAttributesToRemove = CollectionTools.collection(attributes());
- Collection<JavaPersistentAttribute> contextAttributesToUpdate = new ArrayList<JavaPersistentAttribute>();
- int resourceIndex = 0;
-
- for (Iterator<JavaResourcePersistentAttribute> stream = this.persistentAttributes(jrpt); stream.hasNext(); ) {
- JavaResourcePersistentAttribute resourceAttribute = stream.next();
- boolean contextAttributeFound = false;
- for (JavaPersistentAttribute contextAttribute : contextAttributesToRemove) {
- if (contextAttribute.getResourcePersistentAttribute() == resourceAttribute) {
- moveAttribute(resourceIndex, contextAttribute);
- contextAttributesToRemove.remove(contextAttribute);
- contextAttributesToUpdate.add(contextAttribute);
- contextAttributeFound = true;
- break;
- }
- }
- if (!contextAttributeFound) {
- addAttribute(resourceIndex, createAttribute(resourceAttribute));
- }
- resourceIndex++;
- }
- for (JavaPersistentAttribute contextAttribute : contextAttributesToRemove) {
- removeAttribute(contextAttribute);
- }
- //first handle adding/removing of the persistent attributes, then update the others last,
- //this causes less churn in the update process
- for (JavaPersistentAttribute contextAttribute : contextAttributesToUpdate) {
- contextAttribute.update();
- }
- }
-
- protected JavaPersistentAttribute createAttribute(JavaResourcePersistentAttribute jrpa) {
- return getJpaFactory().buildJavaPersistentAttribute(this, jrpa);
- }
-
- public void updateParentPersistentType(JavaResourcePersistentType jrpt) {
- setParentPersistentType(parentPersistentType(jrpt));
- }
-
- protected PersistentType parentPersistentType(JavaResourcePersistentType jrpt) {
- return parentPersistentType(jrpt.getSuperClassQualifiedName());
- }
-
- protected PersistentType parentPersistentType(String fullyQualifiedTypeName) {
- PersistentType possibleParent = possibleParent(fullyQualifiedTypeName);
- if (possibleParent == null) {
- return null;
- }
- if (possibleParent.isMapped()) {
- return possibleParent;
- }
- return possibleParent.getParentPersistentType();
- }
-
- /**
- * JPA spec supports the case where there are non-persistent types in the hierarchy
- * This will check for a PersistentType with the given name in this PersistenceUnit.
- * If it is not found then find the JavaPersistentTypeResource and look for its parent type
- */
- protected PersistentType possibleParent(String fullyQualifiedTypeName) {
- PersistentType possibleParent = getPersistentType(fullyQualifiedTypeName);
- if (possibleParent != null) {
- return possibleParent;
- }
- JavaResourcePersistentType jrpt = getJpaProject().getJavaResourcePersistentType(fullyQualifiedTypeName);
- return (jrpt == null) ? null : this.possibleParent(jrpt.getSuperClassQualifiedName());
- }
-
- protected PersistentType getPersistentType(String fullyQualifiedTypeName) {
- return getPersistenceUnit().getPersistentType(fullyQualifiedTypeName);
- }
-
-
- // ********** validation **********
-
- public void validate(List<IMessage> messages) {
- // build the AST root here to pass down
- this.validate(messages, this.buildASTRoot());
- }
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- this.validateMapping(messages, astRoot);
- this.validateAttributes(messages, astRoot);
- }
-
- protected void validateMapping(List<IMessage> messages, CompilationUnit astRoot) {
- try {
- this.mapping.validate(messages, astRoot);
- } catch(Throwable t) {
- JptCorePlugin.log(t);
- }
- }
-
- protected void validateAttributes(List<IMessage> messages, CompilationUnit astRoot) {
- for (Iterator<JavaPersistentAttribute> stream = this.attributes(); stream.hasNext(); ) {
- this.validateAttribute(stream.next(), messages, astRoot);
- }
- }
-
- protected void validateAttribute(JavaPersistentAttribute attribute, List<IMessage> messages, CompilationUnit astRoot) {
- try {
- attribute.validate(messages, astRoot);
- } catch(Throwable t) {
- JptCorePlugin.log(t);
- }
- }
-
-
- // ********** misc **********
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(this.name);
- }
-
- public void dispose() {
- JpaFile jpaFile = getJpaFile(this.resourcePersistentType.getFile());
- if (jpaFile != null) {
- // the JPA file can be null if the .java file was deleted
- jpaFile.removeRootStructureNode(this.resourcePersistentType.getQualifiedName());
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPrimaryKeyJoinColumn.java
deleted file mode 100644
index ec53fc977b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPrimaryKeyJoinColumn.java
+++ /dev/null
@@ -1,176 +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.java;
-
-import java.util.Iterator;
-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.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.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-
-public class GenericJavaPrimaryKeyJoinColumn extends AbstractJavaNamedColumn<PrimaryKeyJoinColumnAnnotation>
- implements JavaPrimaryKeyJoinColumn
-{
- protected String specifiedReferencedColumnName;
-
- protected String defaultReferencedColumnName;
-
- protected PrimaryKeyJoinColumnAnnotation resourcePrimaryKeyJoinColumn;
-
- public GenericJavaPrimaryKeyJoinColumn(JavaJpaContextNode parent, JavaBaseJoinColumn.Owner owner) {
- super(parent, owner);
- }
-
- @Override
- public void initialize(PrimaryKeyJoinColumnAnnotation column) {
- this.resourcePrimaryKeyJoinColumn = column;
- super.initialize(column);
- this.specifiedReferencedColumnName = this.specifiedReferencedColumnName(column);
- this.defaultReferencedColumnName = this.defaultReferencedColumnName();
- }
-
- //************** JavaNamedColumn implementation ***************
- @Override
- public JavaBaseJoinColumn.Owner getOwner() {
- return (JavaBaseJoinColumn.Owner) super.getOwner();
- }
-
- @Override
- protected PrimaryKeyJoinColumnAnnotation getResourceColumn() {
- return this.resourcePrimaryKeyJoinColumn;
- }
-
- //************** IAbstractJoinColumn 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
- protected String getTableName() {
- return this.getOwner().getTypeMapping().getPrimaryTableName();
- }
-
- public Column getReferencedDbColumn() {
- Table table = this.getReferencedColumnDbTable();
- return (table == null) ? null : table.getColumnForIdentifier(this.getReferencedColumnName());
- }
-
- protected 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.javaCandidateReferencedColumnNames(filter);
- }
- return null;
- }
-
- private Iterator<String> javaCandidateReferencedColumnNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.candidateReferencedColumnNames(filter));
- }
-
- private Iterator<String> candidateReferencedColumnNames(Filter<String> filter) {
- return new FilteringIterator<String, String>(this.candidateReferencedColumnNames(), filter);
- }
-
- private Iterator<String> candidateReferencedColumnNames() {
- Table table = this.getOwner().getReferencedColumnDbTable();
- return (table != null) ? table.sortedColumnIdentifiers() : EmptyIterator.<String> instance();
- }
-
- public boolean isReferencedColumnResolved() {
- return getReferencedDbColumn() != null;
- }
-
- public TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot) {
- return this.getResourceColumn().getReferencedColumnNameTextRange(astRoot);
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = getResourceColumn().getTextRange(astRoot);
- return (textRange != null) ? textRange : this.getOwner().getValidationTextRange(astRoot);
- }
-
- @Override
- public void update(PrimaryKeyJoinColumnAnnotation resourceColumn) {
- this.resourcePrimaryKeyJoinColumn = resourceColumn;
- super.update(resourceColumn);
- this.setSpecifiedReferencedColumnName_(this.specifiedReferencedColumnName(resourceColumn));
- this.setDefaultReferencedColumnName(this.defaultReferencedColumnName());
- }
-
- protected String specifiedReferencedColumnName(PrimaryKeyJoinColumnAnnotation resourceColumn) {
- return resourceColumn.getReferencedColumnName();
- }
-
- //TODO not correct when we start supporting primaryKeyJoinColumns in 1-1 mappings
- protected String defaultReferencedColumnName() {
- return buildDefaultName();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append("=>");
- sb.append(this.getReferencedColumnName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaQueryHint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaQueryHint.java
deleted file mode 100644
index d03e9a660c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaQueryHint.java
+++ /dev/null
@@ -1,76 +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.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.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/context/java/GenericJavaSecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaSecondaryTable.java
deleted file mode 100644
index e27eb22db4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaSecondaryTable.java
+++ /dev/null
@@ -1,389 +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.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.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.SecondaryTable;
-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.resource.java.NullPrimaryKeyJoinColumn;
-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;
-
-/**
- *
- */
-public class GenericJavaSecondaryTable
- extends AbstractJavaTable
- implements JavaSecondaryTable
-{
- protected final List<JavaPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns;
-
- protected JavaPrimaryKeyJoinColumn defaultPrimaryKeyJoinColumn;
-
- protected SecondaryTableAnnotation resourceSecondaryTable;
-
- public GenericJavaSecondaryTable(JavaEntity parent) {
- super(parent);
- this.specifiedPrimaryKeyJoinColumns = new ArrayList<JavaPrimaryKeyJoinColumn>();
- }
-
- @Override
- public JavaEntity getParent() {
- return (JavaEntity) super.getParent();
- }
-
-
- //***************** AbstractJavaTable implementation ********************
-
- @Override
- protected String getAnnotationName() {
- return SecondaryTableAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected SecondaryTableAnnotation getResourceTable() {
- return this.resourceSecondaryTable;
- }
-
- // 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(SecondaryTable.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, createPrimaryKeyJoinColumnOwner());
- this.specifiedPrimaryKeyJoinColumns.add(index, primaryKeyJoinColumn);
- PrimaryKeyJoinColumnAnnotation pkJoinColumnResource = this.resourceSecondaryTable.addPkJoinColumn(index);
- primaryKeyJoinColumn.initialize(pkJoinColumnResource);
- this.fireItemAdded(SecondaryTable.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, index, primaryKeyJoinColumn);
- if (oldDefaultPkJoinColumn != null) {
- this.firePropertyChanged(SecondaryTable.DEFAULT_PRIMARY_KEY_JOIN_COLUMN, oldDefaultPkJoinColumn, null);
- }
- return primaryKeyJoinColumn;
- }
-
- protected void addSpecifiedPrimaryKeyJoinColumn(int index, JavaPrimaryKeyJoinColumn primaryKeyJoinColumn) {
- addItemToList(index, primaryKeyJoinColumn, this.specifiedPrimaryKeyJoinColumns, SecondaryTable.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 NullPrimaryKeyJoinColumn(this.resourceSecondaryTable));
- }
- this.resourceSecondaryTable.removePkJoinColumn(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_(JavaPrimaryKeyJoinColumn 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.resourceSecondaryTable.movePkJoinColumn(targetIndex, sourceIndex);
- fireItemMoved(SecondaryTable.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 NullPrimaryKeyJoinColumn(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 NullPrimaryKeyJoinColumn(sta)));
- }
- else {
- this.defaultPrimaryKeyJoinColumn.update(new NullPrimaryKeyJoinColumn(sta));
- }
- }
-
- protected JavaPrimaryKeyJoinColumn buildPrimaryKeyJoinColumn(PrimaryKeyJoinColumnAnnotation resourcePrimaryKeyJoinColumn) {
- JavaPrimaryKeyJoinColumn primaryKeyJoinColumn = getJpaFactory().buildJavaPrimaryKeyJoinColumn(this, createPrimaryKeyJoinColumnOwner());
- primaryKeyJoinColumn.initialize(resourcePrimaryKeyJoinColumn);
- return primaryKeyJoinColumn;
- }
-
- protected JavaBaseJoinColumn.Owner createPrimaryKeyJoinColumnOwner() {
- return new PrimaryKeyJoinColumnOwner();
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- if (this.connectionProfileIsActive()) {
- this.validateAgainstDatabase(messages, astRoot);
- }
- for (Iterator<JavaPrimaryKeyJoinColumn> stream = this.primaryKeyJoinColumns(); stream.hasNext(); ) {
- stream.next().validate(messages, astRoot);
- }
- }
-
- protected void 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;
- }
-
- 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;
- }
-
- if ( ! this.isResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.SECONDARY_TABLE_UNRESOLVED_NAME,
- new String[] {this.getName()},
- this,
- this.getNameTextRange(astRoot)
- )
- );
- return;
- }
- }
-
-
- // ********** 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;
- }
-
- class PrimaryKeyJoinColumnOwner implements JavaBaseJoinColumn.Owner
- {
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return GenericJavaSecondaryTable.this.getValidationTextRange(astRoot);
- }
-
- public TypeMapping getTypeMapping() {
- return GenericJavaSecondaryTable.this.getJavaEntity();
- }
-
- public Table getDbTable(String tableName) {
- return GenericJavaSecondaryTable.this.getDbTable();
- }
-
- public Table getReferencedColumnDbTable() {
- return getTypeMapping().getPrimaryDbTable();
- }
-
- public int joinColumnsSize() {
- return GenericJavaSecondaryTable.this.primaryKeyJoinColumnsSize();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return GenericJavaSecondaryTable.this.defaultPrimaryKeyJoinColumn == joinColumn;
- }
-
- public String getDefaultColumnName() {
- if (joinColumnsSize() != 1) {
- return null;
- }
- return getJavaEntity().getPrimaryKeyColumnName();
-
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaSequenceGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaSequenceGenerator.java
deleted file mode 100644
index fed36a1d64..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaSequenceGenerator.java
+++ /dev/null
@@ -1,145 +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.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.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-/**
- *
- */
-public class GenericJavaSequenceGenerator extends AbstractJavaGenerator
- implements JavaSequenceGenerator
-{
- protected String specifiedSequenceName;
-
-
- public GenericJavaSequenceGenerator(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());
- }
-
-
- // ********** 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();
- }
-
-
- // ********** 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.javaCandidateSequences(filter);
- }
- return null;
- }
-
- protected boolean sequenceNameTouches(int pos, CompilationUnit astRoot) {
- return this.getResourceGenerator().sequenceNameTouches(pos, astRoot);
- }
-
- protected Iterator<String> javaCandidateSequences(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.candidateSequences(filter));
- }
-
- protected Iterator<String> candidateSequences(Filter<String> filter) {
- return new FilteringIterator<String, String>(this.candidateSequences(), filter);
- }
-
- protected Iterator<String> candidateSequences() {
- Schema dbSchema = this.getDbSchema();
- return (dbSchema != null) ? dbSchema.sortedSequenceIdentifiers() : EmptyIterator.<String> instance();
- }
-
-
- // ********** misc **********
-
- public Integer 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/GenericJavaTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTable.java
deleted file mode 100644
index 8243fbe6e0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTable.java
+++ /dev/null
@@ -1,149 +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.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.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;
-
-/**
- *
- */
-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(getResourceTable());
- }
-
- //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 getResourceTable() {
- //TODO get the NullTable from the resource model or build it here in the context model??
- return (TableAnnotation) this.resourcePersistentMember.getNonNullSupportingAnnotation(getAnnotationName());
- }
-
- @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(getResourceTable());
- }
-
-
- //******************* validation **********************
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, 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/context/java/GenericJavaTableGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTableGenerator.java
deleted file mode 100644
index 9f7094efe9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTableGenerator.java
+++ /dev/null
@@ -1,518 +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.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.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.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.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-/**
- *
- */
-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.sortedColumnIdentifiers() : 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.javaCandidateTables(filter);
- }
- if (this.schemaTouches(pos, astRoot)) {
- return this.javaCandidateSchemata(filter);
- }
- if (this.catalogTouches(pos, astRoot)) {
- return this.javaCandidateCatalogs(filter);
- }
- if (this.pkColumnNameTouches(pos, astRoot)) {
- return this.javaCandidateColumnNames(filter);
- }
- if (this.valueColumnNameTouches(pos, astRoot)) {
- return this.javaCandidateColumnNames(filter);
- }
- return null;
- }
-
- protected boolean tableTouches(int pos, CompilationUnit astRoot) {
- return this.getResourceGenerator().tableTouches(pos, astRoot);
- }
-
- protected Iterator<String> javaCandidateTables(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.candidateTables(filter));
- }
-
- protected Iterator<String> candidateTables(Filter<String> filter) {
- return new FilteringIterator<String, String>(this.candidateTables(), filter);
- }
-
- protected Iterator<String> candidateTables() {
- Schema dbSchema = this.getDbSchema();
- return (dbSchema != null) ? dbSchema.sortedTableIdentifiers() : EmptyIterator.<String> instance();
- }
-
- protected boolean schemaTouches(int pos, CompilationUnit astRoot) {
- return this.getResourceGenerator().schemaTouches(pos, astRoot);
- }
-
- protected Iterator<String> javaCandidateSchemata(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.candidateSchemata(filter));
- }
-
- protected Iterator<String> candidateSchemata(Filter<String> filter) {
- return new FilteringIterator<String, String>(this.candidateSchemata(), filter);
- }
-
- protected Iterator<String> candidateSchemata() {
- return this.getDbSchemaContainer().sortedSchemaIdentifiers();
- }
-
- protected boolean catalogTouches(int pos, CompilationUnit astRoot) {
- return this.getResourceGenerator().catalogTouches(pos, astRoot);
- }
-
- protected Iterator<String> javaCandidateCatalogs(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.candidateCatalogs(filter));
- }
-
- protected Iterator<String> candidateCatalogs(Filter<String> filter) {
- return new FilteringIterator<String, String>(this.candidateCatalogs(), filter);
- }
-
- protected Iterator<String> candidateCatalogs() {
- Database db = this.getDatabase();
- return (db != null) ? db.sortedCatalogIdentifiers() : EmptyIterator.<String> instance();
- }
-
- protected boolean pkColumnNameTouches(int pos, CompilationUnit astRoot) {
- return this.getResourceGenerator().pkColumnNameTouches(pos, astRoot);
- }
-
- protected Iterator<String> javaCandidateColumnNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.candidateColumnNames(filter));
- }
-
- protected Iterator<String> candidateColumnNames(Filter<String> filter) {
- return new FilteringIterator<String, String>(this.candidateColumnNames(), filter);
- }
-
- protected Iterator<String> candidateColumnNames() {
- Table table = this.getDbTable();
- return (table != null) ? table.sortedColumnIdentifiers() : EmptyIterator.<String> instance();
- }
-
- protected boolean valueColumnNameTouches(int pos, CompilationUnit astRoot) {
- return this.getResourceGenerator().valueColumnNameTouches(pos, astRoot);
- }
-
-
- // ********** misc **********
-
- @Override
- protected TableGeneratorAnnotation getResourceGenerator() {
- return (TableGeneratorAnnotation) super.getResourceGenerator();
- }
-
- public Integer getDefaultInitialValue() {
- return DEFAULT_INITIAL_VALUE;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTemporalConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTemporalConverter.java
deleted file mode 100644
index d5d4d8c629..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTemporalConverter.java
+++ /dev/null
@@ -1,93 +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.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.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
-{
- private TemporalType temporalType;
-
- private 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.addSupportingAnnotation(getAnnotationName());
- }
-
- public void removeFromResourceModel() {
- this.resourcePersistentAttribute.removeSupportingAnnotation(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.getSupportingAnnotation(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/context/java/GenericJavaTransientMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTransientMapping.java
deleted file mode 100644
index 05004e1822..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTransientMapping.java
+++ /dev/null
@@ -1,47 +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.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.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaTransientMapping;
-import org.eclipse.jpt.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-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;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return EmptyIterator.instance();
- }
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaUniqueConstraint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaUniqueConstraint.java
deleted file mode 100644
index 26e1250640..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaUniqueConstraint.java
+++ /dev/null
@@ -1,167 +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.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.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, 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/context/java/GenericJavaVersionMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaVersionMapping.java
deleted file mode 100644
index e5676223ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaVersionMapping.java
+++ /dev/null
@@ -1,218 +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.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.Converter;
-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.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericJavaVersionMapping extends AbstractJavaAttributeMapping<VersionAnnotation> implements JavaVersionMapping
-{
- protected final JavaColumn column;
-
- protected final JavaConverter defaultConverter;
-
- protected JavaConverter specifiedConverter;
-
- public GenericJavaVersionMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.column = createJavaColumn();
- this.defaultConverter = new GenericJavaNullConverter(this);
- }
-
- protected JavaColumn createJavaColumn() {
- return getJpaFactory().buildJavaColumn(this, this);
- }
-
- @Override
- public void initialize(JavaResourcePersistentAttribute jrpa) {
- super.initialize(jrpa);
- this.column.initialize(this.getResourceColumn());
- this.specifiedConverter = this.buildSpecifiedConverter(this.specifiedConverterType(jrpa));
- }
-
- public ColumnAnnotation getResourceColumn() {
- return (ColumnAnnotation) getResourcePersistentAttribute().getNonNullSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME);
- }
-
- //************** IJavaAttributeMapping implementation ***************
-
- public String getKey() {
- return MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return VersionAnnotation.ANNOTATION_NAME;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return new ArrayIterator<String>(
- JPA.COLUMN,
- JPA.TEMPORAL);
- }
-
- //************** NamedColumn.Owner implementation ***************
-
- public String getDefaultColumnName() {
- return getAttributeName();
- }
-
- public String getDefaultTableName() {
- return getTypeMapping().getPrimaryTableName();
- }
-
- //************** VersionMapping implementation ***************
-
- public JavaColumn getColumn() {
- return this.column;
- }
-
- public JavaConverter getConverter() {
- return getSpecifiedConverter() == null ? getDefaultConverter() : getSpecifiedConverter();
- }
-
- public JavaConverter getDefaultConverter() {
- return this.defaultConverter;
- }
-
- public JavaConverter getSpecifiedConverter() {
- return this.specifiedConverter;
- }
-
- protected String getSpecifedConverterType() {
- if (this.specifiedConverter == null) {
- return Converter.NO_CONVERTER;
- }
- return this.specifiedConverter.getType();
- }
-
- public void setSpecifiedConverter(String converterType) {
- if (getSpecifedConverterType() == converterType) {
- return;
- }
- JavaConverter oldConverter = this.specifiedConverter;
- JavaConverter newConverter = buildSpecifiedConverter(converterType);
- this.specifiedConverter = null;
- if (oldConverter != null) {
- oldConverter.removeFromResourceModel();
- }
- this.specifiedConverter = newConverter;
- if (newConverter != null) {
- newConverter.addToResourceModel();
- }
- firePropertyChanged(SPECIFIED_CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- protected void setSpecifiedConverter(JavaConverter newConverter) {
- JavaConverter oldConverter = this.specifiedConverter;
- this.specifiedConverter = newConverter;
- firePropertyChanged(SPECIFIED_CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
-
- @Override
- public void update(JavaResourcePersistentAttribute jrpa) {
- super.update(jrpa);
- this.column.update(this.getResourceColumn());
- if (specifiedConverterType(jrpa) == getSpecifedConverterType()) {
- getSpecifiedConverter().update(jrpa);
- }
- else {
- JavaConverter javaConverter = buildSpecifiedConverter(specifiedConverterType(jrpa));
- setSpecifiedConverter(javaConverter);
- }
- }
-
- protected JavaConverter buildSpecifiedConverter(String converterType) {
- if (converterType == Converter.TEMPORAL_CONVERTER) {
- return getJpaFactory().buildJavaTemporalConverter(this, this.resourcePersistentAttribute);
- }
- return null;
- }
-
- protected String specifiedConverterType(JavaResourcePersistentAttribute jrpa) {
- if (jrpa.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME) != null) {
- return Converter.TEMPORAL_CONVERTER;
- }
- 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 = this.getColumn().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- return null;
- }
-
- //*********** Validation ******************************
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- if (this.ownerIsEntity() && this.connectionProfileIsActive()) {
- this.validateColumn(messages, astRoot);
- }
- if (this.specifiedConverter != null) {
- this.specifiedConverter.validate(messages, astRoot);
- }
- }
-
- protected void validateColumn(List<IMessage> messages, CompilationUnit astRoot) {
- String tableName = this.column.getTable();
- if (this.getTypeMapping().tableNameIsInvalid(tableName)) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_TABLE,
- new String[] {tableName, this.column.getName()},
- this.column,
- this.column.getTableTextRange(astRoot)
- )
- );
- return;
- }
-
- if ( ! this.column.isResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {this.column.getName()},
- this.column,
- this.column.getNameTextRange(astRoot)
- )
- );
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaBasicMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaBasicMappingProvider.java
deleted file mode 100644
index 2fe23b63d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaBasicMappingProvider.java
+++ /dev/null
@@ -1,56 +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.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.DefaultJavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.BasicAnnotation;
-
-public class JavaBasicMappingProvider
- implements DefaultJavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaBasicMappingProvider INSTANCE = new JavaBasicMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaBasicMappingProvider() {
- 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);
- }
-
- public boolean defaultApplies(JavaPersistentAttribute persistentAttribute) {
- return persistentAttribute.getResourcePersistentAttribute().typeIsBasic();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaCascade.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaCascade.java
deleted file mode 100644
index ec6d67722f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaCascade.java
+++ /dev/null
@@ -1,142 +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.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.Cascade;
-import org.eclipse.jpt.core.context.java.JavaRelationshipMapping;
-import org.eclipse.jpt.core.resource.java.RelationshipMappingAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class JavaCascade extends AbstractJavaJpaContextNode implements Cascade
-{
- protected boolean all;
-
- protected boolean persist;
-
- protected boolean merge;
-
- protected boolean remove;
-
- protected boolean refresh;
-
- protected RelationshipMappingAnnotation relationshipMapping;
-
- protected JavaCascade(JavaRelationshipMapping parent) {
- super(parent);
- }
-
- public boolean isAll() {
- return this.all;
- }
-
- public void setAll(boolean newAll) {
- boolean oldAll = this.all;
- this.all = newAll;
- this.relationshipMapping.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;
- this.relationshipMapping.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;
- this.relationshipMapping.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;
- this.relationshipMapping.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;
- this.relationshipMapping.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 TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.relationshipMapping.getCascadeTextRange(astRoot);
- }
-
- public void initialize(RelationshipMappingAnnotation relationshipMapping) {
- this.relationshipMapping = relationshipMapping;
- this.all = relationshipMapping.isCascadeAll();
- this.persist = relationshipMapping.isCascadePersist();
- this.merge = relationshipMapping.isCascadeMerge();
- this.remove = relationshipMapping.isCascadeRemove();
- this.refresh = relationshipMapping.isCascadeRefresh();
- }
-
- public void update(RelationshipMappingAnnotation relationshipMapping) {
- this.relationshipMapping = relationshipMapping;
- this.setAll_(relationshipMapping.isCascadeAll());
- this.setPersist_(relationshipMapping.isCascadePersist());
- this.setMerge_(relationshipMapping.isCascadeMerge());
- this.setRemove_(relationshipMapping.isCascadeRemove());
- this.setRefresh_(relationshipMapping.isCascadeRefresh());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddableProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddableProvider.java
deleted file mode 100644
index 6e19562b57..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddableProvider.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.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.JavaTypeMappingProvider;
-import org.eclipse.jpt.core.resource.java.EmbeddableAnnotation;
-
-public class JavaEmbeddableProvider
- implements JavaTypeMappingProvider
-{
-
- // singleton
- private static final JavaEmbeddableProvider INSTANCE = new JavaEmbeddableProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaEmbeddableProvider() {
- 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/JavaEmbeddedIdMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddedIdMappingProvider.java
deleted file mode 100644
index f1ec20f8d8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddedIdMappingProvider.java
+++ /dev/null
@@ -1,56 +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.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.DefaultJavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.resource.java.EmbeddedIdAnnotation;
-
-public class JavaEmbeddedIdMappingProvider
- implements DefaultJavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaEmbeddedIdMappingProvider INSTANCE = new JavaEmbeddedIdMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaEmbeddedIdMappingProvider() {
- 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);
- }
-
- public boolean defaultApplies(JavaPersistentAttribute persistentAttribute) {
- return MappingTools.getEmbeddableFor(persistentAttribute) != null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddedMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddedMappingProvider.java
deleted file mode 100644
index 3e3814b17e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddedMappingProvider.java
+++ /dev/null
@@ -1,56 +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.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.DefaultJavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.resource.java.EmbeddedAnnotation;
-
-public class JavaEmbeddedMappingProvider
- implements DefaultJavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaEmbeddedMappingProvider INSTANCE = new JavaEmbeddedMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaEmbeddedMappingProvider() {
- 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);
- }
-
- public boolean defaultApplies(JavaPersistentAttribute persistentAttribute) {
- return MappingTools.getEmbeddableFor(persistentAttribute) != null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEntityProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEntityProvider.java
deleted file mode 100644
index 3aa0b12616..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEntityProvider.java
+++ /dev/null
@@ -1,55 +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.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.JavaTypeMappingProvider;
-import org.eclipse.jpt.core.resource.java.EntityAnnotation;
-
-/**
- *
- */
-public class JavaEntityProvider
- implements JavaTypeMappingProvider
-{
-
- // singleton
- private static final JavaEntityProvider INSTANCE = new JavaEntityProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaEntityProvider() {
- 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/JavaIdMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaIdMappingProvider.java
deleted file mode 100644
index 013f5eed1e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaIdMappingProvider.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.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.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.IdAnnotation;
-
-public class JavaIdMappingProvider
- implements JavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaIdMappingProvider INSTANCE = new JavaIdMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaIdMappingProvider() {
- 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/JavaManyToManyMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaManyToManyMappingProvider.java
deleted file mode 100644
index 9b540d2293..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaManyToManyMappingProvider.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.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.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.ManyToManyAnnotation;
-
-public class JavaManyToManyMappingProvider
- implements JavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaManyToManyMappingProvider INSTANCE = new JavaManyToManyMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaManyToManyMappingProvider() {
- 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/JavaManyToOneMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaManyToOneMappingProvider.java
deleted file mode 100644
index dd1b262211..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaManyToOneMappingProvider.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.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.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.ManyToOneAnnotation;
-
-public class JavaManyToOneMappingProvider
- implements JavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaManyToOneMappingProvider INSTANCE = new JavaManyToOneMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaManyToOneMappingProvider() {
- 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/JavaMappedSuperclassProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaMappedSuperclassProvider.java
deleted file mode 100644
index 87470fb64c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaMappedSuperclassProvider.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.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.JavaTypeMappingProvider;
-import org.eclipse.jpt.core.resource.java.MappedSuperclassAnnotation;
-
-public class JavaMappedSuperclassProvider
- implements JavaTypeMappingProvider
-{
-
- // singleton
- private static final JavaMappedSuperclassProvider INSTANCE = new JavaMappedSuperclassProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaMappedSuperclassProvider() {
- 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/JavaNullAttributeMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaNullAttributeMappingProvider.java
deleted file mode 100644
index 290cab10d8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaNullAttributeMappingProvider.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.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-
-/**
- * This mapping provider implementation is used to create a JavaNullAttributeMapping.
- * A JavaNullAttributeMapping should be used when no "mapping" annotation
- * exists on a Java attribute *and* no default mapping applies.
- */
-public class JavaNullAttributeMappingProvider
- implements JavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaNullAttributeMappingProvider INSTANCE = new JavaNullAttributeMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaNullAttributeMappingProvider() {
- super();
- }
-
- public String getKey() {
- return null;
- }
-
- public String getAnnotationName() {
- return null;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return factory.buildJavaNullAttributeMapping(parent);
- }
-}
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 8445bb0e91..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaNullTypeMapping.java
+++ /dev/null
@@ -1,71 +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.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.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.iterators.EmptyIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-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 Iterator<String> correspondingAnnotationNames() {
- return EmptyIterator.instance();
- }
-
- /**
- * 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, CompilationUnit 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/JavaNullTypeMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaNullTypeMappingProvider.java
deleted file mode 100644
index ea5a610296..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaNullTypeMappingProvider.java
+++ /dev/null
@@ -1,55 +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.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingProvider;
-
-/**
- * This mapping provider implementation is used to create a JavaNullAttributeMapping.
- * A JavaNullAttributeMapping should be used when no "mapping" annotation
- * exists on a Java type.
- */
-public class JavaNullTypeMappingProvider
- implements JavaTypeMappingProvider
-{
-
- // singleton
- private static final JavaNullTypeMappingProvider INSTANCE = new JavaNullTypeMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaNullTypeMappingProvider() {
- super();
- }
-
- public String getKey() {
- return null;
- }
-
- public String getAnnotationName() {
- return null;
- }
-
- public JavaTypeMapping buildMapping(JavaPersistentType parent, JpaFactory factory) {
- return factory.buildJavaNullTypeMapping(parent);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOneToManyMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOneToManyMappingProvider.java
deleted file mode 100644
index 0fa0f8e7ca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOneToManyMappingProvider.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.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.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.OneToManyAnnotation;
-
-public class JavaOneToManyMappingProvider
- implements JavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaOneToManyMappingProvider INSTANCE = new JavaOneToManyMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaOneToManyMappingProvider() {
- 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/JavaOneToOneMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOneToOneMappingProvider.java
deleted file mode 100644
index ed3215ef46..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOneToOneMappingProvider.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.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.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.OneToOneAnnotation;
-
-public class JavaOneToOneMappingProvider
- implements JavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaOneToOneMappingProvider INSTANCE = new JavaOneToOneMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaOneToOneMappingProvider() {
- 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/JavaTransientMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaTransientMappingProvider.java
deleted file mode 100644
index ebb98f5c7a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaTransientMappingProvider.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.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.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.TransientAnnotation;
-
-public class JavaTransientMappingProvider
- implements JavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaTransientMappingProvider INSTANCE = new JavaTransientMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaTransientMappingProvider() {
- 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/JavaVersionMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaVersionMappingProvider.java
deleted file mode 100644
index 78442c9274..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaVersionMappingProvider.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.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.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.VersionAnnotation;
-
-public class JavaVersionMappingProvider
- implements JavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaVersionMappingProvider INSTANCE = new JavaVersionMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaVersionMappingProvider() {
- 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/VirtualAttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualAttributeOverride.java
deleted file mode 100644
index 9e2c36502d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualAttributeOverride.java
+++ /dev/null
@@ -1,112 +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.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.internal.resource.java.AbstractJavaResourceNode;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-public class VirtualAttributeOverride extends AbstractJavaResourceNode implements AttributeOverrideAnnotation, Annotation
-{
- private final VirtualAttributeOverrideColumn column;
-
- private String name;
-
- public VirtualAttributeOverride(JavaResourceNode parent, String name, Column column) {
- super(parent);
- this.name = name;
- this.column = new VirtualAttributeOverrideColumn(this, column);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation getJdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public String getAnnotationName() {
- return AttributeOverrideAnnotation.ANNOTATION_NAME;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (name != null) {
- createAttributeOverrideResource().setName(name);
- }
- }
-
- public ColumnAnnotation getNonNullColumn() {
- return getColumn();
- }
-
- public ColumnAnnotation getColumn() {
- return this.column;
- }
-
- public ColumnAnnotation addColumn() {
- throw new UnsupportedOperationException();
- }
-
- public void removeColumn() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public JavaResourcePersistentMember getParent() {
- return (JavaResourcePersistentMember) super.getParent();
- }
-
- protected AttributeOverrideAnnotation createAttributeOverrideResource() {
- return (AttributeOverrideAnnotation) getParent().addSupportingAnnotation(getAnnotationName());
- }
-
- public void update(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
-
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- @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/VirtualAttributeOverrideColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualAttributeOverrideColumn.java
deleted file mode 100644
index 641bbaced1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualAttributeOverrideColumn.java
+++ /dev/null
@@ -1,146 +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.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.internal.resource.java.NullBaseColumn;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-public class VirtualAttributeOverrideColumn extends NullBaseColumn implements ColumnAnnotation, Annotation
-{
- private Column column;
-
- public VirtualAttributeOverrideColumn(AttributeOverrideAnnotation parent, Column column) {
- super(parent);
- this.column = column;
- }
-
- @Override
- public AttributeOverrideAnnotation getParent() {
- return (AttributeOverrideAnnotation) super.getParent();
- }
-
- public String getAnnotationName() {
- return ColumnAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected ColumnAnnotation createResourceColumn() {
- return getParent().addColumn();
- }
-
- @Override
- public String getName() {
- if (this.column.getSpecifiedName() != null) {
- return this.column.getSpecifiedName();
- }
- return null;
- }
-
- @Override
- public String getTable() {
- if (this.column.getSpecifiedTable() != null) {
- return this.column.getSpecifiedTable();
- }
- return null;
- }
-
- @Override
- public Boolean getInsertable() {
- if (this.column.getSpecifiedInsertable() != null) {
- return this.column.getSpecifiedInsertable();
- }
- return null;
- }
-
- @Override
- public Boolean getUpdatable() {
- if (this.column.getSpecifiedUpdatable() != null) {
- return this.column.getSpecifiedUpdatable();
- }
- return null;
- }
- @Override
- public Boolean getNullable() {
- if (this.column.getSpecifiedNullable() != null) {
- return this.column.getSpecifiedNullable();
- }
- return null;
- }
-
- @Override
- public Boolean getUnique() {
- if (this.column.getSpecifiedUnique() != null) {
- return this.column.getSpecifiedUnique();
- }
- return null;
- }
-
- @Override
- public String getColumnDefinition() {
- return this.column.getColumnDefinition();
- }
-
- public Integer getLength() {
- if (this.column.getSpecifiedLength() != null) {
- return this.column.getSpecifiedLength();
- }
- return null;
- }
-
- public void setLength(Integer length) {
- if (length != null) {
- createResourceColumn().setLength(length);
- }
- }
-
- public Integer getScale() {
- if (this.column.getSpecifiedScale() != null) {
- return this.column.getSpecifiedScale();
- }
- return null;
- }
-
- public void setScale(Integer scale) {
- if (scale != null) {
- createResourceColumn().setScale(scale);
- }
- }
-
- public Integer getPrecision() {
- if (this.column.getSpecifiedPrecision() != null) {
- return this.column.getSpecifiedPrecision();
- }
- return null;
- }
-
- public void setPrecision(Integer precision) {
- if (precision != null) {
- createResourceColumn().setPrecision(precision);
- }
- }
-
- public TextRange getScaleTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getLengthTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getPrecisionTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
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 491cf79043..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmAttributeMapping.java
+++ /dev/null
@@ -1,326 +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.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.NonOwningMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-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.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-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.wst.validation.internal.provisional.core.IMessage;
-
-public abstract class AbstractOrmAttributeMapping<T extends XmlAttributeMapping>
- extends AbstractXmlContextNode
- implements OrmAttributeMapping
-{
- protected String name;
-
- protected T resourceAttributeMapping;
-
- protected JavaPersistentAttribute javaPersistentAttribute;
-
-
- protected AbstractOrmAttributeMapping(OrmPersistentAttribute parent) {
- super(parent);
- }
-
- 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);
- }
-
- 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();
- }
-
- public String getAttributeName() {
- return this.getPersistentAttribute().getName();
- }
-
- public boolean isDefault() {
- return false;
- }
-
- public void initializeFromOrmAttributeMapping(OrmAttributeMapping oldMapping) {
- setName(oldMapping.getName());
- }
-
- public void initializeFromOrmColumnMapping(OrmColumnMapping oldMapping) {
- initializeFromOrmAttributeMapping((OrmAttributeMapping) oldMapping);
- }
-
- public void initializeFromOrmNonOwningMapping(NonOwningMapping 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 initializeFromOrmMulitRelationshipMapping(OrmMultiRelationshipMapping oldMapping) {
- initializeFromOrmRelationshipMapping(oldMapping);
- }
-
- public void initializeFromOrmSingleRelationshipMapping(OrmSingleRelationshipMapping oldMapping) {
- initializeFromOrmRelationshipMapping(oldMapping);
- }
-
- public void initializeFromOrmOneToManyMapping(OrmOneToManyMapping oldMapping) {
- initializeFromOrmNonOwningMapping(oldMapping);
- initializeFromOrmMulitRelationshipMapping(oldMapping);
- }
-
- public void initializeFromOrmManyToOneMapping(OrmManyToOneMapping oldMapping) {
- initializeFromOrmSingleRelationshipMapping(oldMapping);
- }
-
- public void initializeFromOrmOneToOneMapping(OrmOneToOneMapping oldMapping) {
- initializeFromOrmNonOwningMapping(oldMapping);
- initializeFromOrmSingleRelationshipMapping(oldMapping);
- }
-
- public void initializeFromOrmManyToManyMapping(OrmManyToManyMapping oldMapping) {
- initializeFromOrmNonOwningMapping(oldMapping);
- initializeFromOrmMulitRelationshipMapping(oldMapping);
- }
-
- public String getPrimaryKeyColumnName() {
- return null;
- }
-
- public OrmTypeMapping getTypeMapping() {
- return this.getPersistentAttribute().getTypeMapping();
- }
-
-
- public boolean isOverridableAttributeMapping() {
- return false;
- }
-
- public boolean isOverridableAssociationMapping() {
- return false;
- }
-
- public boolean isIdMapping() {
- return false;
- }
-
- public T getResourceAttributeMapping() {
- return this.resourceAttributeMapping;
- }
-
- public void initialize(XmlAttributeMapping resourceAttributeMapping) {
- this.resourceAttributeMapping = (T) resourceAttributeMapping;
- this.name = resourceAttributeMapping.getName();
- this.javaPersistentAttribute = findJavaPersistentAttribute();
- }
-
- public void update() {
- this.setName_(this.resourceAttributeMapping.getName());
- this.setJavaPersistentAttribute(findJavaPersistentAttribute());
- }
-
- protected JavaPersistentAttribute findJavaPersistentAttribute() {
- JavaPersistentType javaPersistentType = getPersistentAttribute().getPersistentType().getJavaPersistentType();
- if (javaPersistentType != null && getName() != null) {
- return javaPersistentType.getAttributeNamed(getName());
- }
- return null;
- }
-
-
- protected boolean ownerIsEntity() {
- return getTypeMapping().getKey() == MappingKeys.ENTITY_TYPE_MAPPING_KEY;
- }
-
- 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();
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- this.validateAttribute(messages);
- this.validateModifiers(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;
- }
-
- if (this.findJavaPersistentAttribute() == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENT_ATTRIBUTE_UNRESOLVED_NAME,
- new String[] {this.name, this.getPersistentAttribute().getPersistentType().getMapping().getClass_()},
- this,
- this.getNameTextRange()
- )
- );
- }
- }
-
- protected void validateModifiers(List<IMessage> messages) {
- if (this.getKey() == MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY) {
- return;
- }
- if (this.javaPersistentAttribute == null) {
- return;
- }
- JavaResourcePersistentAttribute jrpa = this.javaPersistentAttribute.getResourcePersistentAttribute();
-
- if (jrpa.isForField()) {
- if (jrpa.isFinal()) {
- messages.add(this.buildAttributeMessage(JpaValidationMessages.PERSISTENT_ATTRIBUTE_FINAL_FIELD));
- }
- if (jrpa.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) {
- OrmPersistentAttribute pa = this.getPersistentAttribute();
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- msgID,
- new String[] {this.name},
- pa,
- pa.getValidationTextRange()
- );
- }
-
- //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()
- )
- );
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getAttributeName());
- }
-
-}
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 f4642e1770..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseColumn.java
+++ /dev/null
@@ -1,308 +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.orm;
-
-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.XmlAbstractColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-public abstract class AbstractOrmBaseColumn<T extends XmlAbstractColumn> 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);
-// }
-
- 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 (oldSpecifiedTable != newSpecifiedTable) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setTable(newSpecifiedTable);
- if (this.getResourceColumn().isAllFeaturesUnset()) {
- removeResourceColumn();
- }
- }
- 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 getUnique() {
- return (this.getSpecifiedUnique() == null) ? this.getDefaultUnique() : this.getSpecifiedUnique();
- }
-
- public Boolean getDefaultUnique() {
- return BaseColumn.DEFAULT_UNIQUE;
- }
-
- public Boolean getSpecifiedUnique() {
- return this.specifiedUnique;
- }
-
- public void setSpecifiedUnique(Boolean newSpecifiedUnique) {
- Boolean oldSpecifiedUnique = this.specifiedUnique;
- this.specifiedUnique = newSpecifiedUnique;
- if (oldSpecifiedUnique != newSpecifiedUnique) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setUnique(newSpecifiedUnique);
- if (this.getResourceColumn().isAllFeaturesUnset()) {
- 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 getNullable() {
- return (this.getSpecifiedNullable() == null) ? this.getDefaultNullable() : this.getSpecifiedNullable();
- }
-
- public Boolean getDefaultNullable() {
- return BaseColumn.DEFAULT_NULLABLE;
- }
-
- public Boolean getSpecifiedNullable() {
- return this.specifiedNullable;
- }
-
- public void setSpecifiedNullable(Boolean newSpecifiedNullable) {
- Boolean oldSpecifiedNullable = this.specifiedNullable;
- this.specifiedNullable = newSpecifiedNullable;
- if (oldSpecifiedNullable != newSpecifiedNullable) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setNullable(newSpecifiedNullable);
- if (this.getResourceColumn().isAllFeaturesUnset()) {
- removeResourceColumn();
- }
- }
- 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 getInsertable() {
- return (this.getSpecifiedInsertable() == null) ? this.getDefaultInsertable() : this.getSpecifiedInsertable();
- }
-
- public Boolean getDefaultInsertable() {
- return BaseColumn.DEFAULT_INSERTABLE;
- }
-
- public Boolean getSpecifiedInsertable() {
- return this.specifiedInsertable;
- }
-
- public void setSpecifiedInsertable(Boolean newSpecifiedInsertable) {
- Boolean oldSpecifiedInsertable = this.specifiedInsertable;
- this.specifiedInsertable = newSpecifiedInsertable;
- if (oldSpecifiedInsertable != newSpecifiedInsertable) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setInsertable(newSpecifiedInsertable);
- if (this.getResourceColumn().isAllFeaturesUnset()) {
- removeResourceColumn();
- }
- }
- 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 getUpdatable() {
- return (this.getSpecifiedUpdatable() == null) ? this.getDefaultUpdatable() : this.getSpecifiedUpdatable();
- }
-
- public Boolean getDefaultUpdatable() {
- return BaseColumn.DEFAULT_UPDATABLE;
- }
-
- public Boolean getSpecifiedUpdatable() {
- return this.specifiedUpdatable;
- }
-
- public void setSpecifiedUpdatable(Boolean newSpecifiedUpdatable) {
- Boolean oldSpecifiedUpdatable = this.specifiedUpdatable;
- this.specifiedUpdatable = newSpecifiedUpdatable;
- if (oldSpecifiedUpdatable != newSpecifiedUpdatable) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setUpdatable(newSpecifiedUpdatable);
- if (this.getResourceColumn().isAllFeaturesUnset()) {
- 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);
- }
-
- @Override
- protected String tableName() {
- return this.getTable();
- }
-
-
- 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.specifiedTable(column);
- this.defaultTable = this.defaultTable();
- //TODO default from java for all of these settings
- this.specifiedNullable = this.specifiedNullable(column);
- this.specifiedUpdatable = this.specifiedUpdatable(column);
- this.specifiedUnique = this.specifiedUnique(column);
- this.specifiedInsertable = this.specifiedInsertable(column);
- }
-
- @Override
- protected void update(T column) {
- super.update(column);
- setSpecifiedTable_(this.specifiedTable(column));
- setDefaultTable(this.defaultTable());
- setSpecifiedNullable_(this.specifiedNullable(column));
- setSpecifiedUpdatable_(this.specifiedUpdatable(column));
- setSpecifiedUnique_(this.specifiedUnique(column));
- setSpecifiedInsertable_(this.specifiedInsertable(column));
- }
-
- protected String specifiedTable(T column) {
- return column == null ? null : column.getTable();
- }
-
- protected Boolean specifiedNullable(T column) {
- return column == null ? null : column.getNullable();
- }
-
- protected Boolean specifiedUpdatable(T column) {
- return column == null ? null : column.getUpdatable();
- }
-
- protected Boolean specifiedUnique(T column) {
- return column == null ? null : column.getUnique();
- }
-
- protected Boolean specifiedInsertable(T column) {
- return column == null ? null : column.getInsertable();
- }
-
- protected String defaultTable() {
- return getOwner().getDefaultTableName();
- }
-
-}
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 3e33ace127..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java
+++ /dev/null
@@ -1,364 +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.orm;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.BaseEmbeddedMapping;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.ColumnMapping;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.core.context.orm.OrmBaseEmbeddedMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaBaseEmbeddedMapping;
-import org.eclipse.jpt.core.resource.orm.BaseXmlEmbedded;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-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.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-
-public abstract class AbstractOrmBaseEmbeddedMapping<T extends BaseXmlEmbedded> extends AbstractOrmAttributeMapping<T> implements OrmBaseEmbeddedMapping
-{
- protected final List<OrmAttributeOverride> specifiedAttributeOverrides;
-
- protected final List<OrmAttributeOverride> virtualAttributeOverrides;
-
- private Embeddable embeddable;
-
- protected AbstractOrmBaseEmbeddedMapping(OrmPersistentAttribute parent) {
- super(parent);
- this.specifiedAttributeOverrides = new ArrayList<OrmAttributeOverride>();
- this.virtualAttributeOverrides = new ArrayList<OrmAttributeOverride>();
- }
-
- @Override
- public void initializeFromOrmBaseEmbeddedMapping(OrmBaseEmbeddedMapping oldMapping) {
- super.initializeFromOrmBaseEmbeddedMapping(oldMapping);
- int index = 0;
- for (OrmAttributeOverride attributeOverride : CollectionTools.iterable(oldMapping.specifiedAttributeOverrides())) {
- OrmAttributeOverride newAttributeOverride = addSpecifiedAttributeOverride(index++);
- newAttributeOverride.setName(attributeOverride.getName());
- newAttributeOverride.getColumn().initializeFrom(attributeOverride.getColumn());
- }
- }
-
- @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);
- }
- protected void addVirtualAttributeOverride(OrmAttributeOverride attributeOverride) {
- addItemToList(attributeOverride, this.virtualAttributeOverrides, BaseEmbeddedMapping.VIRTUAL_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- protected void removeVirtualAttributeOverride(OrmAttributeOverride attributeOverride) {
- removeItemFromList(attributeOverride, this.virtualAttributeOverrides, BaseEmbeddedMapping.VIRTUAL_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public int virtualAttributeOverridesSize() {
- return this.virtualAttributeOverrides.size();
- }
-
- 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.createXmlAttributeOverrideImpl();
- OrmAttributeOverride attributeOverride = buildAttributeOverride(xmlAttributeOverride);
- this.specifiedAttributeOverrides.add(index, attributeOverride);
- this.resourceAttributeMapping.getAttributeOverrides().add(index, xmlAttributeOverride);
- this.fireItemAdded(BaseEmbeddedMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, attributeOverride);
- return attributeOverride;
- }
-
- protected void addSpecifiedAttributeOverride(int index, OrmAttributeOverride attributeOverride) {
- addItemToList(index, attributeOverride, this.specifiedAttributeOverrides, BaseEmbeddedMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- protected void addSpecifiedAttributeOverride(OrmAttributeOverride attributeOverride) {
- this.addSpecifiedAttributeOverride(this.specifiedAttributeOverrides.size(), attributeOverride);
- }
-
- protected void removeSpecifiedAttributeOverride_(OrmAttributeOverride attributeOverride) {
- removeItemFromList(attributeOverride, this.specifiedAttributeOverrides, BaseEmbeddedMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public void moveSpecifiedAttributeOverride(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedAttributeOverrides, targetIndex, sourceIndex);
- this.resourceAttributeMapping.getAttributeOverrides().move(targetIndex, sourceIndex);
- fireItemMoved(BaseEmbeddedMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, targetIndex, sourceIndex);
- }
-
- public OrmAttributeOverride getAttributeOverrideNamed(String name) {
- return (OrmAttributeOverride) getOverrideNamed(name, attributeOverrides());
- }
-
- 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;
- }
-
- //****************** AttributeOverride.Owner implemenation *******************
-
- public boolean isVirtual(BaseOverride override) {
- return this.virtualAttributeOverrides.contains(override);
- }
-
- public BaseOverride setVirtual(boolean virtual, BaseOverride override) {
- // Add a new attribute override
- if (virtual) {
- return setVirtual((OrmAttributeOverride) override);
- }
- return setSpecified((OrmAttributeOverride) override);
- }
-
- protected OrmAttributeOverride setVirtual(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 udpate. This causes the UI to be flaky, since change notification might not occur in the correct order
- OrmAttributeOverride virtualAttributeOverride = null;
- if (attributeOverrideName != null) {
- for (PersistentAttribute persistentAttribute : CollectionTools.iterable(allOverridableAttributes())) {
- if (persistentAttribute.getName().equals(attributeOverrideName)) {
- JavaAttributeOverride javaAttributeOverride = null;
- if (getJavaEmbeddedMapping() != null) {
- javaAttributeOverride = getJavaEmbeddedMapping().getAttributeOverrideNamed(attributeOverrideName);
- }
- //store the virtualAttributeOverride so we can fire change notification later
- virtualAttributeOverride = buildVirtualAttributeOverride(persistentAttribute, javaAttributeOverride);
- this.virtualAttributeOverrides.add(virtualAttributeOverride);
- }
- }
- }
-
- this.resourceAttributeMapping.getAttributeOverrides().remove(index);
- fireItemRemoved(BaseEmbeddedMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, attributeOverride);
-
- if (virtualAttributeOverride != null) {
- fireItemAdded(BaseEmbeddedMapping.VIRTUAL_ATTRIBUTE_OVERRIDES_LIST, virtualAttributeOverridesSize() - 1, virtualAttributeOverride);
- }
- return virtualAttributeOverride;
- }
-
- protected OrmAttributeOverride setSpecified(OrmAttributeOverride oldAttributeOverride) {
- int index = specifiedAttributeOverridesSize();
- XmlAttributeOverride xmlAttributeOverride = OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl();
- OrmAttributeOverride newAttributeOverride = getJpaFactory().buildOrmAttributeOverride(this, this, xmlAttributeOverride);
- this.specifiedAttributeOverrides.add(index, newAttributeOverride);
-
- this.resourceAttributeMapping.getAttributeOverrides().add(xmlAttributeOverride);
-
- int defaultIndex = this.virtualAttributeOverrides.indexOf(oldAttributeOverride);
- this.virtualAttributeOverrides.remove(defaultIndex);
-
- newAttributeOverride.setName(oldAttributeOverride.getName());
- newAttributeOverride.getColumn().setSpecifiedName(oldAttributeOverride.getColumn().getName());
-
- this.fireItemRemoved(BaseEmbeddedMapping.VIRTUAL_ATTRIBUTE_OVERRIDES_LIST, defaultIndex, oldAttributeOverride);
- this.fireItemAdded(BaseEmbeddedMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, newAttributeOverride);
-
- return newAttributeOverride;
- }
-
- public ColumnMapping getColumnMapping(String attributeName) {
- return MappingTools.getColumnMapping(attributeName, getEmbeddable());
- }
-
- public Embeddable getEmbeddable() {
- return this.embeddable;
- }
-
- public Iterator<String> allOverridableAttributeNames() {
- return new TransformationIterator<PersistentAttribute, String>(this.allOverridableAttributes()) {
- @Override
- protected String transform(PersistentAttribute attribute) {
- return attribute.getName();
- }
- };
- }
-
- public Iterator<PersistentAttribute> allOverridableAttributes() {
- if (this.getEmbeddable() == null) {
- return EmptyIterator.instance();
- }
- return new FilteringIterator<PersistentAttribute, PersistentAttribute>(this.getEmbeddable().getPersistentType().attributes()) {
- @Override
- protected boolean accept(PersistentAttribute o) {
- return o.isOverridableAttribute();
- }
- };
- }
-
- public AbstractJavaBaseEmbeddedMapping<?> getJavaEmbeddedMapping() {
- if (this.javaPersistentAttribute != null && this.javaPersistentAttribute.getMappingKey() == getKey()) {
- return (AbstractJavaBaseEmbeddedMapping<?>) this.javaPersistentAttribute.getMapping();
- }
- return null;
- }
-
- @Override
- public void initialize(XmlAttributeMapping xmlAttributeMapping) {
- super.initialize(xmlAttributeMapping);
- this.embeddable = embeddableFor(findJavaPersistentAttribute());
- this.initializeSpecifiedAttributeOverrides();
- this.initializeVirtualAttributeOverrides();
- }
-
- protected void initializeSpecifiedAttributeOverrides() {
- for (XmlAttributeOverride attributeOverride : this.resourceAttributeMapping.getAttributeOverrides()) {
- this.specifiedAttributeOverrides.add(buildAttributeOverride(attributeOverride));
- }
- }
-
- protected void initializeVirtualAttributeOverrides() {
- if (getPersistentAttribute().isVirtual()) {
- //specifiedAttributeOverrides are used if the persistentAttribute is virtual
- return;
- }
- for (PersistentAttribute persistentAttribute : CollectionTools.iterable(allOverridableAttributes())) {
- OrmAttributeOverride attributeOverride = getAttributeOverrideNamed(persistentAttribute.getName());
- if (attributeOverride == null) {
- JavaAttributeOverride javaAttributeOverride = null;
- if (getJavaEmbeddedMapping() != null) {
- javaAttributeOverride = getJavaEmbeddedMapping().getAttributeOverrideNamed(persistentAttribute.getName());
- }
- this.virtualAttributeOverrides.add(buildVirtualAttributeOverride(persistentAttribute, javaAttributeOverride));
- }
- }
- }
-
- protected OrmAttributeOverride buildVirtualAttributeOverride(PersistentAttribute persistentAttribute, JavaAttributeOverride javaAttributeOverride) {
- return buildAttributeOverride(buildVirtualXmlAttributeOverride(persistentAttribute, javaAttributeOverride));
- }
-
- protected XmlAttributeOverride buildVirtualXmlAttributeOverride(PersistentAttribute persistentAttribute, JavaAttributeOverride javaAttributeOverride) {
- XmlColumn xmlColumn;
- if (javaAttributeOverride == null) {
- ColumnMapping columnMapping = (ColumnMapping) persistentAttribute.getMapping();
- xmlColumn = new VirtualXmlColumn(getTypeMapping(), columnMapping.getColumn());
- }
- else {
- xmlColumn = new VirtualXmlColumn(getTypeMapping(), javaAttributeOverride.getColumn());
- }
- return new VirtualXmlAttributeOverride(persistentAttribute.getName(), xmlColumn);
- }
-
- protected OrmAttributeOverride buildAttributeOverride(XmlAttributeOverride attributeOverride) {
- return getJpaFactory().buildOrmAttributeOverride(this, this, attributeOverride);
- }
-
- @Override
- public void update() {
- super.update();
- this.embeddable = embeddableFor(findJavaPersistentAttribute());
- this.updateSpecifiedAttributeOverrides();
- this.updateVirtualAttributeOverrides();
- }
-
- protected void updateSpecifiedAttributeOverrides() {
- ListIterator<OrmAttributeOverride> attributeOverrides = specifiedAttributeOverrides();
- ListIterator<XmlAttributeOverride> resourceAttributeOverrides = new CloneListIterator<XmlAttributeOverride>(this.resourceAttributeMapping.getAttributeOverrides());//prevent ConcurrentModificiationException
-
- while (attributeOverrides.hasNext()) {
- OrmAttributeOverride attributeOverride = attributeOverrides.next();
- if (resourceAttributeOverrides.hasNext()) {
- attributeOverride.update(resourceAttributeOverrides.next());
- }
- else {
- removeSpecifiedAttributeOverride_(attributeOverride);
- }
- }
-
- while (resourceAttributeOverrides.hasNext()) {
- addSpecifiedAttributeOverride(buildAttributeOverride(resourceAttributeOverrides.next()));
- }
- }
-
- protected void updateVirtualAttributeOverrides() {
- Iterator<PersistentAttribute> overridableAttributes = allOverridableAttributes();
- ListIterator<OrmAttributeOverride> virtualAttributeOverrides = virtualAttributeOverrides();
-
- if (!getPersistentAttribute().isVirtual()) {
- //specifiedAttributeOverrides are used if the persistentAttribute is virtual
- for (PersistentAttribute persistentAttribute : CollectionTools.iterable(overridableAttributes)) {
- OrmAttributeOverride ormAttributeOverride = getAttributeOverrideNamed(persistentAttribute.getName());
- if (ormAttributeOverride != null && !ormAttributeOverride.isVirtual()) {
- continue;
- }
- JavaAttributeOverride javaAttributeOverride = null;
- if (getJavaEmbeddedMapping() != null) {
- javaAttributeOverride = getJavaEmbeddedMapping().getAttributeOverrideNamed(persistentAttribute.getName());
- }
- if (ormAttributeOverride != null) {
- if (virtualAttributeOverrides.hasNext()) {
- OrmAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- virtualAttributeOverride.update(buildVirtualXmlAttributeOverride(persistentAttribute, javaAttributeOverride));
- }
- else {
- addVirtualAttributeOverride(buildVirtualAttributeOverride(persistentAttribute, javaAttributeOverride));
- }
- }
- else {
- addVirtualAttributeOverride(buildVirtualAttributeOverride(persistentAttribute, javaAttributeOverride));
- }
- }
- }
- for (OrmAttributeOverride virtualAttributeOverride : CollectionTools.iterable(virtualAttributeOverrides)) {
- removeVirtualAttributeOverride(virtualAttributeOverride);
- }
-
- }
-
- //************ static methods ************
-
- public static Embeddable embeddableFor(JavaPersistentAttribute javaPersistentAttribute) {
- if (javaPersistentAttribute == null) {
- return null;
- }
- return MappingTools.getEmbeddableFor(javaPersistentAttribute);
- }
-}
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 9300c53f6a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmGenerator.java
+++ /dev/null
@@ -1,237 +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.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.internal.context.AbstractXmlContextNode;
-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 AbstractXmlContextNode
- implements OrmGenerator
-{
-
- protected String name;
-
- protected Integer specifiedInitialValue;
- protected Integer defaultInitialValue;
-
- protected Integer specifiedAllocationSize;
- protected Integer 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 Integer getInitialValue() {
- return (this.specifiedInitialValue != null) ? this.specifiedInitialValue : 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 Integer getDefaultInitialValue() {
- return this.defaultInitialValue;
- }
-
- protected void setDefaultInitialValue(Integer defaultInitialValue) {
- Integer old = this.defaultInitialValue;
- this.defaultInitialValue = defaultInitialValue;
- this.firePropertyChanged(DEFAULT_INITIAL_VALUE_PROPERTY, old, defaultInitialValue);
- }
-
-
- // ********** allocation size **********
-
- public Integer getAllocationSize() {
- return (this.specifiedAllocationSize != null) ? this.specifiedAllocationSize : 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 Integer getDefaultAllocationSize() {
- return this.defaultAllocationSize;
- }
-
- protected void setDefaultAllocationSize(Integer defaultAllocationSize) {
- Integer 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();
- getPersistenceUnit().addGenerator(this);
- //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 *default* 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();
-
- public Catalog getDbCatalog() {
- String catalog = this.getCatalog();
- if (catalog == null) {
- return null; // not even a default catalog (i.e. database probably does not support catalogs)
- }
- return 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 generator) {
- 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(generator.getName()) && generator instanceof JavaGenerator;
- }
-
- 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/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 aa802ec9ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java
+++ /dev/null
@@ -1,373 +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.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.MultiRelationshipMapping;
-import org.eclipse.jpt.core.context.NonOwningMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.core.context.orm.OrmMultiRelationshipMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.orm.MapKey;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public abstract class AbstractOrmMultiRelationshipMapping<T extends XmlMultiRelationshipMapping>
- extends AbstractOrmRelationshipMapping<T>
- implements OrmMultiRelationshipMapping
-{
-
- protected String mappedBy;
-
- protected String orderBy;//TODO change this to defaultOrderBy and specifiedOrderBy?
-
- protected boolean isNoOrdering;
-
- protected boolean isPkOrdering;
-
- protected boolean isCustomOrdering;
-
- protected final OrmJoinTable joinTable;
-
- protected String mapKey;
-
- protected AbstractOrmMultiRelationshipMapping(OrmPersistentAttribute parent) {
- super(parent);
- this.joinTable = getJpaFactory().buildOrmJoinTable(this);
- }
-
- @Override
- public void initializeFromOrmMulitRelationshipMapping(OrmMultiRelationshipMapping oldMapping) {
- super.initializeFromOrmMulitRelationshipMapping(oldMapping);
- getJoinTable().initializeFrom(oldMapping.getJoinTable());
- }
-
- public boolean isRelationshipOwner() {
- return getMappedBy() == null;
- }
-
- public FetchType getDefaultFetch() {
- return MultiRelationshipMapping.DEFAULT_FETCH_TYPE;
- }
-
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String newMappedBy) {
- String oldMappedBy = this.mappedBy;
- this.mappedBy = newMappedBy;
- this.resourceAttributeMapping.setMappedBy(newMappedBy);
- firePropertyChanged(MAPPED_BY_PROPERTY, oldMappedBy, newMappedBy);
- }
-
- protected void setMappedBy_(String newMappedBy) {
- String oldMappedBy = this.mappedBy;
- this.mappedBy = newMappedBy;
- firePropertyChanged(MAPPED_BY_PROPERTY, oldMappedBy, newMappedBy);
- }
-
- public String getOrderBy() {
- return this.orderBy;
- }
-
- public void setOrderBy(String newOrderBy) {
- String oldOrderBy = this.orderBy;
- this.orderBy = newOrderBy;
- this.resourceAttributeMapping.setOrderBy(newOrderBy);
- firePropertyChanged(ORDER_BY_PROPERTY, oldOrderBy, newOrderBy);
- }
-
- protected void setOrderBy_(String newOrderBy) {
- String oldOrderBy = this.orderBy;
- this.orderBy = newOrderBy;
- firePropertyChanged(ORDER_BY_PROPERTY, oldOrderBy, newOrderBy);
- }
-
- public boolean isNoOrdering() {
- return this.isNoOrdering;
- }
-
- public void setNoOrdering(boolean newNoOrdering) {
- boolean oldNoOrdering = this.isNoOrdering;
- this.isNoOrdering = newNoOrdering;
- if (newNoOrdering) {
- this.resourceAttributeMapping.setOrderBy(null);
- }
- firePropertyChanged(NO_ORDERING_PROPERTY, oldNoOrdering, newNoOrdering);
- }
-
- protected void setNoOrdering_(boolean newNoOrdering) {
- boolean oldNoOrdering = this.isNoOrdering;
- this.isNoOrdering = newNoOrdering;
- firePropertyChanged(NO_ORDERING_PROPERTY, oldNoOrdering, newNoOrdering);
- }
-
- public boolean isPkOrdering() {
- return this.isPkOrdering;
- }
-
- public void setPkOrdering(boolean newPkOrdering) {
- boolean oldPkOrdering = this.isPkOrdering;
- this.isPkOrdering = newPkOrdering;
- if (newPkOrdering) {
- this.resourceAttributeMapping.setOrderBy(""); //$NON-NLS-1$
- }
- firePropertyChanged(PK_ORDERING_PROPERTY, oldPkOrdering, newPkOrdering);
- }
-
- protected void setPkOrdering_(boolean newPkOrdering) {
- boolean oldPkOrdering = this.isPkOrdering;
- this.isPkOrdering = newPkOrdering;
- firePropertyChanged(PK_ORDERING_PROPERTY, oldPkOrdering, newPkOrdering);
- }
-
- public boolean isCustomOrdering() {
- return this.isCustomOrdering;
- }
-
- public void setCustomOrdering(boolean newCustomOrdering) {
- boolean oldCustomOrdering = this.isCustomOrdering;
- this.isCustomOrdering = newCustomOrdering;
- if (newCustomOrdering) {
- setOrderBy(""); //$NON-NLS-1$
- }
- firePropertyChanged(CUSTOM_ORDERING_PROPERTY, oldCustomOrdering, newCustomOrdering);
- }
-
- protected void setCustomOrdering_(boolean newCustomOrdering) {
- boolean oldCustomOrdering = this.isCustomOrdering;
- this.isCustomOrdering = newCustomOrdering;
- firePropertyChanged(CUSTOM_ORDERING_PROPERTY, oldCustomOrdering, newCustomOrdering);
- }
-
- public OrmJoinTable getJoinTable() {
- return this.joinTable;
- }
-
- public boolean joinTableIsSpecified() {
- return getJoinTable().isSpecified();
- }
-
- public String getMapKey() {
- return this.mapKey;
- }
-
- public void setMapKey(String newMapKey) {
- String oldMapKey = this.mapKey;
- this.mapKey = newMapKey;
- if (oldMapKey != newMapKey) {
- if (this.getResourceMapKey() != null) {
- this.getResourceMapKey().setName(newMapKey);
- if (this.getResourceMapKey().isAllFeaturesUnset()) {
- removeResourceMapKey();
- }
- }
- else if (newMapKey != null) {
- addResourceMapKey();
- getResourceMapKey().setName(newMapKey);
- }
- }
- firePropertyChanged(MAP_KEY_PROPERTY, oldMapKey, newMapKey);
- }
-
- protected void setMapKey_(String newMapKey) {
- String oldMapKey = this.mapKey;
- this.mapKey = newMapKey;
- firePropertyChanged(MAP_KEY_PROPERTY, oldMapKey, newMapKey);
- }
-
- protected MapKey getResourceMapKey() {
- return this.resourceAttributeMapping.getMapKey();
- }
-
- protected void removeResourceMapKey() {
- this.resourceAttributeMapping.setMapKey(null);
- }
-
- protected void addResourceMapKey() {
- this.resourceAttributeMapping.setMapKey(OrmFactory.eINSTANCE.createMapKeyImpl());
- }
-
- public Iterator<String> candidateMapKeyNames() {
- return this.allTargetEntityAttributeNames();
- }
-
-// public void refreshDefaults(DefaultsContext defaultsContext) {
-// super.refreshDefaults(defaultsContext);
-// // TODO
-// // if (isOrderByPk()) {
-// // refreshDefaultOrderBy(defaultsContext);
-// // }
-// }
-//
-// //primary key ordering when just the @OrderBy annotation is present
-// protected void refreshDefaultOrderBy(DefaultsContext defaultsContext) {
-// IEntity targetEntity = getResolvedTargetEntity();
-// if (targetEntity != null) {
-// setOrderBy(targetEntity.primaryKeyAttributeName() + " ASC");
-// }
-// }
-//
-// //TODO copied from JavaMultiRelationshipMapping
-// /**
-// * extract the element type from the specified container signature and
-// * convert it into a reference entity type name;
-// * return null if the type is not a valid reference entity type (e.g. it's
-// * another container or an array or a primitive or other Basic type)
-// */
-// @Override
-// protected String javaDefaultTargetEntity(ITypeBinding typeBinding) {
-// String typeName = super.javaDefaultTargetEntity(typeBinding);
-// return JavaRelationshipMapping.typeNamedIsContainer(typeName) ? this.javaDefaultTargetEntityFromContainer(typeBinding) : null;
-// }
-//
-// protected String javaDefaultTargetEntityFromContainer(ITypeBinding typeBinding) {
-// return JavaMultiRelationshipMapping.javaDefaultTargetEntityFromContainer(typeBinding);
-// }
-
- public TextRange getMappedByTextRange() {
- TextRange mappedByTextRange = this.resourceAttributeMapping.getMappedByTextRange();
- return mappedByTextRange != null ? mappedByTextRange : getValidationTextRange();
- }
-
- @Override
- public void initialize(XmlAttributeMapping attributeMapping) {
- super.initialize(attributeMapping);
- this.mappedBy = this.resourceAttributeMapping.getMappedBy();
- this.mapKey = this.mapKey();
- this.orderBy = this.orderBy();
- if (this.orderBy == null) {
- this.isNoOrdering = true;
- }
- else {
- this.isCustomOrdering = true;
- }
- this.joinTable.initialize(this.resourceAttributeMapping);
- }
-
- @Override
- public void update() {
- super.update();
- this.setMappedBy_(this.resourceAttributeMapping.getMappedBy());
- this.setMapKey_(this.mapKey());
- this.setOrderBy_(this.orderBy());
- if (getOrderBy() == null) {
- setNoOrdering_(true);
- setPkOrdering_(false);
- setCustomOrdering_(false);
- }
- else {
- setNoOrdering_(false);
- setPkOrdering_(false);
- setCustomOrdering_(true);
- }
- this.joinTable.update();
- }
-
- protected String mapKey() {
- return this.resourceAttributeMapping.getMapKey() == null ? null : this.resourceAttributeMapping.getMapKey().getName();
- }
-
- protected String orderBy() {
- return this.resourceAttributeMapping.getOrderBy();
- }
-
- @Override
- protected String defaultTargetEntity(JavaResourcePersistentAttribute jrpa) {
- if (!jrpa.typeIsContainer()) {
- return null;
- }
- return jrpa.getQualifiedReferenceEntityElementTypeName();
- }
-
- //****************** validation ******************8
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- if (this.ownerIsEntity() && (this.joinTableIsSpecified() || this.isRelationshipOwner())) {
- this.joinTable.validate(messages);
- }
- if (this.mappedBy != null) {
- this.validateMappedBy(messages);
- }
- }
-
- protected void validateMappedBy(List<IMessage> messages) {
- if (this.joinTableIsSpecified()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAPPING_MAPPED_BY_WITH_JOIN_TABLE,
- this.joinTable,
- this.joinTable.getValidationTextRange()
- )
- );
- }
- Entity targetEntity = this.getResolvedTargetEntity();
- if (targetEntity == null) {
- return; // validated elsewhere
- }
-
- PersistentAttribute attribute = targetEntity.getPersistentType().resolveAttribute(this.mappedBy);
-
- if (attribute == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAPPING_UNRESOLVED_MAPPED_BY,
- new String[] {this.mappedBy},
- this,
- this.getMappedByTextRange()
- )
- );
- return;
- }
-
- AttributeMapping mappedByMapping = attribute.getMapping();
- if ( ! this.mappedByIsValid(mappedByMapping)) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAPPING_INVALID_MAPPED_BY,
- new String[] {this.mappedBy},
- this,
- this.getMappedByTextRange()
- )
- );
- return;
- }
-
- if ((mappedByMapping instanceof NonOwningMapping)
- && ((NonOwningMapping) mappedByMapping).getMappedBy() != null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAPPING_MAPPED_BY_ON_BOTH_SIDES,
- this,
- this.getMappedByTextRange()
- )
- );
- }
- }
-}
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 f2cbfcaf8a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmNamedColumn.java
+++ /dev/null
@@ -1,196 +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.orm;
-
-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.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlNamedColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.Table;
-
-
-public abstract class AbstractOrmNamedColumn<T extends XmlNamedColumn> extends AbstractXmlContextNode
- 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();
-
- 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 (oldSpecifiedName != newSpecifiedName) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setName(newSpecifiedName);
- if (this.getResourceColumn().isAllFeaturesUnset()) {
- removeResourceColumn();
- }
- }
- 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 (oldColumnDefinition != newColumnDefinition) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setColumnDefinition(newColumnDefinition);
- if (this.getResourceColumn().isAllFeaturesUnset()) {
- removeResourceColumn();
- }
- }
- 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.tableName());
- }
-
- protected abstract String tableName();
-
- 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.buildSpecifiedName(column);
- this.defaultName = this.buildDefaultName();
- this.columnDefinition = this.buildSpecifiedColumnDefinition(column);
- }
-
- protected void update(T column) {
- setSpecifiedName_(this.buildSpecifiedName(column));
- setDefaultName(this.buildDefaultName());
- setColumnDefinition_(this.buildSpecifiedColumnDefinition(column));
- }
-
- protected String buildSpecifiedName(T column) {
- return column == null ? null : column.getName();
- }
-
- protected String buildSpecifiedColumnDefinition(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());
- }
-
-} \ No newline at end of file
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 6dece52cbe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmQuery.java
+++ /dev/null
@@ -1,192 +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.orm;
-
-import java.util.ArrayList;
-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.internal.context.AbstractXmlContextNode;
-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.CloneListIterator;
-
-
-public abstract class AbstractOrmQuery<E extends XmlQuery> extends AbstractXmlContextNode
- 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();
- getPersistenceUnit().addQuery(this);
- }
-
- protected void initializeHints() {
- for (XmlQueryHint resourceQueryHint : this.resourceQuery.getHints()) {
- this.hints.add(buildQueryHint(resourceQueryHint));
- }
- }
-
- protected OrmQueryHint buildQueryHint(XmlQueryHint resourceQueryHint) {
- return getJpaFactory().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() {
- ListIterator<OrmQueryHint> contextHints = hints();
- ListIterator<XmlQueryHint> resourceHints = new CloneListIterator<XmlQueryHint>(this.resourceQuery.getHints());//prevent ConcurrentModificiationException
-
- while (contextHints.hasNext()) {
- OrmQueryHint contextHint = contextHints.next();
- if (resourceHints.hasNext()) {
- contextHint.update(resourceHints.next());
- }
- else {
- removeHint_(contextHint);
- }
- }
-
- while (resourceHints.hasNext()) {
- addHint(buildQueryHint(resourceHints.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 42e0665424..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmRelationshipMapping.java
+++ /dev/null
@@ -1,230 +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.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.MappingKeys;
-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.PersistentType;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipMapping;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-
-public abstract class AbstractOrmRelationshipMapping<T extends XmlRelationshipMapping>
- extends AbstractOrmAttributeMapping<T>
- implements OrmRelationshipMapping
-{
-
- protected String specifiedTargetEntity;
- protected String defaultTargetEntity;
- protected Entity resolvedTargetEntity;
-
- protected final OrmCascade cascade;
-
- protected FetchType specifiedFetch;
-
-
- protected AbstractOrmRelationshipMapping(OrmPersistentAttribute parent) {
- super(parent);
- this.cascade = new OrmCascade(this);
- }
-
-
- // ********** 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.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);
- }
-
-
- // ********** cascade **********
-
- public OrmCascade 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);
- }
-
-
- // ********** resource => context **********
-
- @Override
- public void initialize(XmlAttributeMapping relationshipMapping) {
- super.initialize(relationshipMapping);
- this.specifiedTargetEntity = this.resourceAttributeMapping.getTargetEntity();
- this.defaultTargetEntity = this.buildDefaultTargetEntity();
- this.resolvedTargetEntity = this.buildResolvedTargetEntity();
- this.specifiedFetch = this.buildSpecifiedFetch();
- this.cascade.initialize(this.resourceAttributeMapping);
- }
-
- @Override
- public void update() {
- super.update();
- this.setSpecifiedTargetEntity_(this.resourceAttributeMapping.getTargetEntity());
- this.setDefaultTargetEntity(this.buildDefaultTargetEntity());
- this.setResolvedTargetEntity(this.buildResolvedTargetEntity());
- this.setSpecifiedFetch_(this.buildSpecifiedFetch());
- this.cascade.update();
- }
-
- protected FetchType buildSpecifiedFetch() {
- return FetchType.fromOrmResourceModel(this.resourceAttributeMapping.getFetch());
- }
-
- protected String buildDefaultTargetEntity() {
- RelationshipMapping javaMapping = getJavaRelationshipMapping();
- if (javaMapping != null) {
- if (getPersistentAttribute().isVirtual() && !getTypeMapping().isMetadataComplete()) {
- return javaMapping.getTargetEntity();
- }
- }
- if (findJavaPersistentAttribute() != null) {
- return defaultTargetEntity(findJavaPersistentAttribute().getResourcePersistentAttribute());
- }
- return null;
- }
-
- protected RelationshipMapping getJavaRelationshipMapping() {
- if (findJavaPersistentAttribute() == null) {
- return null;
- }
- AttributeMapping javaAttributeMapping = findJavaPersistentAttribute().getMapping();
- if (javaAttributeMapping instanceof RelationshipMapping) {
- return ((RelationshipMapping) javaAttributeMapping);
- }
- return null;
- }
-
- protected abstract String defaultTargetEntity(JavaResourcePersistentAttribute persistentAttributeResource);
-
- protected Entity buildResolvedTargetEntity() {
- if (getTargetEntity() == null) {
- return null;
- }
- PersistentType persistentType = getTargetPersistentType();
- if (persistentType != null && persistentType.getMappingKey() == MappingKeys.ENTITY_TYPE_MAPPING_KEY) {
- return (Entity) persistentType.getMapping();
- }
- return null;
- }
-
- protected PersistentType getTargetPersistentType() {
- // try to resolve by only the locally specified name
- PersistentType persistentType = getPersistenceUnit().getPersistentType(getTargetEntity());
- if (persistentType == null) {
- // try to resolve by prepending the global package name
- String packageName =
- getPersistentAttribute().getPersistentType().getContext().getDefaultPersistentTypePackage();
- persistentType = getPersistenceUnit().getPersistentType(packageName + '.' + getTargetEntity());
- }
- return persistentType;
- }
-
-
- // ********** RelationshipMapping implementation **********
-
- public Entity getEntity() {
- if (getTypeMapping() instanceof Entity) {
- return (Entity) getTypeMapping();
- }
- return null;
- }
-
- public String getJoinTableDefaultName() {
- return MappingTools.buildJoinTableDefaultName(this);
- }
-
- @Override
- public void initializeFromOrmRelationshipMapping(OrmRelationshipMapping oldMapping) {
- super.initializeFromOrmRelationshipMapping(oldMapping);
- setSpecifiedTargetEntity(oldMapping.getSpecifiedTargetEntity());
- setSpecifiedFetch(oldMapping.getSpecifiedFetch());
- getCascade().initializeFrom(oldMapping.getCascade());
- //TODO should we set the fetch type from a BasicMapping??
- }
-
- public Iterator<String> allTargetEntityAttributeNames() {
- Entity targetEntity = this.getResolvedTargetEntity();
- return (targetEntity == null) ? EmptyIterator.<String> instance() : targetEntity.getPersistentType().allAttributeNames();
- }
-
- public Iterator<String> candidateMappedByAttributeNames() {
- return this.allTargetEntityAttributeNames();
- }
-
-}
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 00e8c86617..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmSingleRelationshipMapping.java
+++ /dev/null
@@ -1,467 +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.context.orm;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-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.Nullable;
-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.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmSingleRelationshipMapping;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping;
-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.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;
-
-/**
- *
- */
-public abstract class AbstractOrmSingleRelationshipMapping<T extends XmlSingleRelationshipMapping>
- extends AbstractOrmRelationshipMapping<T>
- implements OrmSingleRelationshipMapping
-{
-
- protected final List<OrmJoinColumn> specifiedJoinColumns;
- protected OrmJoinColumn defaultJoinColumn;
-
- protected Boolean specifiedOptional;
-
-
- protected AbstractOrmSingleRelationshipMapping(OrmPersistentAttribute parent) {
- super(parent);
- this.specifiedJoinColumns = new ArrayList<OrmJoinColumn>();
- }
-
-
- // ********** join columns **********
-
- public ListIterator<OrmJoinColumn> joinColumns() {
- return this.containsSpecifiedJoinColumns() ? this.specifiedJoinColumns() : this.defaultJoinColumns();
- }
-
- public int joinColumnsSize() {
- return this.containsSpecifiedJoinColumns() ? this.specifiedJoinColumnsSize() : this.defaultJoinColumnsSize();
- }
-
- public ListIterator<OrmJoinColumn> specifiedJoinColumns() {
- return new CloneListIterator<OrmJoinColumn>(this.specifiedJoinColumns);
- }
-
- public int specifiedJoinColumnsSize() {
- return this.specifiedJoinColumns.size();
- }
-
- public boolean containsSpecifiedJoinColumns() {
- 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.createXmlJoinColumnImpl();
- OrmJoinColumn contextJoinColumn = this.buildJoinColumn(resourceJoinColumn);
- this.specifiedJoinColumns.add(index, contextJoinColumn);
- this.resourceAttributeMapping.getJoinColumns().add(index, resourceJoinColumn);
- this.fireItemAdded(SPECIFIED_JOIN_COLUMNS_LIST, index, contextJoinColumn);
- if (oldDefaultJoinColumn != null) {
- this.firePropertyChanged(DEFAULT_JOIN_COLUMN, 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.resourceAttributeMapping.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) {
- removeItemFromList(joinColumn, this.specifiedJoinColumns, SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedJoinColumns, targetIndex, sourceIndex);
- this.resourceAttributeMapping.getJoinColumns().move(targetIndex, sourceIndex);
- fireItemMoved(SPECIFIED_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- public OrmJoinColumn getDefaultJoinColumn() {
- return this.defaultJoinColumn;
- }
-
- protected void setDefaultJoinColumn(OrmJoinColumn joinColumn) {
- OrmJoinColumn old = this.defaultJoinColumn;
- this.defaultJoinColumn = joinColumn;
- this.firePropertyChanged(DEFAULT_JOIN_COLUMN, 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;
- }
-
-
- // ********** optional **********
-
- public Boolean getOptional() {
- return (this.specifiedOptional != null) ? this.specifiedOptional : this.getDefaultOptional();
- }
-
- 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 getDefaultOptional() {
- return Nullable.DEFAULT_OPTIONAL;
- }
-
-
- // ********** resource => context **********
-
- @Override
- public void initialize(XmlAttributeMapping attributeMapping) {
- super.initialize(attributeMapping);
- this.specifiedOptional = this.resourceAttributeMapping.getOptional();
- //TODO defaultOptional
- this.initializeSpecifiedJoinColumns();
- this.initializeDefaultJoinColumn();
- }
-
- protected void initializeSpecifiedJoinColumns() {
- if (this.resourceAttributeMapping != null) {
- for (XmlJoinColumn resourceJoinColumn : this.resourceAttributeMapping.getJoinColumns()) {
- this.specifiedJoinColumns.add(buildJoinColumn(resourceJoinColumn));
- }
- }
- }
-
- protected void initializeDefaultJoinColumn() {
- if (this.shouldBuildDefaultJoinColumn()) {
- this.defaultJoinColumn = this.buildJoinColumn(null);
- }
- }
-
- protected boolean shouldBuildDefaultJoinColumn() {
- return ! this.containsSpecifiedJoinColumns() && this.isRelationshipOwner();
- }
-
- protected OrmJoinColumn buildJoinColumn(XmlJoinColumn resourceJoinColumn) {
- return this.getJpaFactory().buildOrmJoinColumn(this, new JoinColumnOwner(), resourceJoinColumn);
- }
-
- @Override
- public void update() {
- super.update();
- this.setSpecifiedOptional_(this.resourceAttributeMapping.getOptional());
- this.updateSpecifiedJoinColumns();
- this.updateDefaultJoinColumn();
- }
-
- protected void updateSpecifiedJoinColumns() {
- ListIterator<OrmJoinColumn> contextJoinColumns = specifiedJoinColumns();
- ListIterator<XmlJoinColumn> resourceJoinColumns = new CloneListIterator<XmlJoinColumn>(this.resourceAttributeMapping.getJoinColumns());//prevent ConcurrentModificiationException
-
- while (contextJoinColumns.hasNext()) {
- OrmJoinColumn contextJoinColumn = contextJoinColumns.next();
- if (resourceJoinColumns.hasNext()) {
- contextJoinColumn.update(resourceJoinColumns.next());
- }
- else {
- removeSpecifiedJoinColumn_(contextJoinColumn);
- }
- }
-
- while (resourceJoinColumns.hasNext()) {
- addSpecifiedJoinColumn(buildJoinColumn(resourceJoinColumns.next()));
- }
- }
-
- protected void updateDefaultJoinColumn() {
- if (this.shouldBuildDefaultJoinColumn()) {
- if (this.defaultJoinColumn == null) {
- this.setDefaultJoinColumn(this.buildJoinColumn(null));
- } else {
- this.defaultJoinColumn.update(null);
- }
- } else {
- this.setDefaultJoinColumn(null);
- }
- }
-
-
- // ********** AbstractOrmRelationshipMapping implementation **********
-
- /**
- * eliminate any "container" types
- */
- @Override
- protected String defaultTargetEntity(JavaResourcePersistentAttribute persistentAttributeResource) {
- if (persistentAttributeResource.typeIsContainer()) {
- return null;
- }
- return persistentAttributeResource.getQualifiedReferenceEntityTypeName();
- }
-
-
- // ********** AbstractOrmAttributeMapping implementation **********
-
- @Override
- public void initializeFromOrmSingleRelationshipMapping(OrmSingleRelationshipMapping oldMapping) {
- super.initializeFromOrmSingleRelationshipMapping(oldMapping);
- int index = 0;
- for (JoinColumn joinColumn : CollectionTools.iterable(oldMapping.specifiedJoinColumns())) {
- OrmJoinColumn newJoinColumn = addSpecifiedJoinColumn(index++);
- newJoinColumn.initializeFrom(joinColumn);
- }
- }
-
-
- // ********** Fetchable implementation **********
-
- public FetchType getDefaultFetch() {
- return DEFAULT_FETCH_TYPE;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- if (this.connectionProfileIsActive()) {
- this.validateJoinColumns(messages);
- }
- }
-
- //bug 192287 - do not want joinColumn validation errors on the non-owning side
- //of a bidirectional relationship. This is a low risk fix for RC3, but a better
- //solution would be to not have the default joinColumns on the non-owning side.
- //This would fix another bug that we show default joinColumns in this situation.
- protected void validateJoinColumns(List<IMessage> messages) {
- if (this.ownerIsEntity() && this.isRelationshipOwner()) {
- for (Iterator<OrmJoinColumn> stream = this.joinColumns(); stream.hasNext(); ) {
- this.validateJoinColumn(stream.next(), messages);
- }
- }
- }
-
- protected void validateJoinColumn(OrmJoinColumn joinColumn, List<IMessage> messages) {
- String tableName = joinColumn.getTable();
- if (this.getTypeMapping().tableNameIsInvalid(tableName)) {
- if (this.getPersistentAttribute().isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_TABLE,
- new String[] {this.getName(), tableName, joinColumn.getName()},
- joinColumn,
- joinColumn.getTableTextRange()
- )
- );
- } else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_TABLE,
- new String[] {tableName, joinColumn.getName()},
- joinColumn,
- joinColumn.getTableTextRange()
- )
- );
- }
- return;
- }
-
- if ( ! joinColumn.isResolved()) {
- if (this.getPersistentAttribute().isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {this.getName(), joinColumn.getName()},
- joinColumn,
- joinColumn.getNameTextRange()
- )
- );
- } else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {joinColumn.getName()},
- joinColumn,
- joinColumn.getNameTextRange()
- )
- );
- }
- }
-
- if ( ! joinColumn.isReferencedColumnResolved()) {
- if (this.getPersistentAttribute().isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME,
- new String[] {this.getName(), joinColumn.getReferencedColumnName(), joinColumn.getName()},
- joinColumn,
- joinColumn.getReferencedColumnNameTextRange()
- )
- );
- } else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME,
- new String[] {joinColumn.getReferencedColumnName(), joinColumn.getName()},
- joinColumn,
- joinColumn.getReferencedColumnNameTextRange()
- )
- );
- }
- }
- }
-
-
- // ********** join column owner adapter **********
-
- public class JoinColumnOwner implements OrmJoinColumn.Owner {
-
- public JoinColumnOwner() {
- super();
- }
-
- /**
- * by default, the join column is in the type mapping's primary table
- */
- public String getDefaultTableName() {
- return AbstractOrmSingleRelationshipMapping.this.getTypeMapping().getPrimaryTableName();
- }
-
- public Entity getTargetEntity() {
- return AbstractOrmSingleRelationshipMapping.this.getResolvedTargetEntity();
- }
-
- public String getAttributeName() {
- return AbstractOrmSingleRelationshipMapping.this.getName();
- }
-
- public RelationshipMapping getRelationshipMapping() {
- return AbstractOrmSingleRelationshipMapping.this;
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return AbstractOrmSingleRelationshipMapping.this.getTypeMapping().tableNameIsInvalid(tableName);
- }
-
- /**
- * the join column can be on a secondary table
- */
- public boolean tableIsAllowed() {
- return true;
- }
-
- public TypeMapping getTypeMapping() {
- return AbstractOrmSingleRelationshipMapping.this.getTypeMapping();
- }
-
- public Table getDbTable(String tableName) {
- return getTypeMapping().getDbTable(tableName);
- }
-
- public Table getReferencedColumnDbTable() {
- Entity targetEntity = getTargetEntity();
- return (targetEntity == null) ? null : targetEntity.getPrimaryDbTable();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return AbstractOrmSingleRelationshipMapping.this.defaultJoinColumn == joinColumn;
- }
-
- public String getDefaultColumnName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public int joinColumnsSize() {
- return AbstractOrmSingleRelationshipMapping.this.joinColumnsSize();
- }
-
- public TextRange getValidationTextRange() {
- return AbstractOrmSingleRelationshipMapping.this.getValidationTextRange();
- }
-
- }
-
-}
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 8f1f720634..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmTable.java
+++ /dev/null
@@ -1,466 +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.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.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlBaseTable;
-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.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-
-/**
- *
- */
-public abstract class AbstractOrmTable
- extends AbstractXmlContextNode
- 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 XmlBaseTable getResourceTable();
-
- /**
- * Return the added resource table.
- */
- protected abstract XmlBaseTable addResourceTable();
-
- protected abstract void removeResourceTable();
-
- 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;
- if (this.attributeValueHasChanged(old, name)) {
- XmlBaseTable resourceTable = this.getResourceTable();
- if (resourceTable == null) {
- resourceTable = this.addResourceTable();
- }
- resourceTable.setName(name);
- if (resourceTable.isAllFeaturesUnset()) {
- 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)) {
- XmlBaseTable resourceTable = this.getResourceTable();
- if (resourceTable == null) {
- resourceTable = this.addResourceTable();
- }
- resourceTable.setSchema(schema);
- if (resourceTable.isAllFeaturesUnset()) {
- 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)) {
- XmlBaseTable resourceTable = this.getResourceTable();
- if (resourceTable == null) {
- resourceTable = this.addResourceTable();
- }
- resourceTable.setCatalog(catalog);
- if (resourceTable.isAllFeaturesUnset()) {
- 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.createXmlUniqueConstraintImpl();
- OrmUniqueConstraint contextConstraint = this.buildUniqueConstraint(resourceConstraint);
- this.uniqueConstraints.add(index, contextConstraint);
-
- XmlBaseTable 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() {
- XmlBaseTable resourceTable = this.getResourceTable();
- return (resourceTable == null) ? null : resourceTable.getNameTextRange();
- }
-
- protected TextRange getSchemaTextRange() {
- return this.getTextRange(this.getResourceTableSchemaTextRange());
- }
-
- protected TextRange getResourceTableSchemaTextRange() {
- XmlBaseTable resourceTable = this.getResourceTable();
- return (resourceTable == null) ? null : resourceTable.getSchemaTextRange();
- }
-
- protected TextRange getCatalogTextRange() {
- return this.getTextRange(this.getResourceTableCatalogTextRange());
- }
-
- protected TextRange getResourceTableCatalogTextRange() {
- XmlBaseTable resourceTable = this.getResourceTable();
- return (resourceTable == null) ? null : resourceTable.getCatalogTextRange();
- }
-
- protected OrmUniqueConstraint buildUniqueConstraint(XmlUniqueConstraint resourceUniqueConstraint) {
- return this.getJpaFactory().buildOrmUniqueConstraint(this, this, resourceUniqueConstraint);
- }
-
-
- // ********** resource => context **********
-
- protected void initialize(XmlBaseTable xmlTable) {
- this.defaultName = this.buildDefaultName();
- this.specifiedName = this.buildSpecifiedName(xmlTable);
-
- this.defaultSchema = this.buildDefaultSchema();
- this.specifiedSchema = this.buildSpecifiedSchema(xmlTable);
-
- this.defaultCatalog = this.buildDefaultCatalog();
- this.specifiedCatalog = this.buildSpecifiedCatalog(xmlTable);
-
- this.initializeUniqueContraints(xmlTable);
- }
-
- protected void initializeUniqueContraints(XmlBaseTable xmlTable) {
- if (xmlTable == null) {
- return;
- }
- for (XmlUniqueConstraint uniqueConstraint : xmlTable.getUniqueConstraints()) {
- this.uniqueConstraints.add(this.buildUniqueConstraint(uniqueConstraint));
- }
- }
-
- protected void update(XmlBaseTable xmlTable) {
- this.setDefaultName(this.buildDefaultName());
- this.setSpecifiedName_(this.buildSpecifiedName(xmlTable));
-
- this.setDefaultSchema(this.buildDefaultSchema());
- this.setSpecifiedSchema_(this.buildSpecifiedSchema(xmlTable));
-
- this.setDefaultCatalog(this.buildDefaultCatalog());
- this.setSpecifiedCatalog_(this.buildSpecifiedCatalog(xmlTable));
-
- this.updateUniqueConstraints(xmlTable);
- }
-
- protected String buildSpecifiedName(XmlBaseTable xmlTable) {
- return (xmlTable == null) ? null : xmlTable.getName();
- }
-
- protected String buildSpecifiedSchema(XmlBaseTable xmlTable) {
- return (xmlTable == null) ? null : xmlTable.getSchema();
- }
-
- protected String buildSpecifiedCatalog(XmlBaseTable xmlTable) {
- return (xmlTable == null) ? null : xmlTable.getCatalog();
- }
-
- protected void updateUniqueConstraints(XmlBaseTable xmlTable) {
- ListIterator<OrmUniqueConstraint> contextConstraints = uniqueConstraints();
- ListIterator<XmlUniqueConstraint> resourceConstraints = EmptyListIterator.instance();
- if (xmlTable != null) {
- resourceConstraints = new CloneListIterator<XmlUniqueConstraint>(xmlTable.getUniqueConstraints());//prevent ConcurrentModificiationException
- }
- while (contextConstraints.hasNext()) {
- OrmUniqueConstraint contextConstraint = contextConstraints.next();
- if (resourceConstraints.hasNext()) {
- contextConstraint.update(resourceConstraints.next());
- } else {
- this.removeUniqueConstraint_(contextConstraint);
- }
- }
-
- while (resourceConstraints.hasNext()) {
- this.addUniqueConstraint(this.buildUniqueConstraint(resourceConstraints.next()));
- }
- }
-
- 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 *default* 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();
- }
-
- public Catalog getDbCatalog() {
- String catalog = this.getCatalog();
- if (catalog == null) {
- return null; // not even a default catalog (i.e. database probably does not support catalogs)
- }
- return this.getDbCatalog(catalog);
- }
-
- public boolean isResolved() {
- return this.getDbTable() != null;
- }
-
- public boolean hasResolvedSchema() {
- return this.getDbSchema() != null;
- }
-
- public boolean hasResolvedCatalog() {
- String catalog = this.getCatalog();
- if (catalog == null) {
- return true; // not even a default catalog (i.e. database probably does not support catalogs)
- }
- return this.getDbCatalog(catalog) != null;
- }
-
-
- // ********** UniqueConstraint.Owner implementation **********
-
- public Iterator<String> candidateUniqueConstraintColumnNames() {
- org.eclipse.jpt.db.Table dbTable = this.getDbTable();
- return (dbTable != null) ? dbTable.sortedColumnIdentifiers() : EmptyIterator.<String>instance();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange() {
- return this.getTextRange(this.getResourceTableValidationTextRange());
- }
-
- protected TextRange getResourceTableValidationTextRange() {
- XmlBaseTable 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 d20ab40871..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmTypeMapping.java
+++ /dev/null
@@ -1,397 +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.context.orm;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.TypeMapping;
-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.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-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.AbstractXmlTypeMapping;
-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.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public abstract class AbstractOrmTypeMapping<T extends AbstractXmlTypeMapping> extends AbstractXmlContextNode
- implements OrmTypeMapping
-{
- protected String class_;
-
- public AccessType defaultAccess;
-
- protected AccessType specifiedAccess;
-
- public boolean defaultMetadataComplete;
-
- protected Boolean specifiedMetadataComplete;
-
- protected JavaPersistentType javaPersistentType;
-
- protected T resourceTypeMapping;
-
-
- protected AbstractOrmTypeMapping(OrmPersistentType parent) {
- super(parent);
- }
-
-
- // **************** PersistentTypeContext impl *****************************
-
- public AccessType getOverridePersistentTypeAccess() {
- AccessType accessType = getSpecifiedAccess();
- if (accessType == null && getPersistentType().getParentPersistentType() instanceof OrmPersistentType) {
- accessType = ((OrmPersistentType) getPersistentType().getParentPersistentType()).getMapping().getSpecifiedAccess();
- }
- if (accessType == null && isMetadataComplete()) {
- accessType = getPersistentType().getContext().getDefaultPersistentTypeAccess();
- // FIELD here is a default. We're specifying metadata complete, which means
- // that annotations aren't to be used, so we basically *have* to have an
- // access type coming from xml. We're using FIELD, since it's the same
- // default we use in java when we have no other option.
- if (accessType == null) {
- accessType = AccessType.FIELD;
- }
- }
- return accessType;
- }
-
- public AccessType getDefaultPersistentTypeAccess() {
- AccessType accessType = null;
- if (accessType == null && getPersistentType().getParentPersistentType() instanceof OrmPersistentType) {
- accessType = ((OrmPersistentType) getPersistentType().getParentPersistentType()).getMapping().getDefaultAccess();
- }
- if (accessType == null) {
- accessType = getPersistentType().getContext().getDefaultPersistentTypeAccess();
- }
- return accessType;
- }
-
-
- public boolean isMapped() {
- return true;
- }
-
- 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 AccessType getDefaultAccess() {
- return this.defaultAccess;
- }
-
- protected void setDefaultAccess(AccessType newDefaultAccess) {
- AccessType oldDefaultAccess = this.defaultAccess;
- this.defaultAccess = newDefaultAccess;
- firePropertyChanged(DEFAULT_ACCESS_PROPERTY, oldDefaultAccess, newDefaultAccess);
- }
-
- public AccessType getSpecifiedAccess() {
- return this.specifiedAccess;
- }
-
- public void setSpecifiedAccess(AccessType newSpecifiedAccess) {
- AccessType oldSpecifiedAccess = this.specifiedAccess;
- this.specifiedAccess = newSpecifiedAccess;
- this.resourceTypeMapping.setAccess(AccessType.toXmlResourceModel(newSpecifiedAccess));
- firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, oldSpecifiedAccess, newSpecifiedAccess);
- }
-
- public AccessType getAccess() {
- return (this.getSpecifiedAccess() == null) ? this.getDefaultAccess() : this.getSpecifiedAccess();
- }
-
- 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);
- }
-
- public OrmPersistentType getPersistentType() {
- return (OrmPersistentType) getParent();
- }
-
- /**
- * ITypeMapping is changed and various ITypeMappings may have
- * common settings. In this method initialize the new ITypeMapping (this)
- * fromthe old ITypeMapping (oldMapping)
- * @param oldMapping
- */
- public void initializeFrom(OrmTypeMapping oldMapping) {
- this.setClass(oldMapping.getClass_());
- this.setSpecifiedAccess(oldMapping.getSpecifiedAccess());
- this.setSpecifiedMetadataComplete(oldMapping.getSpecifiedMetadataComplete());
- this.setDefaultAccess(oldMapping.getDefaultAccess());
- this.setDefaultMetadataComplete(oldMapping.isDefaultMetadataComplete());
- }
-
- public Table getPrimaryDbTable() {
- return null;
- }
-
- public Table getDbTable(String tableName) {
- return null;
- }
-
- public Schema getDbSchema() {
- return null;
- }
-
- /**
- * @see TypeMapping#attributeMappingKeyAllowed(String)
- *
- * Default implementation: override where needed
- */
- public boolean attributeMappingKeyAllowed(String attributeMappingKey) {
- return true;
- }
-
- public Iterator<OrmPersistentAttribute> overridableAttributes() {
- return EmptyIterator.instance();
- }
-
- public Iterator<String> overridableAttributeNames() {
- return EmptyIterator.instance();
- }
-
- public Iterator<PersistentAttribute> allOverridableAttributes() {
- return EmptyIterator.instance();
- }
-
- public Iterator<String> allOverridableAttributeNames() {
- return EmptyIterator.instance();
- }
-
- public Iterator<OrmPersistentAttribute> overridableAssociations() {
- return EmptyIterator.instance();
- }
-
- public Iterator<String> overridableAssociationNames() {
- return EmptyIterator.instance();
- }
-
- public Iterator<PersistentAttribute> allOverridableAssociations() {
- return EmptyIterator.instance();
- }
-
- public Iterator<String> allOverridableAssociationNames() {
- return EmptyIterator.instance();
- }
-
- public T getResourceTypeMapping() {
- return this.resourceTypeMapping;
- }
-
- protected AccessType defaultAccess() {
- if (! isMetadataComplete()) {
- if (getJavaPersistentType() != null) {
- if (getJavaPersistentType().hasAnyAttributeMappingAnnotations()) {
- return getJavaPersistentType().getAccess();
- }
- if (getPersistentType().getParentPersistentType() != null) {
- return getPersistentType().getParentPersistentType().getAccess();
- }
- }
- }
- return getMappingFileRoot().getAccess();
- }
-
- public JavaPersistentType getJavaPersistentType() {
- return this.javaPersistentType;
- }
-
- protected void setJavaPersistentType(JavaPersistentType newJavaPersistentType) {
- JavaPersistentType oldJavaPersistentType = this.javaPersistentType;
- this.javaPersistentType = newJavaPersistentType;
- firePropertyChanged(JAVA_PERSISTENT_TYPE_PROPERTY, oldJavaPersistentType, newJavaPersistentType);
- }
-
- protected void initializeJavaPersistentType() {
- JavaResourcePersistentType persistentTypeResource = getJavaResourcePersistentType();
- if (persistentTypeResource != null) {
- this.javaPersistentType = buildJavaPersistentType(persistentTypeResource);
- }
- }
-
- protected JavaResourcePersistentType getJavaResourcePersistentType() {
- // try to resolve by only the locally specified name
- JavaResourcePersistentType persistentTypeResource = getJpaProject().getJavaResourcePersistentType(getClass_());
- if (persistentTypeResource == null) {
- // try to resolve by prepending the global package name
- String packageName = getPersistentType().getContext().getDefaultPersistentTypePackage();
- persistentTypeResource = getJpaProject().getJavaResourcePersistentType(packageName + '.' + getClass_());
- }
- return persistentTypeResource;
- }
-
- protected void updateJavaPersistentType() {
- JavaResourcePersistentType jrpt = getJavaResourcePersistentType();
- if (jrpt == null) {
- setJavaPersistentType(null);
- }
- else {
- if (getJavaPersistentType() != null) {
- getJavaPersistentType().update(jrpt);
- }
- else {
- setJavaPersistentType(buildJavaPersistentType(jrpt));
- }
- }
- }
-
- protected JavaPersistentType buildJavaPersistentType(JavaResourcePersistentType resourcePersistentType) {
- return getJpaFactory().buildJavaPersistentType(this, resourcePersistentType);
- }
-
- public void initialize(T mapping) {
- this.resourceTypeMapping = mapping;
- this.class_ = mapping.getClassName();
- this.initializeJavaPersistentType();
- this.specifiedMetadataComplete = this.metadataComplete(mapping);
- this.defaultMetadataComplete = getPersistentType().getContext().isDefaultPersistentTypeMetadataComplete();
- this.specifiedAccess = AccessType.fromXmlResourceModel(mapping.getAccess());
- this.defaultAccess = this.defaultAccess();
- }
-
- public void update(T mapping) {
- this.resourceTypeMapping = mapping;
- this.setClass(mapping.getClassName());
- this.updateJavaPersistentType();
- this.setSpecifiedMetadataComplete(this.metadataComplete(mapping));
- this.setDefaultMetadataComplete(getPersistentType().getContext().isDefaultPersistentTypeMetadataComplete());
- this.setSpecifiedAccess(AccessType.fromXmlResourceModel(mapping.getAccess()));
- this.setDefaultAccess(this.defaultAccess());
- }
-
- protected Boolean metadataComplete(AbstractXmlTypeMapping mapping) {
- return mapping.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) {
- if (this.resourceTypeMapping == null) {
- return false;
- }
- return this.resourceTypeMapping.containsOffset(textOffset);
- }
-
- //************************* validation ************************
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- 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;
- }
-
- if (this.javaPersistentType == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENT_TYPE_UNRESOLVED_CLASS,
- new String[] {this.class_},
- this,
- this.getClassTextRange()
- )
- );
- }
- }
-
- 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/GenericEntityMappings.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericEntityMappings.java
deleted file mode 100644
index 7258918892..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericEntityMappings.java
+++ /dev/null
@@ -1,929 +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.context.orm;
-
-import java.util.ArrayList;
-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.MappingKeys;
-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.NamedNativeQuery;
-import org.eclipse.jpt.core.context.NamedQuery;
-import org.eclipse.jpt.core.context.Query;
-import org.eclipse.jpt.core.context.QueryHolder;
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.core.context.orm.OrmGenerator;
-import org.eclipse.jpt.core.context.orm.OrmNamedNativeQuery;
-import org.eclipse.jpt.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.core.context.orm.OrmPersistenceUnitDefaults;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmQuery;
-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.OrmXml;
-import org.eclipse.jpt.core.context.orm.PersistenceUnitMetadata;
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-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.XmlSequenceGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlTableGenerator;
-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.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class GenericEntityMappings
- extends AbstractXmlContextNode
- implements EntityMappings
-{
- protected XmlEntityMappings xmlEntityMappings;
-
- protected String version;
-
- 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 List<OrmNamedQuery> namedQueries;
-
- protected final List<OrmNamedNativeQuery> namedNativeQueries;
-
-
- public GenericEntityMappings(OrmXml parent, XmlEntityMappings xmlEntityMappings) {
- super(parent);
- this.persistenceUnitMetadata = getJpaFactory().buildPersistenceUnitMetadata(this, xmlEntityMappings);
- this.persistentTypes = new ArrayList<OrmPersistentType>();
- this.sequenceGenerators = new ArrayList<OrmSequenceGenerator>();
- this.tableGenerators = new ArrayList<OrmTableGenerator>();
- this.namedQueries = new ArrayList<OrmNamedQuery>();
- this.namedNativeQueries = new ArrayList<OrmNamedNativeQuery>();
- this.initialize(xmlEntityMappings);
- }
-
-
- // **************** JpaNode impl *******************************************
-
- @Override
- public OrmXml getParent() {
- return (OrmXml) super.getParent();
- }
-
-
- // **************** JpaContextNode impl ************************************
-
- @Override
- public MappingFileRoot getMappingFileRoot() {
- return this;
- }
-
-
- // **************** JpaStructureNode impl **********************************
-
- public String getId() {
- return OrmStructureNodes.ENTITY_MAPPINGS_ID;
- }
-
-
- // **************** OrmPersistentTypeContext impl **************************
-
- public AccessType getOverridePersistentTypeAccess() {
- if (getPersistenceUnitMetadata().isXmlMappingMetadataComplete()) {
- return getSpecifiedAccess();
- }
- return null;
- }
-
- public AccessType getDefaultPersistentTypeAccess() {
- return getAccess();
- }
-
- public String getDefaultPersistentTypePackage() {
- return getPackage();
- }
-
- public boolean isDefaultPersistentTypeMetadataComplete() {
- return getPersistenceUnitMetadata().isXmlMappingMetadataComplete();
- }
-
- public void changeMapping(OrmPersistentType ormPersistentType, OrmTypeMapping oldMapping, OrmTypeMapping newMapping) {
- 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);
- //TODO are the source and target correct in this case, or is target off by one???
- fireItemMoved(PERSISTENT_TYPES_LIST, targetIndex, sourceIndex);
- }
-
- public OrmPersistentType getPersistentType(String fullyQualifiedTypeName) {
- for (OrmPersistentType ormPersistentType : CollectionTools.iterable(ormPersistentTypes())) {
- if (ormPersistentType.isFor(fullyQualifiedTypeName)) {
- return ormPersistentType;
- }
- }
- return null;
- }
-
- 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.version;
- }
-
- 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.toXmlResourceModel(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);
- }
-
- public Catalog getDbCatalog() {
- String catalog = this.getCatalog();
- if (catalog == null) {
- return null; // not even a default catalog (i.e. database probably does not support catalogs)
- }
- return this.getDbCatalog(catalog);
- }
-
-
- // ********** schema container **********
-
- /**
- * If we don't have a catalog (i.e. we don't even have a *default* 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();
- }
-
-
- // ********** persistent types **********
-
- public ListIterator<OrmPersistentType> ormPersistentTypes() {
- return new CloneListIterator<OrmPersistentType>(this.persistentTypes);
- }
-
- public int ormPersistentTypesSize() {
- return this.persistentTypes.size();
- }
-
- public OrmPersistentType addOrmPersistentType(String mappingKey, String className) {
- OrmPersistentType persistentType = getJpaFactory().buildOrmPersistentType(this, mappingKey);
- 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);
- }
- AbstractXmlTypeMapping typeMapping = persistentType.getMapping().addToResourceModel(this.xmlEntityMappings);
- typeMapping.setClassName(className);
- fireItemAdded(PERSISTENT_TYPES_LIST, index, persistentType);
- return persistentType;
- }
-
- protected void addOrmPersistentType(OrmPersistentType ormPersistentType) {
- addItemToList(ormPersistentType, this.persistentTypes, PERSISTENT_TYPES_LIST);
- }
-
- protected int insertionIndex(OrmPersistentType ormPersistentType) {
- return CollectionTools.insertionIndexOf(this.persistentTypes, ormPersistentType, buildMappingComparator());
- }
-
- private Comparator<OrmPersistentType> buildMappingComparator() {
- return 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 removeOrmPersistentType(int index) {
- OrmPersistentType ormPersistentType = this.persistentTypes.get(index);
- ormPersistentType.dispose();
- this.persistentTypes.remove(index);
- ormPersistentType.getMapping().removeFromResourceModel(this.xmlEntityMappings);
- fireItemRemoved(PERSISTENT_TYPES_LIST, index, ormPersistentType);
- }
-
- public void removeOrmPersistentType(OrmPersistentType ormPersistentType) {
- removeOrmPersistentType(this.persistentTypes.indexOf(ormPersistentType));
- }
-
- protected void removeOrmPersistentType_(OrmPersistentType ormPersistentType) {
- ormPersistentType.dispose();
- removeItemFromList(ormPersistentType, this.persistentTypes, PERSISTENT_TYPES_LIST);
- }
-
- public ListIterator<OrmSequenceGenerator> sequenceGenerators() {
- return new CloneListIterator<OrmSequenceGenerator>(this.sequenceGenerators);
- }
-
- public int sequenceGeneratorsSize() {
- return this.sequenceGenerators.size();
- }
-
- public OrmSequenceGenerator addSequenceGenerator(int index) {
- XmlSequenceGenerator resourceSequenceGenerator = OrmFactory.eINSTANCE.createXmlSequenceGeneratorImpl();
- OrmSequenceGenerator contextSequenceGenerator = 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);
- }
-
- public ListIterator<OrmTableGenerator> tableGenerators() {
- return new CloneListIterator<OrmTableGenerator>(this.tableGenerators);
- }
-
- public int tableGeneratorsSize() {
- return this.tableGenerators.size();
- }
-
- public OrmTableGenerator addTableGenerator(int index) {
- XmlTableGenerator resourceTableGenerator = OrmFactory.eINSTANCE.createXmlTableGeneratorImpl();
- 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);
- }
-
- 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.xmlEntityMappings.getNamedQueries().add(index, resourceNamedQuery);
- this.fireItemAdded(QueryHolder.NAMED_QUERIES_LIST, index, contextNamedQuery);
- return contextNamedQuery;
- }
-
- protected void addNamedQuery(int index, OrmNamedQuery namedQuery) {
- addItemToList(index, namedQuery, this.namedQueries, QueryHolder.NAMED_QUERIES_LIST);
- }
-
- protected void addNamedQuery(OrmNamedQuery namedQuery) {
- this.addNamedQuery(this.namedQueries.size(), namedQuery);
- }
-
- public void removeNamedQuery(NamedQuery namedQuery) {
- this.removeNamedQuery(this.namedQueries.indexOf(namedQuery));
- }
-
- public void removeNamedQuery(int index) {
- OrmNamedQuery namedQuery = this.namedQueries.remove(index);
- this.xmlEntityMappings.getNamedQueries().remove(index);
- fireItemRemoved(QueryHolder.NAMED_QUERIES_LIST, index, namedQuery);
- }
-
- protected void removeNamedQuery_(OrmNamedQuery namedQuery) {
- removeItemFromList(namedQuery, this.namedQueries, QueryHolder.NAMED_QUERIES_LIST);
- }
-
- public void moveNamedQuery(int targetIndex, int sourceIndex) {
- this.xmlEntityMappings.getNamedQueries().move(targetIndex, sourceIndex);
- moveItemInList(targetIndex, sourceIndex, this.namedQueries, QueryHolder.NAMED_QUERIES_LIST);
- }
-
- 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 namedNativeQuery = buildNamedNativeQuery(resourceNamedNativeQuery);
- this.namedNativeQueries.add(index, namedNativeQuery);
- this.xmlEntityMappings.getNamedNativeQueries().add(index, resourceNamedNativeQuery);
- this.fireItemAdded(QueryHolder.NAMED_NATIVE_QUERIES_LIST, index, namedNativeQuery);
- return namedNativeQuery;
- }
-
- protected void addNamedNativeQuery(int index, OrmNamedNativeQuery namedNativeQuery) {
- addItemToList(index, namedNativeQuery, this.namedNativeQueries, QueryHolder.NAMED_NATIVE_QUERIES_LIST);
- }
-
- protected void addNamedNativeQuery(OrmNamedNativeQuery namedNativeQuery) {
- this.addNamedNativeQuery(this.namedNativeQueries.size(), namedNativeQuery);
- }
-
- public void removeNamedNativeQuery(NamedNativeQuery namedNativeQuery) {
- removeNamedNativeQuery(this.namedNativeQueries.indexOf(namedNativeQuery));
- }
-
- public void removeNamedNativeQuery(int index) {
- OrmNamedNativeQuery namedNativeQuery = this.namedNativeQueries.remove(index);
- this.xmlEntityMappings.getNamedNativeQueries().remove(index);
- fireItemRemoved(QueryHolder.NAMED_NATIVE_QUERIES_LIST, index, namedNativeQuery);
- }
-
- protected void removeNamedNativeQuery_(OrmNamedNativeQuery namedNativeQuery) {
- removeItemFromList(namedNativeQuery, this.namedNativeQueries, QueryHolder.NAMED_NATIVE_QUERIES_LIST);
- }
-
- public void moveNamedNativeQuery(int targetIndex, int sourceIndex) {
- this.xmlEntityMappings.getNamedNativeQueries().move(targetIndex, sourceIndex);
- moveItemInList(targetIndex, sourceIndex, this.namedNativeQueries, QueryHolder.NAMED_NATIVE_QUERIES_LIST);
- }
-
- //TODO what about qualified name? package + class
- //this needs to be handled both for className and persistentType.getName().
- //moving on for now since I am just trying to get the ui compiled! just a warning that this isn't good api
- public boolean containsPersistentType(String className) {
- for (OrmPersistentType persistentType : CollectionTools.iterable(ormPersistentTypes())) {
- if (persistentType.getName().equals(className)) {
- return true;
- }
- }
- return false;
- }
-
- public OrmPersistenceUnitDefaults getPersistenceUnitDefaults() {
- return getPersistenceUnitMetadata().getPersistenceUnitDefaults();
- }
-
- protected void initialize(XmlEntityMappings entityMappings) {
- this.xmlEntityMappings = entityMappings;
- this.version = this.xmlEntityMappings.getVersion();
- this.description = this.xmlEntityMappings.getDescription();
- this.package_ = this.xmlEntityMappings.getPackage();
-
- this.defaultAccess = this.getPersistenceUnit().getDefaultAccess();
- this.specifiedAccess = this.buildSpecifiedAccess();
-
- 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();
- this.initializeNamedQueries();
- this.initializeNamedNativeQueries();
- }
-
- protected void initializePersistentTypes() {
- this.initializeMappedSuperclasses();
- this.initializeEntities();
- this.initializeEmbeddables();
- }
-
- protected void initializeMappedSuperclasses() {
- for (XmlMappedSuperclass mappedSuperclass : this.xmlEntityMappings.getMappedSuperclasses()) {
- OrmPersistentType ormPersistentType = getJpaFactory().buildOrmPersistentType(this, MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
- ormPersistentType.initialize(mappedSuperclass);
- this.persistentTypes.add(ormPersistentType);
- }
- }
-
- protected void initializeEntities() {
- for (XmlEntity entity : this.xmlEntityMappings.getEntities()) {
- OrmPersistentType ormPersistentType = getJpaFactory().buildOrmPersistentType(this, MappingKeys.ENTITY_TYPE_MAPPING_KEY);
- ormPersistentType.initialize(entity);
- this.persistentTypes.add(ormPersistentType);
- }
- }
-
- protected void initializeEmbeddables() {
- for (XmlEmbeddable embeddable : this.xmlEntityMappings.getEmbeddables()) {
- OrmPersistentType ormPersistentType = getJpaFactory().buildOrmPersistentType(this, MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
- ormPersistentType.initialize(embeddable);
- this.persistentTypes.add(ormPersistentType);
- }
- }
-
- 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));
- }
- }
-
- protected void initializeNamedQueries() {
- for (XmlNamedQuery namedQuery : this.xmlEntityMappings.getNamedQueries()) {
- this.namedQueries.add(buildNamedQuery(namedQuery));
- }
- }
-
- protected void initializeNamedNativeQueries() {
- for (XmlNamedNativeQuery namedNativeQuery : this.xmlEntityMappings.getNamedNativeQueries()) {
- this.namedNativeQueries.add(buildNamedNativeQuery(namedNativeQuery));
- }
- }
-
- public void update() {
- this.setDescription(this.xmlEntityMappings.getDescription());
- this.setPackage(this.xmlEntityMappings.getPackage());
-
- this.setDefaultAccess(this.getPersistenceUnit().getDefaultAccess());
- this.setSpecifiedAccess(this.buildSpecifiedAccess());
-
- 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();
- this.updateNamedQueries();
- this.updateNamedNativeQueries();
- }
-
- protected AccessType buildSpecifiedAccess() {
- return AccessType.fromXmlResourceModel(this.xmlEntityMappings.getAccess());
- }
-
- protected void updatePersistentTypes() {
- ListIterator<OrmPersistentType> ormPersistentTypes = this.ormPersistentTypes();
- this.updateMappedSuperclasses(ormPersistentTypes);
- this.updateEntities(ormPersistentTypes);
- this.updateEmbeddables(ormPersistentTypes);
-
- while (ormPersistentTypes.hasNext()) {
- this.removeOrmPersistentType_(ormPersistentTypes.next());
- }
- }
-
- protected void updateMappedSuperclasses(ListIterator<OrmPersistentType> ormPersistentTypes) {
- ListIterator<XmlMappedSuperclass> mappedSuperclasses = new CloneListIterator<XmlMappedSuperclass>(this.xmlEntityMappings.getMappedSuperclasses());//prevent ConcurrentModificiationException
- for (XmlMappedSuperclass mappedSuperclass : CollectionTools.iterable(mappedSuperclasses)) {
- if (ormPersistentTypes.hasNext()) {
- ormPersistentTypes.next().update(mappedSuperclass);
- }
- else {
- OrmPersistentType ormPersistentType = getJpaFactory().buildOrmPersistentType(this, MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
- ormPersistentType.initialize(mappedSuperclass);
- addOrmPersistentType(ormPersistentType);
- }
- }
- }
-
- protected void updateEntities(ListIterator<OrmPersistentType> ormPersistentTypes) {
- ListIterator<XmlEntity> entities = new CloneListIterator<XmlEntity>(this.xmlEntityMappings.getEntities());//prevent ConcurrentModificiationException
- for (XmlEntity entity : CollectionTools.iterable(entities)) {
- if (ormPersistentTypes.hasNext()) {
- ormPersistentTypes.next().update(entity);
- }
- else {
- OrmPersistentType ormPersistentType = getJpaFactory().buildOrmPersistentType(this, MappingKeys.ENTITY_TYPE_MAPPING_KEY);
- ormPersistentType.initialize(entity);
- addOrmPersistentType(ormPersistentType);
- }
- }
- }
-
- protected void updateEmbeddables(ListIterator<OrmPersistentType> ormPersistentTypes) {
- ListIterator<XmlEmbeddable> embeddables = new CloneListIterator<XmlEmbeddable>(this.xmlEntityMappings.getEmbeddables());//prevent ConcurrentModificiationException
- for (XmlEmbeddable embeddable : CollectionTools.iterable(embeddables)) {
- if (ormPersistentTypes.hasNext()) {
- ormPersistentTypes.next().update(embeddable);
- }
- else {
- OrmPersistentType ormPersistentType = getJpaFactory().buildOrmPersistentType(this, MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
- ormPersistentType.initialize(embeddable);
- addOrmPersistentType(ormPersistentType);
- }
- }
- }
-
- protected void updateTableGenerators() {
- ListIterator<OrmTableGenerator> contextTableGenerators = tableGenerators();
- ListIterator<XmlTableGenerator> resourceTableGenerators = new CloneListIterator<XmlTableGenerator>(this.xmlEntityMappings.getTableGenerators());//prevent ConcurrentModificiationException
- while (contextTableGenerators.hasNext()) {
- OrmTableGenerator contextTableGenerator = contextTableGenerators.next();
- if (resourceTableGenerators.hasNext()) {
- contextTableGenerator.update(resourceTableGenerators.next());
- }
- else {
- removeTableGenerator_(contextTableGenerator);
- }
- }
-
- while (resourceTableGenerators.hasNext()) {
- addTableGenerator(buildTableGenerator(resourceTableGenerators.next()));
- }
- }
-
- protected OrmTableGenerator buildTableGenerator(XmlTableGenerator resourceTableGenerator) {
- return getJpaFactory().buildOrmTableGenerator(this, resourceTableGenerator);
- }
-
- protected void updateSequenceGenerators() {
- ListIterator<OrmSequenceGenerator> contextSequenceGenerators = sequenceGenerators();
- ListIterator<XmlSequenceGenerator> resourceSequenceGenerators = new CloneListIterator<XmlSequenceGenerator>(this.xmlEntityMappings.getSequenceGenerators());//prevent ConcurrentModificiationException
- while (contextSequenceGenerators.hasNext()) {
- OrmSequenceGenerator contextSequenceGenerator = contextSequenceGenerators.next();
- if (resourceSequenceGenerators.hasNext()) {
- contextSequenceGenerator.update(resourceSequenceGenerators.next());
- }
- else {
- removeSequenceGenerator_(contextSequenceGenerator);
- }
- }
-
- while (resourceSequenceGenerators.hasNext()) {
- addSequenceGenerator(buildSequenceGenerator(resourceSequenceGenerators.next()));
- }
- }
-
- protected OrmSequenceGenerator buildSequenceGenerator(XmlSequenceGenerator resourceSequenceGenerator) {
- return getJpaFactory().buildOrmSequenceGenerator(this, resourceSequenceGenerator);
- }
-
- protected void updateNamedQueries() {
- ListIterator<OrmNamedQuery> contextNamedQueries = namedQueries();
- ListIterator<XmlNamedQuery> resourceNamedQueries = new CloneListIterator<XmlNamedQuery>(this.xmlEntityMappings.getNamedQueries());//prevent ConcurrentModificiationException
-
- while (contextNamedQueries.hasNext()) {
- OrmNamedQuery contextNamedQuery = contextNamedQueries.next();
- if (resourceNamedQueries.hasNext()) {
- contextNamedQuery.update(resourceNamedQueries.next());
- }
- else {
- removeNamedQuery_(contextNamedQuery);
- }
- }
-
- while (resourceNamedQueries.hasNext()) {
- addNamedQuery(buildNamedQuery(resourceNamedQueries.next()));
- }
- }
-
- protected OrmNamedQuery buildNamedQuery(XmlNamedQuery resourceNamedQuery) {
- return getJpaFactory().buildOrmNamedQuery(this, resourceNamedQuery);
- }
-
- protected void updateNamedNativeQueries() {
- ListIterator<OrmNamedNativeQuery> contextQueries = namedNativeQueries();
- ListIterator<XmlNamedNativeQuery> resourceQueries = new CloneListIterator<XmlNamedNativeQuery>(this.xmlEntityMappings.getNamedNativeQueries());//prevent ConcurrentModificiationException
-
- while (contextQueries.hasNext()) {
- OrmNamedNativeQuery namedQuery = contextQueries.next();
- if (resourceQueries.hasNext()) {
- namedQuery.update(resourceQueries.next());
- }
- else {
- removeNamedNativeQuery_(namedQuery);
- }
- }
-
- while (resourceQueries.hasNext()) {
- addNamedNativeQuery(buildNamedNativeQuery(resourceQueries.next()));
- }
- }
-
- protected OrmNamedNativeQuery buildNamedNativeQuery(XmlNamedNativeQuery resourceNamedQuery) {
- return getJpaFactory().buildOrmNamedNativeQuery(this, resourceNamedQuery);
- }
-
- public JpaStructureNode getStructureNode(int textOffset) {
- for (OrmPersistentType persistentType: CollectionTools.iterable(ormPersistentTypes())) {
- if (persistentType.contains(textOffset)) {
- return persistentType.getStructureNode(textOffset);
- }
- }
- return this;
- }
-
- public boolean containsOffset(int textOffset) {
- if (this.xmlEntityMappings == null) {
- return false;
- }
- return this.xmlEntityMappings.containsOffset(textOffset);
- }
-
- public TextRange getSelectionTextRange() {
- return this.xmlEntityMappings.getSelectionTextRange();
- }
-
- public TextRange getValidationTextRange() {
- return null;
- }
-
-
- // **************** validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- this.validateGenerators(messages);
- this.validateQueries(messages);
- for (Iterator<OrmPersistentType> stream = this.ormPersistentTypes(); stream.hasNext(); ) {
- this.validatePersistentType(stream.next(), 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().allGenerators(); 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")
- public Iterator<OrmGenerator> generators() {
- return new CompositeIterator<OrmGenerator>(
- this.tableGenerators(),
- this.sequenceGenerators()
- );
- }
-
- protected void validateQueries(List<IMessage> messages) {
- for (Iterator<OrmQuery> localQueries = this.queries(); localQueries.hasNext(); ) {
- OrmQuery localQuery = localQueries.next();
- for (Iterator<Query> globalQueries = this.getPersistenceUnit().allQueries(); 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>(
- this.namedQueries(),
- this.namedNativeQueries()
- );
- }
-
- protected void validatePersistentType(OrmPersistentType persistentType, List<IMessage> messages) {
- try {
- persistentType.validate(messages);
- } catch (Throwable exception) {
- JptCorePlugin.log(exception);
- }
- }
-
-
- // ********** dispose **********
-
- public void dispose() {
- for (OrmPersistentType ormPersistentType : CollectionTools.iterable(ormPersistentTypes())) {
- ormPersistentType.dispose();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmAssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmAssociationOverride.java
deleted file mode 100644
index f5505fb2d6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmAssociationOverride.java
+++ /dev/null
@@ -1,266 +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.context.orm;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.BaseOverride;
-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.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-public class GenericOrmAssociationOverride extends AbstractXmlContextNode
- implements OrmAssociationOverride
-{
-
- protected String name;
-
- protected final List<OrmJoinColumn> specifiedJoinColumns;
-
- protected final List<OrmJoinColumn> defaultJoinColumns;
-
- private final AssociationOverride.Owner owner;
-
- protected XmlAssociationOverride resourceAssociationOverride;
-
-
- public GenericOrmAssociationOverride(XmlContextNode parent, AssociationOverride.Owner owner, XmlAssociationOverride resourceAssociationOverride) {
- super(parent);
- this.owner = owner;
- this.specifiedJoinColumns = new ArrayList<OrmJoinColumn>();
- this.defaultJoinColumns = new ArrayList<OrmJoinColumn>();
- this.initialize(resourceAssociationOverride);
- }
-
- public OrmAssociationOverride setVirtual(boolean virtual) {
- return (OrmAssociationOverride) getOwner().setVirtual(virtual, this);
- }
-
- public Owner getOwner() {
- return this.owner;
- }
-
- // ********** IAssociationOverride implementation **********
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.resourceAssociationOverride.setName(newName);
- firePropertyChanged(BaseOverride.NAME_PROPERTY, oldName, newName);
- }
-
-
- public ListIterator<OrmJoinColumn> joinColumns() {
- return this.specifiedJoinColumns.isEmpty() ? this.defaultJoinColumns() : this.specifiedJoinColumns();
- }
-
- public int joinColumnsSize() {
- return this.specifiedJoinColumns.isEmpty() ? this.defaultJoinColumnsSize() : this.specifiedJoinColumnsSize();
- }
-
- public ListIterator<OrmJoinColumn> defaultJoinColumns() {
- return new CloneListIterator<OrmJoinColumn>(this.defaultJoinColumns);
- }
-
- public int defaultJoinColumnsSize() {
- return this.defaultJoinColumns.size();
- }
-
- public ListIterator<OrmJoinColumn> specifiedJoinColumns() {
- return new CloneListIterator<OrmJoinColumn>(this.specifiedJoinColumns);
- }
-
- public int specifiedJoinColumnsSize() {
- return this.specifiedJoinColumns.size();
- }
-
- public OrmJoinColumn addSpecifiedJoinColumn(int index) {
- XmlJoinColumn resourceJoinColumn = OrmFactory.eINSTANCE.createXmlJoinColumnImpl();
- OrmJoinColumn contextJoinColumn = buildJoinColumn(resourceJoinColumn);
- this.specifiedJoinColumns.add(index, contextJoinColumn);
- this.resourceAssociationOverride.getJoinColumns().add(index, resourceJoinColumn);
- this.fireItemAdded(AssociationOverride.SPECIFIED_JOIN_COLUMNS_LIST, index, contextJoinColumn);
- return contextJoinColumn;
- }
-
- protected OrmJoinColumn.Owner createJoinColumnOwner() {
- return new JoinColumnOwner();
- }
-
- protected void addSpecifiedJoinColumn(int index, OrmJoinColumn joinColumn) {
- addItemToList(index, joinColumn, this.specifiedJoinColumns, AssociationOverride.SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- protected void addSpecifiedJoinColumn(OrmJoinColumn joinColumn) {
- this.addSpecifiedJoinColumn(this.specifiedJoinColumns.size(), joinColumn);
- }
-
- public void removeSpecifiedJoinColumn(int index) {
- OrmJoinColumn removedJoinColumn = this.specifiedJoinColumns.remove(index);
- this.resourceAssociationOverride.getJoinColumns().remove(index);
- fireItemRemoved(Entity.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, index, removedJoinColumn);
- }
-
- protected void removeSpecifiedJoinColumn(OrmJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.specifiedJoinColumns, AssociationOverride.SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedJoinColumn(int targetIndex, int sourceIndex) {
- this.resourceAssociationOverride.getJoinColumns().move(targetIndex, sourceIndex);
- moveItemInList(targetIndex, sourceIndex, this.specifiedJoinColumns, AssociationOverride.SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public boolean containsSpecifiedJoinColumns() {
- return !this.specifiedJoinColumns.isEmpty();
- }
-
- public boolean isVirtual() {
- return getOwner().isVirtual(this);
- }
-
- protected void initialize(XmlAssociationOverride resourceAssociationOverride) {
- this.resourceAssociationOverride = resourceAssociationOverride;
- this.name = resourceAssociationOverride.getName();
- initializeSpecifiedJoinColumns();
- }
-
- protected void initializeSpecifiedJoinColumns() {
- for (XmlJoinColumn joinColumn : this.resourceAssociationOverride.getJoinColumns()) {
- this.specifiedJoinColumns.add(buildJoinColumn(joinColumn));
- }
- }
-
- public void update(XmlAssociationOverride resourceAssociationOverride) {
- this.resourceAssociationOverride = resourceAssociationOverride;
- this.setName(resourceAssociationOverride.getName());
- updateSpecifiedJoinColumns();
- }
-
- protected void updateSpecifiedJoinColumns() {
- ListIterator<OrmJoinColumn> contextJoinColumns = specifiedJoinColumns();
- ListIterator<XmlJoinColumn> resourceJoinColumns = new CloneListIterator<XmlJoinColumn>(this.resourceAssociationOverride.getJoinColumns());//prevent ConcurrentModificiationException
-
- while (contextJoinColumns.hasNext()) {
- OrmJoinColumn contextJoinColumn = contextJoinColumns.next();
- if (resourceJoinColumns.hasNext()) {
- contextJoinColumn.update(resourceJoinColumns.next());
- }
- else {
- removeSpecifiedJoinColumn(contextJoinColumn);
- }
- }
-
- while (resourceJoinColumns.hasNext()) {
- addSpecifiedJoinColumn(buildJoinColumn(resourceJoinColumns.next()));
- }
- }
-
- protected OrmJoinColumn buildJoinColumn(XmlJoinColumn resourceJoinColumn) {
- return getJpaFactory().buildOrmJoinColumn(this, new JoinColumnOwner(), resourceJoinColumn);
- }
-
- public TextRange getValidationTextRange() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
- class JoinColumnOwner implements OrmJoinColumn.Owner
- {
-
- public JoinColumnOwner() {
- super();
- }
-
- /**
- * by default, the join column is in the type mapping's primary table
- */
- public String getDefaultTableName() {
- return GenericOrmAssociationOverride.this.owner.getTypeMapping().getPrimaryTableName();
- }
-
- public String getDefaultColumnName() {
- return null;
- }
-
- public Entity getTargetEntity() {
- RelationshipMapping relationshipMapping = getRelationshipMapping();
- return relationshipMapping == null ? null : relationshipMapping.getResolvedTargetEntity();
- }
-
- public String getAttributeName() {
- return GenericOrmAssociationOverride.this.getName();
- }
-
- public RelationshipMapping getRelationshipMapping() {
- return GenericOrmAssociationOverride.this.owner.getRelationshipMapping(GenericOrmAssociationOverride.this.getName());
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getTypeMapping().tableNameIsInvalid(tableName);
- }
-
- /**
- * the join column can be on a secondary table
- */
- public boolean tableIsAllowed() {
- return true;
- }
-
- public TypeMapping getTypeMapping() {
- return GenericOrmAssociationOverride.this.owner.getTypeMapping();
- }
-
- public Table getDbTable(String tableName) {
- return getTypeMapping().getDbTable(tableName);
- }
-
- public Table getReferencedColumnDbTable() {
- Entity targetEntity = getTargetEntity();
- return (targetEntity == null) ? null : targetEntity.getPrimaryDbTable();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return GenericOrmAssociationOverride.this.defaultJoinColumns.contains(joinColumn);
- }
-
- public int joinColumnsSize() {
- return GenericOrmAssociationOverride.this.joinColumnsSize();
- }
-
- public TextRange getValidationTextRange() {
- // TODO Auto-generated method stub
- return null;
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmAttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmAttributeOverride.java
deleted file mode 100644
index 06fcc1f231..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmAttributeOverride.java
+++ /dev/null
@@ -1,222 +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.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.ColumnMapping;
-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.OrmColumn;
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-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.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.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericOrmAttributeOverride extends AbstractXmlContextNode
- implements OrmAttributeOverride, OrmColumn.Owner
-{
-
- protected String name;
-
- private final Owner owner;
-
- protected XmlAttributeOverride resourceAttributeOverride;
-
-
- protected final OrmColumn column;
-
- public GenericOrmAttributeOverride(XmlContextNode parent, AttributeOverride.Owner owner, XmlAttributeOverride resourceAttributeOverride) {
- super(parent);
- this.owner = owner;
- this.column = getJpaFactory().buildOrmColumn(this, this);
- this.initialize(resourceAttributeOverride);
- }
- @Override
- public XmlContextNode getParent() {
- return (XmlContextNode) super.getParent();
- }
-
- public OrmAttributeOverride setVirtual(boolean virtual) {
- return (OrmAttributeOverride) getOwner().setVirtual(virtual, this);
- }
-
- public Owner getOwner() {
- return this.owner;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.resourceAttributeOverride.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);
- }
-
- public OrmColumn getColumn() {
- return this.column;
- }
-
- public TypeMapping getTypeMapping() {
- return getOwner().getTypeMapping();
- }
-
- public Table getDbTable(String tablename) {
- return this.getTypeMapping().getDbTable(getColumn().getTable());
- }
-
- public String getDefaultColumnName() {
- ColumnMapping columnMapping = getColumnMapping();
- if (columnMapping == null) {
- return null;
- }
- return columnMapping.getColumn().getName();
- }
-
- public String getDefaultTableName() {
- ColumnMapping columnMapping = getColumnMapping();
- if (columnMapping == null) {
- return null;
- }
- String tableName = columnMapping.getColumn().getSpecifiedTable();
- if (tableName != null) {
- return tableName;
- }
- return getOwner().getTypeMapping().getPrimaryTableName();
- }
-
- protected ColumnMapping getColumnMapping() {
- return getOwner().getColumnMapping(getName());
- }
-
- public boolean isVirtual() {
- return getOwner().isVirtual(this);
- }
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.resourceAttributeOverride.getValidationTextRange();
- return textRange == null ? getParent().getValidationTextRange() : textRange;
- }
-
-
- //***************** IXmlColumn.Owner implementation ****************
-
- public XmlColumn getResourceColumn() {
- return this.resourceAttributeOverride.getColumn();
- }
-
- public void addResourceColumn() {
- this.resourceAttributeOverride.setColumn(OrmFactory.eINSTANCE.createXmlColumnImpl());
- }
-
- public void removeResourceColumn() {
- this.resourceAttributeOverride.setColumn(null);
- }
-
-
- //***************** updating ****************
-
- protected void initialize(XmlAttributeOverride xmlAttributeOverride) {
- this.resourceAttributeOverride = xmlAttributeOverride;
- this.name = xmlAttributeOverride.getName();
- this.column.initialize(xmlAttributeOverride.getColumn());
- }
-
- public void update(XmlAttributeOverride xmlAttributeOverride) {
- this.resourceAttributeOverride = xmlAttributeOverride;
- this.setName_(xmlAttributeOverride.getName());
- this.column.update(xmlAttributeOverride.getColumn());
- }
-
- //****************** validation ********************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- if (this.connectionProfileIsActive()) {
- this.validateColumn(messages);
- }
- }
-
- protected void validateColumn(List<IMessage> messages) {
- String tableName = this.column.getTable();
- if (this.getTypeMapping().tableNameIsInvalid(tableName)) {
- if (this.isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_TABLE,
- new String[] {this.getName(), tableName, this.column.getName()},
- this.column,
- this.column.getTableTextRange()
- )
- );
- } else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_TABLE,
- new String[] {tableName, this.column.getName()},
- this.column,
- this.column.getTableTextRange()
- )
- );
- }
- return;
- }
-
- if ( ! this.column.isResolved()) {
- if (this.isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME,
- new String[] {this.getName(), this.column.getName()},
- this.column,
- this.column.getNameTextRange()
- )
- );
- } else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {this.column.getName()},
- this.column,
- this.column.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/GenericOrmBasicMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmBasicMapping.java
deleted file mode 100644
index a6c4c7d54c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmBasicMapping.java
+++ /dev/null
@@ -1,332 +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.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.MappingKeys;
-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.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.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericOrmBasicMapping extends AbstractOrmAttributeMapping<XmlBasic>
- implements OrmBasicMapping
-{
- protected final OrmColumn column;
-
- protected FetchType specifiedFetch;
-
- protected Boolean specifiedOptional;
-
- protected OrmConverter defaultConverter;
-
- protected OrmConverter specifiedConverter;
-
- public GenericOrmBasicMapping(OrmPersistentAttribute parent) {
- super(parent);
- this.column = getJpaFactory().buildOrmColumn(this, this);
- }
-
- 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 getOptional() {
- return (this.getSpecifiedOptional() == null) ? this.getDefaultOptional() : this.getSpecifiedOptional();
- }
-
- public Boolean getDefaultOptional() {
- 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 getSpecifiedConverter() == null ? getDefaultConverter() : getSpecifiedConverter();
- }
-
- public OrmConverter getDefaultConverter() {
- return this.defaultConverter;
- }
-
- public OrmConverter getSpecifiedConverter() {
- return this.specifiedConverter;
- }
-
- protected String getSpecifedConverterType() {
- if (this.specifiedConverter == null) {
- return Converter.NO_CONVERTER;
- }
- return this.specifiedConverter.getType();
- }
-
- public void setSpecifiedConverter(String converterType) {
- if (getSpecifedConverterType() == converterType) {
- return;
- }
- OrmConverter oldConverter = this.specifiedConverter;
- OrmConverter newConverter = buildSpecifiedConverter(converterType);
- this.specifiedConverter = null;
- if (oldConverter != null) {
- oldConverter.removeFromResourceModel();
- }
- this.specifiedConverter = newConverter;
- if (newConverter != null) {
- newConverter.addToResourceModel();
- }
- firePropertyChanged(SPECIFIED_CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- protected void setSpecifiedConverter(OrmConverter newConverter) {
- OrmConverter oldConverter = this.specifiedConverter;
- this.specifiedConverter = newConverter;
- firePropertyChanged(SPECIFIED_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 getAttributeName();
- }
-
- public String getDefaultTableName() {
- return getTypeMapping().getPrimaryTableName();
- }
-
- public Table getDbTable(String tableName) {
- return getTypeMapping().getDbTable(tableName);
- }
-
- @Override
- public void initialize(XmlAttributeMapping attributeMapping) {
- super.initialize(attributeMapping);
- this.specifiedFetch = this.specifiedFetch();
- this.specifiedOptional = this.specifiedOptional();
- this.column.initialize(this.resourceAttributeMapping.getColumn());
- this.defaultConverter = new GenericOrmNullConverter(this);
- this.specifiedConverter = this.buildSpecifiedConverter(this.specifiedConverterType());
- }
-
- @Override
- public void update() {
- super.update();
- this.setSpecifiedFetch_(this.specifiedFetch());
- this.setSpecifiedOptional_(this.specifiedOptional());
- this.column.update(this.resourceAttributeMapping.getColumn());
- if (specifiedConverterType() == getSpecifedConverterType()) {
- getSpecifiedConverter().update();
- }
- else {
- setSpecifiedConverter(buildSpecifiedConverter(specifiedConverterType()));
- }
- }
-
- protected Boolean specifiedOptional() {
- return this.resourceAttributeMapping.getOptional();
- }
-
- protected FetchType specifiedFetch() {
- return FetchType.fromOrmResourceModel(this.resourceAttributeMapping.getFetch());
- }
-
- protected OrmConverter buildSpecifiedConverter(String converterType) {
- if (converterType == Converter.ENUMERATED_CONVERTER) {
- return new GenericOrmEnumeratedConverter(this, this.resourceAttributeMapping);
- }
- else if (converterType == Converter.TEMPORAL_CONVERTER) {
- return new GenericOrmTemporalConverter(this, this.resourceAttributeMapping);
- }
- else if (converterType == Converter.LOB_CONVERTER) {
- return new GenericOrmLobConverter(this, this.resourceAttributeMapping);
- }
- return null;
- }
-
- protected String specifiedConverterType() {
- 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 null;
- }
-
- public XmlBasic addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlBasic basic = OrmFactory.eINSTANCE.createXmlBasicImpl();
- getPersistentAttribute().initialize(basic);
- typeMapping.getAttributes().getBasics().add(basic);
- return basic;
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- typeMapping.getAttributes().getBasics().remove(this.resourceAttributeMapping);
- }
-
- //***************** XmlColumn.Owner implementation ****************
-
- public XmlColumn getResourceColumn() {
- return this.resourceAttributeMapping.getColumn();
- }
-
- public void addResourceColumn() {
- this.resourceAttributeMapping.setColumn(OrmFactory.eINSTANCE.createXmlColumnImpl());
- }
-
- public void removeResourceColumn() {
- this.resourceAttributeMapping.setColumn(null);
- }
-
- // ****************** validation ****************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- if (this.connectionProfileIsActive() && this.ownerIsEntity()) {
- this.validateColumn(messages);
- }
- }
-
- protected void validateColumn(List<IMessage> messages) {
- String tableName = this.column.getTable();
- if (this.getTypeMapping().tableNameIsInvalid(tableName)) {
- if (this.getPersistentAttribute().isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_TABLE,
- new String[] {this.getName(), tableName, this.column.getName()},
- this.column,
- this.column.getTableTextRange()
- )
- );
- } else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_TABLE,
- new String[] {tableName, this.column.getName()},
- this.column,
- this.column.getTableTextRange()
- )
- );
- }
- return;
- }
-
- if ( ! this.column.isResolved()) {
- if (this.getPersistentAttribute().isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME,
- new String[] {this.getName(), this.column.getName()},
- this.column,
- this.column.getNameTextRange()
- )
- );
- } else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {this.column.getName()},
- this.column,
- this.column.getNameTextRange()
- )
- );
- }
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmColumn.java
deleted file mode 100644
index 6530746902..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmColumn.java
+++ /dev/null
@@ -1,191 +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.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.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 Integer getLength() {
- return (this.getSpecifiedLength() == null) ? getDefaultLength() : this.getSpecifiedLength();
- }
-
- public Integer getDefaultLength() {
- return Column.DEFAULT_LENGTH;
- }
-
- public Integer getSpecifiedLength() {
- return this.specifiedLength;
- }
-
- public void setSpecifiedLength(Integer newSpecifiedLength) {
- Integer oldSpecifiedLength = this.specifiedLength;
- this.specifiedLength = newSpecifiedLength;
- if (oldSpecifiedLength != newSpecifiedLength) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setLength(newSpecifiedLength);
- if (this.getResourceColumn().isAllFeaturesUnset()) {
- removeResourceColumn();
- }
- }
- 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 Integer getPrecision() {
- return (this.getSpecifiedPrecision() == null) ? getDefaultPrecision() : this.getSpecifiedPrecision();
- }
-
- public Integer getDefaultPrecision() {
- return Column.DEFAULT_PRECISION;
- }
-
- public Integer getSpecifiedPrecision() {
- return this.specifiedPrecision;
- }
-
- public void setSpecifiedPrecision(Integer newSpecifiedPrecision) {
- Integer oldSpecifiedPrecision = this.specifiedPrecision;
- this.specifiedPrecision = newSpecifiedPrecision;
- if (oldSpecifiedPrecision != newSpecifiedPrecision) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setPrecision(newSpecifiedPrecision);
- if (this.getResourceColumn().isAllFeaturesUnset()) {
- removeResourceColumn();
- }
- }
- 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 Integer getScale() {
- return (this.getSpecifiedScale() == null) ? getDefaultScale() : this.getSpecifiedScale();
- }
-
- public Integer getDefaultScale() {
- return Column.DEFAULT_SCALE;
- }
-
- public Integer getSpecifiedScale() {
- return this.specifiedScale;
- }
-
- public void setSpecifiedScale(Integer newSpecifiedScale) {
- Integer oldSpecifiedScale = this.specifiedScale;
- this.specifiedScale = newSpecifiedScale;
- if (oldSpecifiedScale != newSpecifiedScale) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setScale(newSpecifiedScale);
- if (this.getResourceColumn().isAllFeaturesUnset()) {
- removeResourceColumn();
- }
- }
- 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.specifiedLength(column);
- this.specifiedPrecision = this.specifiedPrecision(column);
- this.specifiedScale = this.specifiedScale(column);
- }
-
- @Override
- public void update(XmlColumn column) {
- super.update(column);
- this.setSpecifiedLength_(this.specifiedLength(column));
- this.setSpecifiedPrecision_(this.specifiedPrecision(column));
- this.setSpecifiedScale_(this.specifiedScale(column));
- }
-
- protected Integer specifiedLength(XmlColumn column) {
- return column == null ? null : column.getLength();
- }
-
- protected Integer specifiedPrecision(XmlColumn column) {
- return column == null ? null : column.getPrecision();
- }
-
- protected Integer specifiedScale(XmlColumn column) {
- return column == null ? null : column.getScale();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmDiscriminatorColumn.java
deleted file mode 100644
index 138dbfa0fa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmDiscriminatorColumn.java
+++ /dev/null
@@ -1,166 +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.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.context.orm.OrmNamedColumn;
-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 XmlEntity entity;
-
- public GenericOrmDiscriminatorColumn(XmlContextNode parent, OrmNamedColumn.Owner owner) {
- super(parent, owner);
- }
-
- public DiscriminatorType getDiscriminatorType() {
- return (this.getSpecifiedDiscriminatorType() == null) ? this.getDefaultDiscriminatorType() : this.getSpecifiedDiscriminatorType();
- }
-
- public DiscriminatorType getDefaultDiscriminatorType() {
- return DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE;
- }
-
- 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));
- if (this.getResourceColumn().isAllFeaturesUnset()) {
- removeResourceColumn();
- }
- }
- 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 Integer getLength() {
- return (this.getSpecifiedLength() == null) ? this.getDefaultLength() : this.getSpecifiedLength();
- }
-
- public Integer getDefaultLength() {
- return DiscriminatorColumn.DEFAULT_LENGTH;
- }
-
- public Integer getSpecifiedLength() {
- return this.specifiedLength;
- }
-
- public void setSpecifiedLength(Integer newSpecifiedLength) {
- Integer oldSpecifiedLength = this.specifiedLength;
- this.specifiedLength = newSpecifiedLength;
- if (oldSpecifiedLength != newSpecifiedLength) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setLength(newSpecifiedLength);
- if (this.getResourceColumn().isAllFeaturesUnset()) {
- removeResourceColumn();
- }
- }
- 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
- protected String tableName() {
- return this.getOwner().getTypeMapping().getPrimaryTableName();
- }
-
-
-
- @Override
- protected 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 void initialize(XmlEntity entity) {
- this.entity = entity;
- this.initialize(this.getResourceColumn());
- }
-
- public void update(XmlEntity entity) {
- this.entity = entity;
- this.update(this.getResourceColumn());
- }
-
-
- @Override
- protected void initialize(XmlDiscriminatorColumn column) {
- super.initialize(column);
- this.specifiedLength = this.specifiedLength(column);
- this.specifiedDiscriminatorType = this.specifiedDiscriminatorType(column);
- //TODO defaultLength, discriminator type java column
- }
-
- @Override
- protected void update(XmlDiscriminatorColumn column) {
- super.update(column);
- this.setSpecifiedLength_(this.specifiedLength(column));
- this.setSpecifiedDiscriminatorType_(this.specifiedDiscriminatorType(column));
- //TODO defaultLength, scale, precision from java column
- }
-
- protected Integer specifiedLength(XmlDiscriminatorColumn column) {
- return column == null ? null : column.getLength();
- }
-
- protected DiscriminatorType specifiedDiscriminatorType(XmlDiscriminatorColumn column) {
- return column == null ? null : DiscriminatorType.fromOrmResourceModel(column.getDiscriminatorType());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddable.java
deleted file mode 100644
index 3d85f342da..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddable.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.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.orm.OrmEmbeddable;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-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 class GenericOrmEmbeddable extends AbstractOrmTypeMapping<XmlEmbeddable> implements OrmEmbeddable
-{
- public GenericOrmEmbeddable(OrmPersistentType parent) {
- super(parent);
- }
-
- public JavaEmbeddable getJavaEmbeddable() {
- if (this.javaPersistentType != null && this.javaPersistentType.getMappingKey() == MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY) {
- return (JavaEmbeddable) this.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 String getKey() {
- return MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY;
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return false;
- }
-
- public Iterator<String> associatedTableNamesIncludingInherited() {
- return EmptyIterator.instance();
- }
-
- public Iterator<Table> associatedTables() {
- return EmptyIterator.instance();
- }
-
- public Iterator<Table> associatedTablesIncludingInherited() {
- return EmptyIterator.instance();
- }
-
- public int getXmlSequence() {
- return 2;
- }
-
- @Override
- public boolean attributeMappingKeyAllowed(String attributeMappingKey) {
- return attributeMappingKey == MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY || attributeMappingKey == MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- protected Boolean metadataComplete(XmlEmbeddable embeddable) {
- return embeddable.getMetadataComplete();
- }
-
- public void removeFromResourceModel(XmlEntityMappings entityMappings) {
- entityMappings.getEmbeddables().remove(this.resourceTypeMapping);
- }
-
- public XmlEmbeddable addToResourceModel(XmlEntityMappings entityMappings) {
- XmlEmbeddable embeddable = OrmFactory.eINSTANCE.createXmlEmbeddable();
- getPersistentType().initialize(embeddable);
- entityMappings.getEmbeddables().add(embeddable);
- return embeddable;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddedIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddedIdMapping.java
deleted file mode 100644
index 43c54996de..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddedIdMapping.java
+++ /dev/null
@@ -1,57 +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.orm;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddedId;
-
-
-public class GenericOrmEmbeddedIdMapping extends AbstractOrmBaseEmbeddedMapping<XmlEmbeddedId> implements OrmEmbeddedIdMapping
-{
-
- public GenericOrmEmbeddedIdMapping(OrmPersistentAttribute parent) {
- super(parent);
- }
-
- 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;
- }
-
- @Override
- public boolean isIdMapping() {
- return true;
- }
-
- public XmlEmbeddedId addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlEmbeddedId embeddedId = OrmFactory.eINSTANCE.createXmlEmbeddedIdImpl();
- getPersistentAttribute().initialize(embeddedId);
- typeMapping.getAttributes().getEmbeddedIds().add(embeddedId);
- return embeddedId;
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- typeMapping.getAttributes().getEmbeddedIds().remove(this.resourceAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddedMapping.java
deleted file mode 100644
index 0fd1fe3473..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddedMapping.java
+++ /dev/null
@@ -1,50 +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.orm;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlEmbedded;
-
-
-public class GenericOrmEmbeddedMapping extends AbstractOrmBaseEmbeddedMapping<XmlEmbedded> implements OrmEmbeddedMapping
-{
-
- public GenericOrmEmbeddedMapping(OrmPersistentAttribute parent) {
- super(parent);
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmEmbeddedMapping(this);
- }
-
- public int getXmlSequence() {
- return 80;
- }
-
- public String getKey() {
- return MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlEmbedded addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlEmbedded embedded = OrmFactory.eINSTANCE.createXmlEmbeddedImpl();
- getPersistentAttribute().initialize(embedded);
- typeMapping.getAttributes().getEmbeddeds().add(embedded);
- return embedded;
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- typeMapping.getAttributes().getEmbeddeds().remove(this.resourceAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEntity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEntity.java
deleted file mode 100644
index e7a60ea9af..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEntity.java
+++ /dev/null
@@ -1,2074 +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.context.orm;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.ColumnMapping;
-import org.eclipse.jpt.core.context.DiscriminatorColumn;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.Generator;
-import org.eclipse.jpt.core.context.IdClass;
-import org.eclipse.jpt.core.context.InheritanceType;
-import org.eclipse.jpt.core.context.NamedNativeQuery;
-import org.eclipse.jpt.core.context.NamedQuery;
-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.Query;
-import org.eclipse.jpt.core.context.QueryHolder;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-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.JavaAttributeOverride;
-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.context.java.JavaTable;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverride;
-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.OrmGenerator;
-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.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmQuery;
-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.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.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.XmlIdClass;
-import org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery;
-import org.eclipse.jpt.core.resource.orm.XmlNamedQuery;
-import org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn;
-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.utility.TextRange;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.utility.internal.ClassTools;
-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.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;
-
-public class GenericOrmEntity
- extends AbstractOrmTypeMapping<XmlEntity>
- implements OrmEntity
-{
- protected String specifiedName;
-
- protected String defaultName;
-
- protected String idClass;
-
- protected final OrmTable table;
-
- 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 discriminatorValueAllowed;
-
- protected final OrmDiscriminatorColumn discriminatorColumn;
-
- protected OrmSequenceGenerator sequenceGenerator;
-
- protected OrmTableGenerator tableGenerator;
-
- protected final List<OrmAttributeOverride> specifiedAttributeOverrides;
-
- protected final List<OrmAttributeOverride> virtualAttributeOverrides;
-
- protected final List<OrmAssociationOverride> specifiedAssociationOverrides;
-
- protected final List<OrmAssociationOverride> virtualAssociationOverrides;
-
- protected final List<OrmNamedQuery> namedQueries;
-
- protected final List<OrmNamedNativeQuery> namedNativeQueries;
-
- public GenericOrmEntity(OrmPersistentType parent) {
- super(parent);
- this.table = getJpaFactory().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.specifiedAttributeOverrides = new ArrayList<OrmAttributeOverride>();
- this.virtualAttributeOverrides = new ArrayList<OrmAttributeOverride>();
- this.specifiedAssociationOverrides = new ArrayList<OrmAssociationOverride>();
- this.virtualAssociationOverrides = new ArrayList<OrmAssociationOverride>();
- this.namedQueries = new ArrayList<OrmNamedQuery>();
- this.namedNativeQueries = new ArrayList<OrmNamedNativeQuery>();
- }
-
- protected OrmDiscriminatorColumn buildDiscriminatorColumn() {
- return getJpaFactory().buildOrmDiscriminatorColumn(this, buildDiscriminatorColumnOwner());
- }
-
- protected OrmNamedColumn.Owner buildDiscriminatorColumnOwner() {
- return new OrmNamedColumn.Owner(){
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- return GenericOrmEntity.this.getDbTable(tableName);
- }
-
- public TypeMapping getTypeMapping() {
- return GenericOrmEntity.this;
- }
-
- public String getDefaultColumnName() {
- //TODO default column name from java here or in XmlDiscriminatorColumn?
- return DiscriminatorColumn.DEFAULT_NAME;
- }
-
- public TextRange getValidationTextRange() {
- // TODO Auto-generated method stub
- return null;
- }
-
- };
- }
-
- // ******************* ITypeMapping implementation ********************
-
- public String getKey() {
- return MappingKeys.ENTITY_TYPE_MAPPING_KEY;
- }
-
- @Override
- public String getPrimaryTableName() {
- return this.table.getName();
- }
-
- @Override
- public org.eclipse.jpt.db.Table getPrimaryDbTable() {
- return this.table.getDbTable();
- }
-
- private static final org.eclipse.jpt.db.Table[] EMPTY_DB_TABLE_ARRAY = new org.eclipse.jpt.db.Table[0];
-
- @Override
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- // the JPA platform searches database objects for us
- return this.getDataSource().selectDatabaseObjectForIdentifier(
- CollectionTools.array(this.associatedDbTablesIncludingInherited(), EMPTY_DB_TABLE_ARRAY),
- tableName
- );
- }
-
- private Iterator<org.eclipse.jpt.db.Table> associatedDbTablesIncludingInherited() {
- return new FilteringIterator<org.eclipse.jpt.db.Table, org.eclipse.jpt.db.Table>(this.associatedDbTablesIncludingInherited_()) {
- @Override
- protected boolean accept(org.eclipse.jpt.db.Table t) {
- return t != null;
- }
- };
- }
-
- private Iterator<org.eclipse.jpt.db.Table> associatedDbTablesIncludingInherited_() {
- return new TransformationIterator<Table, org.eclipse.jpt.db.Table>(this.associatedTablesIncludingInherited()) {
- @Override
- protected org.eclipse.jpt.db.Table transform(Table t) {
- return t.getDbTable();
- }
- };
- }
-
- @Override
- public Schema getDbSchema() {
- return this.table.getDbSchema();
- }
-
- public JavaEntity getJavaEntity() {
- if (this.javaPersistentType != null && this.javaPersistentType.getMappingKey() == MappingKeys.ENTITY_TYPE_MAPPING_KEY) {
- return (JavaEntity) this.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();
- }
-
- 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);
- }
-
- 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.createXmlSecondaryTableImpl();
- 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.createXmlSecondaryTableImpl();
- 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, 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 new CompositeIterator<Table>(new TransformationIterator<TypeMapping, Iterator<Table>>(this.inheritanceHierarchy()) {
- @Override
- protected Iterator<Table> transform(TypeMapping mapping) {
- return new FilteringIterator<Table, Table>(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) {
- return ! CollectionTools.contains(this.associatedTableNamesIncludingInherited(), tableName);
- }
-
- 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().isAllFeaturesUnset()) {
- 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 OrmSequenceGenerator addSequenceGenerator() {
- if (getSequenceGenerator() != null) {
- throw new IllegalStateException("sequenceGenerator already exists"); //$NON-NLS-1$
- }
- XmlSequenceGenerator resourceSequenceGenerator = OrmFactory.eINSTANCE.createXmlSequenceGeneratorImpl();
- this.sequenceGenerator = buildSequenceGenerator(resourceSequenceGenerator);
- this.resourceTypeMapping.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.resourceTypeMapping.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 = OrmFactory.eINSTANCE.createXmlTableGeneratorImpl();
- this.tableGenerator = buildTableGenerator(resourceTableGenerator);
- this.resourceTypeMapping.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.resourceTypeMapping.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 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 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 isDiscriminatorValueAllowed() {
- return this.discriminatorValueAllowed;
- }
-
- protected void setDiscriminatorValueAllowed(boolean newDiscriminatorValueAllowed) {
- boolean oldDiscriminatorValueAllowed = this.discriminatorValueAllowed;
- this.discriminatorValueAllowed = newDiscriminatorValueAllowed;
- firePropertyChanged(Entity.DISCRIMINATOR_VALUE_ALLOWED_PROPERTY, oldDiscriminatorValueAllowed, newDiscriminatorValueAllowed);
- }
-
- 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.createXmlPrimaryKeyJoinColumnImpl();
- 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);
- }
- }
-
- 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);
- }
-
- @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, Entity.VIRTUAL_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- protected void removeVirtualAttributeOverride(OrmAttributeOverride attributeOverride) {
- removeItemFromList(attributeOverride, this.virtualAttributeOverrides, Entity.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 udpate. This causes the UI to be flaky, since change notification might not occur in the correct order
- OrmAttributeOverride virtualAttributeOverride = null;
- if (attributeOverrideName != null) {
- for (PersistentAttribute persistentAttribute : CollectionTools.iterable(allOverridableAttributes())) {
- if (persistentAttribute.getName().equals(attributeOverrideName)) {
- JavaAttributeOverride javaAttributeOverride = null;
- if (getJavaEntity() != null) {
- javaAttributeOverride = getJavaEntity().getAttributeOverrideNamed(attributeOverrideName);
- }
- //store the virtualAttributeOverride so we can fire change notification later
- virtualAttributeOverride = buildVirtualAttributeOverride(persistentAttribute, javaAttributeOverride);
- this.virtualAttributeOverrides.add(virtualAttributeOverride);
- }
- }
- }
-
- this.resourceTypeMapping.getAttributeOverrides().remove(index);
- fireItemRemoved(Entity.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, attributeOverride);
-
- if (virtualAttributeOverride != null) {
- fireItemAdded(Entity.VIRTUAL_ATTRIBUTE_OVERRIDES_LIST, virtualAttributeOverridesSize() - 1, virtualAttributeOverride);
- }
- return virtualAttributeOverride;
- }
-
- protected OrmAttributeOverride setAttributeOverrideSpecified(OrmAttributeOverride oldAttributeOverride) {
- int index = specifiedAttributeOverridesSize();
- XmlAttributeOverride xmlAttributeOverride = OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl();
- OrmAttributeOverride newAttributeOverride = getJpaFactory().buildOrmAttributeOverride(this, createAttributeOverrideOwner(), xmlAttributeOverride);
- this.specifiedAttributeOverrides.add(index, newAttributeOverride);
-
- this.resourceTypeMapping.getAttributeOverrides().add(xmlAttributeOverride);
-
- int defaultIndex = this.virtualAttributeOverrides.indexOf(oldAttributeOverride);
- this.virtualAttributeOverrides.remove(defaultIndex);
-
- newAttributeOverride.setName(oldAttributeOverride.getName());
- newAttributeOverride.getColumn().setSpecifiedName(oldAttributeOverride.getColumn().getName());
-
- this.fireItemRemoved(Entity.VIRTUAL_ATTRIBUTE_OVERRIDES_LIST, defaultIndex, oldAttributeOverride);
- this.fireItemAdded(Entity.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 void addSpecifiedAttributeOverride(int index, OrmAttributeOverride attributeOverride) {
- addItemToList(index, attributeOverride, this.specifiedAttributeOverrides, Entity.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- protected void addSpecifiedAttributeOverride(OrmAttributeOverride attributeOverride) {
- this.addSpecifiedAttributeOverride(this.specifiedAttributeOverrides.size(), attributeOverride);
- }
-
- protected void removeSpecifiedAttributeOverride_(OrmAttributeOverride attributeOverride) {
- removeItemFromList(attributeOverride, this.specifiedAttributeOverrides, Entity.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public void moveSpecifiedAttributeOverride(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedAttributeOverrides, targetIndex, sourceIndex);
- this.resourceTypeMapping.getAttributeOverrides().move(targetIndex, sourceIndex);
- fireItemMoved(Entity.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, targetIndex, sourceIndex);
- }
-
- @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();
- }
-
- 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, Entity.SPECIFIED_ASSOCIATION_OVERRIDES_LIST);
- }
-
- protected void addSpecifiedAssociationOverride(OrmAssociationOverride associationOverride) {
- this.addSpecifiedAssociationOverride(this.specifiedAssociationOverrides.size(), associationOverride);
- }
-
- protected void removeSpecifiedAssociationOverride_(OrmAssociationOverride associationOverride) {
- removeItemFromList(associationOverride, this.specifiedAssociationOverrides, Entity.SPECIFIED_ASSOCIATION_OVERRIDES_LIST);
- }
-
- public void moveSpecifiedAssociationOverride(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedAssociationOverrides, targetIndex, sourceIndex);
- this.resourceTypeMapping.getAssociationOverrides().move(targetIndex, sourceIndex);
- fireItemMoved(Entity.SPECIFIED_ASSOCIATION_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());
- }
-
- 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;
- }
-
-
- 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.resourceTypeMapping.getNamedQueries().add(index, resourceNamedQuery);
- this.fireItemAdded(QueryHolder.NAMED_QUERIES_LIST, index, contextNamedQuery);
- return contextNamedQuery;
- }
-
- protected void addNamedQuery(int index, OrmNamedQuery namedQuery) {
- addItemToList(index, namedQuery, this.namedQueries, QueryHolder.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.resourceTypeMapping.getNamedQueries().remove(index);
- fireItemRemoved(QueryHolder.NAMED_QUERIES_LIST, index, namedQuery);
- }
-
- protected void removeNamedQuery_(OrmNamedQuery namedQuery) {
- removeItemFromList(namedQuery, this.namedQueries, QueryHolder.NAMED_QUERIES_LIST);
- }
-
- public void moveNamedQuery(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.namedQueries, targetIndex, sourceIndex);
- this.resourceTypeMapping.getNamedQueries().move(targetIndex, sourceIndex);
- fireItemMoved(QueryHolder.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.resourceTypeMapping.getNamedNativeQueries().add(index, resourceNamedNativeQuery);
- this.fireItemAdded(QueryHolder.NAMED_NATIVE_QUERIES_LIST, index, contextNamedNativeQuery);
- return contextNamedNativeQuery;
- }
-
- protected void addNamedNativeQuery(int index, OrmNamedNativeQuery namedNativeQuery) {
- addItemToList(index, namedNativeQuery, this.namedNativeQueries, QueryHolder.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.resourceTypeMapping.getNamedNativeQueries().remove(index);
- fireItemRemoved(QueryHolder.NAMED_NATIVE_QUERIES_LIST, index, namedNativeQuery);
- }
-
- protected void removeNamedNativeQuery_(OrmNamedNativeQuery namedNativeQuery) {
- removeItemFromList(namedNativeQuery, this.namedNativeQueries, QueryHolder.NAMED_NATIVE_QUERIES_LIST);
- }
-
- public void moveNamedNativeQuery(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.namedNativeQueries, targetIndex, sourceIndex);
- this.resourceTypeMapping.getNamedNativeQueries().move(targetIndex, sourceIndex);
- fireItemMoved(QueryHolder.NAMED_NATIVE_QUERIES_LIST, targetIndex, sourceIndex);
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<OrmQuery> queries() {
- return new CompositeIterator<OrmQuery>(this.namedQueries(), this.namedNativeQueries());
- }
-
- public String getIdClass() {
- return this.idClass;
- }
-
- public void setIdClass(String newIdClass) {
- String oldIdClass = this.idClass;
- this.idClass = newIdClass;
- if (oldIdClass != newIdClass) {
- if (this.getResourceIdClass() != null) {
- this.getResourceIdClass().setClassName(newIdClass);
- if (this.getResourceIdClass().isAllFeaturesUnset()) {
- removeResourceIdClass();
- }
- }
- else if (newIdClass != null) {
- addResourceIdClass();
- getResourceIdClass().setClassName(newIdClass);
- }
- }
- firePropertyChanged(IdClass.ID_CLASS_PROPERTY, oldIdClass, newIdClass);
- }
-
- protected void setIdClass_(String newIdClass) {
- String oldIdClass = this.idClass;
- this.idClass = newIdClass;
- firePropertyChanged(IdClass.ID_CLASS_PROPERTY, oldIdClass, newIdClass);
- }
-
- protected XmlIdClass getResourceIdClass() {
- return this.resourceTypeMapping.getIdClass();
- }
-
- protected void addResourceIdClass() {
- this.resourceTypeMapping.setIdClass(OrmFactory.eINSTANCE.createXmlIdClass());
- }
-
- protected void removeResourceIdClass() {
- this.resourceTypeMapping.setIdClass(null);
- }
-
- public Entity getParentEntity() {
- for (Iterator<PersistentType> stream = getPersistentType().ancestors(); stream.hasNext();) {
- TypeMapping tm = stream.next().getMapping();
- if (tm instanceof Entity) {
- return (Entity) tm;
- }
- }
- return this;
- }
-
- public Entity getRootEntity() {
- Entity rootEntity = null;
- for (Iterator<PersistentType> stream = getPersistentType().inheritanceHierarchy(); stream.hasNext();) {
- PersistentType persistentType = stream.next();
- if (persistentType.getMapping() instanceof Entity) {
- rootEntity = (Entity) persistentType.getMapping();
- }
- }
- return rootEntity;
- }
-
- public String getDefaultTableName() {
- JavaEntity javaEntity = this.getJavaEntity();
- if (javaEntity != null) {
- JavaTable javaTable = javaEntity.getTable();
- if ( ! this.isMetadataComplete()
- && ! this.table.hasSpecifiedResourceTable()
- && javaTable.getSpecifiedName() != null) {
- return javaTable.getSpecifiedName();
- }
- }
-
- return this.isSingleTableDescendant() ?
- this.getRootEntity().getTable().getName()
- :
- this.getName();
- }
-
- public String getDefaultSchema() {
- JavaEntity javaEntity = this.getJavaEntity();
- if (javaEntity != null) {
- if (this.isMetadataComplete() || this.table.hasSpecifiedResourceTable()) {
- return javaEntity.getTable().getDefaultSchema();
- }
- return javaEntity.getTable().getSchema();
- }
-
- return this.isSingleTableDescendant() ?
- this.getRootEntity().getTable().getSchema()
- :
- this.getContextDefaultSchema();
- }
-
- public String getDefaultCatalog() {
- JavaEntity javaEntity = this.getJavaEntity();
- if (javaEntity != null) {
- if (this.isMetadataComplete() || this.table.hasSpecifiedResourceTable()) {
- return javaEntity.getTable().getDefaultCatalog();
- }
- return javaEntity.getTable().getCatalog();
- }
-
- return this.isSingleTableDescendant() ?
- this.getRootEntity().getTable().getCatalog()
- :
- 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);
- }
-
- /**
- * 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.
- */
- protected boolean isRoot() {
- return this == this.getRootEntity();
- }
-
-// 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> inheritanceHierarchy() {
- return new TransformationIterator<PersistentType, TypeMapping>(getPersistentType().inheritanceHierarchy()) {
- @Override
- protected TypeMapping transform(PersistentType type) {
- return type.getMapping();
- }
- };
- }
-
- @Override
- public Iterator<PersistentAttribute> allOverridableAttributes() {
- return new CompositeIterator<PersistentAttribute>(new TransformationIterator<TypeMapping, Iterator<PersistentAttribute>>(this.inheritanceHierarchy()) {
- @Override
- protected Iterator<PersistentAttribute> transform(TypeMapping mapping) {
- return mapping.overridableAttributes();
- }
- });
- }
-
- @Override
- 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();
- }
- });
- }
-
- @Override
- 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 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();
-// }
-
-
- @Override
- public void initialize(XmlEntity entity) {
- super.initialize(entity);
- this.specifiedName = entity.getName();
- this.defaultName = this.buildDefaultName();
- this.initializeInheritance(this.getResourceInheritance());
- this.discriminatorColumn.initialize(this.resourceTypeMapping);
- this.specifiedDiscriminatorValue = this.resourceTypeMapping.getDiscriminatorValue();
- this.defaultDiscriminatorValue = this.defaultDiscriminatorValue();
- this.discriminatorValueAllowed = this.discriminatorValueIsAllowed();
- this.table.initialize(this.resourceTypeMapping);
- this.initializeSpecifiedSecondaryTables();
- this.initializeVirtualSecondaryTables();
- this.initializeSequenceGenerator();
- this.initializeTableGenerator();
- this.initializeSpecifiedPrimaryKeyJoinColumns();
- this.initializeDefaultPrimaryKeyJoinColumns();
- this.initializeSpecifiedAttributeOverrides();
- this.initializeVirtualAttributeOverrides();
- this.initializeSpecifiedAssociationOverrides();
- this.initializeNamedQueries();
- this.initializeNamedNativeQueries();
- this.initializeIdClass(this.getResourceIdClass());
- }
-
- protected void initializeInheritance(Inheritance inheritanceResource) {
- this.specifiedInheritanceStrategy = this.specifiedInheritanceStrategy(inheritanceResource);
- this.defaultInheritanceStrategy = this.defaultInheritanceStrategy();
- }
-
- 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 initializeTableGenerator() {
- if (this.resourceTypeMapping.getTableGenerator() != null) {
- this.tableGenerator = buildTableGenerator(this.resourceTypeMapping.getTableGenerator());
- }
- }
-
- protected OrmTableGenerator buildTableGenerator(XmlTableGenerator resourceTableGenerator) {
- return getJpaFactory().buildOrmTableGenerator(this, resourceTableGenerator);
- }
-
- protected void initializeSequenceGenerator() {
- if (this.resourceTypeMapping.getSequenceGenerator() != null) {
- this.sequenceGenerator = buildSequenceGenerator(this.resourceTypeMapping.getSequenceGenerator());
- }
- }
-
- protected OrmSequenceGenerator buildSequenceGenerator(XmlSequenceGenerator resourceSequenceGenerator) {
- return getJpaFactory().buildOrmSequenceGenerator(this, resourceSequenceGenerator);
- }
-
- protected void initializeSpecifiedPrimaryKeyJoinColumns() {
- for (XmlPrimaryKeyJoinColumn resourcePkJoinColumn : this.resourceTypeMapping.getPrimaryKeyJoinColumns()) {
- this.specifiedPrimaryKeyJoinColumns.add(buildPrimaryKeyJoinColumn(resourcePkJoinColumn));
- }
- }
-
- protected void initializeSpecifiedAttributeOverrides() {
- for (XmlAttributeOverride attributeOverride : this.resourceTypeMapping.getAttributeOverrides()) {
- this.specifiedAttributeOverrides.add(buildAttributeOverride(attributeOverride));
- }
- }
-
- protected void initializeVirtualAttributeOverrides() {
- for (PersistentAttribute persistentAttribute : CollectionTools.iterable(allOverridableAttributes())) {
- OrmAttributeOverride attributeOverride = getAttributeOverrideNamed(persistentAttribute.getName());
- if (attributeOverride == null) {
- JavaAttributeOverride javaAttributeOverride = null;
- if (getJavaEntity() != null) {
- javaAttributeOverride = getJavaEntity().getAttributeOverrideNamed(persistentAttribute.getName());
- }
- this.virtualAttributeOverrides.add(buildVirtualAttributeOverride(persistentAttribute, javaAttributeOverride));
- }
- }
- }
-
- protected OrmAttributeOverride buildVirtualAttributeOverride(PersistentAttribute persistentAttribute, JavaAttributeOverride javaAttributeOverride) {
- return buildAttributeOverride(buildVirtualXmlAttributeOverride(persistentAttribute, javaAttributeOverride));
- }
-
- protected XmlAttributeOverride buildVirtualXmlAttributeOverride(PersistentAttribute persistentAttribute, JavaAttributeOverride javaAttributeOverride) {
- XmlColumn xmlColumn;
- if (javaAttributeOverride == null) {
- ColumnMapping columnMapping = (ColumnMapping) persistentAttribute.getMapping();
- xmlColumn = new VirtualXmlColumn(this, columnMapping.getColumn());
- }
- else {
- xmlColumn = new VirtualXmlColumn(this, javaAttributeOverride.getColumn());
- }
- return new VirtualXmlAttributeOverride(persistentAttribute.getName(), xmlColumn);
- }
-
- protected void initializeSpecifiedAssociationOverrides() {
- for (XmlAssociationOverride associationOverride : this.resourceTypeMapping.getAssociationOverrides()) {
- this.specifiedAssociationOverrides.add(buildAssociationOverride(associationOverride));
- }
- }
-
- protected void initializeNamedQueries() {
- for (XmlNamedQuery namedQuery : this.resourceTypeMapping.getNamedQueries()) {
- this.namedQueries.add(buildNamedQuery(namedQuery));
- }
- }
-
- protected void initializeNamedNativeQueries() {
- for (XmlNamedNativeQuery namedNativeQuery : this.resourceTypeMapping.getNamedNativeQueries()) {
- this.namedNativeQueries.add(buildNamedNativeQuery(namedNativeQuery));
- }
- }
-
- protected void initializeIdClass(XmlIdClass idClassResource) {
- this.idClass = this.idClass(idClassResource);
- }
-
- protected String idClass(XmlIdClass idClassResource) {
- return idClassResource == null ? null : idClassResource.getClassName();
- }
-
- @Override
- public void update(XmlEntity entity) {
- super.update(entity);
- this.setSpecifiedName(this.resourceTypeMapping.getName());
- this.setDefaultName(this.buildDefaultName());
- this.updateInheritance(this.getResourceInheritance());
- this.discriminatorColumn.update(this.resourceTypeMapping);
- this.setSpecifiedDiscriminatorValue(this.resourceTypeMapping.getDiscriminatorValue());
- this.setDefaultDiscriminatorValue(defaultDiscriminatorValue());
- this.setDiscriminatorValueAllowed(this.discriminatorValueIsAllowed());
- this.table.update(this.resourceTypeMapping);
- this.updateSpecifiedSecondaryTables();
- this.updateVirtualSecondaryTables();
- this.updateSequenceGenerator();
- this.updateTableGenerator();
- this.updateSpecifiedPrimaryKeyJoinColumns();
- this.updateDefaultPrimaryKeyJoinColumns();
- this.updateSpecifiedAttributeOverrides();
- this.updateVirtualAttributeOverrides();
- this.updateSpecifiedAssociationOverrides();
- this.updateNamedQueries();
- this.updateNamedNativeQueries();
- this.updateIdClass(this.getResourceIdClass());
- }
-
- protected String buildDefaultName() {
- if (!isMetadataComplete()) {
- JavaEntity javaEntity = getJavaEntity();
- if (javaEntity != null) {
- return javaEntity.getName();
- }
- }
- String className = getClass_();
- if (className != null) {
- return ClassTools.shortNameForClassNamed(className);
- }
- return null;
- }
-
- protected String defaultDiscriminatorValue() {
- //TODO default discriminator value
- return null;
- }
-
- protected boolean discriminatorValueIsAllowed() {
- JavaResourcePersistentType javaResourcePersistentType = getJavaResourcePersistentType();
- return javaResourcePersistentType == null ? false : !javaResourcePersistentType.isAbstract();
- }
-
- protected void updateInheritance(Inheritance inheritanceResource) {
- this.setSpecifiedInheritanceStrategy_(this.specifiedInheritanceStrategy(inheritanceResource));
- this.setDefaultInheritanceStrategy(this.defaultInheritanceStrategy());
- }
-
- protected void updateSpecifiedSecondaryTables() {
- ListIterator<OrmSecondaryTable> secondaryTables = specifiedSecondaryTables();
- ListIterator<XmlSecondaryTable> resourceSecondaryTables = new CloneListIterator<XmlSecondaryTable>(this.resourceTypeMapping.getSecondaryTables());//prevent ConcurrentModificiationException
-
- while (secondaryTables.hasNext()) {
- OrmSecondaryTable secondaryTable = secondaryTables.next();
- if (resourceSecondaryTables.hasNext()) {
- secondaryTable.update(resourceSecondaryTables.next());
- }
- else {
- removeSpecifiedSecondaryTable_(secondaryTable);
- }
- }
-
- while (resourceSecondaryTables.hasNext()) {
- addSpecifiedSecondaryTable(buildSecondaryTable(resourceSecondaryTables.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 getJpaFactory().buildOrmSecondaryTable(this, xmlSecondaryTable);
- }
-
- protected OrmSecondaryTable buildVirtualSecondaryTable(JavaSecondaryTable javaSecondaryTable) {
- return buildSecondaryTable(new VirtualXmlSecondaryTable(javaSecondaryTable));
- }
-
- protected void updateTableGenerator() {
- if (this.resourceTypeMapping.getTableGenerator() == null) {
- if (getTableGenerator() != null) {
- setTableGenerator(null);
- }
- }
- else {
- if (getTableGenerator() == null) {
- setTableGenerator(buildTableGenerator(this.resourceTypeMapping.getTableGenerator()));
- }
- else {
- getTableGenerator().update(this.resourceTypeMapping.getTableGenerator());
- }
- }
- }
-
- protected void updateSequenceGenerator() {
- if (this.resourceTypeMapping.getSequenceGenerator() == null) {
- if (getSequenceGenerator() != null) {
- setSequenceGenerator(null);
- }
- }
- else {
- if (getSequenceGenerator() == null) {
- setSequenceGenerator(buildSequenceGenerator(this.resourceTypeMapping.getSequenceGenerator()));
- }
- else {
- getSequenceGenerator().update(this.resourceTypeMapping.getSequenceGenerator());
- }
- }
- }
-
- protected InheritanceType specifiedInheritanceStrategy(Inheritance inheritanceResource) {
- if (inheritanceResource == null) {
- return null;
- }
- return InheritanceType.fromOrmResourceModel(inheritanceResource.getStrategy());
- }
-
- protected InheritanceType defaultInheritanceStrategy() {
- 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() {
- ListIterator<OrmPrimaryKeyJoinColumn> contextPkJoinColumns = specifiedPrimaryKeyJoinColumns();
- ListIterator<XmlPrimaryKeyJoinColumn> resourcePkJoinColumns = new CloneListIterator<XmlPrimaryKeyJoinColumn>(this.resourceTypeMapping.getPrimaryKeyJoinColumns());//prevent ConcurrentModificiationException
-
- while (contextPkJoinColumns.hasNext()) {
- OrmPrimaryKeyJoinColumn contextPkJoinColumn = contextPkJoinColumns.next();
- if (resourcePkJoinColumns.hasNext()) {
- contextPkJoinColumn.update(resourcePkJoinColumns.next());
- }
- else {
- removeSpecifiedPrimaryKeyJoinColumn_(contextPkJoinColumn);
- }
- }
-
- while (resourcePkJoinColumns.hasNext()) {
- addSpecifiedPrimaryKeyJoinColumn(buildPrimaryKeyJoinColumn(resourcePkJoinColumns.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 getJpaFactory().buildOrmPrimaryKeyJoinColumn(this, createPrimaryKeyJoinColumnOwner(), resourcePkJoinColumn);
- }
-
- protected void updateSpecifiedAttributeOverrides() {
- ListIterator<OrmAttributeOverride> attributeOverrides = specifiedAttributeOverrides();
- ListIterator<XmlAttributeOverride> resourceAttributeOverrides = new CloneListIterator<XmlAttributeOverride>(this.resourceTypeMapping.getAttributeOverrides());//prevent ConcurrentModificiationException
-
- while (attributeOverrides.hasNext()) {
- OrmAttributeOverride attributeOverride = attributeOverrides.next();
- if (resourceAttributeOverrides.hasNext()) {
- attributeOverride.update(resourceAttributeOverrides.next());
- }
- else {
- removeSpecifiedAttributeOverride_(attributeOverride);
- }
- }
-
- while (resourceAttributeOverrides.hasNext()) {
- addSpecifiedAttributeOverride(buildAttributeOverride(resourceAttributeOverrides.next()));
- }
- }
-
- protected void updateVirtualAttributeOverrides() {
- Iterator<PersistentAttribute> overridableAttributes = allOverridableAttributes();
- ListIterator<OrmAttributeOverride> virtualAttributeOverridesCopy = virtualAttributeOverrides();
-
- for (PersistentAttribute persistentAttribute : CollectionTools.iterable(overridableAttributes)) {
- OrmAttributeOverride ormAttributeOverride = getAttributeOverrideNamed(persistentAttribute.getName());
- if (ormAttributeOverride != null && !ormAttributeOverride.isVirtual()) {
- continue;
- }
- JavaAttributeOverride javaAttributeOverride = null;
- if (getJavaEntity() != null) {
- javaAttributeOverride = getJavaEntity().getAttributeOverrideNamed(persistentAttribute.getName());
- }
- if (ormAttributeOverride != null) {
- if (virtualAttributeOverridesCopy.hasNext()) {
- OrmAttributeOverride virtualAttributeOverride = virtualAttributeOverridesCopy.next();
- virtualAttributeOverride.update(buildVirtualXmlAttributeOverride(persistentAttribute, javaAttributeOverride));
- }
- else {
- addVirtualAttributeOverride(buildVirtualAttributeOverride(persistentAttribute, javaAttributeOverride));
- }
- }
- else {
- addVirtualAttributeOverride(buildVirtualAttributeOverride(persistentAttribute, javaAttributeOverride));
- }
- }
- for (OrmAttributeOverride virtualAttributeOverride : CollectionTools.iterable(virtualAttributeOverridesCopy)) {
- removeVirtualAttributeOverride(virtualAttributeOverride);
- }
- }
-
- protected OrmAttributeOverride buildAttributeOverride(XmlAttributeOverride attributeOverride) {
- return getJpaFactory().buildOrmAttributeOverride(this, createAttributeOverrideOwner(), attributeOverride);
- }
-
- protected AttributeOverride.Owner createAttributeOverrideOwner() {
- return new AttributeOverrideOwner();
- }
-
- protected void updateSpecifiedAssociationOverrides() {
- ListIterator<OrmAssociationOverride> associationOverrides = specifiedAssociationOverrides();
- ListIterator<XmlAssociationOverride> resourceAssociationOverrides = new CloneListIterator<XmlAssociationOverride>(this.resourceTypeMapping.getAssociationOverrides());//prevent ConcurrentModificiationException
-
- while (associationOverrides.hasNext()) {
- OrmAssociationOverride associationOverride = associationOverrides.next();
- if (resourceAssociationOverrides.hasNext()) {
- associationOverride.update(resourceAssociationOverrides.next());
- }
- else {
- removeSpecifiedAssociationOverride_(associationOverride);
- }
- }
-
- while (resourceAssociationOverrides.hasNext()) {
- addSpecifiedAssociationOverride(buildAssociationOverride(resourceAssociationOverrides.next()));
- }
- }
-
- protected OrmAssociationOverride buildAssociationOverride(XmlAssociationOverride associationOverride) {
- return getJpaFactory().buildOrmAssociationOverride(this, createAssociationOverrideOwner(), associationOverride);
- }
-
- protected AssociationOverride.Owner createAssociationOverrideOwner() {
- return new AssociationOverrideOwner();
- }
-
- protected void updateNamedQueries() {
- ListIterator<OrmNamedQuery> queries = namedQueries();
- ListIterator<XmlNamedQuery> resourceNamedQueries = new CloneListIterator<XmlNamedQuery>(this.resourceTypeMapping.getNamedQueries());//prevent ConcurrentModificiationException
-
- while (queries.hasNext()) {
- OrmNamedQuery namedQuery = queries.next();
- if (resourceNamedQueries.hasNext()) {
- namedQuery.update(resourceNamedQueries.next());
- }
- else {
- removeNamedQuery_(namedQuery);
- }
- }
-
- while (resourceNamedQueries.hasNext()) {
- addNamedQuery(buildNamedQuery(resourceNamedQueries.next()));
- }
- }
-
- protected OrmNamedQuery buildNamedQuery(XmlNamedQuery resourceNamedQuery) {
- return getJpaFactory().buildOrmNamedQuery(this, resourceNamedQuery);
- }
-
- protected void updateNamedNativeQueries() {
- ListIterator<OrmNamedNativeQuery> queries = namedNativeQueries();
- ListIterator<XmlNamedNativeQuery> resourceNamedNativeQueries = new CloneListIterator<XmlNamedNativeQuery>(this.resourceTypeMapping.getNamedNativeQueries());//prevent ConcurrentModificiationException
-
- while (queries.hasNext()) {
- OrmNamedNativeQuery namedQuery = queries.next();
- if (resourceNamedNativeQueries.hasNext()) {
- namedQuery.update(resourceNamedNativeQueries.next());
- }
- else {
- removeNamedNativeQuery_(namedQuery);
- }
- }
-
- while (resourceNamedNativeQueries.hasNext()) {
- addNamedNativeQuery(buildNamedNativeQuery(resourceNamedNativeQueries.next()));
- }
- }
-
- protected OrmNamedNativeQuery buildNamedNativeQuery(XmlNamedNativeQuery resourceNamedNativeQuery) {
- return getJpaFactory().buildOrmNamedNativeQuery(this, resourceNamedNativeQuery);
- }
-
- protected void updateIdClass(XmlIdClass idClassResource) {
- this.setIdClass_(this.idClass(idClassResource));
- }
-
-
- // *************************************************************************
-
- public String getPrimaryKeyColumnName() {
- return getPrimaryKeyColumnName(getPersistentType().allAttributes());
- }
-
- //copied in GenericJavaEntity to avoid an API change for fixing bug 229423 in RC1
- public String getPrimaryKeyColumnName(Iterator<PersistentAttribute> attributes) {
- String pkColumnName = null;
- for (Iterator<PersistentAttribute> stream = attributes; stream.hasNext();) {
- PersistentAttribute attribute = stream.next();
- String name = attribute.getPrimaryKeyColumnName();
- if (name != null) {
- //if the attribute is a primary key then we need to check if there is an attribute override
- //and use its column name instead (bug 229423)
- AttributeOverride attributeOverride = getAttributeOverrideNamed(attribute.getName());
- if (attributeOverride != null) {
- name = attributeOverride.getColumn().getName();
- }
- }
- 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 void removeFromResourceModel(XmlEntityMappings entityMappings) {
- entityMappings.getEntities().remove(this.resourceTypeMapping);
- }
-
- public XmlEntity addToResourceModel(XmlEntityMappings entityMappings) {
- XmlEntity entity = OrmFactory.eINSTANCE.createXmlEntity();
- getPersistentType().initialize(entity);
- entityMappings.getEntities().add(entity);
- return entity;
- }
-
-
- // **************** validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
-
- this.table.validate(messages);
- this.validateId(messages);
- this.validateGenerators(messages);
- this.validateQueries(messages);
-
- for (Iterator<OrmSecondaryTable> stream = this.secondaryTables(); stream.hasNext(); ) {
- stream.next().validate(messages);
- }
-
- for (Iterator<OrmAttributeOverride> stream = this.attributeOverrides(); stream.hasNext(); ) {
- stream.next().validate(messages);
- }
-
- for (Iterator<OrmAssociationOverride> stream = this.associationOverrides(); stream.hasNext(); ) {
- stream.next().validate(messages);
- }
- }
-
- protected void validateId(List<IMessage> messages) {
- if (this.entityHasNoId()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ENTITY_NO_ID,
- new String[] {this.getName()},
- this,
- this.getValidationTextRange()
- )
- );
- }
- }
-
- private boolean entityHasNoId() {
- return ! this.entityHasId();
- }
-
- private boolean entityHasId() {
- for (Iterator<PersistentAttribute> stream = this.getPersistentType().allAttributes(); stream.hasNext(); ) {
- if (stream.next().isIdAttribute()) {
- return true;
- }
- }
- return false;
- }
-
- protected void validateGenerators(List<IMessage> messages) {
- for (Iterator<OrmGenerator> localGenerators = this.generators(); localGenerators.hasNext(); ) {
- OrmGenerator localGenerator = localGenerators.next();
- for (Iterator<Generator> globalGenerators = this.getPersistenceUnit().allGenerators(); 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 void validateQueries(List<IMessage> messages) {
- for (Iterator<OrmQuery> localQueries = this.queries(); localQueries.hasNext(); ) {
- OrmQuery localQuery = localQueries.next();
- for (Iterator<Query> globalQueries = this.getPersistenceUnit().allQueries(); 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())
- );
- }
- }
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(getName());
- }
-
-
- class PrimaryKeyJoinColumnOwner implements OrmBaseJoinColumn.Owner
- {
- public TypeMapping getTypeMapping() {
- return GenericOrmEntity.this;
- }
-
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- return GenericOrmEntity.this.getDbTable(tableName);
- }
-
- public org.eclipse.jpt.db.Table getReferencedColumnDbTable() {
- Entity parentEntity = GenericOrmEntity.this.getParentEntity();
- return (parentEntity == null) ? null : parentEntity.getPrimaryDbTable();
- }
-
- public int joinColumnsSize() {
- return GenericOrmEntity.this.primaryKeyJoinColumnsSize();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return GenericOrmEntity.this.defaultPrimaryKeyJoinColumns.contains(joinColumn);
- }
-
- public String getDefaultColumnName() {
- if (joinColumnsSize() != 1) {
- return null;
- }
- return GenericOrmEntity.this.getParentEntity().getPrimaryKeyColumnName();
- }
-
- public TextRange getValidationTextRange() {
- // TODO Auto-generated method stub
- return null;
- }
- }
-
- class AttributeOverrideOwner implements AttributeOverride.Owner {
-
- public ColumnMapping getColumnMapping(String attributeName) {
- if (attributeName == null) {
- return null;
- }
- for (Iterator<PersistentAttribute> stream = getPersistentType().allAttributes(); stream.hasNext();) {
- PersistentAttribute persAttribute = stream.next();
- if (attributeName.equals(persAttribute.getName())) {
- if (persAttribute.getMapping() instanceof ColumnMapping) {
- return (ColumnMapping) persAttribute.getMapping();
- }
- }
- }
- return null;
- }
-
- public boolean isVirtual(BaseOverride override) {
- return GenericOrmEntity.this.virtualAttributeOverrides.contains(override);
- }
-
- public BaseOverride setVirtual(boolean virtual, BaseOverride override) {
- return GenericOrmEntity.this.setAttributeOverrideVirtual(virtual, (OrmAttributeOverride) override);
- }
-
- public TypeMapping getTypeMapping() {
- return GenericOrmEntity.this;
- }
-
- }
-
- class AssociationOverrideOwner implements AssociationOverride.Owner {
-
- public RelationshipMapping getRelationshipMapping(String attributeName) {
- if (attributeName == null) {
- return null;
- }
- for (Iterator<PersistentAttribute> stream = getPersistentType().allAttributes(); stream.hasNext();) {
- PersistentAttribute persAttribute = stream.next();
- if (attributeName.equals(persAttribute.getName())) {
- if (persAttribute.getMapping() instanceof RelationshipMapping) {
- return (RelationshipMapping) persAttribute.getMapping();
- }
- }
- }
- return null;
- }
-
- public boolean isVirtual(BaseOverride override) {
- return GenericOrmEntity.this.virtualAssociationOverrides.contains(override);
- }
-
- public BaseOverride setVirtual(boolean virtual, BaseOverride override) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public TypeMapping getTypeMapping() {
- return GenericOrmEntity.this;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEnumeratedConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEnumeratedConverter.java
deleted file mode 100644
index 4c0c73eca1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEnumeratedConverter.java
+++ /dev/null
@@ -1,95 +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.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.AbstractXmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericOrmEnumeratedConverter extends AbstractXmlContextNode
- implements EnumeratedConverter, OrmConverter
-{
- private EnumType specifiedEnumType;
-
- private XmlConvertibleMapping resourceConvertibleMapping;
-
- public GenericOrmEnumeratedConverter(OrmAttributeMapping parent, XmlBasic resourceBasic) {
- super(parent);
- this.initialize(resourceBasic);
- }
-
- @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/context/orm/GenericOrmGeneratedValue.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmGeneratedValue.java
deleted file mode 100644
index 9d12d53699..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmGeneratedValue.java
+++ /dev/null
@@ -1,132 +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.orm;
-
-import org.eclipse.jpt.core.context.GeneratedValue;
-import org.eclipse.jpt.core.context.GenerationType;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmGeneratedValue;
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericOrmGeneratedValue extends AbstractXmlContextNode implements OrmGeneratedValue
-{
-
- protected GenerationType specifiedStrategy;
-
- protected String specifiedGenerator;
- protected String defaultGenerator;
-
- protected XmlGeneratedValue resourceGeneratedValue;
-
- public GenericOrmGeneratedValue(XmlContextNode parent, XmlGeneratedValue resourceGeneratedValue) {
- super(parent);
- this.initialize(resourceGeneratedValue);
- }
-
- @Override
- public XmlContextNode getParent() {
- return (XmlContextNode) super.getParent();
- }
-
- public GenerationType getStrategy() {
- return (this.getSpecifiedStrategy() == null) ? this.getDefaultStrategy() : this.getSpecifiedStrategy();
- }
-
- public GenerationType getDefaultStrategy() {
- return GeneratedValue.DEFAULT_STRATEGY;
- }
-
- public GenerationType getSpecifiedStrategy() {
- return this.specifiedStrategy;
- }
-
- public void setSpecifiedStrategy(GenerationType newSpecifiedStrategy) {
- GenerationType oldStrategy = this.specifiedStrategy;
- this.specifiedStrategy = newSpecifiedStrategy;
- this.resourceGeneratedValue.setStrategy(GenerationType.toOrmResourceModel(newSpecifiedStrategy));
- firePropertyChanged(SPECIFIED_STRATEGY_PROPERTY, oldStrategy, newSpecifiedStrategy);
- }
-
- protected void setSpecifiedStrategy_(GenerationType newSpecifiedStrategy) {
- GenerationType oldStrategy = this.specifiedStrategy;
- this.specifiedStrategy = newSpecifiedStrategy;
- firePropertyChanged(SPECIFIED_STRATEGY_PROPERTY, oldStrategy, newSpecifiedStrategy);
- }
-
- public String getGenerator() {
- return (this.getSpecifiedGenerator() == null) ? this.getDefaultGenerator() : this.getSpecifiedGenerator();
- }
-
- public String getDefaultGenerator() {
- return this.defaultGenerator;
- }
-
- protected void setDefaultGenerator(String newDefaultGenerator) {
- String oldGenerator = this.defaultGenerator;
- this.defaultGenerator = newDefaultGenerator;
- firePropertyChanged(DEFAULT_GENERATOR_PROPERTY, oldGenerator, newDefaultGenerator);
- }
-
- public String getSpecifiedGenerator() {
- return this.specifiedGenerator;
- }
-
- public void setSpecifiedGenerator(String newSpecifiedGenerator) {
- String oldGenerator = this.specifiedGenerator;
- this.specifiedGenerator = newSpecifiedGenerator;
- this.resourceGeneratedValue.setGenerator(newSpecifiedGenerator);
- firePropertyChanged(SPECIFIED_GENERATOR_PROPERTY, oldGenerator, newSpecifiedGenerator);
- }
-
- protected void setSpecifiedGenerator_(String newSpecifiedGenerator) {
- String oldGenerator = this.specifiedGenerator;
- this.specifiedGenerator = newSpecifiedGenerator;
- firePropertyChanged(SPECIFIED_GENERATOR_PROPERTY, oldGenerator, newSpecifiedGenerator);
- }
-
- public TextRange getGeneratorTextRange() {
- TextRange textRange = this.resourceGeneratedValue.getGeneratorTextRange();
- return textRange != null ? textRange : getValidationTextRange();
- }
-
-
- // ********** resource model -> java context model **********
-
- protected void initialize(XmlGeneratedValue resourceGeneratedValue) {
- this.resourceGeneratedValue = resourceGeneratedValue;
- this.specifiedStrategy = this.strategy(resourceGeneratedValue);
- this.specifiedGenerator = this.generator(resourceGeneratedValue);
- //TODO
- this.defaultGenerator = null;
- }
-
- public void update(XmlGeneratedValue resourceGeneratedValue) {
- this.resourceGeneratedValue = resourceGeneratedValue;
- this.setSpecifiedStrategy_(this.strategy(resourceGeneratedValue));
- this.setSpecifiedGenerator_(this.generator(resourceGeneratedValue));
- //TODO
- this.setDefaultGenerator(null);
- }
-
- protected GenerationType strategy(XmlGeneratedValue resourceGeneratedValue) {
- return GenerationType.fromOrmResourceModel(resourceGeneratedValue.getStrategy());
- }
-
- protected String generator(XmlGeneratedValue resourceGeneratedValue) {
- return resourceGeneratedValue.getGenerator();
- }
-
- public TextRange getValidationTextRange() {
- TextRange validationTextRange = this.resourceGeneratedValue.getValidationTextRange();
- return validationTextRange != null ? validationTextRange : getParent().getValidationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmIdMapping.java
deleted file mode 100644
index 2c289c8832..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmIdMapping.java
+++ /dev/null
@@ -1,521 +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.context.orm;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.Generator;
-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.OrmGenerator;
-import org.eclipse.jpt.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmSequenceGenerator;
-import org.eclipse.jpt.core.context.orm.OrmTableGenerator;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-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.db.Table;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- *
- */
-public class GenericOrmIdMapping
- extends AbstractOrmAttributeMapping<XmlId>
- implements OrmIdMapping
-{
- protected final OrmColumn column;
-
- protected OrmGeneratedValue generatedValue;
-
- protected OrmConverter defaultConverter;
- protected OrmConverter specifiedConverter;
-
- protected OrmTableGenerator tableGenerator;
- protected OrmSequenceGenerator sequenceGenerator;
-
-
- public GenericOrmIdMapping(OrmPersistentAttribute parent) {
- super(parent);
- this.column = getJpaFactory().buildOrmColumn(this, this);
- }
-
-
- 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 getSpecifiedConverter() == null ? getDefaultConverter() : getSpecifiedConverter();
- }
-
- public OrmConverter getDefaultConverter() {
- return this.defaultConverter;
- }
-
- public OrmConverter getSpecifiedConverter() {
- return this.specifiedConverter;
- }
-
- protected String getSpecifedConverterType() {
- if (this.specifiedConverter == null) {
- return Converter.NO_CONVERTER;
- }
- return this.specifiedConverter.getType();
- }
-
- public void setSpecifiedConverter(String converterType) {
- if (getSpecifedConverterType() == converterType) {
- return;
- }
- OrmConverter oldConverter = this.specifiedConverter;
- OrmConverter newConverter = buildSpecifiedConverter(converterType);
- this.specifiedConverter = null;
- if (oldConverter != null) {
- oldConverter.removeFromResourceModel();
- }
- this.specifiedConverter = newConverter;
- if (newConverter != null) {
- newConverter.addToResourceModel();
- }
- firePropertyChanged(SPECIFIED_CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- protected void setSpecifiedConverter(OrmConverter newConverter) {
- OrmConverter oldConverter = this.specifiedConverter;
- this.specifiedConverter = newConverter;
- firePropertyChanged(SPECIFIED_CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- public OrmGeneratedValue addGeneratedValue() {
- if (getGeneratedValue() != null) {
- throw new IllegalStateException("gemeratedValue already exists"); //$NON-NLS-1$
- }
- XmlGeneratedValue resourceGeneratedValue = OrmFactory.eINSTANCE.createXmlGeneratedValueImpl();
- 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 OrmSequenceGenerator addSequenceGenerator() {
- if (getSequenceGenerator() != null) {
- throw new IllegalStateException("sequenceGenerator already exists"); //$NON-NLS-1$
- }
- XmlSequenceGenerator resourceSequenceGenerator = OrmFactory.eINSTANCE.createXmlSequenceGeneratorImpl();
- this.sequenceGenerator = buildSequenceGenerator(resourceSequenceGenerator);
- this.resourceAttributeMapping.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.resourceAttributeMapping.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 = OrmFactory.eINSTANCE.createXmlTableGeneratorImpl();
- this.tableGenerator = buildTableGenerator(resourceTableGenerator);
- this.resourceAttributeMapping.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.resourceAttributeMapping.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 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);
- }
- }
-
- @Override
- public String getPrimaryKeyColumnName() {
- return this.getColumn().getName();
- }
-
- @Override
- public boolean isOverridableAttributeMapping() {
- return true;
- }
-
- @Override
- public boolean isIdMapping() {
- return true;
- }
-
- public XmlId addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlId id = OrmFactory.eINSTANCE.createXmlIdImpl();
- getPersistentAttribute().initialize(id);
- typeMapping.getAttributes().getIds().add(id);
- return id;
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- typeMapping.getAttributes().getIds().remove(this.resourceAttributeMapping);
- }
-
- public Table getDbTable(String tableName) {
- return getTypeMapping().getDbTable(tableName);
- }
-
- public String getDefaultColumnName() {
- return getAttributeName();
- }
-
- public String getDefaultTableName() {
- return getTypeMapping().getPrimaryTableName();
- }
-
- @Override
- public void initialize(XmlAttributeMapping attributeMapping) {
- super.initialize(attributeMapping);
- this.column.initialize(this.resourceAttributeMapping.getColumn());
- this.initializeSequenceGenerator();
- this.initializeTableGenerator();
- this.initializeGeneratedValue();
- this.defaultConverter = new GenericOrmNullConverter(this);
- this.specifiedConverter = this.buildSpecifiedConverter(this.specifiedConverterType());
- }
-
- protected void initializeSequenceGenerator() {
- if (this.resourceAttributeMapping.getSequenceGenerator() != null) {
- this.sequenceGenerator = buildSequenceGenerator(this.resourceAttributeMapping.getSequenceGenerator());
- }
- }
-
- protected OrmSequenceGenerator buildSequenceGenerator(XmlSequenceGenerator resourceSequenceGenerator) {
- return getJpaFactory().buildOrmSequenceGenerator(this, resourceSequenceGenerator);
- }
-
- protected void initializeTableGenerator() {
- if (this.resourceAttributeMapping.getTableGenerator() != null) {
- this.tableGenerator = buildTableGenerator(this.resourceAttributeMapping.getTableGenerator());
- }
- }
-
- protected OrmTableGenerator buildTableGenerator(XmlTableGenerator resourceTableGenerator) {
- return getJpaFactory().buildOrmTableGenerator(this, resourceTableGenerator);
- }
-
- protected void initializeGeneratedValue() {
- if (this.resourceAttributeMapping.getGeneratedValue() != null) {
- this.generatedValue = buildGeneratedValue(this.resourceAttributeMapping.getGeneratedValue());
- }
- }
-
- protected OrmGeneratedValue buildGeneratedValue(XmlGeneratedValue resourceGeneratedValue) {
- return getJpaFactory().buildOrmGeneratedValue(this, resourceGeneratedValue);
- }
- @Override
- public void update() {
- super.update();
- this.column.update(this.resourceAttributeMapping.getColumn());
- this.updateSequenceGenerator();
- this.updateTableGenerator();
- this.updateGeneratedValue();
- if (specifiedConverterType() == getSpecifedConverterType()) {
- getSpecifiedConverter().update();
- }
- else {
- setSpecifiedConverter(buildSpecifiedConverter(specifiedConverterType()));
- }
- }
-
- protected void updateSequenceGenerator() {
- if (this.resourceAttributeMapping.getSequenceGenerator() == null) {
- if (getSequenceGenerator() != null) {
- setSequenceGenerator(null);
- }
- }
- else {
- if (getSequenceGenerator() == null) {
- setSequenceGenerator(buildSequenceGenerator(this.resourceAttributeMapping.getSequenceGenerator()));
- }
- else {
- getSequenceGenerator().update(this.resourceAttributeMapping.getSequenceGenerator());
- }
- }
- }
-
- protected void updateTableGenerator() {
- if (this.resourceAttributeMapping.getTableGenerator() == null) {
- if (getTableGenerator() != null) {
- setTableGenerator(null);
- }
- }
- else {
- if (getTableGenerator() == null) {
- setTableGenerator(buildTableGenerator(this.resourceAttributeMapping.getTableGenerator()));
- }
- else {
- getTableGenerator().update(this.resourceAttributeMapping.getTableGenerator());
- }
- }
- }
-
- 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 buildSpecifiedConverter(String converterType) {
- if (converterType == Converter.TEMPORAL_CONVERTER) {
- return new GenericOrmTemporalConverter(this, this.resourceAttributeMapping);
- }
- return null;
- }
-
- protected String specifiedConverterType() {
- if (this.resourceAttributeMapping.getTemporal() != null) {
- return Converter.TEMPORAL_CONVERTER;
- }
-
- return null;
- }
-
- //***************** XmlColumn.Owner implementation ****************
-
- public XmlColumn getResourceColumn() {
- return this.resourceAttributeMapping.getColumn();
- }
-
- public void addResourceColumn() {
- this.resourceAttributeMapping.setColumn(OrmFactory.eINSTANCE.createXmlColumnImpl());
- }
-
- public void removeResourceColumn() {
- this.resourceAttributeMapping.setColumn(null);
- }
-
- // ****************** validation ****************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
-
- if (this.connectionProfileIsActive() && this.ownerIsEntity()) {
- this.validateColumn(messages);
- }
- this.validateGeneratedValue(messages);
- this.validateGenerators(messages);
- }
-
- protected void validateColumn(List<IMessage> messages) {
- OrmPersistentAttribute pa = this.getPersistentAttribute();
- String tableName = this.column.getTable();
- if (this.getTypeMapping().tableNameIsInvalid(tableName)) {
- if (pa.isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_TABLE,
- new String[] {pa.getName(), tableName, this.column.getName()},
- this.column,
- this.column.getTableTextRange()
- )
- );
- } else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_TABLE,
- new String[] {tableName, this.column.getName()},
- this.column,
- this.column.getTableTextRange()
- )
- );
- }
- return;
- }
-
- if ( ! this.column.isResolved()) {
- if (pa.isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME,
- new String[] {pa.getName(), this.column.getName()},
- this.column,
- this.column.getNameTextRange()
- )
- );
- } else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {this.column.getName()},
- this.column,
- this.column.getNameTextRange()
- )
- );
- }
- }
- }
-
- protected void validateGeneratedValue(List<IMessage> messages) {
- if (this.generatedValue == null) {
- return;
- }
-
- String generatorName = this.generatedValue.getGenerator();
- if (generatorName == null) {
- return;
- }
-
- for (Iterator<Generator> stream = this.getPersistenceUnit().allGenerators(); stream.hasNext(); ) {
- if (generatorName.equals(stream.next().getName())) {
- return;
- }
- }
-
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ID_MAPPING_UNRESOLVED_GENERATOR_NAME,
- new String[] {generatorName},
- this,
- this.generatedValue.getGeneratorTextRange())
- );
- }
-
- protected void validateGenerators(List<IMessage> messages) {
- for (Iterator<OrmGenerator> localGenerators = this.generators(); localGenerators.hasNext(); ) {
- OrmGenerator localGenerator = localGenerators.next();
- if (localGenerator.isVirtual()) {
- continue;
- }
- for (Iterator<Generator> globalGenerators = this.getPersistenceUnit().allGenerators(); 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())
- );
- }
- }
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinColumn.java
deleted file mode 100644
index 25af2966f1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinColumn.java
+++ /dev/null
@@ -1,203 +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.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.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipMapping;
-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.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;
- }
-
- protected 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);
- }
-
- protected String buildDefaultReferencedColumnName() {
- return MappingTools.buildJoinColumnDefaultReferencedColumnName(this.getOwner());
- }
-
- @Override
- protected String defaultTable() {
- RelationshipMapping relationshipMapping = getOwner().getRelationshipMapping();
- if (relationshipMapping == null) {
- return null;
- }
- if (!relationshipMapping.isRelationshipOwner()) {
- return null;
- }
- return super.defaultTable();
- }
-
-
- //******************* validation ***********************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- if ( ! this.isResolved()) {
- messages.add(this.buildUnresolvedMessage());
- }
- }
-
- protected IMessage buildUnresolvedMessage() {
- OrmRelationshipMapping mapping = (OrmRelationshipMapping) this.getOwner().getRelationshipMapping();
- return mapping.getPersistentAttribute().isVirtual() ? this.buildVirtualUnresolvedMessage(mapping) : this.buildNonVirtualUnresolvedMessage();
- }
-
- protected IMessage buildVirtualUnresolvedMessage(OrmRelationshipMapping mapping) {
- return this.buildMessage(
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME,
- new String[] {mapping.getName(), this.getName()}
- );
- }
-
- protected IMessage buildNonVirtualUnresolvedMessage() {
- return this.buildMessage(
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {this.getName()}
- );
- }
-
- protected IMessage buildMessage(String msgID, String[] parms) {
- return DefaultJpaValidationMessages.buildMessage(IMessage.HIGH_SEVERITY, msgID, parms, this, this.getNameTextRange());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinTable.java
deleted file mode 100644
index dadca85f25..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinTable.java
+++ /dev/null
@@ -1,727 +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.orm;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.AttributeMapping;
-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.NonOwningMapping;
-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.OrmRelationshipMapping;
-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.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping;
-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.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- *
- */
-public class GenericOrmJoinTable
- extends AbstractOrmTable
- implements OrmJoinTable
-{
-
- protected final List<OrmJoinColumn> specifiedJoinColumns;
- protected OrmJoinColumn defaultJoinColumn;
-
- protected final List<OrmJoinColumn> specifiedInverseJoinColumns;
- protected OrmJoinColumn defaultInverseJoinColumn;
-
- protected XmlRelationshipMapping relationshipMappingResource;
-
-
- public GenericOrmJoinTable(OrmRelationshipMapping parent) {
- super(parent);
- this.specifiedJoinColumns = new ArrayList<OrmJoinColumn>();
- this.specifiedInverseJoinColumns = new ArrayList<OrmJoinColumn>();
- }
-
- @Override
- public OrmRelationshipMapping getParent() {
- return (OrmRelationshipMapping) super.getParent();
- }
-
- public OrmRelationshipMapping getRelationshipMapping() {
- return getParent();
- }
-
- public void initializeFrom(JoinTable oldJoinTable) {
- super.initializeFrom(oldJoinTable);
- int index = 0;
- for (JoinColumn joinColumn : CollectionTools.iterable(oldJoinTable.specifiedJoinColumns())) {
- OrmJoinColumn newJoinColumn = addSpecifiedJoinColumn(index++);
- newJoinColumn.initializeFrom(joinColumn);
- }
- index = 0;
- for (JoinColumn joinColumn : CollectionTools.iterable(oldJoinTable.specifiedInverseJoinColumns())) {
- OrmJoinColumn newJoinColumn = addSpecifiedInverseJoinColumn(index++);
- newJoinColumn.initializeFrom(joinColumn);
- }
- }
-
- //******************* AbstractOrmTable implementation *****************
-
- @Override
- protected String buildDefaultName() {
- return this.getRelationshipMapping().getJoinTableDefaultName();
- }
-
- /**
- * 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.getRelationshipMapping().isRelationshipOwner() ? this.getContextDefaultSchema() : null;
- }
-
- /**
- * if the join table is on the "mappedBy" side, it's bogus;
- * so don't give it a default catalog
- */
- @Override
- protected String buildDefaultCatalog() {
- return this.getRelationshipMapping().isRelationshipOwner() ? this.getContextDefaultCatalog() : null;
- }
-
- @Override
- protected XmlJoinTable getResourceTable() {
- return this.relationshipMappingResource.getJoinTable();
- }
-
- @Override
- protected XmlJoinTable addResourceTable() {
- XmlJoinTable resourceTable = OrmFactory.eINSTANCE.createXmlJoinTableImpl();
- this.relationshipMappingResource.setJoinTable(resourceTable);
- return resourceTable;
- }
-
- @Override
- protected void removeResourceTable() {
- this.relationshipMappingResource.setJoinTable(null);
- }
-
-
- //******************* JoinTable implementation *****************
-
- //****************** join columns **********************
- public ListIterator<OrmJoinColumn> joinColumns() {
- return this.containsSpecifiedJoinColumns() ? this.specifiedJoinColumns() : this.defaultJoinColumns();
- }
-
- public int joinColumnsSize() {
- return this.containsSpecifiedJoinColumns() ? this.specifiedJoinColumnsSize() : this.defaultJoinColumnsSize();
- }
-
- public ListIterator<OrmJoinColumn> specifiedJoinColumns() {
- return new CloneListIterator<OrmJoinColumn>(this.specifiedJoinColumns);
- }
-
- public int specifiedJoinColumnsSize() {
- return this.specifiedJoinColumns.size();
- }
-
- 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;
- }
-
- public OrmJoinColumn getDefaultJoinColumn() {
- return this.defaultJoinColumn;
- }
-
- protected void setDefaultJoinColumn(OrmJoinColumn newJoinColumn) {
- OrmJoinColumn oldJoinColumn = this.defaultJoinColumn;
- this.defaultJoinColumn = newJoinColumn;
- firePropertyChanged(JoinTable.DEFAULT_JOIN_COLUMN, oldJoinColumn, newJoinColumn);
- }
-
- public boolean containsSpecifiedJoinColumns() {
- return !this.specifiedJoinColumns.isEmpty();
- }
-
- public OrmJoinColumn addSpecifiedJoinColumn(int index) {
- if (getResourceTable() == null) {
- addResourceTable();
- }
- XmlJoinColumn resourceJoinColumn = OrmFactory.eINSTANCE.createXmlJoinColumnImpl();
- OrmJoinColumn contextJoinColumn = buildJoinColumn(resourceJoinColumn);
- this.specifiedJoinColumns.add(index, contextJoinColumn);
- this.getResourceTable().getJoinColumns().add(index, resourceJoinColumn);
- this.fireItemAdded(JoinTable.SPECIFIED_JOIN_COLUMNS_LIST, index, contextJoinColumn);
- return contextJoinColumn;
- }
-
- protected void addSpecifiedJoinColumn(int index, OrmJoinColumn joinColumn) {
- addItemToList(index, joinColumn, this.specifiedJoinColumns, JoinTable.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 (!containsSpecifiedJoinColumns()) {
- //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(null);
- }
- this.getResourceTable().getJoinColumns().remove(index);
- fireItemRemoved(JoinTable.SPECIFIED_JOIN_COLUMNS_LIST, index, removedJoinColumn);
- if (this.defaultJoinColumn != null) {
- //fire change notification if a defaultJoinColumn was created above
- this.firePropertyChanged(JoinTable.DEFAULT_JOIN_COLUMN, null, this.defaultJoinColumn);
- }
- }
-
- protected void removeSpecifiedJoinColumn_(OrmJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.specifiedJoinColumns, JoinTable.SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedJoinColumns, targetIndex, sourceIndex);
- this.getResourceTable().getJoinColumns().move(targetIndex, sourceIndex);
- fireItemMoved(JoinTable.SPECIFIED_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
-
- //****************** inverse join columns **********************
-
- public ListIterator<OrmJoinColumn> inverseJoinColumns() {
- return this.containsSpecifiedInverseJoinColumns() ? this.specifiedInverseJoinColumns() : this.defaultInverseJoinColumns();
- }
-
- public int inverseJoinColumnsSize() {
- return this.containsSpecifiedInverseJoinColumns() ? this.specifiedInverseJoinColumnsSize() : this.defaultInverseJoinColumnsSize();
- }
-
- public ListIterator<OrmJoinColumn> specifiedInverseJoinColumns() {
- return new CloneListIterator<OrmJoinColumn>(this.specifiedInverseJoinColumns);
- }
-
- public int specifiedInverseJoinColumnsSize() {
- return this.specifiedInverseJoinColumns.size();
- }
-
- 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;
- }
-
- public OrmJoinColumn getDefaultInverseJoinColumn() {
- return this.defaultInverseJoinColumn;
- }
-
- protected void setDefaultInverseJoinColumn(OrmJoinColumn newJoinColumn) {
- OrmJoinColumn oldJoinColumn = this.defaultInverseJoinColumn;
- this.defaultInverseJoinColumn = newJoinColumn;
- firePropertyChanged(JoinTable.DEFAULT_INVERSE_JOIN_COLUMN, oldJoinColumn, newJoinColumn);
- }
-
- public boolean containsSpecifiedInverseJoinColumns() {
- return !this.specifiedInverseJoinColumns.isEmpty();
- }
-
- public OrmJoinColumn addSpecifiedInverseJoinColumn(int index) {
- if (getResourceTable() == null) {
- addResourceTable();
- }
- XmlJoinColumn resourceJoinColumn = OrmFactory.eINSTANCE.createXmlJoinColumnImpl();
- OrmJoinColumn contextJoinColumn = buildInverseJoinColumn(resourceJoinColumn);
- this.specifiedInverseJoinColumns.add(index, contextJoinColumn);
- this.getResourceTable().getInverseJoinColumns().add(index, resourceJoinColumn);
- this.fireItemAdded(JoinTable.SPECIFIED_INVERSE_JOIN_COLUMNS_LIST, index, contextJoinColumn);
- return contextJoinColumn;
- }
-
- protected void addSpecifiedInverseJoinColumn(int index, OrmJoinColumn joinColumn) {
- addItemToList(index, joinColumn, this.specifiedInverseJoinColumns, JoinTable.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 (!containsSpecifiedInverseJoinColumns()) {
- //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 = buildInverseJoinColumn(null);
- }
- this.getResourceTable().getInverseJoinColumns().remove(index);
- fireItemRemoved(JoinTable.SPECIFIED_INVERSE_JOIN_COLUMNS_LIST, index, removedJoinColumn);
- if (this.defaultInverseJoinColumn != null) {
- //fire change notification if a defaultJoinColumn was created above
- this.firePropertyChanged(JoinTable.DEFAULT_INVERSE_JOIN_COLUMN, null, this.defaultInverseJoinColumn);
- }
- }
-
- protected void removeSpecifiedInverseJoinColumn_(OrmJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.specifiedInverseJoinColumns, JoinTable.SPECIFIED_INVERSE_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedInverseJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedInverseJoinColumns, targetIndex, sourceIndex);
- this.getResourceTable().getInverseJoinColumns().move(targetIndex, sourceIndex);
- fireItemMoved(JoinTable.SPECIFIED_INVERSE_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
-
- // ****************** OrmJoinTable implementation *****************
- public boolean isSpecified() {
- return this.getResourceTable() != null && getResourceTable().isSpecified();
- }
-
- public void initialize(XmlRelationshipMapping relationshipMapping) {
- this.relationshipMappingResource = relationshipMapping;
- this.initialize(this.getResourceTable());
- }
-
- public void update() {
- this.update(this.getResourceTable());
- }
-
- protected void initialize(XmlJoinTable joinTable) {
- super.initialize(joinTable);
- this.initializeSpecifiedJoinColumns(joinTable);
- this.initializeDefaultJoinColumn();
- this.initializeSpecifiedInverseJoinColumns(joinTable);
- this.initializeDefaultInverseJoinColumn();
- }
-
- protected void initializeSpecifiedJoinColumns(XmlJoinTable joinTable) {
- if (joinTable == null) {
- return;
- }
- for (XmlJoinColumn joinColumn : joinTable.getJoinColumns()) {
- this.specifiedJoinColumns.add(buildJoinColumn(joinColumn));
- }
- }
-
- protected void initializeDefaultJoinColumn() {
- if (!shouldBuildDefaultJoinColumn()) {
- return;
- }
- this.defaultJoinColumn = buildJoinColumn(null);
- }
-
- protected void initializeSpecifiedInverseJoinColumns(XmlJoinTable joinTable) {
- if (joinTable == null) {
- return;
- }
- for (XmlJoinColumn joinColumn : joinTable.getInverseJoinColumns()) {
- this.specifiedInverseJoinColumns.add(buildInverseJoinColumn(joinColumn));
- }
- }
-
- protected void initializeDefaultInverseJoinColumn() {
- if (!shouldBuildDefaultInverseJoinColumn()) {
- return;
- }
- this.defaultInverseJoinColumn = buildInverseJoinColumn(null);
- }
-
- protected void update(XmlJoinTable joinTable) {
- super.update(joinTable);
- this.updateSpecifiedJoinColumns(joinTable);
- this.updateDefaultJoinColumn();
- this.updateSpecifiedInverseJoinColumns(joinTable);
- this.updateDefaultInverseJoinColumn();
- }
-
- protected void updateSpecifiedJoinColumns(XmlJoinTable joinTable) {
- ListIterator<OrmJoinColumn> contextJoinColumns = specifiedJoinColumns();
- ListIterator<XmlJoinColumn> resourceJoinColumns = EmptyListIterator.instance();
- if (joinTable != null) {
- resourceJoinColumns = new CloneListIterator<XmlJoinColumn>(joinTable.getJoinColumns());//prevent ConcurrentModificiationException
- }
-
- while (contextJoinColumns.hasNext()) {
- OrmJoinColumn joinColumn = contextJoinColumns.next();
- if (resourceJoinColumns.hasNext()) {
- joinColumn.update(resourceJoinColumns.next());
- }
- else {
- removeSpecifiedJoinColumn_(joinColumn);
- }
- }
-
- while (resourceJoinColumns.hasNext()) {
- addSpecifiedJoinColumn(buildJoinColumn(resourceJoinColumns.next()));
- }
- }
-
- protected boolean shouldBuildDefaultJoinColumn() {
- return !containsSpecifiedJoinColumns();
- }
-
- protected void updateDefaultJoinColumn() {
- if (!shouldBuildDefaultJoinColumn()) {
- setDefaultJoinColumn(null);
- return;
- }
- if (getDefaultJoinColumn() == null) {
- this.setDefaultJoinColumn(buildJoinColumn(null));
- }
- else {
- this.defaultJoinColumn.update(null);
- }
- }
-
- protected void updateSpecifiedInverseJoinColumns(XmlJoinTable joinTable) {
- ListIterator<OrmJoinColumn> contextJoinColumns = specifiedInverseJoinColumns();
- ListIterator<XmlJoinColumn> resourceJoinColumns = EmptyListIterator.instance();
- if (joinTable != null) {
- resourceJoinColumns = new CloneListIterator<XmlJoinColumn>(joinTable.getInverseJoinColumns());//prevent ConcurrentModificiationException
- }
-
- while (contextJoinColumns.hasNext()) {
- OrmJoinColumn joinColumn = contextJoinColumns.next();
- if (resourceJoinColumns.hasNext()) {
- joinColumn.update(resourceJoinColumns.next());
- }
- else {
- removeSpecifiedInverseJoinColumn_(joinColumn);
- }
- }
-
- while (resourceJoinColumns.hasNext()) {
- addSpecifiedInverseJoinColumn(buildInverseJoinColumn(resourceJoinColumns.next()));
- }
- }
-
- protected boolean shouldBuildDefaultInverseJoinColumn() {
- return !containsSpecifiedInverseJoinColumns();
- }
-
- protected void updateDefaultInverseJoinColumn() {
- if (!shouldBuildDefaultInverseJoinColumn()) {
- setDefaultInverseJoinColumn(null);
- return;
- }
- if (getDefaultInverseJoinColumn() == null) {
- this.setDefaultInverseJoinColumn(buildInverseJoinColumn(null));
- }
- else {
- this.defaultInverseJoinColumn.update(null);
- }
- }
-
- protected OrmJoinColumn buildJoinColumn(XmlJoinColumn resourceJoinColumn) {
- return getJpaFactory().buildOrmJoinColumn(this, new JoinColumnOwner(), resourceJoinColumn);
- }
-
- protected OrmJoinColumn buildInverseJoinColumn(XmlJoinColumn resourceJoinColumn) {
- return getJpaFactory().buildOrmJoinColumn(this, new InverseJoinColumnOwner(), resourceJoinColumn);
- }
-
-
- // ************************** validation ***********************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- if (this.connectionProfileIsActive()) {
- this.validateAgainstDatabase(messages);
- }
- }
-
- protected void validateAgainstDatabase(List<IMessage> messages) {
- OrmRelationshipMapping mapping = this.getRelationshipMapping();
-
- if ( ! this.hasResolvedCatalog()) {
- if (mapping.getPersistentAttribute().isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_CATALOG,
- new String[] {mapping.getName(), this.getCatalog(), this.getName()},
- this,
- this.getCatalogTextRange()
- )
- );
-
- } else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_TABLE_UNRESOLVED_CATALOG,
- new String[] {this.getCatalog(), this.getName()},
- this,
- this.getCatalogTextRange()
- )
- );
- }
- return;
- }
-
- if ( ! this.hasResolvedSchema()) {
- if (mapping.getPersistentAttribute().isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_SCHEMA,
- new String[] {mapping.getName(), this.getSchema(), this.getName()},
- this,
- this.getSchemaTextRange()
- )
- );
- } else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_TABLE_UNRESOLVED_SCHEMA,
- new String[] {this.getSchema(), this.getName()},
- this,
- this.getSchemaTextRange()
- )
- );
- }
- return;
- }
-
- if ( ! this.isResolved()) {
- if (mapping.getPersistentAttribute().isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_NAME,
- new String[] {mapping.getName(), this.getName()},
- this,
- this.getNameTextRange()
- )
- );
- } else {
- String attributeName = mapping.getPersistentAttribute().getName();
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_TABLE_CANNOT_BE_DETERMINED,
- new String[] {attributeName},
- this,
- this.getNameTextRange()
- )
- );
- }
- return;
- }
-
- this.validateJoinColumns(this.joinColumns(), messages);
- this.validateJoinColumns(this.inverseJoinColumns(), messages);
- }
-
- protected void validateJoinColumns(Iterator<OrmJoinColumn> joinColumns, List<IMessage> messages) {
- while (joinColumns.hasNext()) {
- joinColumns.next().validate(messages);
- }
- }
-
- /**
- * just a little common behavior
- */
- abstract class AbstractJoinColumnOwner implements OrmJoinColumn.Owner
- {
- AbstractJoinColumnOwner() {
- super();
- }
-
- public TypeMapping getTypeMapping() {
- return getRelationshipMapping().getTypeMapping();
- }
-
- public RelationshipMapping getRelationshipMapping() {
- return GenericOrmJoinTable.this.getRelationshipMapping();
- }
-
- /**
- * 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 join table itself
- */
- public boolean tableIsAllowed() {
- return false;
- }
-
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- if (GenericOrmJoinTable.this.getName() == null) {
- return null;
- }
- return (GenericOrmJoinTable.this.getName().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();
- }
- }
-
-
- /**
- * owner for "forward-pointer" JoinColumns;
- * these point at the target/inverse entity
- */
- class InverseJoinColumnOwner extends AbstractJoinColumnOwner
- {
- public InverseJoinColumnOwner() {
- super();
- }
-
- public Entity getTargetEntity() {
- return GenericOrmJoinTable.this.getRelationshipMapping().getResolvedTargetEntity();
- }
-
- public String getAttributeName() {
- return GenericOrmJoinTable.this.getRelationshipMapping().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 targetEntity = getTargetEntity();
- return (targetEntity == null) ? null : targetEntity.getDbTable(tableName);
- }
-
- public org.eclipse.jpt.db.Table getReferencedColumnDbTable() {
- Entity targetEntity = getTargetEntity();
- return (targetEntity == null) ? null : targetEntity.getPrimaryDbTable();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return GenericOrmJoinTable.this.defaultInverseJoinColumn == joinColumn;
- }
-
- public String getDefaultColumnName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public int joinColumnsSize() {
- return GenericOrmJoinTable.this.inverseJoinColumnsSize();
- }
-
- }
-
-
- /**
- * owner for "back-pointer" JoinColumns;
- * these point at the source/owning entity
- */
- class JoinColumnOwner extends AbstractJoinColumnOwner
- {
- public JoinColumnOwner() {
- super();
- }
-
- public Entity getTargetEntity() {
- return GenericOrmJoinTable.this.getRelationshipMapping().getEntity();
- }
-
- public String getAttributeName() {
- Entity targetEntity = GenericOrmJoinTable.this.getRelationshipMapping().getResolvedTargetEntity();
- if (targetEntity == null) {
- return null;
- }
- String attributeName = GenericOrmJoinTable.this.getRelationshipMapping().getName();
- for (Iterator<PersistentAttribute> stream = targetEntity.getPersistentType().allAttributes(); stream.hasNext();) {
- PersistentAttribute attribute = stream.next();
- AttributeMapping mapping = attribute.getMapping();
- if (mapping instanceof NonOwningMapping) {
- String mappedBy = ((NonOwningMapping) mapping).getMappedBy();
- if ((mappedBy != null) && mappedBy.equals(attributeName)) {
- return attribute.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 : 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() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public int joinColumnsSize() {
- return GenericOrmJoinTable.this.joinColumnsSize();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmLobConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmLobConverter.java
deleted file mode 100644
index c22256504f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmLobConverter.java
+++ /dev/null
@@ -1,58 +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.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.AbstractXmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericOrmLobConverter extends AbstractXmlContextNode
- implements LobConverter, OrmConverter
-{
- private XmlConvertibleMapping resourceConvertibleMapping;
-
- public GenericOrmLobConverter(OrmAttributeMapping parent, XmlBasic resourceBasic) {
- super(parent);
- this.initialize(resourceBasic);
- }
-
- @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() {
- }
-
- 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/context/orm/GenericOrmManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToManyMapping.java
deleted file mode 100644
index bcca1d98fe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToManyMapping.java
+++ /dev/null
@@ -1,64 +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.context.orm;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.NonOwningMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
-
-public class GenericOrmManyToManyMapping extends AbstractOrmMultiRelationshipMapping<XmlManyToMany>
- implements OrmManyToManyMapping
-{
-
- public GenericOrmManyToManyMapping(OrmPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmManyToManyMapping(this);
- }
-
- @Override
- public void initializeFromOrmNonOwningMapping(NonOwningMapping oldMapping) {
- super.initializeFromOrmNonOwningMapping(oldMapping);
- setMappedBy(oldMapping.getMappedBy());
- }
-
- public int getXmlSequence() {
- return 70;
- }
-
- // ********** NonOwningMapping implementation **********
- public boolean mappedByIsValid(AttributeMapping mappedByMapping) {
- String mappedByKey = mappedByMapping.getKey();
- return (mappedByKey == MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- }
-
- public XmlManyToMany addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlManyToMany manyToMany = OrmFactory.eINSTANCE.createXmlManyToManyImpl();
- getPersistentAttribute().initialize(manyToMany);
- typeMapping.getAttributes().getManyToManys().add(manyToMany);
- return manyToMany;
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- typeMapping.getAttributes().getManyToManys().remove(this.resourceAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToOneMapping.java
deleted file mode 100644
index 96590c6dcc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToOneMapping.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.context.orm;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-
-
-public class GenericOrmManyToOneMapping extends AbstractOrmSingleRelationshipMapping<XmlManyToOne>
- implements OrmManyToOneMapping
-{
-
- public GenericOrmManyToOneMapping(OrmPersistentAttribute parent) {
- super(parent);
- }
-
- public int getXmlSequence() {
- return 40;
- }
-
- public String getKey() {
- return MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- //ManyToOne mapping is always the owning side
- public boolean isRelationshipOwner() {
- return true;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmManyToOneMapping(this);
- }
-
- @Override
- public boolean isOverridableAssociationMapping() {
- return true;
- }
-
- public XmlManyToOne addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlManyToOne manyToOne = OrmFactory.eINSTANCE.createXmlManyToOneImpl();
- getPersistentAttribute().initialize(manyToOne);
- typeMapping.getAttributes().getManyToOnes().add(manyToOne);
- return manyToOne;
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- typeMapping.getAttributes().getManyToOnes().remove(this.resourceAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmMappedSuperclass.java
deleted file mode 100644
index 42638754bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmMappedSuperclass.java
+++ /dev/null
@@ -1,201 +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.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.IdClass;
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.orm.XmlIdClass;
-import org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-
-public class GenericOrmMappedSuperclass extends AbstractOrmTypeMapping<XmlMappedSuperclass>
- implements OrmMappedSuperclass
-{
- protected String idClass;
-
- public GenericOrmMappedSuperclass(OrmPersistentType parent) {
- super(parent);
- }
-
- public JavaMappedSuperclass getJavaMappedSuperclass() {
- if (this.javaPersistentType != null && this.javaPersistentType.getMappingKey() == MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY) {
- return (JavaMappedSuperclass) this.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();
- }
-
-
- public String getIdClass() {
- return this.idClass;
- }
-
- public void setIdClass(String newIdClass) {
- String oldIdClass = this.idClass;
- this.idClass = newIdClass;
- if (oldIdClass != newIdClass) {
- if (this.getResourceIdClass() != null) {
- this.getResourceIdClass().setClassName(newIdClass);
- if (this.getResourceIdClass().isAllFeaturesUnset()) {
- removeResourceIdClass();
- }
- }
- else if (newIdClass != null) {
- addResourceIdClass();
- getResourceIdClass().setClassName(newIdClass);
- }
- }
- firePropertyChanged(IdClass.ID_CLASS_PROPERTY, oldIdClass, newIdClass);
- }
-
- protected void setIdClass_(String newIdClass) {
- String oldIdClass = this.idClass;
- this.idClass = newIdClass;
- firePropertyChanged(IdClass.ID_CLASS_PROPERTY, oldIdClass, newIdClass);
- }
-
- protected XmlIdClass getResourceIdClass() {
- return this.resourceTypeMapping.getIdClass();
- }
-
- protected void addResourceIdClass() {
- this.resourceTypeMapping.setIdClass(OrmFactory.eINSTANCE.createXmlIdClass());
- }
-
- protected void removeResourceIdClass() {
- this.resourceTypeMapping.setIdClass(null);
- }
-
- public String getKey() {
- return MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY;
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return false;
- }
-
- public Iterator<String> associatedTableNamesIncludingInherited() {
- return EmptyIterator.instance();
- }
-
- public Iterator<Table> associatedTables() {
- return EmptyIterator.instance();
- }
-
- public Iterator<Table> associatedTablesIncludingInherited() {
- return EmptyIterator.instance();
- }
-
- @Override
- public Iterator<String> overridableAttributeNames() {
- return this.namesOf(this.overridableAttributes());
- }
-
- @Override
- public Iterator<OrmPersistentAttribute> overridableAttributes() {
- return new FilteringIterator<OrmPersistentAttribute, OrmPersistentAttribute>(this.getPersistentType().attributes()) {
- @Override
- protected boolean accept(OrmPersistentAttribute o) {
- return o.isOverridableAttribute();
- }
- };
- }
-
- @Override
- public Iterator<String> overridableAssociationNames() {
- return this.namesOf(this.overridableAssociations());
- }
-
- @Override
- public Iterator<OrmPersistentAttribute> overridableAssociations() {
- return new FilteringIterator<OrmPersistentAttribute, OrmPersistentAttribute>(this.getPersistentType().attributes()) {
- @Override
- protected boolean accept(OrmPersistentAttribute o) {
- return o.isOverridableAssociation();
- }
- };
- }
-
- private Iterator<String> namesOf(Iterator<OrmPersistentAttribute> attributes) {
- return new TransformationIterator<OrmPersistentAttribute, String>(attributes) {
- @Override
- protected String transform(OrmPersistentAttribute attribute) {
- return attribute.getName();
- }
- };
- }
-
- public int getXmlSequence() {
- return 0;
- }
-
- protected Boolean metadataComplete(XmlMappedSuperclass mappedSuperclass) {
- return mappedSuperclass.getMetadataComplete();
- }
-
- public void removeFromResourceModel(XmlEntityMappings entityMappings) {
- entityMappings.getMappedSuperclasses().remove(this.resourceTypeMapping);
- }
-
- public XmlMappedSuperclass addToResourceModel(XmlEntityMappings entityMappings) {
- XmlMappedSuperclass mappedSuperclass = OrmFactory.eINSTANCE.createXmlMappedSuperclass();
- getPersistentType().initialize(mappedSuperclass);
- entityMappings.getMappedSuperclasses().add(mappedSuperclass);
- return mappedSuperclass;
- }
-
-
-
- @Override
- public void initialize(XmlMappedSuperclass mappedSuperclass) {
- super.initialize(mappedSuperclass);
- this.initializeIdClass(this.getResourceIdClass());
- }
-
- protected void initializeIdClass(XmlIdClass idClassResource) {
- this.idClass = this.idClass(idClassResource);
- }
-
- @Override
- public void update(XmlMappedSuperclass mappedSuperclass) {
- super.update(mappedSuperclass);
- this.updateIdClass(this.getResourceIdClass());
- }
-
- protected void updateIdClass(XmlIdClass idClassResource) {
- this.setIdClass_(this.idClass(idClassResource));
- }
-
- protected String idClass(XmlIdClass idClassResource) {
- return idClassResource == null ? null : idClassResource.getClassName();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNamedNativeQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNamedNativeQuery.java
deleted file mode 100644
index a9029a53ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNamedNativeQuery.java
+++ /dev/null
@@ -1,68 +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.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.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 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/context/orm/GenericOrmNamedQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNamedQuery.java
deleted file mode 100644
index 399c45b201..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNamedQuery.java
+++ /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
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmNamedQuery;
-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/context/orm/GenericOrmNullAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNullAttributeMapping.java
deleted file mode 100644
index 5ab796605c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNullAttributeMapping.java
+++ /dev/null
@@ -1,45 +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.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping;
-
-
-public class GenericOrmNullAttributeMapping extends AbstractOrmAttributeMapping<XmlNullAttributeMapping>
-{
-
- public GenericOrmNullAttributeMapping(OrmPersistentAttribute parent) {
- super(parent);
- }
-
- public int getXmlSequence() {
- return -1;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmAttributeMapping(this);
- }
-
- public String getKey() {
- return null;
- }
-
- public XmlAttributeMapping addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- throw new UnsupportedOperationException();
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNullConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNullConverter.java
deleted file mode 100644
index 54a6312e02..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNullConverter.java
+++ /dev/null
@@ -1,50 +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.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.AbstractXmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericOrmNullConverter extends AbstractXmlContextNode
- 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/context/orm/GenericOrmOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToManyMapping.java
deleted file mode 100644
index 7de784c1ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToManyMapping.java
+++ /dev/null
@@ -1,65 +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.context.orm;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.NonOwningMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-
-
-public class GenericOrmOneToManyMapping extends AbstractOrmMultiRelationshipMapping<XmlOneToMany>
- implements OrmOneToManyMapping
-{
-
- public GenericOrmOneToManyMapping(OrmPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmOneToManyMapping(this);
- }
-
- @Override
- public void initializeFromOrmNonOwningMapping(NonOwningMapping oldMapping) {
- super.initializeFromOrmNonOwningMapping(oldMapping);
- setMappedBy(oldMapping.getMappedBy());
- }
-
- public int getXmlSequence() {
- return 50;
- }
-
- // ********** NonOwningMapping implementation **********
- public boolean mappedByIsValid(AttributeMapping mappedByMapping) {
- String mappedByKey = mappedByMapping.getKey();
- return (mappedByKey == MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- }
-
- public XmlOneToMany addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlOneToMany oneToMany = OrmFactory.eINSTANCE.createXmlOneToManyImpl();
- getPersistentAttribute().initialize(oneToMany);
- typeMapping.getAttributes().getOneToManys().add(oneToMany);
- return oneToMany;
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- typeMapping.getAttributes().getOneToManys().remove(this.resourceAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToOneMapping.java
deleted file mode 100644
index 237842b704..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToOneMapping.java
+++ /dev/null
@@ -1,299 +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.orm;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.NonOwningMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-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;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- *
- */
-public class GenericOrmOneToOneMapping
- extends AbstractOrmSingleRelationshipMapping<XmlOneToOne>
- implements OrmOneToOneMapping
-{
-
- protected String mappedBy;
-
- protected final List<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns;
-
-
- public GenericOrmOneToOneMapping(OrmPersistentAttribute parent) {
- super(parent);
- this.primaryKeyJoinColumns = new ArrayList<OrmPrimaryKeyJoinColumn>();
- }
-
-
- // ********** mapped by **********
-
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String mappedBy) {
- String old = this.mappedBy;
- this.mappedBy = mappedBy;
- this.resourceAttributeMapping.setMappedBy(mappedBy);
- this.firePropertyChanged(MAPPED_BY_PROPERTY, old, mappedBy);
- }
-
- protected void setMappedBy_(String mappedBy) {
- String old = this.mappedBy;
- this.mappedBy = mappedBy;
- this.firePropertyChanged(MAPPED_BY_PROPERTY, old, mappedBy);
- }
-
- public boolean mappedByIsValid(AttributeMapping mappedByMapping) {
- return (mappedByMapping.getKey() == MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- }
-
- public TextRange getMappedByTextRange() {
- TextRange mappedByTextRange = this.resourceAttributeMapping.getMappedByTextRange();
- return mappedByTextRange != null ? mappedByTextRange : getValidationTextRange();
- }
-
-
- // ********** primary key join columns **********
-
- public ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns() {
- return new CloneListIterator<OrmPrimaryKeyJoinColumn>(this.primaryKeyJoinColumns);
- }
-
- public int primaryKeyJoinColumnsSize() {
- return this.primaryKeyJoinColumns.size();
- }
-
- public OrmPrimaryKeyJoinColumn addPrimaryKeyJoinColumn(int index) {
- XmlPrimaryKeyJoinColumn resourcePkJoinColumn = OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumnImpl();
- OrmPrimaryKeyJoinColumn contextPkJoinColumn = this.buildPrimaryKeyJoinColumn(resourcePkJoinColumn);
- this.primaryKeyJoinColumns.add(index, contextPkJoinColumn);
- this.resourceAttributeMapping.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.resourceAttributeMapping.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.resourceAttributeMapping.getPrimaryKeyJoinColumns().move(targetIndex, sourceIndex);
- fireItemMoved(PRIMARY_KEY_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- public boolean containsPrimaryKeyJoinColumns() {
- return ! this.primaryKeyJoinColumns.isEmpty();
- }
-
-
- // ********** AttributeMapping implementation **********
-
- public String getKey() {
- return MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
-
- // ********** OrmAttributeMapping implementation **********
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmOneToOneMapping(this);
- }
-
- public int getXmlSequence() {
- return 60;
- }
-
- @Override
- public void initializeFromOrmNonOwningMapping(NonOwningMapping oldMapping) {
- super.initializeFromOrmNonOwningMapping(oldMapping);
- setMappedBy(oldMapping.getMappedBy());
- }
-
- @Override
- public boolean isOverridableAssociationMapping() {
- return true;
- }
-
- public XmlOneToOne addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlOneToOne oneToOne = OrmFactory.eINSTANCE.createXmlOneToOneImpl();
- getPersistentAttribute().initialize(oneToOne);
- typeMapping.getAttributes().getOneToOnes().add(oneToOne);
- return oneToOne;
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- typeMapping.getAttributes().getOneToOnes().remove(this.resourceAttributeMapping);
- }
-
-
- // ********** RelationshipMapping implementation **********
-
- public boolean isRelationshipOwner() {
- return getMappedBy() == null;
- }
-
-
- // ********** resource => context **********
-
- @Override
- public void initialize(XmlAttributeMapping attributeMapping) {
- super.initialize(attributeMapping);
- this.mappedBy = this.resourceAttributeMapping.getMappedBy();
- this.initializePrimaryKeyJoinColumns();
- }
-
- protected void initializePrimaryKeyJoinColumns() {
- if (this.resourceAttributeMapping != null) {
- for (XmlPrimaryKeyJoinColumn resourcePkJoinColumn : this.resourceAttributeMapping.getPrimaryKeyJoinColumns()) {
- this.primaryKeyJoinColumns.add(buildPrimaryKeyJoinColumn(resourcePkJoinColumn));
- }
- }
- }
-
- protected OrmPrimaryKeyJoinColumn buildPrimaryKeyJoinColumn(XmlPrimaryKeyJoinColumn resourcePkJoinColumn) {
- return getJpaFactory().buildOrmPrimaryKeyJoinColumn(this, new JoinColumnOwner(), resourcePkJoinColumn);
- }
-
-
- @Override
- public void update() {
- super.update();
- this.setMappedBy_(this.resourceAttributeMapping.getMappedBy());
- this.updatePrimaryKeyJoinColumns();
- }
-
-
- protected void updatePrimaryKeyJoinColumns() {
- ListIterator<OrmPrimaryKeyJoinColumn> contextPkJoinColumns = primaryKeyJoinColumns();
- ListIterator<XmlPrimaryKeyJoinColumn> resourcePkJoinColumns = new CloneListIterator<XmlPrimaryKeyJoinColumn>(this.resourceAttributeMapping.getPrimaryKeyJoinColumns());//prevent ConcurrentModificiationException
-
- while (contextPkJoinColumns.hasNext()) {
- OrmPrimaryKeyJoinColumn pkJoinColumn = contextPkJoinColumns.next();
- if (resourcePkJoinColumns.hasNext()) {
- pkJoinColumn.update(resourcePkJoinColumns.next());
- }
- else {
- removePrimaryKeyJoinColumn_(pkJoinColumn);
- }
- }
-
- while (resourcePkJoinColumns.hasNext()) {
- addPrimaryKeyJoinColumn(buildPrimaryKeyJoinColumn(resourcePkJoinColumns.next()));
- }
- }
-
-
- // ********** Validation **********
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- if (this.mappedBy != null) {
- this.validateMappedBy(messages);
- }
- }
-
- @Override
- protected void validateJoinColumns(List<IMessage> messages) {
- if (this.primaryKeyJoinColumns.isEmpty() || this.containsSpecifiedJoinColumns()) {
- super.validateJoinColumns(messages);
- }
- }
-
- protected void validateMappedBy(List<IMessage> messages) {
- Entity targetEntity = this.getResolvedTargetEntity();
- if (targetEntity == null) {
- return; // validated elsewhere
- }
-
- PersistentAttribute attribute = targetEntity.getPersistentType().resolveAttribute(this.mappedBy);
-
- if (attribute == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAPPING_UNRESOLVED_MAPPED_BY,
- new String[] {this.mappedBy},
- this,
- this.getMappedByTextRange()
- )
- );
- return;
- }
-
- AttributeMapping mappedByMapping = attribute.getMapping();
- if ( ! this.mappedByIsValid(mappedByMapping)) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAPPING_INVALID_MAPPED_BY,
- new String[] {this.mappedBy},
- this,
- this.getMappedByTextRange()
- )
- );
- return;
- }
-
- if ((mappedByMapping instanceof NonOwningMapping)
- && ((NonOwningMapping) mappedByMapping).getMappedBy() != null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAPPING_MAPPED_BY_ON_BOTH_SIDES,
- this,
- this.getMappedByTextRange()
- )
- );
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentAttribute.java
deleted file mode 100644
index da3d8bad74..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentAttribute.java
+++ /dev/null
@@ -1,187 +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.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.JpaStructureNode;
-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.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmStructureNodes;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericOrmPersistentAttribute extends AbstractXmlContextNode
- implements OrmPersistentAttribute
-{
- protected OrmAttributeMapping attributeMapping;
-
- public GenericOrmPersistentAttribute(OrmPersistentType parent, String mappingKey) {
- super(parent);
- this.attributeMapping = buildAttributeMapping(mappingKey);
- }
-
- protected OrmAttributeMapping buildAttributeMapping(String key) {
- return getJpaPlatform().buildOrmAttributeMappingFromMappingKey(key, this);
- }
-
- public String getId() {
- return OrmStructureNodes.PERSISTENT_ATTRIBUTE_ID;
- }
-
- 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.getMappingKey() == newMappingKey) {
- return;
- }
- OrmAttributeMapping oldMapping = this.attributeMapping;
- this.attributeMapping = buildAttributeMapping(newMappingKey);
- getPersistentType().changeMapping(this, oldMapping, this.attributeMapping);
- firePropertyChanged(SPECIFIED_MAPPING_PROPERTY, oldMapping, this.attributeMapping);
- }
-
- protected void setSpecifiedMappingKey_(String newMappingKey) {
- if (this.getMappingKey() == newMappingKey) {
- return;
- }
- OrmAttributeMapping oldMapping = this.attributeMapping;
- this.attributeMapping = buildAttributeMapping(newMappingKey);
- firePropertyChanged(SPECIFIED_MAPPING_PROPERTY, oldMapping, this.attributeMapping);
- }
-
- public OrmPersistentType getPersistentType() {
- return (OrmPersistentType) getParent();
- }
-
- public OrmTypeMapping getTypeMapping() {
- return getPersistentType().getMapping();
- }
-
- public boolean isVirtual() {
- return getPersistentType().containsVirtualPersistentAttribute(this);
- }
-
- public void makeVirtual() {
- if (isVirtual()) {
- throw new IllegalStateException("Attribute is already virtual"); //$NON-NLS-1$
- }
- getPersistentType().makePersistentAttributeVirtual(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$
- }
- getPersistentType().makePersistentAttributeSpecified(this);
- }
-
- public void makeSpecified(String mappingKey) {
- if (!isVirtual()) {
- throw new IllegalStateException("Attribute is already specified"); //$NON-NLS-1$
- }
- getPersistentType().makePersistentAttributeSpecified(this, mappingKey);
- }
-
- public String getPrimaryKeyColumnName() {
- return this.attributeMapping.getPrimaryKeyColumnName();
- }
-
- public boolean isOverridableAttribute() {
- return this.attributeMapping.isOverridableAttributeMapping();
- }
-
- public boolean isOverridableAssociation() {
- return this.attributeMapping.isOverridableAssociationMapping();
- }
-
- public boolean isIdAttribute() {
- return this.attributeMapping.isIdMapping();
- }
-
- public void initialize(XmlAttributeMapping attributeMapping) {
- this.attributeMapping.initialize(attributeMapping);
- }
-
- public void update() {
- this.attributeMapping.update();
- }
-
- public JpaStructureNode getStructureNode(@SuppressWarnings("unused") 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();
- }
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- this.attributeMapping.validate(messages);
- }
-
- public TextRange getValidationTextRange() {
- if (isVirtual()) {
- return getPersistentType().getMapping().getAttributesTextRange();
- }
- return this.attributeMapping.getValidationTextRange();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(getName());
- }
-
- public void dispose() {
- //nothing to dispose
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentType.java
deleted file mode 100644
index 71bc0a2c08..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentType.java
+++ /dev/null
@@ -1,706 +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.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.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.PersistentTypeContext;
-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.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmPersistentTypeContext;
-import org.eclipse.jpt.core.context.orm.OrmStructureNodes;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMappingProvider;
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.Attributes;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-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;
-
-public class GenericOrmPersistentType
- extends AbstractXmlContextNode
- implements OrmPersistentType
-{
- protected final List<OrmPersistentAttribute> specifiedPersistentAttributes;
-
- protected final List<OrmPersistentAttribute> virtualPersistentAttributes;
-
- protected final Collection<OrmTypeMappingProvider> typeMappingProviders;
-
- protected OrmTypeMapping ormTypeMapping;
-
- protected PersistentType parentPersistentType;
-
-
- public GenericOrmPersistentType(PersistentTypeContext parent, String mappingKey) {
- super(parent);
- this.typeMappingProviders = buildTypeMappingProviders();
- this.ormTypeMapping = buildOrmTypeMapping(mappingKey);
- this.specifiedPersistentAttributes = new ArrayList<OrmPersistentAttribute>();
- this.virtualPersistentAttributes = new ArrayList<OrmPersistentAttribute>();
- }
-
-
- //***************** PersistentType implementation **************************
-
- public OrmPersistentTypeContext getContext() {
- return (OrmPersistentTypeContext) getParent();
- }
-
- public String getId() {
- return OrmStructureNodes.PERSISTENT_TYPE_ID;
- }
-
- public boolean isFor(String fullyQualifiedTypeName) {
- String className = getMapping().getClass_();
- if (className == null) {
- return false;
- }
- if (className.equals(fullyQualifiedTypeName)) {
- return true;
- }
- if ((getContext().getDefaultPersistentTypePackage() + '.' + className).equals(fullyQualifiedTypeName)) {
- return true;
- }
- return false;
- }
-
- protected OrmTypeMapping buildOrmTypeMapping(String key) {
- return getTypeMappingProvider(key).buildMapping(this, getJpaFactory());
- }
-
- protected Collection<OrmTypeMappingProvider> buildTypeMappingProviders() {
- Collection<OrmTypeMappingProvider> collection = new ArrayList<OrmTypeMappingProvider>();
- collection.add(new OrmEntityProvider());
- collection.add(new OrmMappedSuperclassProvider());
- collection.add(new OrmEmbeddableProvider());
- return collection;
- }
-
- protected OrmTypeMappingProvider getTypeMappingProvider(String key) {
- for (OrmTypeMappingProvider provider : this.typeMappingProviders) {
- if (provider.getKey().equals(key)) {
- return provider;
- }
- }
- throw new IllegalArgumentException();
- }
-
- public OrmTypeMapping getMapping() {
- return this.ormTypeMapping;
- }
-
- public void setMappingKey(String newMappingKey) {
- if (this.getMappingKey() == newMappingKey) {
- return;
- }
- OrmTypeMapping oldMapping = getMapping();
- this.ormTypeMapping = buildOrmTypeMapping(newMappingKey);
- getContext().changeMapping(this, oldMapping, this.ormTypeMapping);
- firePropertyChanged(MAPPING_PROPERTY, oldMapping, this.ormTypeMapping);
- }
-
- protected void setMappingKey_(String newMappingKey) {
- if (this.getMappingKey() == newMappingKey) {
- return;
- }
- OrmTypeMapping oldMapping = getMapping();
- this.ormTypeMapping = buildOrmTypeMapping(newMappingKey);
- firePropertyChanged(MAPPING_PROPERTY, oldMapping, this.ormTypeMapping);
- }
-
- public Iterator<PersistentType> inheritanceHierarchy() {
- // using a chain iterator to traverse up the inheritance tree
- return new ChainIterator<PersistentType>(this) {
- @Override
- protected PersistentType nextLink(PersistentType pt) {
- return pt.getParentPersistentType();
- }
- };
- }
-
- public Iterator<PersistentType> ancestors() {
- // using a chain iterator to traverse up the inheritance tree
- return new ChainIterator<PersistentType>(this.getParentPersistentType()) {
- @Override
- protected PersistentType nextLink(PersistentType pt) {
- return pt.getParentPersistentType();
- }
- };
- }
-
- public PersistentType getParentPersistentType() {
- return this.parentPersistentType;
- }
-
- public void setParentPersistentType(PersistentType newParentPersistentType) {
- if (attributeValueHasNotChanged(this.parentPersistentType, newParentPersistentType)) {
- return;
- }
- PersistentType oldParentPersistentType = this.parentPersistentType;
- this.parentPersistentType = newParentPersistentType;
- firePropertyChanged(PersistentType.PARENT_PERSISTENT_TYPE_PROPERTY, oldParentPersistentType, newParentPersistentType);
- }
-
- public AccessType getAccess() {
- return getMapping().getAccess();
- }
-
- public void changeMapping(OrmPersistentAttribute ormPersistentAttribute, OrmAttributeMapping oldMapping, OrmAttributeMapping newMapping) {
- int sourceIndex = this.specifiedPersistentAttributes.indexOf(ormPersistentAttribute);
- this.specifiedPersistentAttributes.remove(sourceIndex);
- oldMapping.removeFromResourceModel(this.ormTypeMapping.getResourceTypeMapping());
- int targetIndex = insertionIndex(ormPersistentAttribute);
- this.specifiedPersistentAttributes.add(targetIndex, ormPersistentAttribute);
- newMapping.addToResourceModel(getMapping().getResourceTypeMapping());
- oldMapping.initializeOn(newMapping);
- fireItemMoved(SPECIFIED_ATTRIBUTES_LIST, targetIndex, sourceIndex);
- }
-
- public void makePersistentAttributeVirtual(OrmPersistentAttribute ormPersistentAttribute) {
- if (ormPersistentAttribute.isVirtual()) {
- throw new IllegalStateException("Attribute is already virtual"); //$NON-NLS-1$
- }
- JavaPersistentAttribute javaPersistentAttribute = ormPersistentAttribute.getMapping().getJavaPersistentAttribute();
- OrmPersistentAttribute virtualPersistentAttribute = null;
- if (javaPersistentAttribute != null) {
- virtualPersistentAttribute = buildVirtualOrmPersistentAttribute(javaPersistentAttribute);
- this.virtualPersistentAttributes.add(virtualPersistentAttribute);
- }
- this.removeSpecifiedPersistentAttribute(ormPersistentAttribute);
- if (virtualPersistentAttribute != null) {
- fireItemAdded(VIRTUAL_ATTRIBUTES_LIST, virtualAttributesSize() - 1, virtualPersistentAttribute);
- }
- }
-
- public void makePersistentAttributeSpecified(OrmPersistentAttribute ormPersistentAttribute) {
- makePersistentAttributeSpecified(ormPersistentAttribute, ormPersistentAttribute.getMappingKey());
- }
-
- public void makePersistentAttributeSpecified(OrmPersistentAttribute ormPersistentAttribute, String mappingKey) {
- if (!ormPersistentAttribute.isVirtual()) {
- throw new IllegalStateException("Attribute is already specified"); //$NON-NLS-1$
- }
- if (mappingKey == MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY) {
- throw new IllegalStateException("Use makePersistentAttributeSpecified(OrmPersistentAttribute, String) instead and specify a mapping type"); //$NON-NLS-1$
- }
-
- OrmPersistentAttribute newPersistentAttribute = buildOrmPersistentAttribute(mappingKey);
- if (getMapping().getResourceTypeMapping().getAttributes() == null) {
- getMapping().getResourceTypeMapping().setAttributes(createAttributesResource());
- }
- int insertionIndex = insertionIndex(newPersistentAttribute);
- this.specifiedPersistentAttributes.add(insertionIndex, newPersistentAttribute);
- newPersistentAttribute.getMapping().addToResourceModel(getMapping().getResourceTypeMapping());
-
- int removalIndex = this.virtualPersistentAttributes.indexOf(ormPersistentAttribute);
- this.virtualPersistentAttributes.remove(ormPersistentAttribute);
- newPersistentAttribute.getSpecifiedMapping().setName(ormPersistentAttribute.getName());
-
- fireItemAdded(PersistentType.SPECIFIED_ATTRIBUTES_LIST, insertionIndex, newPersistentAttribute);
- fireItemRemoved(VIRTUAL_ATTRIBUTES_LIST, removalIndex, ormPersistentAttribute);
- }
-
- protected Attributes createAttributesResource() {
- return OrmFactory.eINSTANCE.createAttributes();
- }
-
- 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, OrmPersistentAttribute>(attributes()) {
- @Override
- protected boolean accept(OrmPersistentAttribute o) {
- if (attributeName == null && o.getName() == null) {
- return true;
- }
- if (attributeName != null && attributeName.equals(o.getName())) {
- return true;
- }
- return false;
- }
- };
- }
-
- public OrmPersistentAttribute getAttributeNamed(String attributeName) {
- Iterator<OrmPersistentAttribute> stream = attributesNamed(attributeName);
- return (stream.hasNext()) ? stream.next() : null;
- }
-
- 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 OrmPersistentAttribute specifiedAttributeNamed(String attributeName) {
- Iterator<OrmPersistentAttribute> stream = specifiedAttributesNamed(attributeName);
- return (stream.hasNext()) ? stream.next() : null;
-
- }
-
- protected Iterator<OrmPersistentAttribute> specifiedAttributesNamed(final String attributeName) {
- return new FilteringIterator<OrmPersistentAttribute, OrmPersistentAttribute>(specifiedAttributes()) {
- @Override
- protected boolean accept(OrmPersistentAttribute ormPersistentAttribute) {
- return attributeName.equals(ormPersistentAttribute.getName());
- }
- };
- }
-
- @SuppressWarnings("unchecked")
- public ListIterator<OrmPersistentAttribute> attributes() {
- return new CompositeListIterator<OrmPersistentAttribute>(specifiedAttributes(), virtualAttributes());
- }
-
- public int attributesSize() {
- return specifiedAttributesSize() + virtualAttributesSize();
- }
-
- public ListIterator<OrmPersistentAttribute> specifiedAttributes() {
- return new CloneListIterator<OrmPersistentAttribute>(this.specifiedPersistentAttributes);
- }
-
- public int specifiedAttributesSize() {
- return this.specifiedPersistentAttributes.size();
- }
-
- public ListIterator<OrmPersistentAttribute> virtualAttributes() {
- return new CloneListIterator<OrmPersistentAttribute>(this.virtualPersistentAttributes);
- }
-
- public int virtualAttributesSize() {
- return this.virtualPersistentAttributes.size();
- }
-
- protected void addVirtualPersistentAttribute(OrmPersistentAttribute ormPersistentAttribute) {
- addItemToList(ormPersistentAttribute, this.virtualPersistentAttributes, OrmPersistentType.VIRTUAL_ATTRIBUTES_LIST);
- }
-
- protected void removeVirtualPersistentAttribute(OrmPersistentAttribute ormPersistentAttribute) {
- removeItemFromList(ormPersistentAttribute, this.virtualPersistentAttributes, OrmPersistentType.VIRTUAL_ATTRIBUTES_LIST);
- }
-
- protected void moveVirtualPersistentAttribute_(int index, OrmPersistentAttribute attribute) {
- moveItemInList(index, this.virtualPersistentAttributes.indexOf(attribute), this.virtualPersistentAttributes, OrmPersistentType.VIRTUAL_ATTRIBUTES_LIST);
- }
-
- public boolean containsVirtualPersistentAttribute(OrmPersistentAttribute ormPersistentAttribute) {
- return this.virtualPersistentAttributes.contains(ormPersistentAttribute);
- }
-
- public OrmPersistentAttribute addSpecifiedPersistentAttribute(String mappingKey, String attributeName) {
- OrmPersistentAttribute persistentAttribute = buildOrmPersistentAttribute(mappingKey);
- int index = insertionIndex(persistentAttribute);
- if (getMapping().getResourceTypeMapping().getAttributes() == null) {
- getMapping().getResourceTypeMapping().setAttributes(createAttributesResource());
- }
- this.specifiedPersistentAttributes.add(index, persistentAttribute);
- persistentAttribute.getMapping().addToResourceModel(getMapping().getResourceTypeMapping());
-
- persistentAttribute.getSpecifiedMapping().setName(attributeName);
- fireItemAdded(PersistentType.SPECIFIED_ATTRIBUTES_LIST, index, persistentAttribute);
- return persistentAttribute;
- }
-
- protected int insertionIndex(OrmPersistentAttribute persistentAttribute) {
- return CollectionTools.insertionIndexOf(this.specifiedPersistentAttributes, persistentAttribute, buildMappingComparator());
- }
-
- protected Comparator<OrmPersistentAttribute> buildMappingComparator() {
- return new Comparator<OrmPersistentAttribute>() {
- public int compare(OrmPersistentAttribute o1, OrmPersistentAttribute o2) {
- int o1Sequence = o1.getMapping().getXmlSequence();
- int o2Sequence = o2.getMapping().getXmlSequence();
- if (o1Sequence < o2Sequence) {
- return -1;
- }
- if (o1Sequence == o2Sequence) {
- return 0;
- }
- return 1;
- }
- };
- }
-
-
- protected void addSpecifiedPersistentAttribute_(OrmPersistentAttribute ormPersistentAttribute) {
- addItemToList(ormPersistentAttribute, this.specifiedPersistentAttributes, PersistentType.SPECIFIED_ATTRIBUTES_LIST);
- }
-
- protected void removeSpecifiedPersistentAttribute_(OrmPersistentAttribute ormPersistentAttribute) {
- removeItemFromList(ormPersistentAttribute, this.specifiedPersistentAttributes, PersistentType.SPECIFIED_ATTRIBUTES_LIST);
- }
-
- protected void moveSpecifiedPersistentAttribute_(int index, OrmPersistentAttribute attribute) {
- moveItemInList(index, this.specifiedPersistentAttributes.indexOf(attribute), this.specifiedPersistentAttributes, PersistentType.SPECIFIED_ATTRIBUTES_LIST);
- }
-
- public void removeSpecifiedPersistentAttribute(OrmPersistentAttribute ormPersistentAttribute) {
- int index = this.specifiedPersistentAttributes.indexOf(ormPersistentAttribute);
- this.specifiedPersistentAttributes.remove(ormPersistentAttribute);
- ormPersistentAttribute.getMapping().removeFromResourceModel(this.ormTypeMapping.getResourceTypeMapping());
- if (this.ormTypeMapping.getResourceTypeMapping().getAttributes().isAllFeaturesUnset()) {
- this.ormTypeMapping.getResourceTypeMapping().setAttributes(null);
- }
- fireItemRemoved(PersistentType.SPECIFIED_ATTRIBUTES_LIST, index, ormPersistentAttribute);
- }
-
- public String getName() {
- return getMapping().getClass_();
- }
-
- public String getShortName(){
- return getName().substring(getName().lastIndexOf('.') + 1);
- }
-
- public void classChanged(String oldClass, String newClass) {
- firePropertyChanged(NAME_PROPERTY, oldClass, newClass);
- }
-
- public boolean isMapped() {
- return true;
- }
-
- public String getMappingKey() {
- return getMapping().getKey();
- }
-
- public JavaPersistentType getJavaPersistentType() {
- return getMapping().getJavaPersistentType();
- }
-
-
- //TODO is there a way to avoid a method for every mapping type?
- //I am trying to take adavantage of generics here, but it sure is
- //leading to a lot of duplicated code. - KFM
- public void initialize(XmlEntity entity) {
- ((OrmEntity) getMapping()).initialize(entity);
- this.initializeParentPersistentType();
- this.initializePersistentAttributes(entity);
- }
-
- public void initialize(XmlMappedSuperclass mappedSuperclass) {
- ((OrmMappedSuperclass) getMapping()).initialize(mappedSuperclass);
- this.initializeParentPersistentType();
- this.initializePersistentAttributes(mappedSuperclass);
- }
-
- public void initialize(XmlEmbeddable embeddable) {
- ((OrmEmbeddable) getMapping()).initialize(embeddable);
- this.initializeParentPersistentType();
- this.initializePersistentAttributes(embeddable);
- }
-
- protected void initializePersistentAttributes(AbstractXmlTypeMapping typeMapping) {
- this.initializeSpecifiedPersistentAttributes(typeMapping.getAttributes());
- this.initializeVirtualPersistentAttributes();
- }
-
- protected OrmPersistentAttribute buildOrmPersistentAttribute(String mappingKey) {
- return getJpaFactory().buildOrmPersistentAttribute(this, mappingKey);
- }
-
- protected void initializeSpecifiedPersistentAttributes(Attributes attributes) {
- if (attributes == null) {
- return;
- }
- for (XmlAttributeMapping resourceMapping : attributes.getAttributeMappings()) {
- OrmPersistentAttribute ormPersistentAttribute = buildOrmPersistentAttribute(resourceMapping.getMappingKey());
- ormPersistentAttribute.initialize(resourceMapping);
- this.specifiedPersistentAttributes.add(ormPersistentAttribute);
- }
- }
-
- protected void initializeVirtualPersistentAttributes() {
- ListIterator<JavaPersistentAttribute> javaAttributes = javaPersistentAttributes();
-
- while (javaAttributes.hasNext()) {
- JavaPersistentAttribute javaPersistentAttribute = javaAttributes.next();
- if (specifiedAttributeNamed(javaPersistentAttribute.getName()) == null) {
- OrmPersistentAttribute ormPersistentAttribute = buildVirtualOrmPersistentAttribute(javaPersistentAttribute);
- this.virtualPersistentAttributes.add(ormPersistentAttribute);
- }
- }
- }
-
- protected ListIterator<JavaPersistentAttribute> javaPersistentAttributes() {
- JavaPersistentType javaPersistentType = getJavaPersistentType();
- if (javaPersistentType != null) {
- return javaPersistentType.attributes();
- }
- return EmptyListIterator.instance();
- }
-
- protected void initializeParentPersistentType() {
- JavaPersistentType javaPersistentType = getJavaPersistentType();
- if (javaPersistentType != null) {
- this.parentPersistentType = javaPersistentType.getParentPersistentType();
- }
- }
-
- public void update(XmlEntity entity) {
- //TODO remove this just like I did in GenericOrmPersistentAttribute
- if (getMappingKey() != MappingKeys.ENTITY_TYPE_MAPPING_KEY) {
- setMappingKey_(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
- }
- ((OrmEntity) getMapping()).update(entity);
- this.updateParentPersistentType();
- this.updatePersistentAttributes(entity);
- }
-
- public void update(XmlMappedSuperclass mappedSuperclass) {
- if (getMappingKey() != MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY) {
- setMappingKey_(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
- }
- ((OrmMappedSuperclass) getMapping()).update(mappedSuperclass);
- this.updateParentPersistentType();
- this.updatePersistentAttributes(mappedSuperclass);
- }
-
- public void update(XmlEmbeddable embeddable) {
- if (getMappingKey() != MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY) {
- setMappingKey_(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
- }
- ((OrmEmbeddable) getMapping()).update(embeddable);
- this.updateParentPersistentType();
- this.updatePersistentAttributes(embeddable);
- }
-
- protected void updateParentPersistentType() {
- JavaPersistentType javaPersistentType = getJavaPersistentType();
- setParentPersistentType(javaPersistentType == null ? null : javaPersistentType.getParentPersistentType());
- }
-
- protected void updatePersistentAttributes(AbstractXmlTypeMapping typeMapping) {
- this.updateSpecifiedPersistentAttributes(typeMapping.getAttributes());
- this.updateVirtualPersistentAttributes();
- }
-
- protected void updateSpecifiedPersistentAttributes(Attributes attributes) {
- Collection<OrmPersistentAttribute> contextAttributesToRemove = CollectionTools.collection(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) {
- moveSpecifiedPersistentAttribute_(resourceIndex, contextAttribute);
- contextAttributesToRemove.remove(contextAttribute);
- contextAttributesToUpdate.add(contextAttribute);
- contextAttributeFound = true;
- break;
- }
- }
- if (!contextAttributeFound) {
- OrmPersistentAttribute ormPersistentAttribute = buildOrmPersistentAttribute(resourceMapping.getMappingKey());
- ormPersistentAttribute.initialize(resourceMapping);
- addSpecifiedPersistentAttribute_(ormPersistentAttribute);
- }
- resourceIndex++;
- }
- }
- for (OrmPersistentAttribute contextAttribute : contextAttributesToRemove) {
- removeSpecifiedPersistentAttribute_(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();
- }
- }
-
- //TODO move this to Attributes, so that eclipselink can implement this as well?
-
- protected void updateVirtualPersistentAttributes() {
- Collection<OrmPersistentAttribute> contextAttributesToRemove = CollectionTools.collection(virtualAttributes());
- Collection<OrmPersistentAttribute> contextAttributesToUpdate = new ArrayList<OrmPersistentAttribute>();
- int resourceIndex = 0;
-
- ListIterator<JavaPersistentAttribute> javaAttributes = this.javaPersistentAttributes();
- for (JavaPersistentAttribute javaAttribute : CollectionTools.iterable(javaAttributes)) {
- if (specifiedAttributeNamed(javaAttribute.getName()) == null) {
- JavaAttributeMapping javaAttributeMapping = javaAttribute.getMapping();
- if (getMapping().isMetadataComplete()) {
- javaAttributeMapping = javaAttribute.getDefaultMapping();
- }
- boolean contextAttributeFound = false;
- for (OrmPersistentAttribute contextAttribute : contextAttributesToRemove) {
- //TODO not so sure about this, casting to VirtualXmlAttributeMapping as well as the getJavaAttributeMapping() api
- if (((VirtualXmlAttributeMapping<?>) contextAttribute.getMapping().getResourceAttributeMapping()).getJavaAttributeMapping() == javaAttributeMapping) {
- moveVirtualPersistentAttribute_(resourceIndex, contextAttribute);
- contextAttributesToRemove.remove(contextAttribute);
- contextAttributesToUpdate.add(contextAttribute);
- contextAttributeFound = true;
- break;
- }
- }
- if (!contextAttributeFound) {
- addVirtualPersistentAttribute(javaAttribute);
- }
- resourceIndex++;
- }
- }
-
- for (OrmPersistentAttribute contextAttribute : contextAttributesToRemove) {
- removeVirtualPersistentAttribute(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 addVirtualPersistentAttribute(JavaPersistentAttribute javaAttribute) {
- addVirtualPersistentAttribute(buildVirtualOrmPersistentAttribute(javaAttribute));
- }
-
- protected OrmPersistentAttribute buildVirtualOrmPersistentAttribute(JavaPersistentAttribute javaAttribute) {
- String javaMappingKey = javaAttribute.getMappingKey();
- JavaAttributeMapping javaAttributeMapping = javaAttribute.getMapping();
- if (getMapping().isMetadataComplete()) {
- javaMappingKey = javaAttribute.getDefaultMappingKey();
- javaAttributeMapping = javaAttribute.getDefaultMapping();
- }
- OrmPersistentAttribute ormPersistentAttribute = buildOrmPersistentAttribute(javaMappingKey);
- XmlAttributeMapping resourceMapping = getJpaPlatform().buildVirtualOrmResourceMappingFromMappingKey(javaMappingKey, getMapping(), javaAttributeMapping);
- ormPersistentAttribute.initialize(resourceMapping);
- return ormPersistentAttribute;
- }
-
- public PersistentAttribute resolveAttribute(String attributeName) {
- Iterator<OrmPersistentAttribute> attributes = attributesNamed(attributeName);
- if (attributes.hasNext()) {
- OrmPersistentAttribute attribute = attributes.next();
- return attributes.hasNext() ? null /* more than one */: attribute;
- }
- else if (getParentPersistentType() != null) {
- return getParentPersistentType().resolveAttribute(attributeName);
- }
- else {
- return null;
- }
- }
-
- public JpaStructureNode getStructureNode(int textOffset) {
- for (OrmPersistentAttribute attribute : CollectionTools.iterable(specifiedAttributes())) {
- if (attribute.contains(textOffset)) {
- return attribute;
- }
- }
- return this;
- }
-
- public boolean contains(int textOffset) {
- return this.ormTypeMapping.containsOffset(textOffset);
- }
-
- public TextRange getSelectionTextRange() {
- return this.ormTypeMapping.getSelectionTextRange();
- }
-
- //******************** validation **********************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- this.validateMapping(messages);
- this.validateAttributes(messages);
- }
-
- protected void validateMapping(List<IMessage> messages) {
- try {
- this.ormTypeMapping.validate(messages);
- } catch(Throwable t) {
- JptCorePlugin.log(t);
- }
- }
-
- protected void validateAttributes(List<IMessage> messages) {
- for (Iterator<OrmPersistentAttribute> stream = this.attributes(); stream.hasNext(); ) {
- this.validateAttribute(stream.next(), messages);
- }
- }
-
- protected void validateAttribute(OrmPersistentAttribute attribute, List<IMessage> messages) {
- try {
- attribute.validate(messages);
- } catch(Throwable t) {
- JptCorePlugin.log(t);
- }
- }
-
- public TextRange getValidationTextRange() {
- return this.ormTypeMapping.getValidationTextRange();
- }
-
- public void dispose() {
- if (getJavaPersistentType() != null) {
- getJavaPersistentType().dispose();
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPrimaryKeyJoinColumn.java
deleted file mode 100644
index 377cb3887e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPrimaryKeyJoinColumn.java
+++ /dev/null
@@ -1,150 +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.orm;
-
-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.resource.orm.XmlPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.Table;
-
-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());
- }
-
- protected Table getReferencedColumnDbTable() {
- return getOwner().getReferencedColumnDbTable();
- }
-
- @Override
- protected String tableName() {
- return this.getOwner().getTypeMapping().getPrimaryTableName();
- }
-
- 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
- protected void initialize(XmlPrimaryKeyJoinColumn resourcePkJoinColumn) {
- this.resourcePkJoinColumn = resourcePkJoinColumn;
- super.initialize(resourcePkJoinColumn);
- this.specifiedReferencedColumnName = specifiedReferencedColumnName();
- this.defaultReferencedColumnName = defaultReferencedColumnName();
- }
-
- @Override
- public void update(XmlPrimaryKeyJoinColumn resourcePkJoinColumn) {
- this.resourcePkJoinColumn = resourcePkJoinColumn;
- super.update(resourcePkJoinColumn);
- this.setSpecifiedReferencedColumnName_(specifiedReferencedColumnName());
- this.setDefaultReferencedColumnName(defaultReferencedColumnName());
- }
-
- protected String specifiedReferencedColumnName() {
- return this.resourcePkJoinColumn == null ? null : this.resourcePkJoinColumn.getReferencedColumnName();
- }
-
- //TODO not correct when we start supporting primaryKeyJoinColumns in 1-1 mappings
- protected String defaultReferencedColumnName() {
- return buildDefaultName();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmQueryHint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmQueryHint.java
deleted file mode 100644
index e8de5db47d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmQueryHint.java
+++ /dev/null
@@ -1,77 +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.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.AbstractXmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlQueryHint;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-public class GenericOrmQueryHint extends AbstractXmlContextNode 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/context/orm/GenericOrmSecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmSecondaryTable.java
deleted file mode 100644
index da3a1caa82..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmSecondaryTable.java
+++ /dev/null
@@ -1,381 +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.orm;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.Entity;
-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.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.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;
-
-/**
- *
- */
-public class GenericOrmSecondaryTable
- extends AbstractOrmTable
- implements OrmSecondaryTable
-{
- protected XmlSecondaryTable secondaryTable;
-
- protected final List<OrmPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns;
-
- protected OrmPrimaryKeyJoinColumn defaultPrimaryKeyJoinColumn;
-
- public GenericOrmSecondaryTable(OrmEntity parent, XmlSecondaryTable xmlSecondaryTable) {
- super(parent);
- this.specifiedPrimaryKeyJoinColumns = new ArrayList<OrmPrimaryKeyJoinColumn>();
- initialize(xmlSecondaryTable);
- }
-
- 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.createXmlPrimaryKeyJoinColumnImpl();
- 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 OrmBaseJoinColumn.Owner createPrimaryKeyJoinColumnOwner() {
- return new PrimaryKeyJoinColumnOwner();
- }
-
- 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() {
- ListIterator<OrmPrimaryKeyJoinColumn> contextPKJoinColumns = specifiedPrimaryKeyJoinColumns();
- ListIterator<XmlPrimaryKeyJoinColumn> resourcePKJoinColumns = new CloneListIterator<XmlPrimaryKeyJoinColumn>(this.secondaryTable.getPrimaryKeyJoinColumns());//prevent ConcurrentModificiationException
-
- while (contextPKJoinColumns.hasNext()) {
- OrmPrimaryKeyJoinColumn primaryKeyJoinColumn = contextPKJoinColumns.next();
- if (resourcePKJoinColumns.hasNext()) {
- primaryKeyJoinColumn.update(resourcePKJoinColumns.next());
- }
- else {
- removeSpecifiedPrimaryKeyJoinColumn_(primaryKeyJoinColumn);
- }
- }
-
- while (resourcePKJoinColumns.hasNext()) {
- addSpecifiedPrimaryKeyJoinColumn(buildPrimaryKeyJoinColumn(resourcePKJoinColumns.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 getJpaFactory().buildOrmPrimaryKeyJoinColumn(this, createPrimaryKeyJoinColumnOwner(), 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) {
- super.validate(messages);
- if (this.connectionProfileIsActive()) {
- this.validateAgainstDatabase(messages);
- }
- for (Iterator<OrmPrimaryKeyJoinColumn> stream = this.primaryKeyJoinColumns(); stream.hasNext(); ) {
- stream.next().validate(messages);
- }
- }
-
- 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 **********
-
- class PrimaryKeyJoinColumnOwner implements OrmBaseJoinColumn.Owner
- {
-
- public TypeMapping getTypeMapping() {
- return GenericOrmSecondaryTable.this.getOrmEntity();
- }
-
- 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;
- }
- return getOrmEntity().getParentEntity().getPrimaryKeyColumnName();
- }
-
- public TextRange getValidationTextRange() {
- // TODO Auto-generated method stub
- return null;
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmSequenceGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmSequenceGenerator.java
deleted file mode 100644
index 2cfd43635b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmSequenceGenerator.java
+++ /dev/null
@@ -1,103 +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.orm;
-
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmSequenceGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-
-/**
- *
- */
-public class GenericOrmSequenceGenerator
- extends AbstractOrmGenerator<XmlSequenceGenerator>
- implements OrmSequenceGenerator
-{
-
- protected String specifiedSequenceName;
- protected String defaultSequenceName;
-
-
- public GenericOrmSequenceGenerator(XmlContextNode parent, XmlSequenceGenerator resourceSequenceGenerator) {
- super(parent);
- this.initialize(resourceSequenceGenerator);
- }
-
-
- // ********** 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
- }
-
-
- // ********** 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/context/orm/GenericOrmTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTable.java
deleted file mode 100644
index 9bb603437c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTable.java
+++ /dev/null
@@ -1,136 +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.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.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;
-
-/**
- *
- */
-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();
- }
-
- public boolean hasSpecifiedResourceTable() {
- return this.getResourceTable() != null;
- }
-
- @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) {
- super.validate(messages);
- 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/context/orm/GenericOrmTableGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTableGenerator.java
deleted file mode 100644
index ba8e15dbd8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTableGenerator.java
+++ /dev/null
@@ -1,411 +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.orm;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-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.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.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-
-/**
- *
- */
-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);
- }
-
-
- // ********** 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.createXmlUniqueConstraintImpl();
- 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.sortedColumnIdentifiers() : 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() {
- ListIterator<OrmUniqueConstraint> contextConstraints = uniqueConstraints();
- ListIterator<XmlUniqueConstraint> resourceConstraints = EmptyListIterator.instance();
- if (this.resourceGenerator != null) {
- resourceConstraints = new CloneListIterator<XmlUniqueConstraint>(this.resourceGenerator.getUniqueConstraints());//prevent ConcurrentModificiationException
- }
-
- while (contextConstraints.hasNext()) {
- OrmUniqueConstraint contextConstraint = contextConstraints.next();
- if (resourceConstraints.hasNext()) {
- contextConstraint.update(resourceConstraints.next());
- }
- else {
- this.removeUniqueConstraint_(contextConstraint);
- }
- }
-
- while (resourceConstraints.hasNext()) {
- this.addUniqueConstraint(this.buildUniqueConstraint(resourceConstraints.next()));
- }
- }
-
- protected OrmUniqueConstraint buildUniqueConstraint(XmlUniqueConstraint resourceUniqueConstraint) {
- return this.getJpaFactory().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/context/orm/GenericOrmTemporalConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTemporalConverter.java
deleted file mode 100644
index f3953d8fad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTemporalConverter.java
+++ /dev/null
@@ -1,86 +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.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.AbstractXmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericOrmTemporalConverter extends AbstractXmlContextNode
- implements TemporalConverter, OrmConverter
-{
- private TemporalType temporalType;
-
- private 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/context/orm/GenericOrmTransientMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTransientMapping.java
deleted file mode 100644
index 7608af1c04..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTransientMapping.java
+++ /dev/null
@@ -1,50 +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.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.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlTransient;
-
-
-public class GenericOrmTransientMapping extends AbstractOrmAttributeMapping<XmlTransient> implements OrmTransientMapping
-{
-
- public GenericOrmTransientMapping(OrmPersistentAttribute parent) {
- super(parent);
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmTransientMapping(this);
- }
-
- public int getXmlSequence() {
- return 90;
- }
-
- public String getKey() {
- return MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlTransient addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlTransient transientResource = OrmFactory.eINSTANCE.createXmlTransientImpl();
- getPersistentAttribute().initialize(transientResource);
- typeMapping.getAttributes().getTransients().add(transientResource);
- return transientResource;
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- typeMapping.getAttributes().getTransients().remove(this.resourceAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmUniqueConstraint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmUniqueConstraint.java
deleted file mode 100644
index 0a6091878b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmUniqueConstraint.java
+++ /dev/null
@@ -1,123 +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.context.orm;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-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.internal.context.AbstractXmlContextNode;
-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 AbstractXmlContextNode
- implements OrmUniqueConstraint
-{
-
- protected final List<String> columnNames;
-
- protected XmlUniqueConstraint resourceUniqueConstraint;
-
- protected UniqueConstraint.Owner owner;
-
- public GenericOrmUniqueConstraint(XmlContextNode parent, UniqueConstraint.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(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.getColumnNames().remove(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.getColumnNames().move(targetIndex, sourceIndex);
- fireItemMoved(UniqueConstraint.COLUMN_NAMES_LIST, targetIndex, sourceIndex);
- }
-
- public TextRange getValidationTextRange() {
- return this.resourceUniqueConstraint.getValidationTextRange();
- }
-
- protected void initialize(XmlUniqueConstraint resourceUniqueConstraint) {
- this.resourceUniqueConstraint = resourceUniqueConstraint;
- this.initializeColumnNames();
- }
-
- protected void initializeColumnNames() {
- ListIterator<String> xmlColumnNames = new CloneListIterator<String>(this.resourceUniqueConstraint.getColumnNames());
-
- for (String annotationColumnName : CollectionTools.iterable(xmlColumnNames)) {
- this.columnNames.add(annotationColumnName);
- }
- }
-
- public void update(XmlUniqueConstraint resourceUniqueConstraint) {
- this.resourceUniqueConstraint = resourceUniqueConstraint;
- this.updateColumnNames();
- }
-
- protected void updateColumnNames() {
- ListIterator<String> xmlColumnNames = new CloneListIterator<String>(this.resourceUniqueConstraint.getColumnNames());
-
- int index = 0;
- for (String xmlColumnName : CollectionTools.iterable(xmlColumnNames)) {
- if (columnNamesSize() > index) {
- if (this.columnNames.get(index) != xmlColumnName) {
- addColumnName_(index, xmlColumnName);
- }
- }
- else {
- addColumnName_(index, xmlColumnName);
- }
- index++;
- }
-
- for ( ; index < columnNamesSize(); ) {
- removeColumnName_(index);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmVersionMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmVersionMapping.java
deleted file mode 100644
index a7a6e0ef20..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmVersionMapping.java
+++ /dev/null
@@ -1,245 +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.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Converter;
-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.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlVersion;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericOrmVersionMapping extends AbstractOrmAttributeMapping<XmlVersion>
- implements OrmVersionMapping
-{
- protected final OrmColumn column;
-
- protected OrmConverter defaultConverter;
- protected OrmConverter specifiedConverter;
-
- public GenericOrmVersionMapping(OrmPersistentAttribute parent) {
- super(parent);
- this.column = getJpaFactory().buildOrmColumn(this, this);
- }
-
- 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 getSpecifiedConverter() == null ? getDefaultConverter() : getSpecifiedConverter();
- }
-
- public OrmConverter getDefaultConverter() {
- return this.defaultConverter;
- }
-
- public OrmConverter getSpecifiedConverter() {
- return this.specifiedConverter;
- }
-
- protected String getSpecifedConverterType() {
- if (this.specifiedConverter == null) {
- return Converter.NO_CONVERTER;
- }
- return this.specifiedConverter.getType();
- }
-
- public void setSpecifiedConverter(String converterType) {
- if (getSpecifedConverterType() == converterType) {
- return;
- }
- OrmConverter oldConverter = this.specifiedConverter;
- OrmConverter newConverter = buildSpecifiedConverter(converterType);
- this.specifiedConverter = null;
- if (oldConverter != null) {
- oldConverter.removeFromResourceModel();
- }
- this.specifiedConverter = newConverter;
- if (newConverter != null) {
- newConverter.addToResourceModel();
- }
- firePropertyChanged(SPECIFIED_CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- protected void setSpecifiedConverter(OrmConverter newConverter) {
- OrmConverter oldConverter = this.specifiedConverter;
- this.specifiedConverter = newConverter;
- firePropertyChanged(SPECIFIED_CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- public XmlVersion addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlVersion version = OrmFactory.eINSTANCE.createXmlVersionImpl();
- getPersistentAttribute().initialize(version);
- typeMapping.getAttributes().getVersions().add(version);
- return version;
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- typeMapping.getAttributes().getVersions().remove(this.resourceAttributeMapping);
- }
-
- public String getDefaultColumnName() {
- return getAttributeName();
- }
-
- public String getDefaultTableName() {
- return getTypeMapping().getPrimaryTableName();
- }
-
- public Table getDbTable(String tableName) {
- return getTypeMapping().getDbTable(tableName);
- }
-
- @Override
- public void initialize(XmlAttributeMapping attributeMapping) {
- super.initialize(attributeMapping);
- this.column.initialize(this.resourceAttributeMapping.getColumn());
- this.defaultConverter = new GenericOrmNullConverter(this);
- this.specifiedConverter = this.buildSpecifiedConverter(this.specifiedConverterType());
- }
-
- @Override
- public void update() {
- super.update();
- this.column.update(this.resourceAttributeMapping.getColumn());
- if (specifiedConverterType() == getSpecifedConverterType()) {
- getSpecifiedConverter().update();
- }
- else {
- setSpecifiedConverter(buildSpecifiedConverter(specifiedConverterType()));
- }
- }
-
- protected OrmConverter buildSpecifiedConverter(String converterType) {
- if (converterType == Converter.TEMPORAL_CONVERTER) {
- return new GenericOrmTemporalConverter(this, this.resourceAttributeMapping);
- }
- return null;
- }
-
- protected String specifiedConverterType() {
- if (this.resourceAttributeMapping.getTemporal() != null) {
- return Converter.TEMPORAL_CONVERTER;
- }
-
- return null;
- }
-
- //***************** XmlColumn.Owner implementation ****************
-
- public XmlColumn getResourceColumn() {
- return this.resourceAttributeMapping.getColumn();
- }
-
- public void addResourceColumn() {
- this.resourceAttributeMapping.setColumn(OrmFactory.eINSTANCE.createXmlColumnImpl());
- }
-
- public void removeResourceColumn() {
- this.resourceAttributeMapping.setColumn(null);
- }
-
- // ****************** validation ****************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
-
- if (this.connectionProfileIsActive() && this.ownerIsEntity()) {
- this.validateColumn(messages);
- }
- }
-
- protected void validateColumn(List<IMessage> messages) {
- OrmPersistentAttribute pa = this.getPersistentAttribute();
- String tableName = this.column.getTable();
- if (this.getTypeMapping().tableNameIsInvalid(tableName)) {
- if (pa.isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_TABLE,
- new String[] {pa.getName(), tableName, this.column.getName()},
- this.column,
- this.column.getTableTextRange()
- )
- );
- } else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_TABLE,
- new String[] {tableName, this.column.getName()},
- this.column,
- this.column.getTableTextRange()
- )
- );
- }
- return;
- }
-
- if ( ! this.column.isResolved()) {
- if (pa.isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME,
- new String[] {pa.getName(), this.column.getName()},
- this.column,
- this.column.getNameTextRange()
- )
- );
- } else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {this.column.getName()},
- this.column,
- this.column.getNameTextRange()
- )
- );
- }
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericPersistenceUnitDefaults.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericPersistenceUnitDefaults.java
deleted file mode 100644
index a9d9dcb378..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericPersistenceUnitDefaults.java
+++ /dev/null
@@ -1,287 +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.context.orm;
-
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.orm.OrmPersistenceUnitDefaults;
-import org.eclipse.jpt.core.context.orm.PersistenceUnitMetadata;
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-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;
-
-/**
- *
- */
-public class GenericPersistenceUnitDefaults
- extends AbstractXmlContextNode
- implements OrmPersistenceUnitDefaults
-{
- protected XmlEntityMappings entityMappings;
-
- protected AccessType access;
-
- protected String specifiedCatalog;
- protected String defaultCatalog;
-
- protected String specifiedSchema;
- protected String defaultSchema;
-
- protected boolean cascadePersist;
-
-
- // ********** constructor/initialization **********
-
- public GenericPersistenceUnitDefaults(PersistenceUnitMetadata parent, XmlEntityMappings xmlEntityMappings) {
- super(parent);
- this.initialize(xmlEntityMappings);
- }
-
- protected void initialize(XmlEntityMappings xmlEntityMappings) {
- this.entityMappings = xmlEntityMappings;
- XmlPersistenceUnitDefaults resourceDefaults = this.getResourceDefaults();
- if (resourceDefaults != null) {
- this.access = AccessType.fromXmlResourceModel(resourceDefaults.getAccess());
- this.specifiedCatalog = resourceDefaults.getCatalog();
- this.specifiedSchema = resourceDefaults.getSchema();
- this.cascadePersist = resourceDefaults.isCascadePersist();
- }
- this.defaultCatalog = this.getJpaProject().getDefaultCatalog();
- this.defaultSchema = this.getJpaProject().getDefaultSchema();
- }
-
- public boolean resourceExists() {
- return getResourceDefaults() != null;
- }
-
- // ********** access **********
-
- public AccessType getAccess() {
- return this.access;
- }
-
- public void setAccess(AccessType access) {
- AccessType old = this.access;
- this.access = access;
- if (access != old) {
- XmlPersistenceUnitDefaults resourceDefaults = this.getResourceDefaults();
- if (resourceDefaults == null) {
- resourceDefaults = this.buildResourceDefaults();
- }
- resourceDefaults.setAccess(AccessType.toXmlResourceModel(access));
- this.checkResourceDefaults(resourceDefaults);
- 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 *default* 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 resourceDefaults = this.getResourceDefaults();
- if (resourceDefaults == null) {
- resourceDefaults = this.buildResourceDefaults();
- }
- resourceDefaults.setCatalog(catalog);
- this.checkResourceDefaults(resourceDefaults);
- 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);
- }
-
- public Catalog getDbCatalog() {
- String catalog = this.getCatalog();
- if (catalog == null) {
- return null; // not even a default catalog (i.e. database probably does not support catalogs)
- }
- return 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 resourceDefaults = this.getResourceDefaults();
- if (resourceDefaults == null) {
- resourceDefaults = this.buildResourceDefaults();
- }
- resourceDefaults.setSchema(schema);
- this.checkResourceDefaults(resourceDefaults);
- 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());
- }
-
-
- // ********** cascadePersist **********
-
- public boolean isCascadePersist() {
- return this.cascadePersist;
- }
-
- public void setCascadePersist(boolean cascadePersist) {
- boolean old = this.cascadePersist;
- this.cascadePersist = cascadePersist;
- if (cascadePersist != old) {
- XmlPersistenceUnitDefaults resourceDefaults = this.getResourceDefaults();
- if (resourceDefaults == null) {
- resourceDefaults = this.buildResourceDefaults();
- }
- resourceDefaults.setCascadePersist(cascadePersist);
- this.checkResourceDefaults(resourceDefaults);
- 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);
- }
-
-
- // ********** behavior **********
-
- /**
- * build the resource defaults and the resource metadata if necessary
- */
- protected XmlPersistenceUnitDefaults buildResourceDefaults() {
- XmlPersistenceUnitMetadata resourceMetadata = this.entityMappings.getPersistenceUnitMetadata();
- if (resourceMetadata == null) {
- resourceMetadata = OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata();
- this.entityMappings.setPersistenceUnitMetadata(resourceMetadata);
- }
- XmlPersistenceUnitDefaults resourceDefaults = OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults();
- resourceMetadata.setPersistenceUnitDefaults(resourceDefaults);
- return resourceDefaults;
- }
-
- /**
- * clear the resource defaults and the resource metadata if appropriate
- */
- protected void checkResourceDefaults(XmlPersistenceUnitDefaults resourceDefaults) {
- if (resourceDefaults.isAllFeaturesUnset()) {
- XmlPersistenceUnitMetadata metadata = this.entityMappings.getPersistenceUnitMetadata();
- metadata.setPersistenceUnitDefaults(null);
- if (metadata.isAllFeaturesUnset()) {
- this.entityMappings.setPersistenceUnitMetadata(null);
- }
- }
- }
-
- public void update() {
- XmlPersistenceUnitDefaults resourceDefaults = this.getResourceDefaults();
- if (resourceDefaults == null) {
- this.setAccess_(null);
- this.setSpecifiedCatalog_(null);
- this.setSpecifiedSchema_(null);
- this.setCascadePersist_(false);
- } else {
- this.setAccess_(AccessType.fromXmlResourceModel(resourceDefaults.getAccess()));
- this.setSpecifiedCatalog_(resourceDefaults.getCatalog());
- this.setSpecifiedSchema_(resourceDefaults.getSchema());
- this.setCascadePersist_(resourceDefaults.isCascadePersist());
- }
- this.setDefaultCatalog(this.getJpaProject().getDefaultCatalog());
- this.setDefaultSchema(this.getJpaProject().getDefaultSchema());
- }
-
- public TextRange getValidationTextRange() {
- XmlPersistenceUnitDefaults resourceDefaults = this.getResourceDefaults();
- return (resourceDefaults != null) ? resourceDefaults.getValidationTextRange() : this.entityMappings.getValidationTextRange();
- }
-
- protected XmlPersistenceUnitDefaults getResourceDefaults() {
- XmlPersistenceUnitMetadata metadata = this.entityMappings.getPersistenceUnitMetadata();
- return (metadata == null) ? null : metadata.getPersistenceUnitDefaults();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericPersistenceUnitMetadata.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericPersistenceUnitMetadata.java
deleted file mode 100644
index 19f49d2740..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericPersistenceUnitMetadata.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.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.AbstractXmlContextNode;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericPersistenceUnitMetadata extends AbstractXmlContextNode
- implements PersistenceUnitMetadata
-{
- protected boolean xmlMappingMetadataComplete;
-
- protected final OrmPersistenceUnitDefaults persistenceUnitDefaults;
-
- protected XmlEntityMappings entityMappings;
-
- public GenericPersistenceUnitMetadata(EntityMappings parent, XmlEntityMappings xmlEntityMappings) {
- super(parent);
- this.persistenceUnitDefaults = getJpaFactory().buildPersistenceUnitDefaults(this, xmlEntityMappings);
- this.initialize(xmlEntityMappings);
- }
-
- public boolean isXmlMappingMetadataComplete() {
- return this.xmlMappingMetadataComplete;
- }
-
- public void setXmlMappingMetadataComplete(boolean newXmlMappingMetadataComplete) {
- boolean oldXmlMappingMetadataComplete = this.xmlMappingMetadataComplete;
- this.xmlMappingMetadataComplete = newXmlMappingMetadataComplete;
- if (oldXmlMappingMetadataComplete != newXmlMappingMetadataComplete) {
- if (this.persistenceUnitMetadata() != null) {
- this.persistenceUnitMetadata().setXmlMappingMetadataComplete(newXmlMappingMetadataComplete);
- if (this.persistenceUnitMetadata().isAllFeaturesUnset()) {
- this.entityMappings.setPersistenceUnitMetadata(null);
- }
- }
- else if (newXmlMappingMetadataComplete) {
- this.entityMappings.setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- this.persistenceUnitMetadata().setXmlMappingMetadataComplete(newXmlMappingMetadataComplete);
- }
- }
- firePropertyChanged(PersistenceUnitMetadata.XML_MAPPING_METADATA_COMPLETE_PROPERTY, oldXmlMappingMetadataComplete, newXmlMappingMetadataComplete);
- }
-
- protected void setXmlMappingMetadataComplete_(boolean newXmlMappingMetadataComplete) {
- boolean oldXmlMappingMetadataComplete = this.xmlMappingMetadataComplete;
- this.xmlMappingMetadataComplete = newXmlMappingMetadataComplete;
- firePropertyChanged(PersistenceUnitMetadata.XML_MAPPING_METADATA_COMPLETE_PROPERTY, oldXmlMappingMetadataComplete, newXmlMappingMetadataComplete);
- }
-
- public OrmPersistenceUnitDefaults getPersistenceUnitDefaults() {
- return this.persistenceUnitDefaults;
- }
-
- protected void initialize(XmlEntityMappings entityMappings) {
- this.entityMappings = entityMappings;
- if (this.persistenceUnitMetadata() != null) {
- this.xmlMappingMetadataComplete = this.persistenceUnitMetadata().isXmlMappingMetadataComplete();
- }
- }
-
- public void update() {
- if (this.persistenceUnitMetadata() != null) {
- setXmlMappingMetadataComplete_(this.persistenceUnitMetadata().isXmlMappingMetadataComplete());
- }
- else {
- setXmlMappingMetadataComplete_(false);
- }
- this.persistenceUnitDefaults.update();
- }
-
- protected XmlPersistenceUnitMetadata persistenceUnitMetadata() {
- return this.entityMappings.getPersistenceUnitMetadata();
- }
-
- public TextRange getValidationTextRange() {
- if (persistenceUnitMetadata() != null) {
- return persistenceUnitMetadata().getValidationTextRange();
- }
- return this.entityMappings.getValidationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmBasicMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmBasicMappingProvider.java
deleted file mode 100644
index 7c2b5febd0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmBasicMappingProvider.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.context.orm;
-
-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.JavaBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-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.resource.orm.XmlBasic;
-
-public class OrmBasicMappingProvider implements OrmAttributeMappingProvider
-{
- // singleton
- private static final OrmBasicMappingProvider INSTANCE = new OrmBasicMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private OrmBasicMappingProvider() {
- super();
- }
-
- public String getKey() {
- return MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY;
- }
-
- public OrmBasicMapping buildMapping(OrmPersistentAttribute parent, JpaFactory factory) {
- return factory.buildOrmBasicMapping(parent);
- }
-
- public XmlBasic buildVirtualResourceMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping, JpaFactory factory) {
- return factory.buildVirtualXmlBasic(ormTypeMapping, (JavaBasicMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmCascade.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmCascade.java
deleted file mode 100644
index 7940b574b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmCascade.java
+++ /dev/null
@@ -1,244 +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.orm;
-
-import org.eclipse.jpt.core.context.Cascade;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipMapping;
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-public class OrmCascade extends AbstractXmlContextNode implements Cascade
-{
- protected boolean all;
-
- protected boolean persist;
-
- protected boolean merge;
-
- protected boolean remove;
-
- protected boolean refresh;
-
-
- protected XmlRelationshipMapping relationshipMapping;
-
- protected OrmCascade(OrmRelationshipMapping parent) {
- super(parent);
- }
-
- public void initializeFrom(Cascade oldCascade) {
- setAll(oldCascade.isAll());
- setPersist(oldCascade.isPersist());
- setMerge(oldCascade.isMerge());
- setRemove(oldCascade.isRemove());
- setRefresh(oldCascade.isRefresh());
- }
-
- public boolean isAll() {
- return this.all;
- }
-
- public void setAll(boolean newAll) {
- boolean oldAll = this.all;
- this.all = newAll;
- if (oldAll != newAll) {
- if (this.getCascadeResource() != null) {
- this.getCascadeResource().setCascadeAll(newAll);
- if (this.getCascadeResource().isAllFeaturesUnset()) {
- removeCascadeResource();
- }
- }
- else if (newAll != false) {
- addCascadeResource();
- getCascadeResource().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.getCascadeResource() != null) {
- this.getCascadeResource().setCascadePersist(newPersist);
- if (this.getCascadeResource().isAllFeaturesUnset()) {
- removeCascadeResource();
- }
- }
- else if (newPersist != false) {
- addCascadeResource();
- getCascadeResource().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.getCascadeResource() != null) {
- this.getCascadeResource().setCascadeMerge(newMerge);
- if (this.getCascadeResource().isAllFeaturesUnset()) {
- removeCascadeResource();
- }
- }
- else if (newMerge != false) {
- addCascadeResource();
- getCascadeResource().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;
- this.remove = newRemove;
- if (oldRemove != newRemove) {
- if (this.getCascadeResource() != null) {
- this.getCascadeResource().setCascadeRemove(newRemove);
- if (this.getCascadeResource().isAllFeaturesUnset()) {
- removeCascadeResource();
- }
- }
- else if (newRemove != false) {
- addCascadeResource();
- getCascadeResource().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.getCascadeResource() != null) {
- this.getCascadeResource().setCascadeRefresh(newRefresh);
- if (this.getCascadeResource().isAllFeaturesUnset()) {
- removeCascadeResource();
- }
- }
- else if (newRefresh != false) {
- addCascadeResource();
- getCascadeResource().setCascadeRefresh(newRefresh);
- }
- }
- firePropertyChanged(REFRESH_PROPERTY, oldRefresh, newRefresh);
- }
-
- protected void setRefresh_(boolean newRefresh) {
- boolean oldRefresh = this.refresh;
- this.refresh = newRefresh;
- firePropertyChanged(REFRESH_PROPERTY, oldRefresh, newRefresh);
- }
-
-
- protected CascadeType getCascadeResource() {
- return this.relationshipMapping.getCascade();
- }
-
- protected void removeCascadeResource() {
- this.relationshipMapping.setCascade(null);
- }
-
- protected void addCascadeResource() {
- this.relationshipMapping.setCascade(OrmFactory.eINSTANCE.createCascadeTypeImpl());
- }
-
- public void initialize(XmlRelationshipMapping relationshipMapping) {
- this.relationshipMapping = relationshipMapping;
- CascadeType cascade = getCascadeResource();
- this.all = this.all(cascade);
- this.persist = this.persist(cascade);
- this.merge = this.merge(cascade);
- this.remove = this.remove(cascade);
- this.refresh = this.refresh(cascade);
- }
-
- public void update() {
- CascadeType cascade = getCascadeResource();
- this.setAll_(this.all(cascade));
- this.setPersist_(this.persist(cascade));
- this.setMerge_(this.merge(cascade));
- this.setRemove_(this.remove(cascade));
- this.setRefresh_(this.refresh(cascade));
- }
-
- protected boolean all(CascadeType cascade) {
- return cascade == null ? false : cascade.isCascadeAll();
- }
-
- protected boolean persist(CascadeType cascade) {
- return cascade == null ? false : cascade.isCascadePersist();
- }
-
- protected boolean merge(CascadeType cascade) {
- return cascade == null ? false : cascade.isCascadeMerge();
- }
-
- protected boolean remove(CascadeType cascade) {
- return cascade == null ? false : cascade.isCascadeRemove();
- }
-
- protected boolean refresh(CascadeType cascade) {
- return cascade == null ? false : cascade.isCascadeRefresh();
- }
-
- public TextRange getValidationTextRange() {
- return this.getCascadeResource().getValidationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddableProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddableProvider.java
deleted file mode 100644
index 7b975610ba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddableProvider.java
+++ /dev/null
@@ -1,29 +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.context.orm;
-
-import org.eclipse.jpt.core.JpaFactory;
-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.OrmTypeMappingProvider;
-
-
-public class OrmEmbeddableProvider implements OrmTypeMappingProvider
-{
-
- public OrmEmbeddable buildMapping(OrmPersistentType parent, JpaFactory factory) {
- return factory.buildOrmEmbeddable(parent);
- }
-
- public String getKey() {
- return MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddedIdMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddedIdMappingProvider.java
deleted file mode 100644
index a07c604bfd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddedIdMappingProvider.java
+++ /dev/null
@@ -1,52 +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.orm;
-
-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.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddedId;
-
-public class OrmEmbeddedIdMappingProvider implements OrmAttributeMappingProvider
-{
- // singleton
- private static final OrmEmbeddedIdMappingProvider INSTANCE = new OrmEmbeddedIdMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private OrmEmbeddedIdMappingProvider() {
- super();
- }
-
- public OrmEmbeddedIdMapping buildMapping(OrmPersistentAttribute parent, JpaFactory factory) {
- return factory.buildOrmEmbeddedIdMapping(parent);
- }
-
- public String getKey() {
- return MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlEmbeddedId buildVirtualResourceMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping, JpaFactory factory) {
- return factory.buildVirtualXmlEmbeddedId(ormTypeMapping, (JavaEmbeddedIdMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddedMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddedMappingProvider.java
deleted file mode 100644
index 025e1c4bcc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddedMappingProvider.java
+++ /dev/null
@@ -1,52 +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.orm;
-
-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.JavaEmbeddedMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlEmbedded;
-
-public class OrmEmbeddedMappingProvider implements OrmAttributeMappingProvider
-{
- // singleton
- private static final OrmEmbeddedMappingProvider INSTANCE = new OrmEmbeddedMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private OrmEmbeddedMappingProvider() {
- super();
- }
-
- public OrmEmbeddedMapping buildMapping(OrmPersistentAttribute parent, JpaFactory factory) {
- return factory.buildOrmEmbeddedMapping(parent);
- }
-
- public String getKey() {
- return MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlEmbedded buildVirtualResourceMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping, JpaFactory factory) {
- return factory.buildVirtualXmlEmbedded(ormTypeMapping, (JavaEmbeddedMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEntityProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEntityProvider.java
deleted file mode 100644
index c4db647d7a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEntityProvider.java
+++ /dev/null
@@ -1,28 +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.context.orm;
-
-import org.eclipse.jpt.core.JpaFactory;
-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.OrmTypeMappingProvider;
-
-
-public class OrmEntityProvider implements OrmTypeMappingProvider
-{
- public OrmEntity buildMapping(OrmPersistentType parent, JpaFactory factory) {
- return factory.buildOrmEntity(parent);
- }
-
- public String getKey() {
- return MappingKeys.ENTITY_TYPE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmIdMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmIdMappingProvider.java
deleted file mode 100644
index b4a75e0b3c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmIdMappingProvider.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.context.orm;
-
-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.JavaIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlId;
-
-public class OrmIdMappingProvider implements OrmAttributeMappingProvider
-{
- // singleton
- private static final OrmIdMappingProvider INSTANCE = new OrmIdMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private OrmIdMappingProvider() {
- super();
- }
- public String getKey() {
- return MappingKeys.ID_ATTRIBUTE_MAPPING_KEY;
- }
-
- public OrmIdMapping buildMapping(OrmPersistentAttribute parent, JpaFactory factory) {
- return factory.buildOrmIdMapping(parent);
- }
-
- public XmlId buildVirtualResourceMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping, JpaFactory factory) {
- return factory.buildVirtualXmlId(ormTypeMapping, (JavaIdMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmManyToManyMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmManyToManyMappingProvider.java
deleted file mode 100644
index c0f3b17a57..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmManyToManyMappingProvider.java
+++ /dev/null
@@ -1,52 +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.orm;
-
-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.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
-
-public class OrmManyToManyMappingProvider implements OrmAttributeMappingProvider
-{
- // singleton
- private static final OrmManyToManyMappingProvider INSTANCE = new OrmManyToManyMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private OrmManyToManyMappingProvider() {
- super();
- }
-
- public String getKey() {
- return MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public OrmManyToManyMapping buildMapping(OrmPersistentAttribute parent, JpaFactory factory) {
- return factory.buildOrmManyToManyMapping(parent);
- }
-
- public XmlManyToMany buildVirtualResourceMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping, JpaFactory factory) {
- return factory.buildVirtualXmlManyToMany(ormTypeMapping, (JavaManyToManyMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmManyToOneMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmManyToOneMappingProvider.java
deleted file mode 100644
index f0df81cb74..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmManyToOneMappingProvider.java
+++ /dev/null
@@ -1,52 +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.orm;
-
-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.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-
-public class OrmManyToOneMappingProvider implements OrmAttributeMappingProvider
-{
- // singleton
- private static final OrmManyToOneMappingProvider INSTANCE = new OrmManyToOneMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private OrmManyToOneMappingProvider() {
- super();
- }
-
- public String getKey() {
- return MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public OrmManyToOneMapping buildMapping(OrmPersistentAttribute parent, JpaFactory factory) {
- return factory.buildOrmManyToOneMapping(parent);
- }
-
- public XmlManyToOne buildVirtualResourceMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping, JpaFactory factory) {
- return factory.buildVirtualXmlManyToOne(ormTypeMapping, (JavaManyToOneMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmMappedSuperclassProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmMappedSuperclassProvider.java
deleted file mode 100644
index 0d76cf523f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmMappedSuperclassProvider.java
+++ /dev/null
@@ -1,28 +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.context.orm;
-
-import org.eclipse.jpt.core.JpaFactory;
-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.OrmTypeMappingProvider;
-
-
-public class OrmMappedSuperclassProvider implements OrmTypeMappingProvider
-{
- public OrmMappedSuperclass buildMapping(OrmPersistentType parent, JpaFactory factory) {
- return factory.buildOrmMappedSuperclass(parent);
- }
-
- public String getKey() {
- return MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmNullAttributeMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmNullAttributeMappingProvider.java
deleted file mode 100644
index e072a3691b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmNullAttributeMappingProvider.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.context.orm;
-
-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.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping;
-
-public class OrmNullAttributeMappingProvider implements OrmAttributeMappingProvider
-{
- // singleton
- private static final OrmNullAttributeMappingProvider INSTANCE = new OrmNullAttributeMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private OrmNullAttributeMappingProvider() {
- super();
- }
-
- public String getKey() {
- return MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY;
- }
-
- public OrmAttributeMapping buildMapping(OrmPersistentAttribute parent, JpaFactory factory) {
- return factory.buildOrmNullAttributeMapping(parent);
- }
-
- public XmlNullAttributeMapping buildVirtualResourceMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping, JpaFactory factory) {
- return factory.buildVirtualXmlNullAttributeMapping(ormTypeMapping, javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOneToManyMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOneToManyMappingProvider.java
deleted file mode 100644
index 7cb57c64cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOneToManyMappingProvider.java
+++ /dev/null
@@ -1,52 +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.orm;
-
-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.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-
-public class OrmOneToManyMappingProvider implements OrmAttributeMappingProvider
-{
- // singleton
- private static final OrmOneToManyMappingProvider INSTANCE = new OrmOneToManyMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private OrmOneToManyMappingProvider() {
- super();
- }
-
- public String getKey() {
- return MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public OrmOneToManyMapping buildMapping(OrmPersistentAttribute parent, JpaFactory factory) {
- return factory.buildOrmOneToManyMapping(parent);
- }
-
- public XmlOneToMany buildVirtualResourceMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping, JpaFactory factory) {
- return factory.buildVirtualXmlOneToMany(ormTypeMapping, (JavaOneToManyMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOneToOneMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOneToOneMappingProvider.java
deleted file mode 100644
index bb37b13ed0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOneToOneMappingProvider.java
+++ /dev/null
@@ -1,52 +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.orm;
-
-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.JavaOneToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-
-public class OrmOneToOneMappingProvider implements OrmAttributeMappingProvider
-{
- // singleton
- private static final OrmOneToOneMappingProvider INSTANCE = new OrmOneToOneMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private OrmOneToOneMappingProvider() {
- super();
- }
-
- public String getKey() {
- return MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public OrmOneToOneMapping buildMapping(OrmPersistentAttribute parent, JpaFactory factory) {
- return factory.buildOrmOneToOneMapping(parent);
- }
-
- public XmlOneToOne buildVirtualResourceMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping, JpaFactory factory) {
- return factory.buildVirtualXmlOneToOne(ormTypeMapping, (JavaOneToOneMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmTransientMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmTransientMappingProvider.java
deleted file mode 100644
index 59cf49dd0c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmTransientMappingProvider.java
+++ /dev/null
@@ -1,52 +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.orm;
-
-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.JavaTransientMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTransientMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlTransient;
-
-public class OrmTransientMappingProvider implements OrmAttributeMappingProvider
-{
- // singleton
- private static final OrmTransientMappingProvider INSTANCE = new OrmTransientMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private OrmTransientMappingProvider() {
- super();
- }
-
- public String getKey() {
- return MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- public OrmTransientMapping buildMapping(OrmPersistentAttribute parent, JpaFactory factory) {
- return factory.buildOrmTransientMapping(parent);
- }
-
- public XmlTransient buildVirtualResourceMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping, JpaFactory factory) {
- return factory.buildVirtualXmlTransient(ormTypeMapping, (JavaTransientMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmVersionMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmVersionMappingProvider.java
deleted file mode 100644
index a68df4fd3c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmVersionMappingProvider.java
+++ /dev/null
@@ -1,52 +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.orm;
-
-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.JavaVersionMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.core.resource.orm.XmlVersion;
-
-public class OrmVersionMappingProvider implements OrmAttributeMappingProvider
-{
- // singleton
- private static final OrmVersionMappingProvider INSTANCE = new OrmVersionMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private OrmVersionMappingProvider() {
- super();
- }
-
- public String getKey() {
- return MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public OrmVersionMapping buildMapping(OrmPersistentAttribute parent, JpaFactory factory) {
- return factory.buildOrmVersionMapping(parent);
- }
-
- public XmlVersion buildVirtualResourceMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping, JpaFactory factory) {
- return factory.buildVirtualXmlVersion(ormTypeMapping, (JavaVersionMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmXmlImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmXmlImpl.java
deleted file mode 100644
index e3db059e97..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmXmlImpl.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.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.context.MappingFileRoot;
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.core.context.orm.OrmPersistenceUnitDefaults;
-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.AbstractXmlContextNode;
-import org.eclipse.jpt.core.resource.common.JpaXmlResource;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.OrmResource;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class OrmXmlImpl
- extends AbstractXmlContextNode
- implements OrmXml
-{
- protected OrmResource ormResource;
-
- protected EntityMappings entityMappings;
-
-
- public OrmXmlImpl(MappingFileRef parent, OrmResource ormResource) {
- super(parent);
- this.initialize(ormResource);
- }
-
-
- // **************** JpaNode impl *******************************************
-
- @Override
- public MappingFileRef getParent() {
- return (MappingFileRef) super.getParent();
- }
-
- @Override
- public IResource getResource() {
- return this.ormResource.getFile();
- }
-
-
- // **************** JpaContextNode impl ************************************
-
- @Override
- public MappingFileRoot getMappingFileRoot() {
- // TODO Auto-generated method stub
- return getEntityMappings();
- }
-
-
- // **************** XmlContextNode impl ************************************
-
- @Override
- public JpaXmlResource getEResource() {
- return this.ormResource;
- }
-
-
- // **************** JpaStructureNode impl **********************************
-
- public String getId() {
- // isn't actually displayed, so needs no details page
- return null;
- }
-
-
- // **************** MappingFile impl ***************************************
-
- public JpaXmlResource getXmlResource() {
- return ormResource;
- }
-
- public MappingFileRoot getRoot() {
- return getEntityMappings();
- }
-
- public OrmPersistentType getPersistentType(String fullyQualifiedTypeName) {
- return (this.entityMappings == null) ? null : this.entityMappings.getPersistentType(fullyQualifiedTypeName);
- }
-
-
-
- // **************** persistence ********************************************
-
- public EntityMappings getEntityMappings() {
- return this.entityMappings;
- }
-
- protected void setEntityMappings(EntityMappings newEntityMappings) {
- EntityMappings oldEntityMappings = this.entityMappings;
- this.entityMappings = newEntityMappings;
- firePropertyChanged(ENTITY_MAPPINGS_PROPERTY, oldEntityMappings, newEntityMappings);
- }
-
- public EntityMappings addEntityMappings() {
- if (this.entityMappings != null) {
- throw new IllegalStateException();
- }
-
- XmlEntityMappings xmlEntityMappings = buildEntityMappingsResource();
- this.entityMappings = buildEntityMappings(xmlEntityMappings);
- this.ormResource.getContents().add(xmlEntityMappings);
- firePropertyChanged(ENTITY_MAPPINGS_PROPERTY, null, this.entityMappings);
- return this.entityMappings;
- }
-
- protected XmlEntityMappings buildEntityMappingsResource() {
- return OrmFactory.eINSTANCE.createXmlEntityMappings();
- }
-
- public void removeEntityMappings() {
- if (this.entityMappings == null) {
- throw new IllegalStateException();
- }
- getJpaFile(this.ormResource.getFile()).removeRootStructureNode(this.ormResource);
- this.entityMappings.dispose();
- EntityMappings oldEntityMappings = this.entityMappings;
-
- this.entityMappings = null;
- XmlEntityMappings xmlEntityMappings = this.ormResource.getEntityMappings(); //TODO helper removeEntityMappings method on ormResource??
- this.ormResource.getContents().remove(xmlEntityMappings);
- firePropertyChanged(ENTITY_MAPPINGS_PROPERTY, oldEntityMappings, null);
- }
-
- public OrmPersistenceUnitDefaults getPersistenceUnitDefaults() {
- return (this.entityMappings == null) ? null : this.entityMappings.getPersistenceUnitDefaults();
- }
-
-
- // **************** updating ***********************************************
-
- protected void initialize(OrmResource resource) {
- this.ormResource = resource;
- XmlEntityMappings xmlEntityMappings = resource.getEntityMappings();
- if (xmlEntityMappings != null) {
- this.entityMappings = buildEntityMappings(xmlEntityMappings);
- }
- }
-
- public void update(JpaXmlResource resource) {
- try {
- this.ormResource = (OrmResource) resource;
- } catch (ClassCastException cce) {
- throw new IllegalArgumentException(resource.toString());
- }
- XmlEntityMappings xmlEntityMappings = this.ormResource.getEntityMappings();
- if (xmlEntityMappings != null) {
- if (this.entityMappings != null) {
- this.getJpaFile(this.ormResource.getFile()).addRootStructureNode(this.ormResource, this.entityMappings);
- this.entityMappings.update();
- } else {
- this.setEntityMappings(this.buildEntityMappings(xmlEntityMappings));
- }
- } else {
- if (this.entityMappings != null) {
- this.getJpaFile(this.ormResource.getFile()).removeRootStructureNode(this.ormResource);
- this.entityMappings.dispose();
- }
- this.setEntityMappings(null);
- }
- }
-
- protected EntityMappings buildEntityMappings(XmlEntityMappings xmlEntityMappings) {
- return getJpaFactory().buildEntityMappings(this, xmlEntityMappings);
- }
-
-
- // *************************************************************************
-
- public JpaStructureNode getStructureNode(int textOffset) {
- if (entityMappings.containsOffset(textOffset)) {
- return entityMappings.getStructureNode(textOffset);
- }
- return this;
- }
-
- // never actually selected
- public TextRange getSelectionTextRange() {
- return TextRange.Empty.instance();
- }
-
- public TextRange getValidationTextRange() {
- return TextRange.Empty.instance();
- }
-
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- if (this.entityMappings != null) {
- this.entityMappings.validate(messages);
- }
- }
-
- public void dispose() {
- if (this.entityMappings != null) {
- this.entityMappings.dispose();
- }
- }
-
-}
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 19b82a480f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualCascadeType.java
+++ /dev/null
@@ -1,82 +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.context.orm;
-
-import org.eclipse.jpt.core.context.Cascade;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-
-public class VirtualCascadeType extends AbstractJpaEObject implements CascadeType
-{
- Cascade javaCascade;
-
- protected boolean metadataComplete;
-
- public VirtualCascadeType(Cascade javaCascade, boolean metadataComplete) {
- super();
- this.javaCascade = javaCascade;
- this.metadataComplete = metadataComplete;
- }
-
- public boolean isCascadeAll() {
- if (this.metadataComplete) {
- return false;
- }
- return this.javaCascade.isAll();
- }
-
- public void setCascadeAll(@SuppressWarnings("unused") boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public boolean isCascadeMerge() {
- if (this.metadataComplete) {
- return false;
- }
- return this.javaCascade.isMerge();
- }
-
- public void setCascadeMerge(@SuppressWarnings("unused") boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public boolean isCascadePersist() {
- if (this.metadataComplete) {
- return false;
- }
- return this.javaCascade.isPersist();
- }
-
- public void setCascadePersist(@SuppressWarnings("unused") boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public boolean isCascadeRefresh() {
- if (this.metadataComplete) {
- return false;
- }
- return this.javaCascade.isRefresh();
- }
-
- public void setCascadeRefresh(@SuppressWarnings("unused") boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public boolean isCascadeRemove() {
- if (this.metadataComplete) {
- return false;
- }
- return this.javaCascade.isRemove();
- }
-
- public void setCascadeRemove(@SuppressWarnings("unused") boolean 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/VirtualMapKey.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualMapKey.java
deleted file mode 100644
index 2f36afd976..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualMapKey.java
+++ /dev/null
@@ -1,38 +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.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaMultiRelationshipMapping;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.MapKey;
-
-public class VirtualMapKey extends AbstractJpaEObject implements MapKey
-{
- JavaMultiRelationshipMapping javaMultiRelationshipMapping;
-
- protected boolean metadataComplete;
-
- public VirtualMapKey(JavaMultiRelationshipMapping javaMultiRelationshipMapping, boolean metadataComplete) {
- super();
- this.javaMultiRelationshipMapping = javaMultiRelationshipMapping;
- this.metadataComplete = metadataComplete;
- }
-
- public String getName() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaMultiRelationshipMapping.getMapKey();
- }
-
- public void setName(@SuppressWarnings("unused") 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/VirtualXmlAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeMapping.java
deleted file mode 100644
index 3126da1d9a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeMapping.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.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.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public abstract class VirtualXmlAttributeMapping<T extends JavaAttributeMapping> extends AbstractJpaEObject implements XmlAttributeMapping
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final T javaAttributeMapping;
-
- protected VirtualXmlAttributeMapping(OrmTypeMapping ormTypeMapping, T javaAttributeMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaAttributeMapping;
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- protected T getJavaAttributeMapping() {
- return this.javaAttributeMapping;
- }
-
- public String getMappingKey() {
- //TODO unsure about this, but don't believe we should be asking a virtual mapping for it's mapping key
- //or maybe we should be asking the javaAttributeMapping for its default or specified mapping key?
- throw new UnsupportedOperationException();
- }
-
- public String getName() {
- return this.javaAttributeMapping.getPersistentAttribute().getName();
- }
-
- public void setName(@SuppressWarnings("unused")String newName) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public TextRange getNameTextRange() {
- return null;
- }
-
-}
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 8e58b9dc09..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeOverride.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-
-public class VirtualXmlAttributeOverride extends AbstractJpaEObject implements XmlAttributeOverride
-{
-
- protected String name;
-
- protected final XmlColumn column;
-
- protected VirtualXmlAttributeOverride(String name, XmlColumn xmlColumn) {
- super();
- this.name = name;
- this.column = xmlColumn;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-
- public XmlColumn getColumn() {
- return this.column;
- }
-
- public void setColumn(@SuppressWarnings("unused") 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/VirtualXmlBasic.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlBasic.java
deleted file mode 100644
index 5594004051..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlBasic.java
+++ /dev/null
@@ -1,126 +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.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 VirtualXmlAttributeMapping<JavaBasicMapping> implements XmlBasic
-{
-
- protected final VirtualXmlColumn column;
-
- public VirtualXmlBasic(OrmTypeMapping ormTypeMapping, JavaBasicMapping javaBasicMapping) {
- super(ormTypeMapping, javaBasicMapping);
- this.column = new VirtualXmlColumn(ormTypeMapping, javaBasicMapping.getColumn());
- }
-
- public XmlColumn getColumn() {
- return this.column;
- }
-
- public void setColumn(@SuppressWarnings("unused")XmlColumn value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- 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());
- }
-
- public void setFetch(@SuppressWarnings("unused")FetchType newFetch) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public Boolean getOptional() {
- if (this.isOrmMetadataComplete()) {
- return this.javaAttributeMapping.getDefaultOptional();
- }
- return this.javaAttributeMapping.getOptional();
- }
-
- public void setOptional(@SuppressWarnings("unused")Boolean newOptional) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public boolean isLob() {
- if (this.isOrmMetadataComplete()) {
- return false;
- }
- return this.javaAttributeMapping.getConverter().getType() == Converter.LOB_CONVERTER;
- }
-
- public void setLob(@SuppressWarnings("unused")boolean newLob) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- 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;
- }
-
- public void setTemporal(@SuppressWarnings("unused")TemporalType newTemporal){
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public EnumType getEnumerated() {
- if (this.javaAttributeMapping.getConverter().getType() != Converter.ENUMERATED_CONVERTER) {
- return null;
- }
- org.eclipse.jpt.core.context.EnumType javaEnumeratedType;
- if (this.isOrmMetadataComplete()) {
- if (this.javaAttributeMapping.getDefaultConverter().getType() != Converter.ENUMERATED_CONVERTER) {
- return null;
- }
- javaEnumeratedType = ((EnumeratedConverter) this.javaAttributeMapping.getDefaultConverter()).getSpecifiedEnumType();
- }
- else {
- javaEnumeratedType = ((EnumeratedConverter) this.javaAttributeMapping.getConverter()).getEnumType();
- }
- return org.eclipse.jpt.core.context.EnumType.toOrmResourceModel(javaEnumeratedType);
- }
-
- public void setEnumerated(@SuppressWarnings("unused")EnumType newEnumerated) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public TextRange getEnumeratedTextRange() {
- return null;
- }
-
- public TextRange getLobTextRange() {
- return null;
- }
-
- 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 992e347623..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlColumn.java
+++ /dev/null
@@ -1,165 +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.context.orm;
-
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-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 AbstractJpaEObject implements XmlColumn
-{
-
- protected Column column;
-
- protected OrmTypeMapping ormTypeMapping;
-
-
- protected VirtualXmlColumn(OrmTypeMapping ormTypeMapping, Column column) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.column = column;
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- public String getColumnDefinition() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- return this.column.getColumnDefinition();
- }
-
- public void setColumnDefinition(@SuppressWarnings("unused")String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public Boolean getInsertable() {
- if (this.isOrmMetadataComplete()) {
- return this.column.getDefaultInsertable();
- }
- return this.column.getInsertable();
- }
-
- public void setInsertable(@SuppressWarnings("unused")Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public Integer getLength() {
- if (this.isOrmMetadataComplete()) {
- return this.column.getDefaultLength();
- }
- return this.column.getLength();
- }
-
- public void setLength(@SuppressWarnings("unused")Integer value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getName() {
- if (this.isOrmMetadataComplete()) {
- return this.column.getDefaultName();
- }
- return this.column.getName();
- }
-
- public void setName(@SuppressWarnings("unused")String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public Boolean getNullable() {
- if (this.isOrmMetadataComplete()) {
- return this.column.getDefaultNullable();
- }
- return this.column.getNullable();
- }
-
- public void setNullable(@SuppressWarnings("unused")Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public Integer getPrecision() {
- if (this.isOrmMetadataComplete()) {
- return this.column.getDefaultPrecision();
- }
- return this.column.getPrecision();
- }
-
- public void setPrecision(@SuppressWarnings("unused")Integer value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public Integer getScale() {
- if (this.isOrmMetadataComplete()) {
- return this.column.getDefaultScale();
- }
- return this.column.getScale();
- }
-
- public void setScale(@SuppressWarnings("unused")Integer value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getTable() {
- if (!this.isOrmMetadataComplete()) {
- if (this.column.getSpecifiedTable() != null) {
- return this.column.getSpecifiedTable();
- }
- }
- return this.ormTypeMapping.getPrimaryTableName();
- }
-
- public void setTable(@SuppressWarnings("unused")String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public Boolean getUnique() {
- if (this.isOrmMetadataComplete()) {
- return this.column.getDefaultUnique();
- }
- return this.column.getUnique();
- }
-
- public void setUnique(@SuppressWarnings("unused")Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public Boolean getUpdatable() {
- if (this.isOrmMetadataComplete()) {
- return this.column.getDefaultUpdatable();
- }
- return this.column.getUpdatable();
- }
-
- public void setUpdatable(@SuppressWarnings("unused")Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public TextRange getNameTextRange() {
- return null;
- }
-
- 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 d3e2c1cfd8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlEmbedded.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.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.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 VirtualXmlAttributeMapping<JavaEmbeddedMapping> implements XmlEmbedded
-{
-
- public VirtualXmlEmbedded(OrmTypeMapping ormTypeMapping, JavaEmbeddedMapping javaEmbeddedMapping) {
- super(ormTypeMapping, javaEmbeddedMapping);
- }
-
- 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.attributeOverrides();
- }
- else {
- javaAttributeOverrides = this.javaAttributeMapping.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 6eaa9302e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlEmbeddedId.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.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.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 VirtualXmlAttributeMapping<JavaEmbeddedIdMapping> implements XmlEmbeddedId
-{
-
- public VirtualXmlEmbeddedId(OrmTypeMapping ormTypeMapping, JavaEmbeddedIdMapping javaEmbeddedIdMapping) {
- super(ormTypeMapping, javaEmbeddedIdMapping);
- }
-
- 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.attributeOverrides();
- }
- else {
- javaAttributeOverrides = this.javaAttributeMapping.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 cfe7c4d33a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlGeneratedValue.java
+++ /dev/null
@@ -1,62 +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.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaGeneratedValue;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-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 AbstractJpaEObject implements 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();
- }
-
-
- public String getGenerator() {
- if (this.metadataComplete) {
- return null;
- }
- return this.getJavaGeneratedValue().getGenerator();
- }
-
- public GenerationType getStrategy() {
- if (this.metadataComplete) {
- return null;
- }
- return org.eclipse.jpt.core.context.GenerationType.toOrmResourceModel(this.getJavaGeneratedValue().getStrategy());
- }
-
- public void setGenerator(@SuppressWarnings("unused")String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public void setStrategy(@SuppressWarnings("unused")GenerationType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- 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 71cdff3318..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlId.java
+++ /dev/null
@@ -1,144 +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.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 VirtualXmlAttributeMapping<JavaIdMapping> implements XmlId
-{
- protected final VirtualXmlColumn column;
-
- protected final VirtualXmlGeneratedValue virtualGeneratedValue;
-
- protected final VirtualXmlTableGenerator virtualTableGenerator;
-
- protected final VirtualXmlSequenceGenerator virtualSequenceGenerator;
-
-
- public VirtualXmlId(OrmTypeMapping ormTypeMapping, JavaIdMapping javaIdMapping) {
- super(ormTypeMapping, javaIdMapping);
- this.column = new VirtualXmlColumn(ormTypeMapping, javaIdMapping.getColumn());
- this.virtualGeneratedValue = new VirtualXmlGeneratedValue(javaIdMapping, this.isOrmMetadataComplete());
- this.virtualTableGenerator = new VirtualXmlTableGenerator(javaIdMapping, this.isOrmMetadataComplete());
- this.virtualSequenceGenerator = new VirtualXmlSequenceGenerator(javaIdMapping, this.isOrmMetadataComplete());
- }
-
- public XmlColumn getColumn() {
- return this.column;
- }
-
- public void setColumn(@SuppressWarnings("unused")XmlColumn value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- 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;
- }
-
- public void setTemporal(@SuppressWarnings("unused")TemporalType newTemporal){
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-
- public XmlGeneratedValue getGeneratedValue() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- if (this.javaAttributeMapping.getGeneratedValue() != null) {
- return this.virtualGeneratedValue;
- }
- return null;
- }
-
- public void setGeneratedValue(@SuppressWarnings("unused")XmlGeneratedValue value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public XmlSequenceGenerator getSequenceGenerator() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- if (this.javaAttributeMapping.getSequenceGenerator() != null) {
- return this.virtualSequenceGenerator;
- }
- return null;
- }
-
- public void setSequenceGenerator(@SuppressWarnings("unused")XmlSequenceGenerator value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public XmlTableGenerator getTableGenerator() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- if (this.javaAttributeMapping.getTableGenerator() != null) {
- return this.virtualTableGenerator;
- }
- return null;
- }
-
- public void setTableGenerator(@SuppressWarnings("unused")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
- public EnumType getEnumerated() {
- throw new UnsupportedOperationException("enumerated not supported on id mappings"); //$NON-NLS-1$
- }
-
- public void setEnumerated(@SuppressWarnings("unused")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
- public boolean isLob() {
- throw new UnsupportedOperationException("lob not supported on id mappings"); //$NON-NLS-1$
- }
-
- public void setLob(@SuppressWarnings("unused")boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public TextRange getEnumeratedTextRange() {
- return null;
- }
-
- public TextRange getLobTextRange() {
- return null;
- }
-
- 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 e359382556..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlJoinColumn.java
+++ /dev/null
@@ -1,129 +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.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class VirtualXmlJoinColumn extends AbstractJpaEObject implements XmlJoinColumn
-{
- protected JavaJoinColumn javaJoinColumn;
-
- protected boolean metadataComplete;
-
- protected VirtualXmlJoinColumn(JavaJoinColumn javaJoinColumn, boolean metadataComplete) {
- super();
- this.javaJoinColumn = javaJoinColumn;
- this.metadataComplete = metadataComplete;
- }
-
- public String getColumnDefinition() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaJoinColumn.getColumnDefinition();
- }
-
- public void setColumnDefinition(@SuppressWarnings("unused")String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public Boolean getInsertable() {
- if (this.metadataComplete) {
- return this.javaJoinColumn.getDefaultInsertable();
- }
- return this.javaJoinColumn.getInsertable();
- }
-
- public void setInsertable(@SuppressWarnings("unused")Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getName() {
- if (this.metadataComplete) {
- return this.javaJoinColumn.getDefaultName();
- }
- return this.javaJoinColumn.getName();
- }
-
- public void setName(@SuppressWarnings("unused")String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getReferencedColumnName() {
- if (this.metadataComplete) {
- return this.javaJoinColumn.getDefaultReferencedColumnName();
- }
- return this.javaJoinColumn.getReferencedColumnName();
- }
-
- public void setReferencedColumnName(@SuppressWarnings("unused")String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public Boolean getNullable() {
- if (this.metadataComplete) {
- return this.javaJoinColumn.getDefaultNullable();
- }
- return this.javaJoinColumn.getNullable();
- }
-
- public void setNullable(@SuppressWarnings("unused")Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getTable() {
- if (this.metadataComplete) {
- return this.javaJoinColumn.getDefaultTable();
- }
- return this.javaJoinColumn.getTable();
- }
-
- public void setTable(@SuppressWarnings("unused")String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public Boolean getUnique() {
- if (this.metadataComplete) {
- return this.javaJoinColumn.getDefaultUnique();
- }
- return this.javaJoinColumn.getUnique();
- }
-
- public void setUnique(@SuppressWarnings("unused")Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public Boolean getUpdatable() {
- if (this.metadataComplete) {
- return this.javaJoinColumn.getDefaultUpdatable();
- }
- return this.javaJoinColumn.getUpdatable();
- }
-
- public void setUpdatable(@SuppressWarnings("unused") Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public TextRange getNameTextRange() {
- return null;
- }
-
- public TextRange getTableTextRange() {
- return null;
- }
-
- 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 7d0f902ced..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlJoinTable.java
+++ /dev/null
@@ -1,121 +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.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-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 AbstractJpaEObject implements XmlJoinTable
-{
- protected OrmTypeMapping ormTypeMapping;
- protected JavaJoinTable javaJoinTable;
-
- protected VirtualXmlJoinTable(OrmTypeMapping ormTypeMapping, JavaJoinTable javaJoinTable) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaJoinTable = javaJoinTable;
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- public String getName() {
- if (this.isOrmMetadataComplete()) {
- return this.javaJoinTable.getDefaultName();
- }
- return this.javaJoinTable.getName();
- }
-
- public void setName(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getCatalog() {
- if (this.isOrmMetadataComplete()) {
- return this.javaJoinTable.getDefaultCatalog();
- }
- return this.javaJoinTable.getCatalog();
- }
-
- public void setCatalog(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getSchema() {
- if (this.isOrmMetadataComplete()) {
- return this.javaJoinTable.getDefaultSchema();
- }
- return this.javaJoinTable.getSchema();
- }
-
- public void setSchema(@SuppressWarnings("unused") 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
- public EList<XmlJoinColumn> getJoinColumns() {
- EList<XmlJoinColumn> joinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_JOIN_TABLE__JOIN_COLUMNS);
- for (JavaJoinColumn joinColumn : CollectionTools.iterable(this.javaJoinTable.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
- public EList<XmlJoinColumn> getInverseJoinColumns() {
- EList<XmlJoinColumn> inverseJoinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS);
- for (JavaJoinColumn joinColumn : CollectionTools.iterable(this.javaJoinTable.specifiedInverseJoinColumns())) {
- XmlJoinColumn xmlJoinColumn = new VirtualXmlJoinColumn(joinColumn, isOrmMetadataComplete());
- inverseJoinColumns.add(xmlJoinColumn);
- }
-
- return inverseJoinColumns;
- }
-
- public EList<XmlUniqueConstraint> getUniqueConstraints() {
- EList<XmlUniqueConstraint> xmlUniqueConstraints = new EObjectContainmentEList<XmlUniqueConstraint>(XmlUniqueConstraint.class, this, OrmPackage.XML_JOIN_TABLE__UNIQUE_CONSTRAINTS);
-
- for (JavaUniqueConstraint uniqueConstraint : CollectionTools.iterable(this.javaJoinTable.uniqueConstraints())) {
- XmlUniqueConstraint xmlUniqueConstraint = new VirtualXmlUniqueConstraint(uniqueConstraint, isOrmMetadataComplete());
- xmlUniqueConstraints.add(xmlUniqueConstraint);
- }
-
- return xmlUniqueConstraints;
- }
-
- public TextRange getNameTextRange() {
- return null;
- }
-
- public TextRange getCatalogTextRange() {
- return null;
- }
-
- public TextRange getSchemaTextRange() {
- return null;
- }
-
- public boolean isSpecified() {
- return this.javaJoinTable.isSpecified();
- }
-}
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 b186719135..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToMany.java
+++ /dev/null
@@ -1,121 +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.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.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.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 VirtualXmlAttributeMapping<JavaManyToManyMapping> implements XmlManyToMany
-{
- protected final VirtualXmlJoinTable virtualJoinTable;
-
- protected final VirtualCascadeType virtualCascadeType;
-
- protected final MapKey mapKey;
-
- //TODO joinColumns not yet supported in the context model
-// protected EList<JoinColumn> virtualJoinColumns;
-
- public VirtualXmlManyToMany(OrmTypeMapping ormTypeMapping, JavaManyToManyMapping javaManyToManyMapping) {
- super(ormTypeMapping, javaManyToManyMapping);
- this.virtualCascadeType = new VirtualCascadeType(javaManyToManyMapping.getCascade(), this.isOrmMetadataComplete());
- this.virtualJoinTable = new VirtualXmlJoinTable(ormTypeMapping, javaManyToManyMapping.getJoinTable());
- this.mapKey = new VirtualMapKey(javaManyToManyMapping, this.isOrmMetadataComplete());
- }
-
- 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());
- }
-
- public void setFetch(@SuppressWarnings("unused") FetchType newFetch) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public EList<XmlJoinColumn> getJoinColumns() {
- return null;
- }
-
- public CascadeType getCascade() {
- return this.virtualCascadeType;
- }
-
- public void setCascade(@SuppressWarnings("unused") CascadeType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public XmlJoinTable getJoinTable() {
- return this.virtualJoinTable;
- }
-
- public void setJoinTable(@SuppressWarnings("unused") XmlJoinTable value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getTargetEntity() {
- if (this.isOrmMetadataComplete()) {
- return this.javaAttributeMapping.getDefaultTargetEntity();
- }
- return this.javaAttributeMapping.getTargetEntity();
- }
-
- public void setTargetEntity(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getMappedBy() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- return this.javaAttributeMapping.getMappedBy();
- }
-
- public void setMappedBy(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-
- public MapKey getMapKey() {
- return this.mapKey;
- }
-
- public void setMapKey(@SuppressWarnings("unused") MapKey value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getOrderBy() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- return this.javaAttributeMapping.getOrderBy();
- }
-
- public void setOrderBy(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public TextRange getMappedByTextRange() {
- 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 af58c5dada..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToOne.java
+++ /dev/null
@@ -1,100 +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.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-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.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 VirtualXmlAttributeMapping<JavaManyToOneMapping> implements XmlManyToOne
-{
-
-// protected VirtualJoinTable virtualJoinTable;
-
- protected final VirtualCascadeType virtualCascadeType;
-
- public VirtualXmlManyToOne(OrmTypeMapping ormTypeMapping, JavaManyToOneMapping javaManyToOneMapping) {
- super(ormTypeMapping, javaManyToOneMapping);
- this.virtualCascadeType = new VirtualCascadeType(javaManyToOneMapping.getCascade(), this.isOrmMetadataComplete());
- }
-
- 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());
- }
-
- public void setFetch(@SuppressWarnings("unused") FetchType newFetch) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public Boolean getOptional() {
- if (this.isOrmMetadataComplete()) {
- return this.javaAttributeMapping.getDefaultOptional();
- }
- return this.javaAttributeMapping.getOptional();
- }
-
- public void setOptional(@SuppressWarnings("unused") Boolean newOptional) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public EList<XmlJoinColumn> getJoinColumns() {
- EList<XmlJoinColumn> joinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_JOIN_TABLE__JOIN_COLUMNS);
- //TODO here i'm using joinColumns() while VirtualXmlJoinTable uses specifiedJoinColumns()???
- for (JavaJoinColumn joinColumn : CollectionTools.iterable(this.javaAttributeMapping.joinColumns())) {
- XmlJoinColumn xmlJoinColumn = new VirtualXmlJoinColumn(joinColumn, this.isOrmMetadataComplete());
- joinColumns.add(xmlJoinColumn);
- }
- return joinColumns;
- }
-
- public CascadeType getCascade() {
- return this.virtualCascadeType;
- }
-
- public void setCascade(@SuppressWarnings("unused") CascadeType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public XmlJoinTable getJoinTable() {
- //TODO we don't yet support JoinTable in the context model for many-to-one mappings
- return null;//this.virtualJoinTable;
- }
-
- public void setJoinTable(@SuppressWarnings("unused") XmlJoinTable value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getTargetEntity() {
- if (this.isOrmMetadataComplete()) {
- return this.javaAttributeMapping.getDefaultTargetEntity();
- }
- return this.javaAttributeMapping.getTargetEntity();
- }
-
- public void setTargetEntity(@SuppressWarnings("unused") String 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/VirtualXmlNullAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlNullAttributeMapping.java
deleted file mode 100644
index 5c6c196ce3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlNullAttributeMapping.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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;
-
-/**
- * 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 VirtualXmlAttributeMapping<JavaAttributeMapping> implements XmlNullAttributeMapping
-{
-
- public VirtualXmlNullAttributeMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping) {
- super(ormTypeMapping, javaAttributeMapping);
- }
-}
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 dac9874452..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToMany.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.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 VirtualXmlAttributeMapping<JavaOneToManyMapping> implements XmlOneToMany
-{
-
- protected final VirtualXmlJoinTable virtualJoinTable;
-
- protected final VirtualCascadeType virtualCascadeType;
-
- protected final MapKey mapKey;
-
- //TODO joinColumns not yet supported in the context model
-// protected EList<JoinColumn> virtualJoinColumns;
-
- public VirtualXmlOneToMany(OrmTypeMapping ormTypeMapping, JavaOneToManyMapping javaOneToManyMapping) {
- super(ormTypeMapping, javaOneToManyMapping);
- this.virtualCascadeType = new VirtualCascadeType(javaOneToManyMapping.getCascade(), this.isOrmMetadataComplete());
- this.virtualJoinTable = new VirtualXmlJoinTable(ormTypeMapping, javaOneToManyMapping.getJoinTable());
- this.mapKey = new VirtualMapKey(javaOneToManyMapping, this.isOrmMetadataComplete());
- }
-
- 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());
- }
-
- public void setFetch(@SuppressWarnings("unused") FetchType newFetch) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public EList<XmlJoinColumn> getJoinColumns() {
- return null;
- }
-
- public CascadeType getCascade() {
- return this.virtualCascadeType;
- }
-
- public void setCascade(@SuppressWarnings("unused") CascadeType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public XmlJoinTable getJoinTable() {
- return this.virtualJoinTable;
- }
-
- public void setJoinTable(@SuppressWarnings("unused") XmlJoinTable value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getTargetEntity() {
- if (this.isOrmMetadataComplete()) {
- return this.javaAttributeMapping.getDefaultTargetEntity();
- }
- return this.javaAttributeMapping.getTargetEntity();
- }
-
- public void setTargetEntity(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getMappedBy() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- return this.javaAttributeMapping.getMappedBy();
- }
-
- public void setMappedBy(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-
- public MapKey getMapKey() {
- return this.mapKey;
- }
-
- public void setMapKey(@SuppressWarnings("unused") MapKey value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getOrderBy() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- return this.javaAttributeMapping.getOrderBy();
- }
-
- public void setOrderBy(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public TextRange getMappedByTextRange() {
- 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 02f36f8357..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToOne.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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.JavaJoinColumn;
-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 VirtualXmlAttributeMapping<JavaOneToOneMapping> implements XmlOneToOne
-{
-
-// protected VirtualJoinTable virtualJoinTable;
-
- protected final VirtualCascadeType virtualCascadeType;
-
- public VirtualXmlOneToOne(OrmTypeMapping ormTypeMapping, JavaOneToOneMapping javaOneToOneMapping) {
- super(ormTypeMapping, javaOneToOneMapping);
- this.virtualCascadeType = new VirtualCascadeType(javaOneToOneMapping.getCascade(), this.isOrmMetadataComplete());
- }
-
- 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());
- }
-
- public void setFetch(@SuppressWarnings("unused") FetchType newFetch) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public Boolean getOptional() {
- if (this.isOrmMetadataComplete()) {
- return this.javaAttributeMapping.getDefaultOptional();
- }
- return this.javaAttributeMapping.getOptional();
- }
-
- public void setOptional(@SuppressWarnings("unused") Boolean newOptional) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public EList<XmlJoinColumn> getJoinColumns() {
- //TODO need to check metadataComplete here
- EList<XmlJoinColumn> joinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_ONE_TO_ONE__JOIN_COLUMNS);
- //TODO here i'm using joinColumns() while VirtualXmlJoinTable uses specifiedJoinColumns()???
- for (JavaJoinColumn joinColumn : CollectionTools.iterable(this.javaAttributeMapping.joinColumns())) {
- XmlJoinColumn xmlJoinColumn = new VirtualXmlJoinColumn(joinColumn, this.isOrmMetadataComplete());
- joinColumns.add(xmlJoinColumn);
- }
- return joinColumns;
- }
-
- public CascadeType getCascade() {
- return this.virtualCascadeType;
- }
-
- public void setCascade(@SuppressWarnings("unused") CascadeType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public XmlJoinTable getJoinTable() {
- //TODO we don't yet support JoinTable in the context model for many-to-one mappings
- return null;//this.virtualJoinTable;
- }
-
- public void setJoinTable(@SuppressWarnings("unused") XmlJoinTable value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getTargetEntity() {
- if (this.isOrmMetadataComplete()) {
- return this.javaAttributeMapping.getDefaultTargetEntity();
- }
- return this.javaAttributeMapping.getTargetEntity();
- }
-
- public void setTargetEntity(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getMappedBy() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- return this.javaAttributeMapping.getMappedBy();
- }
-
- public void setMappedBy(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- 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.primaryKeyJoinColumns())) {
- XmlPrimaryKeyJoinColumn xmlJoinColumn = new VirtualXmlPrimaryKeyJoinColumn(joinColumn/*, this.metadataComplete*/);
- joinColumns.add(xmlJoinColumn);
- }
- }
- return joinColumns;
- }
-
- public TextRange getMappedByTextRange() {
- 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 c99107b37d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlPrimaryKeyJoinColumn.java
+++ /dev/null
@@ -1,67 +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.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-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 AbstractJpaEObject implements XmlPrimaryKeyJoinColumn
-{
-
- protected JavaPrimaryKeyJoinColumn javaPrimaryKeyJoinColumn;
-
-
- protected VirtualXmlPrimaryKeyJoinColumn(JavaPrimaryKeyJoinColumn javaPrimaryKeyJoinColumn) {
- super();
- this.javaPrimaryKeyJoinColumn = javaPrimaryKeyJoinColumn;
- }
-
- public String getName() {
- return this.javaPrimaryKeyJoinColumn.getName();
- }
-
- public void setName(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getColumnDefinition() {
- return this.javaPrimaryKeyJoinColumn.getColumnDefinition();
- }
-
- public void setColumnDefinition(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getReferencedColumnName() {
- return this.javaPrimaryKeyJoinColumn.getReferencedColumnName();
- }
-
- public void setReferencedColumnName(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public TextRange getNameTextRange() {
- return null;
- }
-
- 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 266f7cb1ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlSecondaryTable.java
+++ /dev/null
@@ -1,101 +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.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.common.AbstractJpaEObject;
-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 AbstractJpaEObject implements XmlSecondaryTable
-{
-
- protected JavaSecondaryTable javaSecondaryTable;
-
- protected VirtualXmlSecondaryTable(JavaSecondaryTable javaSecondaryTable) {
- super();
- this.javaSecondaryTable = javaSecondaryTable;
- }
-
- public String getName() {
- return this.javaSecondaryTable.getSpecifiedName();
- }
-
- public void setName(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getCatalog() {
- return this.javaSecondaryTable.getSpecifiedCatalog();
- }
-
- public void setCatalog(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getSchema() {
- return this.javaSecondaryTable.getSpecifiedSchema();
- }
-
- public void setSchema(@SuppressWarnings("unused") 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
- public EList<XmlPrimaryKeyJoinColumn> getPrimaryKeyJoinColumns() {
- EList<XmlPrimaryKeyJoinColumn> primaryKeyJoinColumns = new EObjectContainmentEList<XmlPrimaryKeyJoinColumn>(XmlPrimaryKeyJoinColumn.class, this, OrmPackage.XML_SECONDARY_TABLE_IMPL__PRIMARY_KEY_JOIN_COLUMNS);
-
- for (JavaPrimaryKeyJoinColumn pkJoinColumn : CollectionTools.iterable(this.javaSecondaryTable.specifiedPrimaryKeyJoinColumns())) {
- XmlPrimaryKeyJoinColumn xmlPkJoinColumn = new VirtualXmlPrimaryKeyJoinColumn(pkJoinColumn);
- primaryKeyJoinColumns.add(xmlPkJoinColumn);
- }
-
- return primaryKeyJoinColumns;
- }
-
- 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;
- }
-
- public TextRange getNameTextRange() {
- return null;
- }
-
- public TextRange getCatalogTextRange() {
- return null;
- }
-
- 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 1882de43a2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlSequenceGenerator.java
+++ /dev/null
@@ -1,86 +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.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaGeneratorHolder;
-import org.eclipse.jpt.core.context.java.JavaSequenceGenerator;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class VirtualXmlSequenceGenerator extends AbstractJpaEObject implements XmlSequenceGenerator
-{
- JavaGeneratorHolder javaGeneratorHolder;
-
- protected boolean metadataComplete;
-
-
- public VirtualXmlSequenceGenerator(JavaGeneratorHolder javaGeneratorHolder, boolean metadataComplete) {
- super();
- this.javaGeneratorHolder = javaGeneratorHolder;
- this.metadataComplete = metadataComplete;
- }
-
- protected JavaSequenceGenerator getJavaSequenceGenerator() {
- return this.javaGeneratorHolder.getSequenceGenerator();
- }
-
- public String getSequenceName() {
- if (this.metadataComplete) {
- return null;
- }
- return this.getJavaSequenceGenerator().getSequenceName();
- }
-
- public void setSequenceName(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public Integer getAllocationSize() {
- if (this.metadataComplete) {
- return null;
- }
- return this.getJavaSequenceGenerator().getAllocationSize();
- }
-
- public void setAllocationSize(@SuppressWarnings("unused") Integer value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public Integer getInitialValue() {
- if (this.metadataComplete) {
- return null;
- }
- return this.getJavaSequenceGenerator().getInitialValue();
- }
-
- public void setInitialValue(@SuppressWarnings("unused") Integer value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getName() {
- if (this.metadataComplete) {
- return null;
- }
- return this.getJavaSequenceGenerator().getName();
- }
-
- public void setName(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public TextRange getNameTextRange() {
- return getValidationTextRange();
- }
-
- 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 49fd6cad29..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlTableGenerator.java
+++ /dev/null
@@ -1,160 +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.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.jpt.core.context.java.JavaGeneratorHolder;
-import org.eclipse.jpt.core.context.java.JavaTableGenerator;
-import org.eclipse.jpt.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-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 AbstractJpaEObject implements XmlTableGenerator
-{
- JavaGeneratorHolder javaGeneratorHolder;
-
- protected boolean metadataComplete;
-
-
- public VirtualXmlTableGenerator(JavaGeneratorHolder javaGeneratorHolder, boolean metadataComplete) {
- super();
- this.javaGeneratorHolder = javaGeneratorHolder;
- this.metadataComplete = metadataComplete;
- }
-
- protected JavaTableGenerator getJavaTableGenerator() {
- return this.javaGeneratorHolder.getTableGenerator();
- }
-
- public String getCatalog() {
- if (this.metadataComplete) {
- return null;
- }
- return this.getJavaTableGenerator().getCatalog();
- }
-
- public void setCatalog(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getPkColumnName() {
- if (this.metadataComplete) {
- return null;
- }
- return this.getJavaTableGenerator().getPkColumnName();
- }
-
- public void setPkColumnName(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getPkColumnValue() {
- if (this.metadataComplete) {
- return null;
- }
- return this.getJavaTableGenerator().getPkColumnValue();
- }
-
- public void setPkColumnValue(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getSchema() {
- if (this.metadataComplete) {
- return null;
- }
- return this.getJavaTableGenerator().getSchema();
- }
-
- public void setSchema(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getTable() {
- if (this.metadataComplete) {
- return null;
- }
- return this.getJavaTableGenerator().getTable();
- }
-
- public void setTable(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getValueColumnName() {
- if (this.metadataComplete) {
- return null;
- }
- return this.getJavaTableGenerator().getValueColumnName();
- }
-
- public void setValueColumnName(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public Integer getAllocationSize() {
- if (this.metadataComplete) {
- return null;
- }
- return this.getJavaTableGenerator().getAllocationSize();
- }
-
- public void setAllocationSize(@SuppressWarnings("unused") Integer value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public Integer getInitialValue() {
- if (this.metadataComplete) {
- return null;
- }
- return this.getJavaTableGenerator().getInitialValue();
- }
-
- public void setInitialValue(@SuppressWarnings("unused") Integer value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getName() {
- if (this.metadataComplete) {
- return null;
- }
- return this.getJavaTableGenerator().getName();
- }
-
- public void setName(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-
-
- 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;
- }
-
- public TextRange getNameTextRange() {
- return getValidationTextRange();
- }
-
- 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 85ae039f1e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlTransient.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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;
-
-/**
- * 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 VirtualXmlAttributeMapping<JavaTransientMapping> implements XmlTransient
-{
-
- public VirtualXmlTransient(OrmTypeMapping ormTypeMapping, JavaTransientMapping javaTransientMapping) {
- super(ormTypeMapping, javaTransientMapping);
- }
-}
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 4f106eace8..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * 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.java.JavaUniqueConstraint;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-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 AbstractJpaEObject implements XmlUniqueConstraint
-{
- protected JavaUniqueConstraint javaUniqueConstraint;
-
- protected boolean metadataComplete;
-
- protected VirtualXmlUniqueConstraint(JavaUniqueConstraint javaUniqueConstraint, boolean metadataComplete) {
- super();
- this.javaUniqueConstraint = javaUniqueConstraint;
- this.metadataComplete = metadataComplete;
- }
-
- public EList<String> getColumnNames() {
- EList<String> columnNames = new EDataTypeEList<String>(String.class, this, OrmPackage.XML_UNIQUE_CONSTRAINT_IMPL__COLUMN_NAMES);
-
- for (String columnName : CollectionTools.iterable(this.javaUniqueConstraint.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 0baea36e3d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlVersion.java
+++ /dev/null
@@ -1,89 +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.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 VirtualXmlAttributeMapping<JavaVersionMapping> implements XmlVersion
-{
-
- protected final VirtualXmlColumn column;
-
- public VirtualXmlVersion(OrmTypeMapping ormTypeMapping, JavaVersionMapping javaVersionMapping) {
- super(ormTypeMapping, javaVersionMapping);
- this.column = new VirtualXmlColumn(ormTypeMapping, javaVersionMapping.getColumn());
- }
-
- public XmlColumn getColumn() {
- return this.column;
- }
-
- public void setColumn(@SuppressWarnings("unused") XmlColumn value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- 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;
- }
-
- public void setTemporal(@SuppressWarnings("unused") 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
- public EnumType getEnumerated() {
- throw new UnsupportedOperationException("enumerated not supported on version mappings"); //$NON-NLS-1$
- }
-
- public void setEnumerated(@SuppressWarnings("unused") 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
- public boolean isLob() {
- throw new UnsupportedOperationException("lob not supported on version mappings"); //$NON-NLS-1$
- }
-
- public void setLob(@SuppressWarnings("unused") boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public TextRange getEnumeratedTextRange() {
- return null;
- }
-
- public TextRange getLobTextRange() {
- return null;
- }
-
- public TextRange getTemporalTextRange() {
- return null;
- }
-
-}
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 e1e69eaec9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceUnit.java
+++ /dev/null
@@ -1,1274 +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.persistence;
-
-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.NoSuchElementException;
-import java.util.Set;
-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.Entity;
-import org.eclipse.jpt.core.context.Generator;
-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.Query;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-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.PersistenceUnitTransactionType;
-import org.eclipse.jpt.core.context.persistence.Property;
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.internal.resource.orm.OrmResourceModelProvider;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.OrmResource;
-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.persistence.XmlProperties;
-import org.eclipse.jpt.core.resource.persistence.XmlProperty;
-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.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyCompositeListIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class AbstractPersistenceUnit extends AbstractXmlContextNode
- implements PersistenceUnit
-{
- 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 List<MappingFileRef> specifiedMappingFileRefs = new ArrayList<MappingFileRef>();
-
- protected MappingFileRef impliedMappingFileRef;
-
- protected final List<ClassRef> specifiedClassRefs = new ArrayList<ClassRef>();
-
- protected final List<ClassRef> impliedClassRefs = new ArrayList<ClassRef>();
-
- protected Boolean specifiedExcludeUnlistedClasses;
-
- protected boolean defaultExcludeUnlistedClasses = false;
-
- protected final List<Property> properties = new ArrayList<Property>();
-
- /* global generator definitions, defined elsewhere in model */
- protected final List<Generator> generators = new ArrayList<Generator>();
-
- /* global query definitions, defined elsewhere in model */
- protected final List<Query> queries = new ArrayList<Query>();
-
-
- protected AccessType defaultAccess;
- protected String defaultCatalog;
- protected String defaultSchema;
- protected boolean defaultCascadePersist;
-
- public AbstractPersistenceUnit(Persistence parent) {
- super(parent);
- }
-
- @Override
- protected void addNonUpdateAspectNamesTo(Set<String> nonUpdateAspectNames) {
- super.addNonUpdateAspectNamesTo(nonUpdateAspectNames);
- nonUpdateAspectNames.add(GENERATORS_LIST);
- nonUpdateAspectNames.add(QUERIES_LIST);
- }
-
- public String getId() {
- return PersistenceStructureNodes.PERSISTENCE_UNIT_ID;
- }
-
- @Override
- public PersistenceUnit getPersistenceUnit() {
- return this;
- }
-
-
- // **************** parent *************************************************
-
- @Override
- public Persistence getParent() {
- return (Persistence) super.getParent();
- }
-
-
- // **************** name ***************************************************
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.xmlPersistenceUnit.setName(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
-
- // **************** transaction type ***************************************
-
- public PersistenceUnitTransactionType getTransactionType() {
- return (isTransactionTypeDefault()) ?
- getDefaultTransactionType() : getSpecifiedTransactionType();
- }
-
- public PersistenceUnitTransactionType getSpecifiedTransactionType() {
- return this.specifiedTransactionType;
- }
-
- public void setSpecifiedTransactionType(PersistenceUnitTransactionType newTransactionType) {
- PersistenceUnitTransactionType oldTransactionType = this.specifiedTransactionType;
- this.specifiedTransactionType = newTransactionType;
- this.xmlPersistenceUnit.setTransactionType(PersistenceUnitTransactionType.toXmlResourceModel(newTransactionType));
- firePropertyChanged(SPECIFIED_TRANSACTION_TYPE_PROPERTY, oldTransactionType, newTransactionType);
- }
-
- public boolean isTransactionTypeDefault() {
- return this.specifiedTransactionType == null;
- }
-
- public PersistenceUnitTransactionType getDefaultTransactionType() {
- return this.defaultTransactionType;
- }
-
- protected void setDefaultTransactionType(PersistenceUnitTransactionType newTransactionType) {
- PersistenceUnitTransactionType oldTransactionType = this.defaultTransactionType;
- this.defaultTransactionType = newTransactionType;
- firePropertyChanged(DEFAULT_TRANSACTION_TYPE_PROPERTY, oldTransactionType, newTransactionType);
- }
-
- // **************** description ********************************************
-
- public String getDescription() {
- return this.description;
- }
-
- public void setDescription(String newDescription) {
- String oldDescription = this.description;
- this.description = newDescription;
- this.xmlPersistenceUnit.setDescription(newDescription);
- firePropertyChanged(DESCRIPTION_PROPERTY, oldDescription, newDescription);
- }
-
-
- // **************** provider ***********************************************
-
- public String getProvider() {
- return this.provider;
- }
-
- public void setProvider(String newProvider) {
- String oldProvider = this.provider;
- this.provider = newProvider;
- this.xmlPersistenceUnit.setProvider(newProvider);
- firePropertyChanged(PROVIDER_PROPERTY, oldProvider, newProvider);
- }
-
-
- // **************** jta data source ****************************************
-
- public String getJtaDataSource() {
- return this.jtaDataSource;
- }
-
- public void setJtaDataSource(String newJtaDataSource) {
- String oldJtaDataSource = this.jtaDataSource;
- this.jtaDataSource = newJtaDataSource;
- this.xmlPersistenceUnit.setJtaDataSource(newJtaDataSource);
- firePropertyChanged(JTA_DATA_SOURCE_PROPERTY, oldJtaDataSource, newJtaDataSource);
- }
-
-
- // **************** non-jta data source ************************************
-
- public String getNonJtaDataSource() {
- return this.nonJtaDataSource;
- }
-
- public void setNonJtaDataSource(String newNonJtaDataSource) {
- String oldNonJtaDataSource = this.nonJtaDataSource;
- this.nonJtaDataSource = newNonJtaDataSource;
- this.xmlPersistenceUnit.setNonJtaDataSource(newNonJtaDataSource);
- firePropertyChanged(NON_JTA_DATA_SOURCE_PROPERTY, oldNonJtaDataSource, newNonJtaDataSource);
- }
-
-
- // **************** mapping file refs **************************************
-
- public ListIterator<MappingFileRef> mappingFileRefs() {
- if (impliedMappingFileRef == null) {
- return specifiedMappingFileRefs();
- }
- return new ReadOnlyCompositeListIterator<MappingFileRef>(
- specifiedMappingFileRefs(), impliedMappingFileRef);
- }
-
- public int mappingFileRefsSize() {
- if (impliedMappingFileRef == null) {
- return specifiedMappingFileRefsSize();
- }
- return 1 + specifiedMappingFileRefsSize();
- }
-
- // **************** specified mapping file refs ****************************
-
- public ListIterator<MappingFileRef> specifiedMappingFileRefs() {
- return new CloneListIterator<MappingFileRef>(specifiedMappingFileRefs);
- }
-
- public int specifiedMappingFileRefsSize() {
- return specifiedMappingFileRefs.size();
- }
-
- public MappingFileRef addSpecifiedMappingFileRef() {
- return addSpecifiedMappingFileRef(specifiedMappingFileRefs.size());
- }
-
- public MappingFileRef addSpecifiedMappingFileRef(int index) {
- XmlMappingFileRef xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- MappingFileRef mappingFileRef = buildMappingFileRef(xmlMappingFileRef);
- specifiedMappingFileRefs.add(index, mappingFileRef);
- this.xmlPersistenceUnit.getMappingFiles().add(index, xmlMappingFileRef);
- fireItemAdded(SPECIFIED_MAPPING_FILE_REFS_LIST, index, mappingFileRef);
- return mappingFileRef;
- }
-
- public void removeSpecifiedMappingFileRef(MappingFileRef mappingFileRef) {
- removeSpecifiedMappingFileRef(specifiedMappingFileRefs.indexOf(mappingFileRef));
- }
-
- public void removeSpecifiedMappingFileRef(int index) {
- MappingFileRef mappingFileRefRemoved = specifiedMappingFileRefs.remove(index);
- mappingFileRefRemoved.dispose();
- this.xmlPersistenceUnit.getMappingFiles().remove(index);
- fireItemRemoved(SPECIFIED_MAPPING_FILE_REFS_LIST, index, mappingFileRefRemoved);
- }
-
- protected void addSpecifiedMappingFileRef_(MappingFileRef mappingFileRef) {
- addSpecifiedMappingFileRef_(specifiedMappingFileRefs.size(), mappingFileRef);
- }
-
- protected void addSpecifiedMappingFileRef_(int index, MappingFileRef mappingFileRef) {
- addItemToList(index, mappingFileRef, 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 impliedMappingFileRef;
- }
-
- protected MappingFileRef setImpliedMappingFileRef() {
- if (impliedMappingFileRef != null) {
- throw new IllegalStateException("The implied mapping file ref is already set."); //$NON-NLS-1$
- }
- MappingFileRef mappingFileRef = buildMappingFileRef(null);
- impliedMappingFileRef = mappingFileRef;
- firePropertyChanged(IMPLIED_MAPPING_FILE_REF_PROPERTY, null, mappingFileRef);
- return mappingFileRef;
- }
-
- protected void unsetImpliedMappingFileRef() {
- if (impliedMappingFileRef == null) {
- throw new IllegalStateException("The implied mapping file ref is already unset."); //$NON-NLS-1$
- }
- MappingFileRef mappingFileRef = impliedMappingFileRef;
- impliedMappingFileRef.dispose();
- impliedMappingFileRef = null;
- firePropertyChanged(IMPLIED_MAPPING_FILE_REF_PROPERTY, mappingFileRef, null);
- }
-
-
- // **************** class refs *********************************************
-
- @SuppressWarnings("unchecked")
- public ListIterator<ClassRef> classRefs() {
- return new ReadOnlyCompositeListIterator<ClassRef>(
- specifiedClassRefs(), impliedClassRefs());
- }
-
- public int classRefsSize() {
- return specifiedClassRefsSize() + impliedClassRefsSize();
- }
-
- // **************** specified class refs ***********************************
-
- public ListIterator<ClassRef> specifiedClassRefs() {
- return new CloneListIterator<ClassRef>(this.specifiedClassRefs);
- }
-
- public int specifiedClassRefsSize() {
- return specifiedClassRefs.size();
- }
-
- public ClassRef addSpecifiedClassRef() {
- return addSpecifiedClassRef(this.specifiedClassRefsSize());
- }
-
- public ClassRef addSpecifiedClassRef(int index) {
- XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- ClassRef classRef = buildClassRef(xmlClassRef);
- this.specifiedClassRefs.add(index, classRef);
- this.xmlPersistenceUnit.getClasses().add(index, xmlClassRef);
- fireItemAdded(SPECIFIED_CLASS_REFS_LIST, index, classRef);
- return classRef;
- }
-
- public void removeSpecifiedClassRef(ClassRef classRef) {
- removeSpecifiedClassRef(this.specifiedClassRefs.indexOf(classRef));
- }
-
- public void removeSpecifiedClassRef(int index) {
- ClassRef classRefRemoved = this.specifiedClassRefs.remove(index);
- classRefRemoved.dispose();
- this.xmlPersistenceUnit.getClasses().remove(index);
- fireItemRemoved(SPECIFIED_CLASS_REFS_LIST, index, classRefRemoved);
- }
-
- protected void addSpecifiedClassRef_(ClassRef classRef) {
- addSpecifiedClassRef_(this.specifiedClassRefs.size(), classRef);
- }
-
- protected void addSpecifiedClassRef_(int index, ClassRef classRef) {
- 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);
- }
-
-
- // **************** implied class refs *************************************
-
- public ListIterator<ClassRef> impliedClassRefs() {
- return new CloneListIterator<ClassRef>(impliedClassRefs);
- }
-
- public int impliedClassRefsSize() {
- return impliedClassRefs.size();
- }
-
- protected ClassRef addImpliedClassRef(String className) {
- return this.addImpliedClassRef(this.impliedClassRefs.size(), className);
- }
-
- protected ClassRef addImpliedClassRef(int index, String className) {
- ClassRef classRef = buildClassRef(className);
- addItemToList(index, classRef, this.impliedClassRefs, IMPLIED_CLASS_REFS_LIST);
- return classRef;
- }
-
- protected void removeImpliedClassRef(ClassRef classRef) {
- classRef.dispose();
- this.removeItemFromList(classRef, this.impliedClassRefs, IMPLIED_CLASS_REFS_LIST);
- }
-
-
- // **************** exclude unlisted classes *******************************
-
- public boolean isExcludeUnlistedClasses() {
- return getSpecifiedExcludeUnlistedClasses() == null ? getDefaultExcludeUnlistedClasses() : getSpecifiedExcludeUnlistedClasses().booleanValue();
- }
-
- public Boolean getSpecifiedExcludeUnlistedClasses() {
- return this.specifiedExcludeUnlistedClasses;
- }
-
- public void setSpecifiedExcludeUnlistedClasses(Boolean newExcludeUnlistedClasses) {
- Boolean oldExcludeUnlistedClasses = this.specifiedExcludeUnlistedClasses;
- this.specifiedExcludeUnlistedClasses = newExcludeUnlistedClasses;
-
- this.xmlPersistenceUnit.setExcludeUnlistedClasses(this.specifiedExcludeUnlistedClasses);
-
- firePropertyChanged(SPECIFIED_EXCLUDE_UNLISTED_CLASSES_PROPERTY, oldExcludeUnlistedClasses, newExcludeUnlistedClasses);
- }
-
- public boolean getDefaultExcludeUnlistedClasses() {
- // TODO - calculate default
- // This is determined from the project
- return this.defaultExcludeUnlistedClasses;
- }
-
-
- // **************** properties *********************************************
-
- public ListIterator<Property> properties() {
- return new CloneListIterator<Property>(this.properties);
- }
-
- public int propertiesSize() {
- return this.properties.size();
- }
-
- public Property getProperty(String key) {
- if (key == null) {
- throw new IllegalStateException("Cannot getProperty: key is null."); //$NON-NLS-1$
- }
- for(Property property : this.properties) {
- if(key.equals(property.getName())) {
- return property;
- }
- }
- return null;
- }
-
- public ListIterator<Property> propertiesWithPrefix(String keyPrefix) {
- if (keyPrefix == null) {
- throw new IllegalStateException("Cannot find propertiesWithPrefix: keyPrefix is null."); //$NON-NLS-1$
- }
- List<Property> result = new ArrayList<Property>();
-
- for(Property property : this.properties) {
- if(property.getName() != null && property.getName().startsWith(keyPrefix)) {
- result.add( property);
- }
- }
- return result.listIterator();
- }
-
- public Property getProperty(String key, String value) {
- if (key == null || value == null) {
- throw new IllegalStateException("Cannot getProperty: key or value is null."); //$NON-NLS-1$
- }
- for(Property property : this.properties) {
- if(key.equals(property.getName())) {
- if(value.equals(property.getValue())) {
- return property;
- }
- }
- }
- return null;
- }
-
- protected Property getProperty(int index) {
- return this.properties.get(index);
- }
-
- protected XmlProperty getXmlProperty(String propertyName, String value) {
- if (this.xmlPersistenceUnit.getProperties() == null) {
- XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties();
- this.xmlPersistenceUnit.setProperties(xmlProperties);
- }
- for(XmlProperty xmlProperty : this.xmlPersistenceUnit.getProperties().getProperties()) {
- if(propertyName.equals(xmlProperty.getName()) && value.equals(xmlProperty.getValue())) {
- return xmlProperty;
- }
- }
- return null;
- }
-
- /**
- * Adds or Changes Property with the given key and value.
- */
- public void putProperty(String key, String value, boolean allowDuplicates) {
- if( ! allowDuplicates && this.containsProperty(key)) {
- this.putXmlProperty(key, value, this.getProperty(key).getValue());
- return;
- }
- if( value != null) {
- XmlProperty xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperty.setName(key);
- xmlProperty.setValue(value);
-
- this.addXmlProperty(xmlProperty, propertiesSize());
- return;
- }
- }
-
- public void replacePropertyValue(String key, String oldValue, String newValue) {
-
- this.putXmlProperty(key, newValue, oldValue);
- }
-
- protected void putXmlProperty(String key, String value, String oldValue) {
- if( value == null) {
- this.removeProperty(key);
- return;
- }
-
- XmlProperty xmlProperty = this.getXmlProperty(key, oldValue);
- if(xmlProperty == null) {
- throw new NoSuchElementException("Missing Property name: " + key + ", value: " + oldValue); //$NON-NLS-1$ //$NON-NLS-2$
- }
- xmlProperty.setValue(value);
- }
-
- public boolean containsProperty(String key) {
- return (this.getProperty(key) != null);
- }
-
- public Property addProperty() {
- return addProperty(propertiesSize());
- }
-
- public Property addProperty(int index) {
- return this.addXmlProperty(PersistenceFactory.eINSTANCE.createXmlProperty(), index);
- }
-
- protected Property addXmlProperty(XmlProperty xmlProperty, int index) {
-
- Property property = buildProperty(xmlProperty);
-
- if (this.xmlPersistenceUnit.getProperties() == null) {
- XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties();
- this.xmlPersistenceUnit.setProperties(xmlProperties);
- }
-
- this.properties.add(index, property);
- this.xmlPersistenceUnit.getProperties().getProperties().add(index, xmlProperty);
- this.fireItemAdded(PROPERTIES_LIST, index, property);
- return property;
- }
-
- public void removeProperty(String key) {
- this.removeProperty(this.getProperty(key));
- }
-
- public void removeProperty(String key, String value) {
- this.removeProperty(this.getProperty(key, value));
- }
-
- public void removeProperty(Property property) {
- if (property != null) {
- this.removeProperty(this.properties.indexOf(property));
- }
- }
-
- protected void removeProperty(int index) {
- Property propertyRemoved = this.properties.remove(index);
- this.xmlPersistenceUnit.getProperties().getProperties().remove(index);
-
- if (this.xmlPersistenceUnit.getProperties().getProperties().isEmpty()) {
- this.xmlPersistenceUnit.setProperties(null);
- }
-
- fireItemRemoved(PROPERTIES_LIST, index, propertyRemoved);
- }
-
- protected void addProperty_(Property property) {
- addProperty_(this.properties.size(), property);
- }
-
- protected void addProperty_(int index, Property property) {
- addItemToList(index, property, this.properties, PROPERTIES_LIST);
- }
-
- protected void removeProperty_(Property property) {
- this.removeItemFromList(property, this.properties, PROPERTIES_LIST);
- }
-
-
- // **************** Persistence Unit Defaults *********************************************
-
- //TODO validation for multiple persistenceUnitDefaults.
-
- //Take the first MappingFilePersistenceUnitDefaults found in a mapping file and use
- //this for the defaults of the PersistenceUnit.
- protected MappingFilePersistenceUnitDefaults getPersistenceUnitDefaults() {
- for (Iterator<MappingFileRef> stream= this.mappingFileRefs(); stream.hasNext(); ) {
- MappingFilePersistenceUnitDefaults defaults = stream.next().getPersistenceUnitDefaults();
- if (defaults != null) {
- return defaults;
- }
- }
- return null;
- }
-
- 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);
- }
-
- 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);
- }
-
- 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 boolean getDefaultCascadePersist() {
- return this.defaultCascadePersist;
- }
-
- protected void setDefaultCascadePersist(boolean cascadePersist) {
- boolean old = this.defaultCascadePersist;
- this.defaultCascadePersist = cascadePersist;
- this.firePropertyChanged(DEFAULT_CASCADE_PERSIST_PROPERTY, old, cascadePersist);
- }
-
-
- // **************** generators *********************
-
- public void addGenerator(Generator generator) {
- this.generators.add(generator);
- }
-
- public ListIterator<Generator> allGenerators() {
- return new CloneListIterator<Generator>(this.generators);
- }
-
- protected Iterator<String> allGeneratorNames() {
- return new TransformationIterator<Generator, String>(this.allGenerators()) {
- @Override
- protected String transform(Generator generator) {
- return generator.getName();
- }
- };
- }
-
- protected Iterator<String> allNonNullGeneratorNames() {
- return new FilteringIterator<String, String>(this.allGeneratorNames()) {
- @Override
- protected boolean accept(String generatorName) {
- return generatorName != null;
- }
- };
- }
-
- public String[] uniqueGeneratorNames() {
- HashSet<String> names = CollectionTools.set(this.allNonNullGeneratorNames());
- return names.toArray(new String[names.size()]);
- }
-
-
- // **************** queries *********************
-
- public void addQuery(Query query) {
- this.queries.add(query);
- }
-
- public ListIterator<Query> allQueries() {
- return new CloneListIterator<Query>(this.queries);
- }
-
-
- // **************** updating ***********************************************
-
- /**
- * Concrete subclass must call this in the constructor, not called here
- */
- protected void initialize(XmlPersistenceUnit xpu) {
- this.xmlPersistenceUnit = xpu;
- this.name = xpu.getName();
-
- //initialize specified classRefs before mappingFileRefs because of
- //JpaFile rootStructureNode, we want the mapping file to "win",
- //as it would in a Jpa runtime implementation
- initializeSpecifiedClassRefs(xpu);
- initializeMappingFileRefs(xpu);
- //initialize implied classRefs last since they depend on both
- //specified classRefs and mappingFileRefs
- initializeImpliedClassRefs(xpu);
- initializeProperties(xpu);
- initializePersistenceUnitDefaults();
- this.specifiedExcludeUnlistedClasses = xpu.getExcludeUnlistedClasses();
- this.specifiedTransactionType = specifiedTransactionType(xpu);
- this.defaultTransactionType = defaultTransacationType();
- this.description = xpu.getDescription();
- this.provider = xpu.getProvider();
- this.jtaDataSource = xpu.getJtaDataSource();
- this.nonJtaDataSource = xpu.getNonJtaDataSource();
- this.specifiedExcludeUnlistedClasses = xpu.getExcludeUnlistedClasses();
- }
-
- protected void initializeMappingFileRefs(XmlPersistenceUnit xpu) {
- for (XmlMappingFileRef xmlMappingFileRef : xpu.getMappingFiles()) {
- specifiedMappingFileRefs.add(buildMappingFileRef(xmlMappingFileRef));
- }
- if (! impliedMappingFileIsSpecified() && impliedMappingFileExists()) {
- impliedMappingFileRef = buildMappingFileRef(null);
- }
- }
-
- protected void initializeSpecifiedClassRefs(XmlPersistenceUnit xpu) {
- for (XmlJavaClassRef xmlJavaClassRef : xpu.getClasses()) {
- specifiedClassRefs.add(buildClassRef(xmlJavaClassRef));
- }
- }
-
- protected void initializeImpliedClassRefs(XmlPersistenceUnit xpu) {
- if (getJpaProject().discoversAnnotatedClasses() && ! isExcludeUnlistedClasses()) {
- for (String typeName : CollectionTools.iterable(this.getJpaProject().annotatedClassNames())) {
- if ( ! classIsSpecified(typeName)) {
- impliedClassRefs.add(buildClassRef(typeName));
- }
- }
- }
- }
-
- protected void initializeProperties(XmlPersistenceUnit xpu) {
- XmlProperties xmlProperties = xpu.getProperties();
- if (xmlProperties == null) {
- return;
- }
- for (XmlProperty xmlProperty : xmlProperties.getProperties()) {
- this.properties.add(buildProperty(xmlProperty));
- }
- }
-
- protected void initializePersistenceUnitDefaults() {
- MappingFilePersistenceUnitDefaults defaults = this.getPersistenceUnitDefaults();
- this.defaultAccess = this.buildDefaultAccess(defaults);
- this.defaultCatalog = this.buildDefaultCatalog(defaults);
- this.defaultSchema = this.buildDefaultSchema(defaults);
- this.defaultCascadePersist = this.buildDefaultCascadePersist(defaults);
- }
-
- public void update(XmlPersistenceUnit persistenceUnit) {
- this.xmlPersistenceUnit = persistenceUnit;
- this.generators.clear();
- this.queries.clear();
- updateName(persistenceUnit);
- updateSpecifiedTransactionType(persistenceUnit);
- updateDefaultTransactionType();
- updateDescription(persistenceUnit);
- updateProvider(persistenceUnit);
- updateJtaDataSource(persistenceUnit);
- updateNonJtaDataSource(persistenceUnit);
- //update specified classRefs before mappingFileRefs because of
- //JpaFile rootStructureNode, we want the mapping file to "win",
- //as it would in a Jpa runtime implementation
- updateSpecifiedClassRefs(persistenceUnit);
- updateMappingFileRefs(persistenceUnit);
- //update implied classRefs last since they depend on both
- //specified classRefs and mappingFileRefs
- updateImpliedClassRefs();
- updateExcludeUnlistedClasses(persistenceUnit);
- updateProperties(persistenceUnit);
- updatePersistenceUnitDefaults();
- generatorRepositoryUpdated();
- queryRepositoryUpdated();
- }
-
- protected void updateName(XmlPersistenceUnit persistenceUnit) {
- setName(persistenceUnit.getName());
- }
-
- protected void updateSpecifiedTransactionType(XmlPersistenceUnit persistenceUnit) {
- setSpecifiedTransactionType(specifiedTransactionType(persistenceUnit));
- }
-
- protected PersistenceUnitTransactionType specifiedTransactionType(XmlPersistenceUnit persistenceUnit) {
- return PersistenceUnitTransactionType.fromXmlResourceModel(persistenceUnit.getTransactionType());
- }
-
- protected void updateDefaultTransactionType() {
- setDefaultTransactionType(defaultTransacationType());
- }
-
- protected PersistenceUnitTransactionType defaultTransacationType() {
- // 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."
- return null;
- }
-
- protected void updateDescription(XmlPersistenceUnit persistenceUnit) {
- setDescription(persistenceUnit.getDescription());
- }
-
- protected void updateProvider(XmlPersistenceUnit persistenceUnit) {
- setProvider(persistenceUnit.getProvider());
- }
-
- protected void updateJtaDataSource(XmlPersistenceUnit persistenceUnit) {
- setJtaDataSource(persistenceUnit.getJtaDataSource());
- }
-
- protected void updateNonJtaDataSource(XmlPersistenceUnit persistenceUnit) {
- setNonJtaDataSource(persistenceUnit.getNonJtaDataSource());
- }
-
- protected void updateMappingFileRefs(XmlPersistenceUnit persistenceUnit) {
- Iterator<MappingFileRef> stream = specifiedMappingFileRefs();
- Iterator<XmlMappingFileRef> stream2 = new CloneIterator<XmlMappingFileRef>(persistenceUnit.getMappingFiles());//prevent ConcurrentModificiationException
-
- while (stream.hasNext()) {
- MappingFileRef mappingFileRef = stream.next();
- if (stream2.hasNext()) {
- mappingFileRef.update(stream2.next());
- }
- else {
- removeSpecifiedMappingFileRef_(mappingFileRef);
- }
- }
-
- while (stream2.hasNext()) {
- addSpecifiedMappingFileRef_(buildMappingFileRef(stream2.next()));
- }
-
- if (impliedMappingFileIsSpecified()) {
- if (impliedMappingFileRef != null) {
- unsetImpliedMappingFileRef();
- }
- }
- else {
- if (impliedMappingFileExists()) {
- if (impliedMappingFileRef == null) {
- setImpliedMappingFileRef();
- }
- getImpliedMappingFileRef().update(null);
- }
- else {
- if (impliedMappingFileRef != null) {
- unsetImpliedMappingFileRef();
- }
- }
- }
- }
-
- protected boolean impliedMappingFileIsSpecified() {
- String impliedMappingFile = JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH;
- for (MappingFileRef each : specifiedMappingFileRefs) {
- if (impliedMappingFile.equals(each.getFileName())) {
- return true;
- }
- }
- return false;
- }
-
- protected boolean impliedMappingFileExists() {
- OrmResourceModelProvider modelProvider =
- OrmResourceModelProvider.getDefaultModelProvider(getJpaProject().getProject());
- OrmResource resource = modelProvider.getResource();
- return resource != null && resource.exists();
- }
-
- protected MappingFileRef buildMappingFileRef(XmlMappingFileRef xmlMappingFileRef) {
- return getJpaFactory().buildMappingFileRef(this, xmlMappingFileRef);
- }
-
- //this is not being changed to match updateImpliedClassRefs. In the xml,
- //changing the class name does not imply that a new object needs to be created.
- //If anything we should be matching ClassRefs with the corresponding XmlJavaClassRef
- //and if there is not one the ClassRef would be removed. We would not want to
- //do a name match as is done for the implied class refs.
- protected void updateSpecifiedClassRefs(XmlPersistenceUnit persistenceUnit) {
- Iterator<ClassRef> contextClassRefs = specifiedClassRefs();
- Iterator<XmlJavaClassRef> resourceClassRefs = new CloneIterator<XmlJavaClassRef>(persistenceUnit.getClasses());//prevent ConcurrentModificiationException
-
- while (contextClassRefs.hasNext()) {
- ClassRef contextClassRef = contextClassRefs.next();
- if (resourceClassRefs.hasNext()) {
- contextClassRef.update(resourceClassRefs.next());
- }
- else {
- removeSpecifiedClassRef_(contextClassRef);
- }
- }
-
- while (resourceClassRefs.hasNext()) {
- addSpecifiedClassRef_(buildClassRef(resourceClassRefs.next()));
- }
- }
-
- protected void updateImpliedClassRefs() {
- if (isExcludeUnlistedClasses()) {
- for (ClassRef classRef : CollectionTools.iterable(impliedClassRefs())) {
- removeImpliedClassRef(classRef);
- }
- return;
- }
-
- Iterator<String> annotatedClassNames = getJpaProject().annotatedClassNames();
- Collection<ClassRef> impliedRefsToRemove = CollectionTools.collection(impliedClassRefs());
- Collection<ClassRef> impliedRefsToUpdate = new ArrayList<ClassRef>();
-
- while (annotatedClassNames.hasNext()) {
- String annotatedClassName = annotatedClassNames.next();
- boolean impliedRefFound = false;
- if (!classIsSpecified(annotatedClassName)) {
- for (ClassRef classRef : impliedRefsToRemove) {
- if (annotatedClassName.equals(classRef.getClassName())) {
- impliedRefsToRemove.remove(classRef);
- impliedRefsToUpdate.add(classRef);
- impliedRefFound = true;
- break;
- }
- }
- if (!impliedRefFound) {
- addImpliedClassRef(annotatedClassName);
- }
- }
- }
- for (ClassRef classRef : impliedRefsToRemove) {
- removeImpliedClassRef(classRef);
- }
- //first handle adding/removing of the implied class refs, then update the others last,
- //this causes less churn in the update process
- for (ClassRef classRef : impliedRefsToUpdate) {
- classRef.update(classRef.getClassName());
- }
- }
-
- protected ClassRef buildClassRef(XmlJavaClassRef xmlClassRef) {
- return getJpaFactory().buildClassRef(this, xmlClassRef);
- }
-
- protected ClassRef buildClassRef(String className) {
- return getJpaFactory().buildClassRef(this, className);
- }
-
- /**
- * Return true if the class is specified either as a class
- * or listed in a mapping file
- */
- protected boolean classIsSpecified(String className) {
- for (ClassRef specifiedClassRef : CollectionTools.iterable(specifiedClassRefs())) {
- if (className.equals(specifiedClassRef.getClassName())) {
- return true;
- }
- }
- for (Iterator<MappingFileRef> stream = this.mappingFileRefs(); stream.hasNext(); ) {
- if (stream.next().getPersistentType(className) != null) {
- return true;
- }
- }
- return false;
- }
-
- protected void updateExcludeUnlistedClasses(XmlPersistenceUnit persistenceUnit) {
- setSpecifiedExcludeUnlistedClasses(persistenceUnit.getExcludeUnlistedClasses());
- }
-
- protected void updateProperties(XmlPersistenceUnit persistenceUnit) {
- List<XmlProperty> xmlProperties = this.buildXmlProperties(persistenceUnit);
-
- Iterator<Property> stream = this.properties();
- while (stream.hasNext()) {
- Property property = stream.next();
- XmlProperty xmlProperty = this.getXmlPropertyNamed(property.getName(), xmlProperties);
- if (xmlProperty != null) {
- property.update(xmlProperty);
-
- xmlProperties.remove(xmlProperty);
- }
- else {
- this.removeProperty_(property);
- }
- }
-
- for (XmlProperty xmlProperty : xmlProperties) {
- this.addProperty_(this.buildProperty(xmlProperty));
- }
- }
-
- protected Property buildProperty(XmlProperty xmlProperty) {
- return getJpaFactory().buildProperty(this, xmlProperty);
- }
-
- protected List<XmlProperty> buildXmlProperties(XmlPersistenceUnit persistenceUnit) {
- if (persistenceUnit.getProperties() == null) {
- return new ArrayList<XmlProperty>();
- }
- return CollectionTools.list(persistenceUnit.getProperties().getProperties());
- }
-
- protected XmlProperty getXmlPropertyNamed(String name, List<XmlProperty> xmlProperties) {
- for(XmlProperty xmlProperty : xmlProperties) {
- String xmlPropertyName = xmlProperty.getName();
- if(xmlPropertyName == name || xmlPropertyName.equals(name)) {
- return xmlProperty;
- };
- }
- return null;
- }
-
- protected void updatePersistenceUnitDefaults() {
- MappingFilePersistenceUnitDefaults defaults = getPersistenceUnitDefaults();
- this.setDefaultAccess(this.buildDefaultAccess(defaults));
- this.setDefaultCatalog(this.buildDefaultCatalog(defaults));
- this.setDefaultSchema(this.buildDefaultSchema(defaults));
- this.setDefaultCascadePersist(this.buildDefaultCascadePersist(defaults));
- }
-
- protected AccessType buildDefaultAccess(MappingFilePersistenceUnitDefaults defaults) {
- return (defaults == null) ? null : defaults.getAccess();
- }
-
- protected String buildDefaultCatalog(MappingFilePersistenceUnitDefaults defaults) {
- String catalog = (defaults == null) ? null : defaults.getCatalog();
- return (catalog != null) ? catalog : this.getJpaProject().getDefaultCatalog();
- }
-
- protected String buildDefaultSchema(MappingFilePersistenceUnitDefaults defaults) {
- String schema = (defaults == null) ? null : defaults.getSchema();
- return (schema != null) ? schema : this.getJpaProject().getDefaultSchema();
- }
-
- protected boolean buildDefaultCascadePersist(MappingFilePersistenceUnitDefaults defaults) {
- return (defaults == null) ? false : defaults.isCascadePersist();
- }
-
- // This is called after the persistence unit has been updated to ensure
- // we catch all added generators
- protected void generatorRepositoryUpdated() {
- fireListChanged(GENERATORS_LIST);
- }
-
- // This is called after the persistence unit has been updated to ensure
- // we catch all added queries
- protected void queryRepositoryUpdated() {
- fireListChanged(QUERIES_LIST);
- }
-
-
- // ********** Validation ***********************************************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- this.validateMappingFiles(messages);
- this.validateClassRefs(messages);
- }
-
- protected void validateMappingFiles(List<IMessage> messages) {
- this.checkForMultiplePersistenceUnitDefaults(messages);
- this.checkForDuplicateMappingFiles(messages);
- for (Iterator<MappingFileRef> stream = this.mappingFileRefs(); stream.hasNext();) {
- stream.next().validate(messages);
- }
- }
-
- protected void checkForMultiplePersistenceUnitDefaults(List<IMessage> messages) {
- boolean foundDefaultsToUse = false;
- Iterator<MappingFileRef> stream = mappingFileRefs();
- while (stream.hasNext() && ! foundDefaultsToUse) {
- MappingFileRef mappingFileRef = stream.next();
- MappingFile mappingFile = mappingFileRef.getMappingFile();
- if (mappingFile != null
- && mappingFile.getRoot() != null
- && mappingFile.getRoot().getPersistenceUnitDefaults() != null
- && mappingFile.getRoot().getPersistenceUnitDefaults().resourceExists()) {
- foundDefaultsToUse = true;
- }
- }
- while (stream.hasNext()) {
- MappingFileRef mappingFileRef = stream.next();
- MappingFile mappingFile = mappingFileRef.getMappingFile();
- if (mappingFile != null
- && mappingFile.getRoot() != null
- && mappingFile.getRoot().getPersistenceUnitDefaults() != null
- && mappingFile.getRoot().getPersistenceUnitDefaults().resourceExists()) {
- 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 : CollectionTools.iterable(this.mappingFileRefs())) {
- 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) {
- this.checkForDuplicateClasses(messages);
- for (Iterator<ClassRef> stream = this.classRefs(); stream.hasNext(); ) {
- stream.next().validate(messages);
- }
- }
-
- protected void checkForDuplicateClasses(List<IMessage> messages) {
- HashBag<String> classNames = new HashBag<String>();
- CollectionTools.addAll(classNames, this.classRefNames());
- for (ClassRef classRef : CollectionTools.iterable(this.classRefs())) {
- 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 Collection<MappingFile> buildMappingFiles() {
- ArrayList<MappingFile> result = new ArrayList<MappingFile>();
- for (Iterator<MappingFileRef> stream = this.mappingFileRefs(); stream.hasNext(); ) {
- MappingFile mappingFile = stream.next().getMappingFile();
- if (mappingFile != null) {
- result.add(mappingFile);
- }
- }
- return result;
- }
-
- //*************************************
-
- public PersistentType getPersistentType(String fullyQualifiedTypeName) {
- for (Iterator<MappingFileRef> stream = this.mappingFileRefs(); stream.hasNext(); ) {
- PersistentType persistentType = stream.next().getPersistentType(fullyQualifiedTypeName);
- if (persistentType != null) {
- return persistentType;
- }
- }
- for (ClassRef classRef : CollectionTools.iterable(classRefs())) {
- if (classRef.isFor(fullyQualifiedTypeName)) {
- return classRef.getJavaPersistentType();
- }
- }
- return null;
- }
-
- public Entity getEntity(String fullyQualifiedTypeName) {
- PersistentType persistentType = this.getPersistentType(fullyQualifiedTypeName);
- if (persistentType == null) {
- return null;
- }
- if (persistentType.getMappingKey() == MappingKeys.ENTITY_TYPE_MAPPING_KEY) {
- return (Entity) persistentType.getMapping();
- }
- return null;
- }
-
- public JpaStructureNode getStructureNode(int textOffset) {
- for (MappingFileRef mappingFileRef : CollectionTools.iterable(mappingFileRefs())) {
- if (mappingFileRef.containsOffset(textOffset)) {
- return mappingFileRef;
- }
- }
- for (ClassRef classRef : CollectionTools.iterable(classRefs())) {
- if (classRef.containsOffset(textOffset)) {
- return classRef;
- }
- }
- return this;
- }
-
- public boolean containsOffset(int textOffset) {
- if (xmlPersistenceUnit == null) {
- return false;
- }
- return xmlPersistenceUnit.containsOffset(textOffset);
- }
-
- public TextRange getSelectionTextRange() {
- return xmlPersistenceUnit.getSelectionTextRange();
- }
-
- public TextRange getValidationTextRange() {
- return xmlPersistenceUnit.getValidationTextRange();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(getName());
- }
-
- public void dispose() {
- for (Iterator<ClassRef> stream = this.classRefs(); stream.hasNext(); ) {
- stream.next().dispose();
- }
- for (Iterator<MappingFileRef> stream = this.mappingFileRefs(); stream.hasNext(); ) {
- stream.next().dispose();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericClassRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericClassRef.java
deleted file mode 100644
index 557d4cd288..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericClassRef.java
+++ /dev/null
@@ -1,278 +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.core.internal.context.persistence;
-
-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.PersistentTypeContext;
-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.AbstractXmlContextNode;
-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.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * This is the context model object which corresponds to the
- * persistence resource model object XmlJavaClassRef.
- * XmlJavaClassRef corresponds to the class tag in the persistence.xml
- */
-public class GenericClassRef extends AbstractXmlContextNode
- implements ClassRef, PersistentTypeContext
-{
- //this is null for the implied classRef case
- protected XmlJavaClassRef xmlJavaClassRef;
-
- protected String className;
-
- protected JavaPersistentType javaPersistentType;
-
-
- public GenericClassRef(PersistenceUnit parent, XmlJavaClassRef classRef) {
- super(parent);
- initialize(classRef);
- }
-
- public GenericClassRef(PersistenceUnit parent, String className) {
- super(parent);
- initialize(className);
- }
-
- public String getId() {
- return PersistenceStructureNodes.CLASS_REF_ID;
- }
-
- public boolean isFor(String fullyQualifiedTypeName) {
- if (getClassName() == null) {
- return false;
- }
- return getClassName().equals(fullyQualifiedTypeName);
- }
-
- public boolean isVirtual() {
- return this.xmlJavaClassRef == null;
- }
-
-
- // **************** PersistentTypeContext impl *****************************
-
- public AccessType getOverridePersistentTypeAccess() {
- // no access type at this level overrides any local access type specification
- return null;
- }
-
- public AccessType getDefaultPersistentTypeAccess() {
- return getPersistenceUnit().getDefaultAccess();
- }
-
-
- // **************** class name *********************************************
-
- public String getClassName() {
- return this.className;
- }
-
- public void setClassName(String newClassName) {
- String oldClassName = this.className;
- this.className = newClassName;
- this.xmlJavaClassRef.setJavaClass(newClassName);
- firePropertyChanged(CLASS_NAME_PROPERTY, oldClassName, newClassName);
- }
-
- protected void setClassName_(String newClassName) {
- String oldClassName = this.className;
- this.className = newClassName;
- firePropertyChanged(CLASS_NAME_PROPERTY, oldClassName, newClassName);
- }
-
-
- // **************** java persistent type ***********************************
-
- public JavaPersistentType getJavaPersistentType() {
- return this.javaPersistentType;
- }
-
- protected void setJavaPersistentType(JavaPersistentType newJavaPersistentType) {
- JavaPersistentType oldJavaPersistentType = this.javaPersistentType;
- this.javaPersistentType = newJavaPersistentType;
- firePropertyChanged(ClassRef.JAVA_PERSISTENT_TYPE_PROPERTY, oldJavaPersistentType, newJavaPersistentType);
- }
-
-
- // **************** updating ***********************************************
-
- protected void initialize(XmlJavaClassRef classRef) {
- this.xmlJavaClassRef = classRef;
- this.className = classRef.getJavaClass();
- initializeJavaPersistentType();
- }
-
- protected void initialize(String className) {
- this.className = className;
- initializeJavaPersistentType();
- }
-
- protected void initializeJavaPersistentType() {
- JavaResourcePersistentType jrpt = getJpaProject().getJavaResourcePersistentType(getClassName());
- if (jrpt != null) {
- this.javaPersistentType = buildJavaPersistentType(jrpt);
- }
- }
-
- public void update(XmlJavaClassRef classRef) {
- this.xmlJavaClassRef = classRef;
- setClassName_(classRef.getJavaClass());
- updateJavaPersistentType();
- }
-
- public void update(String className) {
- this.xmlJavaClassRef = null;
- setClassName_(className);
- updateJavaPersistentType();
- }
-
- protected void updateJavaPersistentType() {
- JavaResourcePersistentType jrpt = getJpaProject().getJavaResourcePersistentType(getClassName());
- if (jrpt == null) {
- if (getJavaPersistentType() != null) {
- getJavaPersistentType().dispose();
- }
- setJavaPersistentType(null);
- }
- else {
- if (getJavaPersistentType() != null) {
- getJavaPersistentType().update(jrpt);
- }
- else {
- setJavaPersistentType(buildJavaPersistentType(jrpt));
- }
- }
- }
-
- protected JavaPersistentType buildJavaPersistentType(JavaResourcePersistentType jrpt) {
- return getJpaFactory().buildJavaPersistentType(this, jrpt);
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- 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.className},
- this,
- this.getValidationTextRange()
- )
- );
- return;
- }
- MappingFileRef mappingFileRef = this.getMappingFileContaining(this.className);
- if (mappingFileRef != null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.LOW_SEVERITY,
- JpaValidationMessages.PERSISTENCE_UNIT_REDUNDANT_CLASS,
- new String[] {this.className, mappingFileRef.getFileName()},
- this,
- this.getValidationTextRange()
- )
- );
- return;
- }
- // 190062 only add Java validation messages if this class is not listed
- // in a mapping file
- this.validateJavaPersistentType(messages);
- }
-
- protected void validateJavaPersistentType(List<IMessage> messages) {
- try {
- this.javaPersistentType.validate(messages);
- } catch (Throwable t) {
- JptCorePlugin.log(t);
- }
- }
-
- //possibly move this and make it API on PersistenceUnit
- /**
- * Return the mapping file that contains a persistent type for the given
- * type name. Return null if no mapping file contains the persistent type.
- */
- protected MappingFileRef getMappingFileContaining(String fullyQualifiedTypeName) {
- for (MappingFileRef mappingFileRef : CollectionTools.iterable(getPersistenceUnit().mappingFileRefs())) {
- if (mappingFileRef.getPersistentType(fullyQualifiedTypeName) != null) {
- return mappingFileRef;
- }
- }
- return null;
- }
-
- public JpaStructureNode getStructureNode(int textOffset) {
- return this;
- }
-
- public boolean containsOffset(int textOffset) {
- if (isVirtual()) {
- return false;
- }
- return this.xmlJavaClassRef.containsOffset(textOffset);
- }
-
- public TextRange getSelectionTextRange() {
- if (isVirtual()) {
- return null;
- }
- return this.xmlJavaClassRef.getSelectionTextRange();
- }
-
- public TextRange getValidationTextRange() {
- if (isVirtual()) {
- return null;
- }
- return this.xmlJavaClassRef.getValidationTextRange();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(getClassName());
- }
-
- public void dispose() {
- if (getJavaPersistentType() != null) {
- getJavaPersistentType().dispose();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericMappingFileRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericMappingFileRef.java
deleted file mode 100644
index 8649fb0819..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericMappingFileRef.java
+++ /dev/null
@@ -1,279 +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.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.Path;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.JptCorePlugin;
-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.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.AbstractXmlContextNode;
-import org.eclipse.jpt.core.internal.resource.JpaResourceModelProviderManager;
-import org.eclipse.jpt.core.internal.resource.orm.OrmResourceModelProvider;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.JpaResourceModelProvider;
-import org.eclipse.jpt.core.resource.common.JpaXmlResource;
-import org.eclipse.jpt.core.resource.orm.OrmResource;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class GenericMappingFileRef extends AbstractXmlContextNode
- implements MappingFileRef
-{
- //this is null for the implied mappingFileRef case
- protected XmlMappingFileRef xmlMappingFileRef;
-
- protected String fileName;
-
- protected MappingFile mappingFile;
-
- public GenericMappingFileRef(PersistenceUnit parent, XmlMappingFileRef mappingFileRef) {
- super(parent);
- this.initialize(mappingFileRef);
- }
-
- public String getId() {
- return PersistenceStructureNodes.MAPPING_FILE_REF_ID;
- }
-
-
- public boolean isVirtual() {
- return xmlMappingFileRef == null;
- }
-
-
- // **************** file name **********************************************
-
- public String getFileName() {
- return this.fileName;
- }
-
- public void setFileName(String newFileName) {
- this.xmlMappingFileRef.setFileName(newFileName);
- setFileName_(newFileName);
- }
-
- protected void setFileName_(String newFileName) {
- String oldFileName = this.fileName;
- this.fileName = newFileName;
- firePropertyChanged(FILE_NAME_PROPERTY, oldFileName, newFileName);
- }
-
- public MappingFile getMappingFile() {
- return this.mappingFile;
- }
-
- protected void setMappingFile(MappingFile newMappingFile) {
- MappingFile oldMappingFile = this.mappingFile;
- this.mappingFile = newMappingFile;
- firePropertyChanged(MAPPING_FILE_PROPERTY, oldMappingFile, newMappingFile);
- }
-
-
- // **************** updating ***********************************************
-
- protected void initialize(XmlMappingFileRef mappingFileRef) {
- this.xmlMappingFileRef = mappingFileRef;
- initializeFileName();
- initializeOrmXml();
- }
-
- protected void initializeFileName() {
- if (isVirtual()) {
- fileName = JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH;
- }
- else {
- fileName = xmlMappingFileRef.getFileName();
- }
- }
-
- protected void initializeOrmXml() {
- if (fileName != null) {
- OrmResourceModelProvider modelProvider =
- OrmResourceModelProvider.getModelProvider(getJpaProject().getProject(), fileName);
- OrmResource ormResource = modelProvider.getResource();
-
- if (ormResource != null && ormResource.exists()) {
- mappingFile = buildMappingFile(ormResource);
- }
- }
- }
-
- public void update(XmlMappingFileRef mappingFileRef) {
- xmlMappingFileRef = mappingFileRef;
- updateFileName();
- updateMappingFile();
- }
-
- protected void updateFileName() {
- if (isVirtual()) {
- setFileName_(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- }
- else {
- setFileName_(xmlMappingFileRef.getFileName());
- }
- }
-
- protected void updateMappingFile() {
- if (fileName != null) {
- IProject project = getJpaProject().getProject();
- IVirtualFile vFile = ComponentCore.createFile(project, new Path(fileName));
- IFile realFile = vFile.getUnderlyingFile();
-
- if ((realFile != null) && realFile.exists()) {
- JpaResourceModelProvider modelProvider = JpaResourceModelProviderManager.instance().getModelProvider(realFile);
- JpaXmlResource resource = (modelProvider == null) ? null : modelProvider.getResource();
- if (resource != null) {
- if (this.mappingFile != null && ! resource.equals(this.mappingFile.getXmlResource())) {
- this.mappingFile.dispose();
- }
- if (this.mappingFile == null) {
- setMappingFile(buildMappingFile(resource));
- }
- else {
- this.mappingFile.update(resource);
- }
- return;
- }
- }
- }
-
- if (this.mappingFile != null) {
- this.mappingFile.dispose();
- setMappingFile(null);
- }
- }
-
- protected MappingFile buildMappingFile(JpaXmlResource resource) {
- XmlContextNode context = this.getJpaFactory().buildContextNode(this, resource);
- try {
- return (MappingFile) context;
- } catch (ClassCastException ex) {
- // resource does not correspond to a mapping file
- return null;
- }
- }
-
-
- // *************************************************************************
-
- public MappingFilePersistenceUnitDefaults getPersistenceUnitDefaults() {
- if ((this.mappingFile != null) && (this.mappingFile.getRoot() != null)) {
- return this.mappingFile.getRoot().getPersistenceUnitDefaults();
- }
- return null;
- }
-
- public PersistentType getPersistentType(String fullyQualifiedTypeName) {
- if (this.mappingFile != null) {
- return this.mappingFile.getPersistentType(fullyQualifiedTypeName);
- }
- return null;
- }
-
- public JpaStructureNode getStructureNode(int textOffset) {
- return this;
- }
-
- public boolean containsOffset(int textOffset) {
- if (this.xmlMappingFileRef == null) {
- return false;
- }
- return this.xmlMappingFileRef.containsOffset(textOffset);
- }
-
- public TextRange getSelectionTextRange() {
- if (isVirtual()) {
- return null;
- }
- return this.xmlMappingFileRef.getSelectionTextRange();
- }
-
- public TextRange getValidationTextRange() {
- if (isVirtual()) {
- return getPersistenceUnit().getValidationTextRange();
- }
- return this.xmlMappingFileRef.getValidationTextRange();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(this.fileName);
- }
-
- public void dispose() {
- if (this.mappingFile != null) {
- this.mappingFile.dispose();
- }
- }
-
-
- //**************** Validation *************************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
-
- 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(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_UNIT_NONEXISTENT_MAPPING_FILE,
- new String[] {this.fileName},
- this,
- this.getValidationTextRange()
- )
- );
- return;
- }
-
- if (this.mappingFile.getRoot() == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_UNIT_INVALID_MAPPING_FILE,
- new String[] {this.fileName},
- this,
- this.getValidationTextRange()
- )
- );
- }
-
- this.mappingFile.validate(messages);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistence.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistence.java
deleted file mode 100644
index 6a4553b052..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistence.java
+++ /dev/null
@@ -1,230 +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.core.internal.context.persistence;
-
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.JpaStructureNode;
-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.PersistenceXml;
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-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.CollectionTools;
-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;
-
-public class GenericPersistence extends AbstractXmlContextNode
- implements Persistence
-{
- protected XmlPersistence xmlPersistence;
-
- // the implementation here is a single persistence unit, although the API
- // is for a list. we will want to support multiple persistence units soon.
- protected PersistenceUnit persistenceUnit;
-
- public GenericPersistence(PersistenceXml parent, XmlPersistence xmlPersistence) {
- super(parent);
- this.initialize(xmlPersistence);
- }
-
- public String getId() {
- return PersistenceStructureNodes.PERSISTENCE_ID;
- }
-
- @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);
- }
-
- 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 = createPersistenceUnit(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);
- }
-
-
- // **************** updating ***********************************************
-
- protected void initialize(XmlPersistence persistence) {
- this.xmlPersistence = persistence;
- initializePersistenceUnits(persistence);
- }
-
- protected void initializePersistenceUnits(XmlPersistence persistence) {
- // only adding one here, until we support multiple persistence units
- if (this.xmlPersistence.getPersistenceUnits().size() > 0) {
- this.persistenceUnit = createPersistenceUnit(persistence.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_(createPersistenceUnit(xmlPersistenceUnit));
- }
- }
- }
-
- protected PersistenceUnit createPersistenceUnit(XmlPersistenceUnit xmlPersistenceUnit) {
- return getJpaFactory().buildPersistenceUnit(this, xmlPersistenceUnit);
- }
-
-
- // *************************************************************************
-
- @Override
- public PersistenceUnit getPersistenceUnit() {
- throw new UnsupportedOperationException("No PersistenceUnit in this context"); //$NON-NLS-1$
- }
-
- public JpaStructureNode getStructureNode(int textOffset) {
- for (PersistenceUnit pu : CollectionTools.iterable(persistenceUnits())) {
- 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 : CollectionTools.iterable(persistenceUnits())) {
- pu.dispose();
- }
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- this.checkForMultiplePersistenceUnits(messages);
- this.validatePersistenceUnit(messages);
- }
-
- /**
- * 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) {
- if (this.persistenceUnit == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_NO_PERSISTENCE_UNIT,
- this,
- this.getValidationTextRange()
- )
- );
- return;
- }
- this.persistenceUnit.validate(messages);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistenceUnit.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistenceUnit.java
deleted file mode 100644
index f6ea000fe7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistenceUnit.java
+++ /dev/null
@@ -1,22 +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.persistence;
-
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-
-public class GenericPersistenceUnit extends AbstractPersistenceUnit
-{
-
- public GenericPersistenceUnit(Persistence parent, XmlPersistenceUnit persistenceUnit) {
- super(parent);
- this.initialize(persistenceUnit);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistenceXml.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistenceXml.java
deleted file mode 100644
index 75b23d025b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistenceXml.java
+++ /dev/null
@@ -1,197 +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.core.internal.context.persistence;
-
-import java.util.List;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jpt.core.JpaStructureNode;
-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.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.common.JpaXmlResource;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.PersistenceResource;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistence;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- *
- */
-public class GenericPersistenceXml
- extends AbstractXmlContextNode
- implements PersistenceXml
-{
- protected PersistenceResource persistenceResource;
-
- protected Persistence persistence;
-
-
- public GenericPersistenceXml(JpaRootContextNode parent, PersistenceResource persistenceResource) {
- super(parent);
- this.initialize(persistenceResource);
- }
-
-
- // **************** JpaNode impl *******************************************
-
- @Override
- public JpaRootContextNode getParent() {
- return (JpaRootContextNode) super.getParent();
- }
-
- @Override
- public IResource getResource() {
- return this.persistenceResource.getFile();
- }
-
-
- // **************** XmlContextNode impl ************************************
-
- @Override
- public JpaXmlResource getEResource() {
- return this.persistenceResource;
- }
-
-
- // **************** JpaStructureNode impl **********************************
-
- public String getId() {
- // isn't actually displayed, so needs no details page
- return null;
- }
-
-
- // **************** persistence ********************************************
-
- public Persistence getPersistence() {
- return this.persistence;
- }
-
- public Persistence addPersistence() {
- if (this.persistence != null) {
- throw new IllegalStateException();
- }
-
- XmlPersistence xmlPersistence = PersistenceFactory.eINSTANCE.createXmlPersistence();
- this.persistence = buildPersistence(xmlPersistence);
- this.persistenceResource.getContents().add(xmlPersistence);
- firePropertyChanged(PERSISTENCE_PROPERTY, null, this.persistence);
- return this.persistence;
- }
-
- public void removePersistence() {
- if (this.persistence == null) {
- throw new IllegalStateException();
- }
- getJpaFile(this.persistenceResource.getFile()).removeRootStructureNode(this.persistenceResource);
- this.persistence.dispose();
- Persistence oldPersistence = this.persistence;
- this.persistence = null;
- XmlPersistence xmlPersistence = this.persistenceResource.getPersistence();
- this.persistenceResource.getContents().remove(xmlPersistence);
- firePropertyChanged(PERSISTENCE_PROPERTY, oldPersistence, null);
- }
-
- protected void setPersistence_(Persistence newPersistence) {
- Persistence oldPersistence = this.persistence;
- this.persistence = newPersistence;
- firePropertyChanged(PERSISTENCE_PROPERTY, oldPersistence, newPersistence);
- }
-
-
- // **************** updating ***********************************************
-
- protected void initialize(PersistenceResource pr) {
- this.persistenceResource = pr;
- if (pr.getPersistence() != null) {
- this.persistence = buildPersistence(pr.getPersistence());
- }
- }
-
- public void update(PersistenceResource pr) {
- this.persistenceResource = pr;
- if (pr.getPersistence() != null) {
- if (this.persistence != null) {
- this.getJpaFile(this.persistenceResource.getFile()).addRootStructureNode(this.persistenceResource, this.persistence);
- this.persistence.update(pr.getPersistence());
- }
- else {
- setPersistence_(buildPersistence(pr.getPersistence()));
- }
- }
- else {
- if (this.persistence != null) {
- this.getJpaFile(this.persistenceResource.getFile()).removeRootStructureNode(this.persistenceResource);
- this.persistence.dispose();
- }
- setPersistence_(null);
- }
- }
-
- protected Persistence buildPersistence(XmlPersistence xmlPersistence) {
- return getJpaFactory().buildPersistence(this, xmlPersistence);
- }
-
-
- // *************************************************************************
-
- @Override
- public PersistenceUnit getPersistenceUnit() {
- throw new UnsupportedOperationException("No Persistence Unit in this context"); //$NON-NLS-1$
- }
-
-
- 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 TextRange getValidationTextRange() {
- return TextRange.Empty.instance();
- }
-
-
- // **************** validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
-
- if (this.persistence == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_XML_INVALID_CONTENT,
- this
- )
- );
- return;
- }
-
- this.persistence.validate(messages);
- }
-
- public void dispose() {
- this.persistence.dispose();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericProperty.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericProperty.java
deleted file mode 100644
index 27eb7d089e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericProperty.java
+++ /dev/null
@@ -1,89 +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.persistence;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.Property;
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.resource.persistence.XmlProperty;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-public class GenericProperty extends AbstractXmlContextNode
- implements Property
-{
- protected String name;
-
- protected String value;
-
- protected XmlProperty property;
-
- public GenericProperty(PersistenceUnit parent, XmlProperty property) {
- super(parent);
- this.initialize(property);
- }
-
- // **************** name ***************************************************
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.property.setName(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
-
- // **************** value **************************************************
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String newValue) {
- String oldValue = this.value;
- this.value = newValue;
- this.property.setValue(newValue);
- firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
- }
-
-
- // **************** updating ***********************************************
-
- protected void initialize(XmlProperty property) {
- this.property = property;
- this.name = property.getName();
- this.value = property.getValue();
- }
-
- public void update(XmlProperty property) {
- this.property = property;
- setName(property.getName());
- setValue(property.getValue());
- }
-
- // **************** validation ***********************************************
-
- public TextRange getValidationTextRange() {
- return this.property.getValidationTextRange();
- }
-
- // **************** toString
- @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/facet/JpaFacetDataModelProperties.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProperties.java
deleted file mode 100644
index dd70b9369a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProperties.java
+++ /dev/null
@@ -1,112 +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.facet;
-
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties;
-
-public interface JpaFacetDataModelProperties extends IDataModelProperties
-{
- /**
- * Required, type String, identifies Jpa Platform
- */
- public static final String PLATFORM_ID = "JpaFacetDataModelProperties.PLATFORM_ID";
-
- /**
- * Not required, type String, identifies database connection
- */
- public static final String CONNECTION = "JpaFacetDataModelProperties.CONNECTION";
-
- /**
- * Required, type Boolean, identifies whether database connection is active
- */
- public static final String CONNECTION_ACTIVE = "JpaFacetDataModelProperties.CONNECTION_ACTIVE";
-
- /**
- * Required, type Boolean, identifies if the user wishes to override default schema name
- */
- public static final String USER_WANTS_TO_OVERRIDE_DEFAULT_SCHEMA =
- "JpaFacetDataModelProperties.USER_WANTS_TO_OVERRIDE_DEFAULT_SCHEMA";
-
- /**
- * Not required, type String, identifies the user overridden default schema name
- */
- public static final String USER_OVERRIDE_DEFAULT_SCHEMA =
- "JpaFacetDataModelProperties.USER_OVERRIDE_DEFAULT_SCHEMA";
-
- /**
- * Required, type Boolean, identifies if the user wishes to add the database driver jars to the classpath
- */
- public static final String USER_WANTS_TO_ADD_DB_DRIVER_JARS_TO_CLASSPATH =
- "JpaFacetDataModelProperties.USER_WANTS_TO_ADD_DB_DRIVER_JARS_TO_CLASSPATH";
-
- /**
- * Not required, type String, identifies the database driver library added to the classpath
- */
- public static final String DB_DRIVER_NAME =
- "JpaFacetDataModelProperties.DB_DRIVER_NAME";
-
- /**
- * Not required, type String, identifies the database driver jars added to the classpath
- */
- public static final String DB_DRIVER_JARS =
- "JpaFacetDataModelProperties.DB_DRIVER_JARS";
-
- /**
- * 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
- */
- public static final String RUNTIME = "JpaFacetDataModelProperties.RUNTIME";
-
- /**
- * Required, type boolean, opposite of USE_USER_JPA_LIBRARY, identifies whether
- * server runtime provides JPA implementation
- * If this is true, then the property JPA_LIBRARY is not used
- */
- public static final String USE_SERVER_JPA_IMPLEMENTATION = "JpaFacetDataModelProperties.USE_SERVER_JPA_IMPLEMENTATION";
-
- /**
- * Required, type boolean, opposite of USE_SERVER_JPA_IMPLEMENTATION, identifies
- * whether the user is providing his own JPA library
- * (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)
- * If this is true, then the property JPA_LIBRARY is used
- */
- public static final String USE_USER_JPA_LIBRARY = "JpaFacetDataModelProperties.USE_USER_JPA_LIBRARY";
-
- /**
- * Not required, type String, identifies JPA implementation library.
- * Only used if the property USE_SERVER_JPA_IMPLEMENTATION is false.
- */
- public static final String JPA_LIBRARY = "JpaFacetDataModelProperties.JPA_LIBRARY";
-
- /**
- * Required, type boolean, opposite of LIST_ANNOTATED_CLASSES, identifies
- * whether all annotated classes are to be automatically included as part of
- * all persistence units
- */
- public static final String DISCOVER_ANNOTATED_CLASSES = "JpaFacetDataModelProperties.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)
- */
- public static final String LIST_ANNOTATED_CLASSES = "JpaFacetDataModelProperties.LIST_ANNOTATED_CLASSES";
-
- /**
- * Required, type boolean, details whether orm.xml should be created
- */
- public static final String CREATE_ORM_XML = "JpaFacetDataModelProperties.CREATE_ORM_XML";
-}
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 339ec62677..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProvider.java
+++ /dev/null
@@ -1,523 +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.facet;
-
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.JptCoreMessages;
-import org.eclipse.jpt.core.internal.platform.JpaPlatformRegistry;
-import org.eclipse.jpt.db.ConnectionProfile;
-import org.eclipse.jpt.db.ConnectionProfileFactory;
-import org.eclipse.jpt.db.Database;
-import org.eclipse.jpt.db.DatabaseFinder;
-import org.eclipse.jpt.db.JptDbPlugin;
-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.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.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.frameworks.internal.plugin.WTPCommonMessages;
-import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
-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 class JpaFacetDataModelProvider extends FacetInstallDataModelProvider
- implements JpaFacetDataModelProperties
-{
- private static final String EJB_FACET_ID = IModuleConstants.JST_EJB_MODULE;
-
- private static final String RUNTIME_NONE =
- WTPCommonPlugin.getResourceString(WTPCommonMessages.RUNTIME_NONE, null);
-
- private static final IStatus PLATFORM_NOT_SPECIFIED_STATUS =
- buildErrorStatus(JptCoreMessages.VALIDATE_PLATFORM_NOT_SPECIFIED);
-
- private static final IStatus CONNECTION_NOT_CONNECTED_STATUS =
- buildInfoStatus(JptCoreMessages.VALIDATE_CONNECTION_NOT_CONNECTED);
-
- private static final IStatus USER_OVERRIDE_DEFAULT_SCHEMA_NOT_SPECIFIED_STATUS =
- buildErrorStatus(JptCoreMessages.VALIDATE_DEFAULT_SCHEMA_NOT_SPECIFIED);
-
- private static final IStatus RUNTIME_NOT_SPECIFIED_STATUS =
- buildWarningStatus(JptCoreMessages.VALIDATE_RUNTIME_NOT_SPECIFIED);
-
- private static final IStatus RUNTIME_DOES_NOT_SUPPORT_EJB_30_STATUS =
- buildWarningStatus(JptCoreMessages.VALIDATE_RUNTIME_DOES_NOT_SUPPORT_EJB_30);
-
- private static final IStatus LIBRARY_NOT_SPECIFIED_STATUS =
- buildWarningStatus(JptCoreMessages.VALIDATE_LIBRARY_NOT_SPECIFIED);
-
- /**
- * required default constructor
- */
- public JpaFacetDataModelProvider() {
- super();
- }
-
-
-
- @Override
- public Set<String> getPropertyNames() {
- @SuppressWarnings("unchecked") Set<String> propertyNames = super.getPropertyNames();
- propertyNames.add(PLATFORM_ID);
- propertyNames.add(CONNECTION);
- propertyNames.add(CONNECTION_ACTIVE);
- propertyNames.add(USER_WANTS_TO_ADD_DB_DRIVER_JARS_TO_CLASSPATH);
- propertyNames.add(DB_DRIVER_NAME);
- propertyNames.add(DB_DRIVER_JARS);
- propertyNames.add(USER_WANTS_TO_OVERRIDE_DEFAULT_SCHEMA);
- propertyNames.add(USER_OVERRIDE_DEFAULT_SCHEMA);
- propertyNames.add(RUNTIME);
- propertyNames.add(USE_SERVER_JPA_IMPLEMENTATION);
- propertyNames.add(USE_USER_JPA_LIBRARY);
- propertyNames.add(JPA_LIBRARY);
- propertyNames.add(DISCOVER_ANNOTATED_CLASSES);
- propertyNames.add(LIST_ANNOTATED_CLASSES);
- propertyNames.add(CREATE_ORM_XML);
- return propertyNames;
- }
-
- @Override
- public boolean isPropertyEnabled(String propertyName) {
- if (propertyName.equals(USER_OVERRIDE_DEFAULT_SCHEMA)) {
- return getBooleanProperty(USER_WANTS_TO_OVERRIDE_DEFAULT_SCHEMA);
- }
- if (propertyName.equals(USER_WANTS_TO_ADD_DB_DRIVER_JARS_TO_CLASSPATH)) {
- return getConnectionProfile() != null;
- }
- if (propertyName.equals(DB_DRIVER_NAME)) {
- return getBooleanProperty(USER_WANTS_TO_ADD_DB_DRIVER_JARS_TO_CLASSPATH);
- }
- if (propertyName.equals(JPA_LIBRARY)) {
- return getBooleanProperty(USE_USER_JPA_LIBRARY);
- }
- return super.isPropertyEnabled(propertyName);
- }
-
- @Override
- public Object getDefaultProperty(String propertyName) {
- if (propertyName.equals(FACET_ID)) {
- return JptCorePlugin.FACET_ID;
- }
- if (propertyName.equals(PLATFORM_ID)) {
- return JptCorePlugin.getDefaultJpaPlatformId();
- }
- if (propertyName.equals(CONNECTION)) {
- return null;
- }
- if (propertyName.equals(CONNECTION_ACTIVE)) {
- return Boolean.valueOf(connectionIsActive());
- }
- if (propertyName.equals(USER_WANTS_TO_ADD_DB_DRIVER_JARS_TO_CLASSPATH)) {
- return Boolean.FALSE;
- }
- if (propertyName.equals(DB_DRIVER_NAME)) {
- return getDefaultDriverName();
- }
- if (propertyName.equals(DB_DRIVER_JARS)) {
- return getDefaultDriverJars();
- }
- if (propertyName.equals(USER_WANTS_TO_OVERRIDE_DEFAULT_SCHEMA)) {
- return Boolean.FALSE;
- }
- if (propertyName.equals(USER_OVERRIDE_DEFAULT_SCHEMA)) {
- return getDefaultSchemaName();
- }
- if (propertyName.equals(RUNTIME)) {
- return null;
- }
- if (propertyName.equals(USE_SERVER_JPA_IMPLEMENTATION)) {
- return Boolean.valueOf(this.runtimeSupportsEjb30(this.runtime()));
- }
- if (propertyName.equals(USE_USER_JPA_LIBRARY)) {
- return Boolean.valueOf( ! getBooleanProperty(USE_SERVER_JPA_IMPLEMENTATION));
- }
- if (propertyName.equals(JPA_LIBRARY)) {
- return JptCorePlugin.getDefaultJpaLibrary();
- }
- if (propertyName.equals(DISCOVER_ANNOTATED_CLASSES)) {
- return Boolean.valueOf(this.runtimeSupportsEjb30(this.runtime()));
- }
- if (propertyName.equals(LIST_ANNOTATED_CLASSES)) {
- return Boolean.valueOf( ! getBooleanProperty(DISCOVER_ANNOTATED_CLASSES));
- }
- if (propertyName.equals(CREATE_ORM_XML)) {
- return Boolean.TRUE;
- }
- return super.getDefaultProperty(propertyName);
- }
-
-
-
- @Override
- public boolean propertySet(String propertyName, Object propertyValue) {
- boolean ok = super.propertySet(propertyName, propertyValue);
- if (propertyName.equals(RUNTIME)) {
- this.model.notifyPropertyChange(USE_SERVER_JPA_IMPLEMENTATION, IDataModel.DEFAULT_CHG);
- this.model.notifyPropertyChange(USE_USER_JPA_LIBRARY, IDataModel.DEFAULT_CHG);
- // need to fire that the default change for using user library may have
- // actually changed enablement for library
- this.model.notifyPropertyChange(JPA_LIBRARY, IDataModel.ENABLE_CHG);
- this.model.notifyPropertyChange(DISCOVER_ANNOTATED_CLASSES, IDataModel.DEFAULT_CHG);
- this.model.notifyPropertyChange(LIST_ANNOTATED_CLASSES, IDataModel.DEFAULT_CHG);
- }
- if (propertyName.equals(CONNECTION)) {
- this.model.notifyPropertyChange(CONNECTION, IDataModel.VALID_VALUES_CHG);
- this.model.setBooleanProperty(CONNECTION_ACTIVE, connectionIsActive());
- this.model.notifyPropertyChange(DB_DRIVER_NAME, IDataModel.DEFAULT_CHG);
- this.model.notifyPropertyChange(DB_DRIVER_NAME, IDataModel.VALID_VALUES_CHG);
- this.model.notifyPropertyChange(DB_DRIVER_JARS, IDataModel.DEFAULT_CHG);
- this.model.notifyPropertyChange(DB_DRIVER_JARS, IDataModel.VALID_VALUES_CHG);
- this.model.notifyPropertyChange(USER_OVERRIDE_DEFAULT_SCHEMA, IDataModel.DEFAULT_CHG);
- this.model.notifyPropertyChange(USER_OVERRIDE_DEFAULT_SCHEMA, IDataModel.VALID_VALUES_CHG);
- }
- if (propertyName.equals(CONNECTION_ACTIVE)) {
- this.model.notifyPropertyChange(USER_OVERRIDE_DEFAULT_SCHEMA, IDataModel.DEFAULT_CHG);
- this.model.notifyPropertyChange(USER_OVERRIDE_DEFAULT_SCHEMA, IDataModel.VALID_VALUES_CHG);
- this.model.notifyPropertyChange(USER_WANTS_TO_ADD_DB_DRIVER_JARS_TO_CLASSPATH, IDataModel.ENABLE_CHG);
- this.model.notifyPropertyChange(DB_DRIVER_NAME, IDataModel.ENABLE_CHG);
- this.model.notifyPropertyChange(DB_DRIVER_JARS, IDataModel.ENABLE_CHG);
- }
- if (propertyName.equals(USER_WANTS_TO_ADD_DB_DRIVER_JARS_TO_CLASSPATH)) {
- this.model.notifyPropertyChange(DB_DRIVER_NAME, IDataModel.ENABLE_CHG);
- this.model.notifyPropertyChange(DB_DRIVER_JARS, IDataModel.ENABLE_CHG);
- if (! ((Boolean) propertyValue).booleanValue()) {
- this.model.setProperty(DB_DRIVER_NAME, null);
- this.model.setProperty(DB_DRIVER_JARS, null);
- }
- }
- if (propertyName.equals(USER_WANTS_TO_OVERRIDE_DEFAULT_SCHEMA)) {
- this.model.notifyPropertyChange(USER_OVERRIDE_DEFAULT_SCHEMA, IDataModel.ENABLE_CHG);
- if (! ((Boolean) propertyValue).booleanValue()) {
- this.model.setProperty(USER_OVERRIDE_DEFAULT_SCHEMA, null);
- }
- }
- if (propertyName.equals(USE_SERVER_JPA_IMPLEMENTATION)) {
- this.model.setBooleanProperty(USE_USER_JPA_LIBRARY, ! ((Boolean) propertyValue).booleanValue());
- }
- if (propertyName.equals(USE_USER_JPA_LIBRARY)) {
- this.model.setBooleanProperty(USE_SERVER_JPA_IMPLEMENTATION, ! ((Boolean) propertyValue).booleanValue());
- this.model.notifyPropertyChange(JPA_LIBRARY, IDataModel.ENABLE_CHG);
- }
- if (propertyName.equals(DISCOVER_ANNOTATED_CLASSES)) {
- this.model.setBooleanProperty(LIST_ANNOTATED_CLASSES, ! ((Boolean) propertyValue).booleanValue());
- }
- if (propertyName.equals(LIST_ANNOTATED_CLASSES)) {
- this.model.setBooleanProperty(DISCOVER_ANNOTATED_CLASSES, ! ((Boolean) propertyValue).booleanValue());
- }
- return ok;
- }
-
- private static final DataModelPropertyDescriptor[] EMPTY_DMPD_ARRAY = new DataModelPropertyDescriptor[0];
-
- @Override
- public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) {
- if (propertyName.equals(PLATFORM_ID)) {
- return CollectionTools.array(
- new TransformationIterator<String, DataModelPropertyDescriptor>(
- JpaPlatformRegistry.instance().jpaPlatformIds()) {
- @Override
- protected DataModelPropertyDescriptor transform(String platformId) {
- return platformIdPropertyDescriptor(platformId);
- }
- },
- EMPTY_DMPD_ARRAY);
- }
- if (propertyName.equals(CONNECTION)) {
- return CollectionTools.array(
- new TransformationIterator<String, DataModelPropertyDescriptor>(
- new CompositeIterator<String>(null, connectionNames())) {
- @Override
- protected DataModelPropertyDescriptor transform(String next) {
- return connectionPropertyDescriptor(next);
- }
- },
- EMPTY_DMPD_ARRAY);
- }
- if (propertyName.equals(DB_DRIVER_NAME)) {
- return CollectionTools.array(
- new TransformationIterator<String, DataModelPropertyDescriptor>(driverNames()) {
- @Override
- protected DataModelPropertyDescriptor transform(String next) {
- return new DataModelPropertyDescriptor(next);
- }
- },
- EMPTY_DMPD_ARRAY);
- }
- if (propertyName.equals(USER_OVERRIDE_DEFAULT_SCHEMA)) {
- return CollectionTools.array(
- new TransformationIterator<String, DataModelPropertyDescriptor>(schemaNames()) {
- @Override
- protected DataModelPropertyDescriptor transform(String next) {
- return new DataModelPropertyDescriptor(next);
- }
- },
- EMPTY_DMPD_ARRAY);
- }
- if (propertyName.equals(JPA_LIBRARY)) {
- String[] libraries = CollectionTools.sort(JavaCore.getUserLibraryNames());
- DataModelPropertyDescriptor[] descriptors = new DataModelPropertyDescriptor[libraries.length + 1];
- descriptors[0] = new DataModelPropertyDescriptor("", RUNTIME_NONE); //$NON-NLS-1$
-
- int i = 1;
- for (String library : libraries) {
- descriptors[i++] = new DataModelPropertyDescriptor(library, library);
- }
- return descriptors;
- }
-
- return super.getValidPropertyDescriptors(propertyName);
- }
-
- @Override
- public DataModelPropertyDescriptor getPropertyDescriptor(String propertyName) {
- if (propertyName.equals(PLATFORM_ID)) {
- return platformIdPropertyDescriptor(getStringProperty(PLATFORM_ID));
- }
- if (propertyName.equals(CONNECTION)) {
- return connectionPropertyDescriptor(getStringProperty(CONNECTION));
- }
- return super.getPropertyDescriptor(propertyName);
- }
-
- DataModelPropertyDescriptor platformIdPropertyDescriptor(String platformId) {
- return new DataModelPropertyDescriptor(
- platformId, JpaPlatformRegistry.instance().getJpaPlatformLabel(platformId));
- }
-
- DataModelPropertyDescriptor connectionPropertyDescriptor(String connection) {
- return StringTools.stringIsEmpty(connection) ?
- new DataModelPropertyDescriptor(null, JptCoreMessages.NONE)
- :
- new DataModelPropertyDescriptor(connection);
- }
-
- @Override
- public IStatus validate(String name) {
- if (name.equals(PLATFORM_ID)) {
- return this.validatePlatformId(this.getStringProperty(name));
- }
- if (name.equals(CONNECTION)) {
- return this.validateConnectionName(this.getStringProperty(name));
- }
- if (name.equals(USER_WANTS_TO_ADD_DB_DRIVER_JARS_TO_CLASSPATH)
- || name.equals(DB_DRIVER_NAME)) {
- return this.validateDbDriverName();
- }
- if (name.equals(USER_WANTS_TO_OVERRIDE_DEFAULT_SCHEMA)
- || name.equals(USER_OVERRIDE_DEFAULT_SCHEMA)) {
- return this.validateUserOverrideDefaultSchema();
- }
- if (name.equals(USE_SERVER_JPA_IMPLEMENTATION)) {
- return this.validateJpaLibrary(this.getBooleanProperty(name));
- }
- if (name.equals(DISCOVER_ANNOTATED_CLASSES)) {
- return this.validatePersistentClassManagement(this.getBooleanProperty(name));
- }
- return super.validate(name);
- }
-
- private IRuntime runtime() {
- return (IRuntime) this.getProperty(RUNTIME);
- }
-
- private boolean runtimeSupportsEjb30(IRuntime runtime) {
- IProjectFacetVersion ejb30 = ProjectFacetsManager.getProjectFacet(EJB_FACET_ID).getVersion("3.0"); //$NON-NLS-1$
- return (runtime == null) ? false : runtime.supports(ejb30);
- }
-
- private String getConnectionName() {
- return this.getStringProperty(CONNECTION);
- }
-
- private ConnectionProfile getConnectionProfile() {
- return this.buildConnectionProfile(this.getConnectionName());
- }
-
- private 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();
- }
-
- private ConnectionProfile buildConnectionProfile(String name) {
- return this.getConnectionProfileFactory().buildConnectionProfile(name, DatabaseFinder.Default.instance());
- }
-
- private boolean connectionIsActive() {
- return this.connectionIsActive(this.getConnectionName());
- }
-
- private boolean connectionIsActive(String connectionName) {
- ConnectionProfile cp = this.buildConnectionProfile(connectionName);
- return (cp != null) && cp.isActive();
- }
-
- private String getDefaultDriverName() {
- ConnectionProfile cp = this.getConnectionProfile();
- if (cp == null) {
- return null;
- }
- return cp.getDriverName();
- }
-
- private String getDefaultDriverJars() {
- ConnectionProfile cp = this.getConnectionProfile();
- if (cp == null) {
- return null;
- }
- return cp.getDriverJarList();
- }
-
- private Iterator<String> connectionNames() {
- String setValue = getStringProperty(CONNECTION);
-
- List<String> connectionNames = CollectionTools.sort(CollectionTools.list(
- this.getConnectionProfileFactory().connectionProfileNames()));
-
- if (! StringTools.stringIsEmpty(setValue) && ! connectionNames.contains(setValue)) {
- return new CompositeIterator<String>(setValue, connectionNames.iterator());
- }
- return connectionNames.iterator();
- }
-
- private String getDefaultSchemaName() {
- ConnectionProfile cp = this.getConnectionProfile();
- if (cp == null) {
- return null;
- }
- Database db = cp.getDatabase();
- if (db == null) {
- return null;
- }
- Schema schema = db.getDefaultSchema();
- return (schema == null) ? null : schema.getIdentifier();
- }
-
- private List<String> buildSortedSchemaNames() {
- ConnectionProfile cp = this.getConnectionProfile();
- if (cp == null) {
- return Collections.emptyList();
- }
- Database db = cp.getDatabase();
- if (db == null) {
- return Collections.emptyList();
- }
- // TODO catalogs...
- return CollectionTools.list(db.sortedSchemaIdentifiers()); // use identifiers? names seem OK since combo-box is read-only?
- }
-
- private Iterator<String> schemaNames() {
- String setValue = getStringProperty(USER_OVERRIDE_DEFAULT_SCHEMA);
- List<String> schemaNames = this.buildSortedSchemaNames();
-
- if (StringTools.stringIsEmpty(setValue) || schemaNames.contains(setValue)) {
- return schemaNames.iterator();
- }
- return new CompositeIterator<String>(setValue, schemaNames.iterator());
- }
-
- private Iterator<String> driverNames() {
- String setValue = getStringProperty(DB_DRIVER_NAME);
-
- return new CompositeIterator<String>(setValue, EmptyIterator.<String> instance());
- }
-
-
- // ********** validation **********
-
- private IStatus validatePlatformId(String platformId) {
- return StringTools.stringIsEmpty(platformId) ?
- PLATFORM_NOT_SPECIFIED_STATUS
- :
- OK_STATUS;
- }
-
- private IStatus validateConnectionName(String connectionName) {
- if (StringTools.stringIsEmpty(connectionName)) {
- return OK_STATUS;
- }
- ConnectionProfile connectionProfile = getConnectionProfile();
- if (connectionProfile == null) {
- return buildErrorStatus(NLS.bind(JptCoreMessages.VALIDATE_CONNECTION_INVALID, connectionName));
-
- }
- if (! connectionProfile.isActive()) {
- return CONNECTION_NOT_CONNECTED_STATUS;
- }
- return OK_STATUS;
- }
-
- private IStatus validateUserOverrideDefaultSchema() {
- if (getBooleanProperty(USER_WANTS_TO_OVERRIDE_DEFAULT_SCHEMA)) {
- if (StringTools.stringIsEmpty(getStringProperty(USER_OVERRIDE_DEFAULT_SCHEMA))) {
- return USER_OVERRIDE_DEFAULT_SCHEMA_NOT_SPECIFIED_STATUS;
- }
- }
- return OK_STATUS;
- }
-
- private IStatus validateJpaLibrary(boolean useServerJpaImplementation) {
- if (useServerJpaImplementation) {
- IRuntime runtime = this.runtime();
- if (runtime == null) {
- return RUNTIME_NOT_SPECIFIED_STATUS;
- }
- if ( ! this.runtimeSupportsEjb30(runtime)) {
- return RUNTIME_DOES_NOT_SUPPORT_EJB_30_STATUS;
- }
- } else {
- if (StringTools.stringIsEmpty(this.getStringProperty(JPA_LIBRARY))) {
- return LIBRARY_NOT_SPECIFIED_STATUS;
- }
- }
- return OK_STATUS;
- }
-
- private IStatus validatePersistentClassManagement(boolean discoverAnnotatedClasses) {
- // TODO warning if "discovery" is used, but no runtime specified ??
- return OK_STATUS;
- }
-
- private IStatus validateDbDriverName() {
- return OK_STATUS;
- }
-
-
- // ********** static methods **********
-
- private static IStatus buildInfoStatus(String message) {
- return buildStatus(IStatus.INFO, message);
- }
-
- private static IStatus buildWarningStatus(String message) {
- return buildStatus(IStatus.WARNING, message);
- }
-
- private static IStatus buildErrorStatus(String message) {
- return buildStatus(IStatus.ERROR, message);
- }
-
- private 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/JpaFacetInstallDelegate.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDelegate.java
deleted file mode 100644
index cb8512d0ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDelegate.java
+++ /dev/null
@@ -1,160 +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.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.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathAttribute;
-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.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil;
-import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants;
-import org.eclipse.jst.j2ee.project.EarUtilities;
-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;
-
-/**
- * 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
- implements IDelegate, JpaFacetDataModelProperties
-{
-
- public 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();
- }
- }
-
- private void execute_(IProject project, 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.
-
- IJavaProject javaProject = JavaCore.create(project);
- IDataModel dataModel = (IDataModel) config;
- this.configureClasspath(javaProject, dataModel, monitor);
-
- // project settings
- JptCorePlugin.setJpaPlatformId(project, dataModel.getStringProperty(PLATFORM_ID));
- JptCorePlugin.setConnectionProfileName(project, dataModel.getStringProperty(CONNECTION));
- if (dataModel.getBooleanProperty(USER_WANTS_TO_OVERRIDE_DEFAULT_SCHEMA)) {
- JptCorePlugin.setUserOverrideDefaultSchemaName(project, dataModel.getStringProperty(USER_OVERRIDE_DEFAULT_SCHEMA));
- }
-
- this.addDbDriverLibraryToClasspath(javaProject, dataModel, monitor);
-
- JptCorePlugin.setDiscoverAnnotatedClasses(project, dataModel.getBooleanProperty(DISCOVER_ANNOTATED_CLASSES));
-
- // defaults settings
- JptCorePlugin.setDefaultJpaPlatformId(dataModel.getStringProperty(PLATFORM_ID));
-
- monitor.worked(1);
- }
-
- private void configureClasspath(IJavaProject javaProject, IDataModel dataModel, IProgressMonitor monitor) throws CoreException {
- boolean useServerLibrary = dataModel.getBooleanProperty(USE_SERVER_JPA_IMPLEMENTATION);
- if (useServerLibrary) {
- return;
- }
-
- String jpaLibrary = dataModel.getStringProperty(JPA_LIBRARY);
- if (StringTools.stringIsEmpty(jpaLibrary)) {
- return;
- }
-
- // build the JPA library to be added to the classpath
- IClasspathAttribute[] attributes = this.buildClasspathAttributes(javaProject.getProject());
- IClasspathEntry jpaLibraryEntry =
- JavaCore.newContainerEntry(
- new Path(JavaCore.USER_LIBRARY_CONTAINER_ID + "/" + jpaLibrary), //$NON-NLS-1$
- null, attributes, true
- );
-
- this.addClasspathEntryToProject(jpaLibraryEntry, javaProject, monitor);
- }
-
- private void addDbDriverLibraryToClasspath(IJavaProject javaProject, IDataModel dataModel, IProgressMonitor monitor) throws CoreException {
- if( ! dataModel.getBooleanProperty(USER_WANTS_TO_ADD_DB_DRIVER_JARS_TO_CLASSPATH)) {
- return;
- }
- String driverJars = dataModel.getStringProperty(DB_DRIVER_JARS);
- if (StringTools.stringIsEmpty(driverJars)) {
- return;
- }
-
- String[] driverJarArray = driverJars.split(","); //$NON-NLS-1$
- for(String driverJar : driverJarArray) {
- IClasspathEntry driverJarEntry =
- JavaCore.newLibraryEntry(
- new Path(driverJar), null, null, true
- );
- this.addClasspathEntryToProject(driverJarEntry, 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 (CollectionTools.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 static final IClasspathAttribute[] EMPTY_CLASSPATH_ATTRIBUTES = new IClasspathAttribute[0];
-
- private IClasspathAttribute[] buildClasspathAttributes(IProject project) {
- boolean webApp = JptCorePlugin.projectHasWebFacet(project);
- if ( ! webApp && this.projectIsStandalone(project)) {
- return EMPTY_CLASSPATH_ATTRIBUTES;
- }
- return new IClasspathAttribute[] {
- JavaCore.newClasspathAttribute(
- IClasspathDependencyConstants.CLASSPATH_COMPONENT_DEPENDENCY,
- ClasspathDependencyUtil.getDefaultRuntimePath(webApp).toString()
- )
- };
- }
-
- private boolean projectIsStandalone(IProject project) {
- return EarUtilities.isStandaloneProject(project);
- }
-
- 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/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/operations/OrmFileCreationDataModelProperties.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/OrmFileCreationDataModelProperties.java
deleted file mode 100644
index 908a3bb0d7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/OrmFileCreationDataModelProperties.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.internal.operations;
-
-public interface OrmFileCreationDataModelProperties
-{
- /**
- * Required, type String, identifies the name of the project in which to create the file
- */
- public static final String PROJECT_NAME = "OrmFileCreationDataModelProperties.PROJECT_NAME";
-
- /**
- * Required, type String, identifies the fully pathed source folder in which to create the file
- */
- public static final String SOURCE_FOLDER = "OrmFileCreationDataModelProperties.SOURCE_FOLDER";
-
- /**
- * Required, type String, identifies the file path relative to the source folder
- */
- public static final String FILE_PATH = "OrmFileCreationDataModelProperties.FILE_PATH";
-
- /**
- * 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 55a5adb9d4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/OrmFileCreationDataModelProvider.java
+++ /dev/null
@@ -1,471 +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.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.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.utility.internal.CollectionTools;
-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.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.frameworks.datamodel.IDataModelOperation;
-import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
-
-public class OrmFileCreationDataModelProvider extends AbstractDataModelProvider
- 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(PROJECT_NAME);
- propertyNames.add(SOURCE_FOLDER);
- propertyNames.add(FILE_PATH);
- 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(SOURCE_FOLDER)) {
- IFolder sourceFolder = getDefaultSourceFolder();
- if (sourceFolder != null && sourceFolder.exists()) {
- return sourceFolder.getFullPath().toPortableString();
- }
- }
- else if (propertyName.equals(FILE_PATH)) {
- return new Path(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH).toPortableString();
- }
- else 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
- 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);
- 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(PROJECT_NAME)) {
- return CollectionTools.array(
- new TransformationIterator<IProject, DataModelPropertyDescriptor>(jpaIProjects()) {
- @Override
- protected DataModelPropertyDescriptor transform(IProject next) {
- return new DataModelPropertyDescriptor(next.getName());
- }
- },
- new DataModelPropertyDescriptor[0]);
- }
- else 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 CollectionTools.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(PROJECT_NAME)) {
- return new DataModelPropertyDescriptor(getStringProperty(PROJECT_NAME));
- }
- else if (propertyName.equals(DEFAULT_ACCESS)) {
- return accessPropertyDescriptor((AccessType) getProperty(DEFAULT_ACCESS));
- }
- else 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) {
- if (propertyName.equals(PROJECT_NAME)
- || propertyName.equals(SOURCE_FOLDER)
- || propertyName.equals(FILE_PATH)) {
- return validateProjectSourceFolderAndFilePath();
- }
- else if (propertyName.equals(ADD_TO_PERSISTENCE_UNIT)
- || propertyName.equals(PERSISTENCE_UNIT)) {
- return validatePersistenceUnit();
- }
- return super.validate(propertyName);
- }
-
- 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 (getExistingOrmFile() != null) {
- return new Status(
- IStatus.ERROR, JptCorePlugin.PLUGIN_ID,
- JptCoreMessages.VALIDATE_ORM_FILE_ALREADY_EXISTS);
- }
- return Status.OK_STATUS;
- }
-
- 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 *****************************************
-
- // 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();
- if (project == null) {
- return null;
- }
- return 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 getExistingOrmFile() {
- 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 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();
- }
-
- 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<IProject> jpaIProjects() {
- return new FilteringIterator<IProject, IProject>(CollectionTools.iterator(ProjectUtilities.getAllProjects())) {
- @Override
- protected boolean accept(IProject project) {
- try {
- return FacetedProjectFramework.hasProjectFacet(project, JptCorePlugin.FACET_ID);
- }
- catch (CoreException ce) {
- return false;
- }
- }
- };
- }
-
- 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 adbbd6c58d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/OrmFileCreationOperation.java
+++ /dev/null
@@ -1,171 +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.operations;
-
-import java.util.Iterator;
-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.jem.util.emf.workbench.ProjectUtilities;
-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.OrmResourceModelProvider;
-import org.eclipse.jpt.core.internal.resource.persistence.PersistenceResourceModelProvider;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.OrmResource;
-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.AbstractDataModelOperation;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class OrmFileCreationOperation extends AbstractDataModelOperation
- implements OrmFileCreationDataModelProperties
-{
- public OrmFileCreationOperation(IDataModel dataModel) {
- super(dataModel);
- }
-
-
- @Override
- public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- // Create source folder if it does not exist
- IFolder folder = createSourceFolder();
- // Create orm file
- createMappingFile(folder);
- // Add orm file to persistence unit if specified
- addMappingFileToPersistenceXml();
- 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;
- }
-
- 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$
- }
-
- /**
- * 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 IFolder 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
- return folder;
- }
-
- @SuppressWarnings("unchecked")
- protected void createMappingFile(IFolder folder) {
- String filePath = getDataModel().getStringProperty(FILE_PATH);
- IFile file = folder.getFile(new Path(filePath));
- final OrmResourceModelProvider modelProvider =
- OrmResourceModelProvider.getModelProvider(file);
-
- modelProvider.modify(new Runnable() {
- public void run() {
- OrmResource ormResource = modelProvider.getResource();
-
- XmlEntityMappings entityMappings = OrmFactory.eINSTANCE.createXmlEntityMappings();
- entityMappings.setVersion("1.0"); //$NON-NLS-1$
- ormResource.getContents().add(entityMappings);
-
- AccessType defaultAccess = (AccessType) getDataModel().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);
- }
- }
- });
- }
-
- protected void addMappingFileToPersistenceXml() throws ExecutionException {
- if (! getDataModel().getBooleanProperty(ADD_TO_PERSISTENCE_UNIT)) {
- return;
- }
-
- PersistenceResourceModelProvider modelProvider =
- PersistenceResourceModelProvider.getDefaultModelProvider(getProject());
- final PersistenceUnit pUnit = getPersistenceUnit();
- modelProvider.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());
-
- }
- });
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericEntityGeneratorDatabaseAnnotationNameBuilder.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericEntityGeneratorDatabaseAnnotationNameBuilder.java
deleted file mode 100644
index b0c1a0cbf3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericEntityGeneratorDatabaseAnnotationNameBuilder.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.platform;
-
-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/platform/GenericJpaAnnotationProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericJpaAnnotationProvider.java
deleted file mode 100644
index 2accda9901..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericJpaAnnotationProvider.java
+++ /dev/null
@@ -1,337 +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.platform;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.internal.resource.java.AssociationOverrideImpl.AssociationOverrideAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.AssociationOverridesImpl.AssociationOverridesAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.AttributeOverrideImpl.AttributeOverrideAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.AttributeOverridesImpl.AttributeOverridesAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.BasicImpl.BasicAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.ColumnImpl.ColumnAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.DiscriminatorColumnImpl.DiscriminatorColumnAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.DiscriminatorValueImpl.DiscriminatorValueAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.EmbeddableImpl.EmbeddableAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.EmbeddedIdImpl.EmbeddedIdAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.EmbeddedImpl.EmbeddedAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.EntityImpl.EntityAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.EnumeratedImpl.EnumeratedAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.GeneratedValueImpl.GeneratedValueAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.IdClassImpl.IdClassAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.IdImpl.IdAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.InheritanceImpl.InheritanceAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.JoinColumnImpl.JoinColumnAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.JoinColumnsImpl.JoinColumnsAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.JoinTableImpl.JoinTableAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.LobImpl.LobAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.ManyToManyImpl.ManyToManyAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.ManyToOneImpl.ManyToOneAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.MapKeyImpl.MapKeyAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.MappedSuperclassImpl.MappedSuperclassAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.NamedNativeQueriesImpl.NamedNativeQueriesAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.NamedNativeQueryImpl.NamedNativeQueryAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.NamedQueriesImpl.NamedQueriesAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.NamedQueryImpl.NamedQueryAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.OneToManyImpl.OneToManyAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.OneToOneImpl.OneToOneAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.OrderByImpl.OrderByAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.PrimaryKeyJoinColumnImpl.PrimaryKeyJoinColumnAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.PrimaryKeyJoinColumnsImpl.PrimaryKeyJoinColumnsAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.SecondaryTableImpl.SecondaryTableAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.SecondaryTablesImpl.SecondaryTablesAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.SequenceGeneratorImpl.SequenceGeneratorAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.TableGeneratorImpl.TableGeneratorAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.TableImpl.TableAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.TemporalImpl.TemporalAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.TransientImpl.TransientAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.VersionImpl.VersionAnnotationDefinition;
-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.TransformationListIterator;
-
-/**
- *
- */
-public class GenericJpaAnnotationProvider
- implements JpaAnnotationProvider
-{
- /**
- * Ordered list of possible type mapping annotations. Ordered because this
- * is used to determine the mapping in the case where 2 mapping annotations exist
- */
- private AnnotationDefinition[] typeMappingAnnotationDefinitions;
-
- private AnnotationDefinition[] typeSupportingAnnotationDefinitions;
-
- /**
- * Ordered list of possible attribute mapping annotations. Ordered because this
- * is used to determine the mapping in the case where 2 mapping annotations exist
- */
- private AnnotationDefinition[] attributeMappingAnnotationDefinitions;
-
- private AnnotationDefinition[] attributeSupportingAnnotationDefinitions;
-
-
- protected GenericJpaAnnotationProvider() {
- super();
- }
-
-
- // ********** type annotation definitions **********
-
- protected synchronized ListIterator<AnnotationDefinition> typeMappingAnnotationDefinitions() {
- if (this.typeMappingAnnotationDefinitions == null) {
- this.typeMappingAnnotationDefinitions = this.buildTypeMappingAnnotationDefinitions();
- }
- return new ArrayListIterator<AnnotationDefinition>(this.typeMappingAnnotationDefinitions);
- }
-
- protected AnnotationDefinition[] buildTypeMappingAnnotationDefinitions() {
- ArrayList<AnnotationDefinition> definitions = new ArrayList<AnnotationDefinition>();
- this.addTypeMappingAnnotationDefinitionsTo(definitions);
- return definitions.toArray(new AnnotationDefinition[definitions.size()]);
- }
-
- /**
- * Override this to specify more or different type mapping definitions.
- * The default includes the JPA spec-defined type mappings:
- * Embeddable
- * Entity
- * MappedSuperclass
- */
- protected void addTypeMappingAnnotationDefinitionsTo(List<AnnotationDefinition> definitions) {
- definitions.add(EmbeddableAnnotationDefinition.instance());
- definitions.add(EntityAnnotationDefinition.instance());
- definitions.add(MappedSuperclassAnnotationDefinition.instance());
- }
-
- protected synchronized ListIterator<AnnotationDefinition> typeSupportingAnnotationDefinitions() {
- if (this.typeSupportingAnnotationDefinitions == null) {
- this.typeSupportingAnnotationDefinitions = this.buildTypeSupportingAnnotationDefinitions();
- }
- return new ArrayListIterator<AnnotationDefinition>(this.typeSupportingAnnotationDefinitions);
- }
-
- protected AnnotationDefinition[] buildTypeSupportingAnnotationDefinitions() {
- ArrayList<AnnotationDefinition> definitions = new ArrayList<AnnotationDefinition>();
- this.addTypeSupportingAnnotationDefinitionsTo(definitions);
- return definitions.toArray(new AnnotationDefinition[definitions.size()]);
- }
-
- /**
- * Override this to specify more or different type supporting annotation definitions.
- * The default includes the JPA spec-defined annotations.
- */
- protected void addTypeSupportingAnnotationDefinitionsTo(List<AnnotationDefinition> definitions) {
- definitions.add(AssociationOverrideAnnotationDefinition.instance());
- definitions.add(AssociationOverridesAnnotationDefinition.instance());
- definitions.add(AttributeOverrideAnnotationDefinition.instance());
- definitions.add(AttributeOverrideAnnotationDefinition.instance());
- definitions.add(AttributeOverridesAnnotationDefinition.instance());
- definitions.add(DiscriminatorColumnAnnotationDefinition.instance());
- definitions.add(DiscriminatorValueAnnotationDefinition.instance());
- definitions.add(IdClassAnnotationDefinition.instance());
- definitions.add(InheritanceAnnotationDefinition.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());
- }
-
-
- // ********** attribute annotation definitions **********
-
- protected synchronized ListIterator<AnnotationDefinition> attributeMappingAnnotationDefinitions() {
- if (this.attributeMappingAnnotationDefinitions == null) {
- this.attributeMappingAnnotationDefinitions = this.buildAttributeMappingAnnotationDefinitions();
- }
- return new ArrayListIterator<AnnotationDefinition>(this.attributeMappingAnnotationDefinitions);
- }
-
- protected AnnotationDefinition[] buildAttributeMappingAnnotationDefinitions() {
- ArrayList<AnnotationDefinition> definitions = new ArrayList<AnnotationDefinition>();
- this.addAttributeMappingAnnotationDefinitionsTo(definitions);
- return definitions.toArray(new AnnotationDefinition[definitions.size()]);
- }
-
- /**
- * Override this to specify more or different attribute mapping definitions.
- * The default includes the JPA spec-defined attribute mappings:
- * Basic
- * Embedded
- * EmbeddedId
- * Id
- * ManyToMany
- * ManyToOne
- * OneToMany
- * OneToOne
- * Transient
- * Version
- */
- protected void addAttributeMappingAnnotationDefinitionsTo(List<AnnotationDefinition> definitions) {
- definitions.add(BasicAnnotationDefinition.instance());
- definitions.add(EmbeddedAnnotationDefinition.instance());
- definitions.add(EmbeddedIdAnnotationDefinition.instance());
- definitions.add(IdAnnotationDefinition.instance());
- definitions.add(ManyToManyAnnotationDefinition.instance());
- definitions.add(ManyToOneAnnotationDefinition.instance());
- definitions.add(OneToManyAnnotationDefinition.instance());
- definitions.add(OneToOneAnnotationDefinition.instance());
- definitions.add(TransientAnnotationDefinition.instance());
- definitions.add(VersionAnnotationDefinition.instance());
- }
-
- protected synchronized ListIterator<AnnotationDefinition> attributeSupportingAnnotationDefinitions() {
- if (this.attributeSupportingAnnotationDefinitions == null) {
- this.attributeSupportingAnnotationDefinitions = this.buildAttributeSupportingAnnotationDefinitions();
- }
- return new ArrayListIterator<AnnotationDefinition>(this.attributeSupportingAnnotationDefinitions);
- }
-
- protected AnnotationDefinition[] buildAttributeSupportingAnnotationDefinitions() {
- ArrayList<AnnotationDefinition> definitions = new ArrayList<AnnotationDefinition>();
- this.addAttributeSupportingAnnotationDefinitionsTo(definitions);
- return definitions.toArray(new AnnotationDefinition[definitions.size()]);
- }
-
- /**
- * Override this to specify more or different attribute supporting annotation definitions.
- * The default includes the JPA spec-defined annotations.
- */
- protected void addAttributeSupportingAnnotationDefinitionsTo(List<AnnotationDefinition> definitions) {
- definitions.add(AssociationOverrideAnnotationDefinition.instance());
- definitions.add(AssociationOverridesAnnotationDefinition.instance());
- definitions.add(AttributeOverrideAnnotationDefinition.instance());
- definitions.add(AttributeOverridesAnnotationDefinition.instance());
- definitions.add(ColumnAnnotationDefinition.instance());
- definitions.add(EnumeratedAnnotationDefinition.instance());
- definitions.add(GeneratedValueAnnotationDefinition.instance());
- definitions.add(JoinColumnAnnotationDefinition.instance());
- definitions.add(JoinColumnsAnnotationDefinition.instance());
- definitions.add(JoinTableAnnotationDefinition.instance());
- definitions.add(LobAnnotationDefinition.instance());
- definitions.add(MapKeyAnnotationDefinition.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());
- }
-
-
- // ********** type annotations **********
-
- public ListIterator<String> typeMappingAnnotationNames() {
- return annotationNames(this.typeMappingAnnotationDefinitions());
- }
-
- public Annotation buildTypeMappingAnnotation(JavaResourcePersistentType parent, Type type, String annotationName) {
- return this.getTypeMappingAnnotationDefinition(annotationName).buildAnnotation(parent, type);
- }
-
- public Annotation buildNullTypeMappingAnnotation(JavaResourcePersistentType parent, Type type, String annotationName) {
- return this.getTypeMappingAnnotationDefinition(annotationName).buildNullAnnotation(parent, type);
- }
-
- protected AnnotationDefinition getTypeMappingAnnotationDefinition(String annotationName) {
- return getAnnotationDefinition(annotationName, this.typeMappingAnnotationDefinitions());
- }
-
- public ListIterator<String> typeSupportingAnnotationNames() {
- return annotationNames(this.typeSupportingAnnotationDefinitions());
- }
-
- public Annotation buildTypeSupportingAnnotation(JavaResourcePersistentType parent, Type type, String annotationName) {
- return this.getTypeSupportingAnnotationDefinition(annotationName).buildAnnotation(parent, type);
- }
-
- public Annotation buildNullTypeSupportingAnnotation(JavaResourcePersistentType parent, Type type, String annotationName) {
- return this.getTypeSupportingAnnotationDefinition(annotationName).buildNullAnnotation(parent, type);
- }
-
- protected AnnotationDefinition getTypeSupportingAnnotationDefinition(String annotationName) {
- return getAnnotationDefinition(annotationName, this.typeSupportingAnnotationDefinitions());
- }
-
-
- // ********** attribute annotations **********
-
- public ListIterator<String> attributeMappingAnnotationNames() {
- return annotationNames(this.attributeMappingAnnotationDefinitions());
- }
-
- public Annotation buildAttributeMappingAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, String annotationName) {
- return this.attributeMappingAnnotationDefinition(annotationName).buildAnnotation(parent, attribute);
- }
-
- public Annotation buildNullAttributeMappingAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, String annotationName) {
- return this.attributeMappingAnnotationDefinition(annotationName).buildNullAnnotation(parent, attribute);
- }
-
- protected AnnotationDefinition attributeMappingAnnotationDefinition(String annotationName) {
- return getAnnotationDefinition(annotationName, this.attributeMappingAnnotationDefinitions());
- }
-
- public ListIterator<String> attributeSupportingAnnotationNames() {
- return annotationNames(this.attributeSupportingAnnotationDefinitions());
- }
-
- public Annotation buildAttributeSupportingAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, String annotationName) {
- return this.getAttributeSupportingAnnotationDefinition(annotationName).buildAnnotation(parent, attribute);
- }
-
- public Annotation buildNullAttributeSupportingAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, String annotationName) {
- return this.getAttributeSupportingAnnotationDefinition(annotationName).buildNullAnnotation(parent, attribute);
- }
-
- protected AnnotationDefinition getAttributeSupportingAnnotationDefinition(String annotationName) {
- return getAnnotationDefinition(annotationName, this.attributeSupportingAnnotationDefinitions());
- }
-
-
- // ********** static methods **********
-
- protected static ListIterator<String> annotationNames(ListIterator<AnnotationDefinition> annotationDefinitions) {
- return new TransformationListIterator<AnnotationDefinition, String>(annotationDefinitions) {
- @Override
- protected String transform(AnnotationDefinition annotationDefinition) {
- return annotationDefinition.getAnnotationName();
- }
- };
- }
-
- protected static AnnotationDefinition getAnnotationDefinition(String annotationName, ListIterator<AnnotationDefinition> annotationDefinitions) {
- while (annotationDefinitions.hasNext()) {
- AnnotationDefinition annotationDefinition = annotationDefinitions.next();
- if (annotationDefinition.getAnnotationName().equals(annotationName)) {
- return annotationDefinition;
- }
- }
- throw new IllegalArgumentException("unsupported annotation: " + annotationName); //$NON-NLS-1$
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericJpaFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericJpaFactory.java
deleted file mode 100644
index cb578a1a1c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericJpaFactory.java
+++ /dev/null
@@ -1,669 +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.platform;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jpt.core.JpaDataSource;
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.jpt.core.context.JpaRootContextNode;
-import org.eclipse.jpt.core.context.PersistentTypeContext;
-import org.eclipse.jpt.core.context.UniqueConstraint;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-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.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.JavaIdMapping;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaJoinTable;
-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.JavaQueryHint;
-import org.eclipse.jpt.core.context.java.JavaRelationshipMapping;
-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.orm.OrmAssociationOverride;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverride;
-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.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.OrmIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJoinTable;
-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.OrmPersistentTypeContext;
-import org.eclipse.jpt.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmQuery;
-import org.eclipse.jpt.core.context.orm.OrmQueryHint;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipMapping;
-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.context.persistence.ClassRef;
-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.Property;
-import org.eclipse.jpt.core.internal.GenericJpaDataSource;
-import org.eclipse.jpt.core.internal.GenericJpaProject;
-import org.eclipse.jpt.core.internal.JavaJpaFile;
-import org.eclipse.jpt.core.internal.XmlJpaFile;
-import org.eclipse.jpt.core.internal.context.GenericRootContextNode;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaAssociationOverride;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaAttributeOverride;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaBasicMapping;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaColumn;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaDiscriminatorColumn;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaEmbeddable;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaEmbeddedMapping;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaEntity;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaEnumeratedConverter;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaGeneratedValue;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaIdMapping;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaJoinColumn;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaJoinTable;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaLobConverter;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaManyToManyMapping;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaManyToOneMapping;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaMappedSuperclass;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaNamedNativeQuery;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaNamedQuery;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaNullAttributeMapping;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaOneToManyMapping;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaOneToOneMapping;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaPersistentType;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaQueryHint;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaSecondaryTable;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaSequenceGenerator;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaTable;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaTableGenerator;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaTemporalConverter;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaTransientMapping;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaUniqueConstraint;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaVersionMapping;
-import org.eclipse.jpt.core.internal.context.java.JavaNullTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericEntityMappings;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmAssociationOverride;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmAttributeOverride;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmBasicMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmColumn;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmDiscriminatorColumn;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmEmbeddable;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmEmbeddedIdMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmEmbeddedMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmEntity;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmGeneratedValue;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmIdMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmJoinColumn;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmJoinTable;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmManyToManyMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmManyToOneMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmMappedSuperclass;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmNamedNativeQuery;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmNamedQuery;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmNullAttributeMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmOneToManyMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmOneToOneMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmPersistentType;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmQueryHint;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmSecondaryTable;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmSequenceGenerator;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmTable;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmTableGenerator;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmTransientMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmUniqueConstraint;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmVersionMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericPersistenceUnitDefaults;
-import org.eclipse.jpt.core.internal.context.orm.GenericPersistenceUnitMetadata;
-import org.eclipse.jpt.core.internal.context.orm.OrmXmlImpl;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlBasic;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlEmbedded;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlEmbeddedId;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlId;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlManyToMany;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlManyToOne;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlNullAttributeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlOneToMany;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlOneToOne;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlTransient;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlVersion;
-import org.eclipse.jpt.core.internal.context.persistence.GenericClassRef;
-import org.eclipse.jpt.core.internal.context.persistence.GenericMappingFileRef;
-import org.eclipse.jpt.core.internal.context.persistence.GenericPersistence;
-import org.eclipse.jpt.core.internal.context.persistence.GenericPersistenceUnit;
-import org.eclipse.jpt.core.internal.context.persistence.GenericPersistenceXml;
-import org.eclipse.jpt.core.internal.context.persistence.GenericProperty;
-import org.eclipse.jpt.core.internal.resource.orm.OrmResourceModelProvider;
-import org.eclipse.jpt.core.internal.resource.persistence.PersistenceResourceModelProvider;
-import org.eclipse.jpt.core.resource.common.JpaXmlResource;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.orm.OrmResource;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddedId;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.core.resource.orm.XmlId;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-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.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.XmlUniqueConstraint;
-import org.eclipse.jpt.core.resource.orm.XmlVersion;
-import org.eclipse.jpt.core.resource.persistence.PersistenceResource;
-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 class GenericJpaFactory
- implements JpaFactory
-{
- public GenericJpaFactory() {
- super();
- }
-
-
- // **************** Core Model ******************************************
-
- public JpaProject buildJpaProject(JpaProject.Config config) throws CoreException {
- return new GenericJpaProject(config);
- }
-
- public JpaDataSource buildJpaDataSource(JpaProject jpaProject, String connectionProfileName) {
- return new GenericJpaDataSource(jpaProject, connectionProfileName);
- }
-
- public JpaFile buildJavaJpaFile(JpaProject jpaProject, IFile file) {
- return new JavaJpaFile(jpaProject, file);
- }
-
- public JpaFile buildPersistenceJpaFile(JpaProject jpaProject, IFile file) {
- return new XmlJpaFile(jpaProject, file, PersistenceResourceModelProvider.getModelProvider(file).getResource());
- }
-
- public JpaFile buildOrmJpaFile(JpaProject jpaProject, IFile file) {
- return new XmlJpaFile(jpaProject, file, OrmResourceModelProvider.getModelProvider(file).getResource());
- }
-
-
- // **************** Context Nodes ***************************************
-
- public JpaRootContextNode buildRootContextNode(JpaProject parent) {
- return new GenericRootContextNode(parent);
- }
-
- public XmlContextNode buildContextNode(JpaContextNode parent, JpaXmlResource resource) {
- if (resource instanceof PersistenceResource) {
- return this.buildPersistenceXml((JpaRootContextNode) parent, (PersistenceResource) resource);
- }
- if (resource instanceof OrmResource) {
- return this.buildOrmXml((MappingFileRef) parent, (OrmResource) resource);
- }
- return null;
- }
-
-
- // **************** Persistence Context Model ***************************************
-
- public PersistenceXml buildPersistenceXml(JpaRootContextNode parent, PersistenceResource persistenceResource) {
- return new GenericPersistenceXml(parent, persistenceResource);
- }
-
- public Persistence buildPersistence(PersistenceXml parent, XmlPersistence xmlPersistence) {
- return new GenericPersistence(parent, xmlPersistence);
- }
-
- public PersistenceUnit buildPersistenceUnit(Persistence parent, XmlPersistenceUnit persistenceUnit) {
- return new GenericPersistenceUnit(parent, persistenceUnit);
- }
-
- public MappingFileRef buildMappingFileRef(PersistenceUnit parent, XmlMappingFileRef xmlMappingFileRef) {
- return new GenericMappingFileRef(parent, xmlMappingFileRef);
- }
-
- 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 Property buildProperty(PersistenceUnit parent, XmlProperty xmlProperty) {
- return new GenericProperty(parent, xmlProperty);
- }
-
-
- // **************** ORM Context Model ***************************************
-
- public OrmXml buildOrmXml(MappingFileRef parent, OrmResource ormResource) {
- return new OrmXmlImpl(parent, ormResource);
- }
-
- public EntityMappings buildEntityMappings(OrmXml parent, XmlEntityMappings xmlEntityMappings) {
- return new GenericEntityMappings(parent, xmlEntityMappings);
- }
-
- public PersistenceUnitMetadata buildPersistenceUnitMetadata(EntityMappings parent, XmlEntityMappings xmlEntityMappings) {
- return new GenericPersistenceUnitMetadata(parent, xmlEntityMappings);
- }
-
- public OrmPersistenceUnitDefaults buildPersistenceUnitDefaults(PersistenceUnitMetadata parent, XmlEntityMappings xmlEntityMappings) {
- return new GenericPersistenceUnitDefaults(parent, xmlEntityMappings);
- }
-
- public OrmPersistentType buildOrmPersistentType(OrmPersistentTypeContext parent, String mappingKey) {
- return new GenericOrmPersistentType(parent, mappingKey);
- }
-
- public OrmEntity buildOrmEntity(OrmPersistentType parent) {
- return new GenericOrmEntity(parent);
- }
-
- public OrmMappedSuperclass buildOrmMappedSuperclass(OrmPersistentType parent) {
- return new GenericOrmMappedSuperclass(parent);
- }
-
- public OrmEmbeddable buildOrmEmbeddable(OrmPersistentType parent) {
- return new GenericOrmEmbeddable(parent);
- }
-
- public OrmPersistentAttribute buildOrmPersistentAttribute(OrmPersistentType parent, String mappingKey) {
- return new GenericOrmPersistentAttribute(parent, mappingKey);
- }
-
- 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(OrmRelationshipMapping parent) {
- return new GenericOrmJoinTable(parent);
- }
-
- public OrmJoinColumn buildOrmJoinColumn(XmlContextNode parent, OrmJoinColumn.Owner owner, XmlJoinColumn resourceJoinColumn) {
- return new GenericOrmJoinColumn(parent, owner, resourceJoinColumn);
- }
-
- public OrmAttributeOverride buildOrmAttributeOverride(XmlContextNode parent, AttributeOverride.Owner owner, XmlAttributeOverride xmlAttributeOverride) {
- return new GenericOrmAttributeOverride(parent, owner, xmlAttributeOverride);
- }
-
- public OrmAssociationOverride buildOrmAssociationOverride(XmlContextNode parent, AssociationOverride.Owner owner, XmlAssociationOverride xmlAssociationOverride) {
- return new GenericOrmAssociationOverride(parent, owner, xmlAssociationOverride);
- }
-
- public OrmDiscriminatorColumn buildOrmDiscriminatorColumn(OrmEntity parent, OrmNamedColumn.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 OrmSequenceGenerator buildOrmSequenceGenerator(XmlContextNode parent, XmlSequenceGenerator resourceSequenceGenerator) {
- return new GenericOrmSequenceGenerator(parent, resourceSequenceGenerator);
- }
-
- public OrmTableGenerator buildOrmTableGenerator(XmlContextNode parent, XmlTableGenerator resourceTableGenerator) {
- return new GenericOrmTableGenerator(parent, resourceTableGenerator);
- }
-
- 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) {
- return new GenericOrmBasicMapping(parent);
- }
-
- public OrmEmbeddedMapping buildOrmEmbeddedMapping(OrmPersistentAttribute parent) {
- return new GenericOrmEmbeddedMapping(parent);
- }
-
- public OrmEmbeddedIdMapping buildOrmEmbeddedIdMapping(OrmPersistentAttribute parent) {
- return new GenericOrmEmbeddedIdMapping(parent);
- }
-
- public OrmIdMapping buildOrmIdMapping(OrmPersistentAttribute parent) {
- return new GenericOrmIdMapping(parent);
- }
-
- public OrmManyToManyMapping buildOrmManyToManyMapping(OrmPersistentAttribute parent) {
- return new GenericOrmManyToManyMapping(parent);
- }
-
- public OrmManyToOneMapping buildOrmManyToOneMapping(OrmPersistentAttribute parent) {
- return new GenericOrmManyToOneMapping(parent);
- }
-
- public OrmOneToManyMapping buildOrmOneToManyMapping(OrmPersistentAttribute parent) {
- return new GenericOrmOneToManyMapping(parent);
- }
-
- public OrmOneToOneMapping buildOrmOneToOneMapping(OrmPersistentAttribute parent) {
- return new GenericOrmOneToOneMapping(parent);
- }
-
- public OrmTransientMapping buildOrmTransientMapping(OrmPersistentAttribute parent) {
- return new GenericOrmTransientMapping(parent);
- }
-
- public OrmVersionMapping buildOrmVersionMapping(OrmPersistentAttribute parent) {
- return new GenericOrmVersionMapping(parent);
- }
-
- public OrmAttributeMapping buildOrmNullAttributeMapping(OrmPersistentAttribute parent) {
- return new GenericOrmNullAttributeMapping(parent);
- }
-
- public OrmUniqueConstraint buildOrmUniqueConstraint(XmlContextNode parent, UniqueConstraint.Owner owner, XmlUniqueConstraint resourceUniqueConstraint) {
- return new GenericOrmUniqueConstraint(parent, owner, resourceUniqueConstraint);
- }
-
- // **************** Orm virtual resource model ***************************************
-
- 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 XmlNullAttributeMapping buildVirtualXmlBasic(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping) {
- return new VirtualXmlNullAttributeMapping(ormTypeMapping, javaAttributeMapping);
- }
-
- 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);
- }
-
- // **************** Java Context Model ***************************************
-
- public JavaPersistentType buildJavaPersistentType(PersistentTypeContext parent, JavaResourcePersistentType jrpt) {
- return new GenericJavaPersistentType(parent, jrpt);
- }
-
- public JavaPersistentAttribute buildJavaPersistentAttribute(JavaPersistentType 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, JavaColumn.Owner owner) {
- return new GenericJavaColumn(parent, owner);
- }
-
- public JavaDiscriminatorColumn buildJavaDiscriminatorColumn(JavaEntity parent, JavaNamedColumn.Owner owner) {
- return new GenericJavaDiscriminatorColumn(parent, owner);
- }
-
- public JavaJoinColumn buildJavaJoinColumn(JavaJpaContextNode parent, JavaJoinColumn.Owner owner) {
- return new GenericJavaJoinColumn(parent, owner);
- }
-
- public JavaJoinTable buildJavaJoinTable(JavaRelationshipMapping 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 JavaSequenceGenerator buildJavaSequenceGenerator(JavaJpaContextNode parent) {
- return new GenericJavaSequenceGenerator(parent);
- }
-
- public JavaTableGenerator buildJavaTableGenerator(JavaJpaContextNode parent) {
- return new GenericJavaTableGenerator(parent);
- }
-
- public JavaGeneratedValue buildJavaGeneratedValue(JavaAttributeMapping parent) {
- return new GenericJavaGeneratedValue(parent);
- }
-
- public JavaPrimaryKeyJoinColumn buildJavaPrimaryKeyJoinColumn(JavaJpaContextNode parent, JavaBaseJoinColumn.Owner owner) {
- return new GenericJavaPrimaryKeyJoinColumn(parent, owner);
- }
-
- public JavaAttributeOverride buildJavaAttributeOverride(JavaJpaContextNode parent, AttributeOverride.Owner owner) {
- return new GenericJavaAttributeOverride(parent, owner);
- }
-
- public JavaAssociationOverride buildJavaAssociationOverride(JavaJpaContextNode parent, AssociationOverride.Owner owner) {
- return new GenericJavaAssociationOverride(parent, owner);
- }
-
- 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);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericJpaPlatform.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericJpaPlatform.java
deleted file mode 100644
index 974d1e7faf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericJpaPlatform.java
+++ /dev/null
@@ -1,423 +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.platform;
-
-import java.util.ArrayList;
-import java.util.List;
-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.JpaFileProvider;
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.context.java.DefaultJavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider;
-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.context.java.JavaTypeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.JavaJpaFileProvider;
-import org.eclipse.jpt.core.internal.OrmJpaFileProvider;
-import org.eclipse.jpt.core.internal.PersistenceJpaFileProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaBasicMappingProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddableProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddedIdMappingProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddedMappingProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaEntityProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaIdMappingProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaManyToManyMappingProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaManyToOneMappingProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaMappedSuperclassProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaNullAttributeMappingProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaNullTypeMappingProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaOneToManyMappingProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaOneToOneMappingProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaTransientMappingProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaVersionMappingProvider;
-import org.eclipse.jpt.core.internal.context.orm.OrmBasicMappingProvider;
-import org.eclipse.jpt.core.internal.context.orm.OrmEmbeddedIdMappingProvider;
-import org.eclipse.jpt.core.internal.context.orm.OrmEmbeddedMappingProvider;
-import org.eclipse.jpt.core.internal.context.orm.OrmIdMappingProvider;
-import org.eclipse.jpt.core.internal.context.orm.OrmManyToManyMappingProvider;
-import org.eclipse.jpt.core.internal.context.orm.OrmManyToOneMappingProvider;
-import org.eclipse.jpt.core.internal.context.orm.OrmNullAttributeMappingProvider;
-import org.eclipse.jpt.core.internal.context.orm.OrmOneToManyMappingProvider;
-import org.eclipse.jpt.core.internal.context.orm.OrmOneToOneMappingProvider;
-import org.eclipse.jpt.core.internal.context.orm.OrmTransientMappingProvider;
-import org.eclipse.jpt.core.internal.context.orm.OrmVersionMappingProvider;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.utility.PlatformUtilities;
-import org.eclipse.jpt.db.ConnectionProfileFactory;
-import org.eclipse.jpt.db.DatabaseFinder;
-import org.eclipse.jpt.db.JptDbPlugin;
-
-/**
- *
- */
-public class GenericJpaPlatform
- implements JpaPlatform
-{
- public static final String ID = "generic"; //$NON-NLS-1$
-
- private String id;
-
- private JpaFactory jpaFactory;
-
- private JpaAnnotationProvider annotationProvider;
-
- private JpaFileProvider[] jpaFileProviders;
-
- private JavaTypeMappingProvider[] javaTypeMappingProviders;
-
- private JavaAttributeMappingProvider[] javaAttributeMappingProviders;
-
- private DefaultJavaAttributeMappingProvider[] defaultJavaAttributeMappingProviders;
-
- private OrmAttributeMappingProvider[] ormAttributeMappingProviders;
-
- /**
- * zero-argument constructor
- */
- public GenericJpaPlatform() {
- super();
- }
-
- public String getId() {
- return this.id;
- }
-
- /**
- * For INTERNAL use only!!
- */
- public void setId(String id) {
- this.id = id;
- }
-
-
- // ********** factory **********
-
- public synchronized JpaFactory getJpaFactory() {
- if (this.jpaFactory == null) {
- this.jpaFactory = this.buildJpaFactory();
- }
- return this.jpaFactory;
- }
-
- protected JpaFactory buildJpaFactory() {
- return new GenericJpaFactory();
- }
-
-
- // ********** JPA files **********
-
- public JpaFile buildJpaFile(JpaProject jpaProject, IFile file) {
- String contentTypeId = this.getContentTypeId(file);
- return (contentTypeId == null) ? null : this.buildJpaFileForContentTypeId(jpaProject, file, contentTypeId);
- }
-
- protected JpaFile buildJpaFileForContentTypeId(JpaProject jpaProject, IFile file, String contentTypeID) {
- JpaFileProvider provider = this.getJpaFileProviderForContentTypeId(contentTypeID);
- return (provider == null) ? null : provider.buildJpaFile(jpaProject, file, this.getJpaFactory());
- }
-
- /**
- * Return null if we don't have a provider for the specified content
- * (since we don't have control over the possible content IDs).
- * Also, use #equals(Object) for the same reason.
- */
- protected JpaFileProvider getJpaFileProviderForContentTypeId(String contentTypeID) {
- for (JpaFileProvider provider : this.getJpaFileProviders()) {
- if (provider.getContentId().equals(contentTypeID)) {
- return provider;
- }
- }
- return null;
- }
-
- protected synchronized JpaFileProvider[] getJpaFileProviders() {
- if (this.jpaFileProviders == null) {
- this.jpaFileProviders = this.buildJpaFileProviders();
- }
- return this.jpaFileProviders;
- }
-
- protected JpaFileProvider[] buildJpaFileProviders() {
- ArrayList<JpaFileProvider> providers = new ArrayList<JpaFileProvider>();
- this.addJpaFileProvidersTo(providers);
- return providers.toArray(new JpaFileProvider[providers.size()]);
- }
-
- /**
- * Override this to specify more or different JPA file providers.
- * The default includes support for Java, persistence.xml, and orm.xml
- * files
- */
- protected void addJpaFileProvidersTo(List<JpaFileProvider> providers) {
- providers.add(JavaJpaFileProvider.instance());
- providers.add(PersistenceJpaFileProvider.instance());
- providers.add(OrmJpaFileProvider.instance());
- }
-
- protected String getContentTypeId(IFile file) {
- IContentType contentType = PlatformUtilities.getContentType(file);
- return (contentType == null) ? null : contentType.getId();
- }
-
-
- // ********** Java annotations **********
-
- public synchronized JpaAnnotationProvider getAnnotationProvider() {
- if (this.annotationProvider == null) {
- this.annotationProvider = this.buildAnnotationProvider();
- }
- return this.annotationProvider;
- }
-
- protected JpaAnnotationProvider buildAnnotationProvider() {
- return new GenericJpaAnnotationProvider();
- }
-
-
- // ********** Java type mappings **********
-
- public JavaTypeMapping buildJavaTypeMappingFromMappingKey(String key, JavaPersistentType type) {
- return this.getJavaTypeMappingProviderForMappingKey(key).buildMapping(type, this.getJpaFactory());
- }
-
- public JavaTypeMapping buildJavaTypeMappingFromAnnotation(String annotationName, JavaPersistentType type) {
- return this.getJavaTypeMappingProviderForAnnotation(annotationName).buildMapping(type, this.getJpaFactory());
- }
-
- protected synchronized JavaTypeMappingProvider[] getJavaTypeMappingProviders() {
- if (this.javaTypeMappingProviders == null) {
- this.javaTypeMappingProviders = this.buildJavaTypeMappingProviders();
- }
- return this.javaTypeMappingProviders;
- }
-
- protected JavaTypeMappingProvider[] buildJavaTypeMappingProviders() {
- ArrayList<JavaTypeMappingProvider> providers = new ArrayList<JavaTypeMappingProvider>();
- this.addJavaTypeMappingProvidersTo(providers);
- return providers.toArray(new JavaTypeMappingProvider[providers.size()]);
- }
-
- /**
- * Override this to specify more or different type mapping providers.
- * The default includes the JPA spec-defined type mappings of
- * Entity, MappedSuperclass, and Embeddable.
- */
- protected void addJavaTypeMappingProvidersTo(List<JavaTypeMappingProvider> providers) {
- providers.add(JavaEntityProvider.instance());
- providers.add(JavaMappedSuperclassProvider.instance());
- providers.add(JavaEmbeddableProvider.instance());
- providers.add(JavaNullTypeMappingProvider.instance());
- }
-
- protected JavaTypeMappingProvider getJavaTypeMappingProviderForMappingKey(String key) {
- for (JavaTypeMappingProvider provider : this.getJavaTypeMappingProviders()) {
- if (provider.getKey() == key) {
- return provider;
- }
- }
- throw new IllegalArgumentException("Illegal type mapping key: " + key); //$NON-NLS-1$
- }
-
- protected JavaTypeMappingProvider getJavaTypeMappingProviderForAnnotation(String annotationName) {
- for (JavaTypeMappingProvider provider : this.getJavaTypeMappingProviders()) {
- if (provider.getAnnotationName() == annotationName) {
- return provider;
- }
- }
- throw new IllegalArgumentException("Illegal annotation name: " + annotationName); //$NON-NLS-1$
- }
-
-
- // ********** Java attribute mappings **********
-
- public JavaAttributeMapping buildJavaAttributeMappingFromMappingKey(String key, JavaPersistentAttribute attribute) {
- return this.getJavaAttributeMappingProviderForMappingKey(key).buildMapping(attribute, this.getJpaFactory());
- }
-
- public JavaAttributeMapping buildJavaAttributeMappingFromAnnotation(String annotationName, JavaPersistentAttribute attribute) {
- return this.getJavaAttributeMappingProviderForAnnotation(annotationName).buildMapping(attribute, this.getJpaFactory());
- }
-
- public JavaAttributeMapping buildDefaultJavaAttributeMapping(JavaPersistentAttribute attribute) {
- return this.getDefaultJavaAttributeMappingProvider(attribute).buildMapping(attribute, this.getJpaFactory());
- }
-
- protected synchronized JavaAttributeMappingProvider[] getJavaAttributeMappingProviders() {
- if (this.javaAttributeMappingProviders == null) {
- this.javaAttributeMappingProviders = this.buildJavaAttributeMappingProviders();
- }
- return this.javaAttributeMappingProviders;
- }
-
- protected JavaAttributeMappingProvider[] buildJavaAttributeMappingProviders() {
- ArrayList<JavaAttributeMappingProvider> providers = new ArrayList<JavaAttributeMappingProvider>();
- this.addJavaAttributeMappingProvidersTo(providers);
- return providers.toArray(new JavaAttributeMappingProvider[providers.size()]);
- }
-
- /**
- * Override this to specify more or different attribute mapping providers.
- * The default includes the JPA spec-defined attribute mappings of
- * Basic, Id, Transient OneToOne, OneToMany, ManyToOne, ManyToMany, Embeddable, EmbeddedId, Version.
- */
- protected void addJavaAttributeMappingProvidersTo(List<JavaAttributeMappingProvider> providers) {
- providers.add(JavaBasicMappingProvider.instance());
- providers.add(JavaEmbeddedMappingProvider.instance());
- providers.add(JavaEmbeddedIdMappingProvider.instance());
- providers.add(JavaIdMappingProvider.instance());
- providers.add(JavaManyToManyMappingProvider.instance());
- providers.add(JavaManyToOneMappingProvider.instance());
- providers.add(JavaOneToManyMappingProvider.instance());
- providers.add(JavaOneToOneMappingProvider.instance());
- providers.add(JavaTransientMappingProvider.instance());
- providers.add(JavaVersionMappingProvider.instance());
- }
-
- protected JavaAttributeMappingProvider getJavaAttributeMappingProviderForMappingKey(String key) {
- for (JavaAttributeMappingProvider provider : this.getJavaAttributeMappingProviders()) {
- if (provider.getKey() == key) {
- return provider;
- }
- }
- throw new IllegalArgumentException("Illegal attribute mapping key: " + key); //$NON-NLS-1$
- }
-
- protected JavaAttributeMappingProvider getJavaAttributeMappingProviderForAnnotation(String annotationName) {
- for (JavaAttributeMappingProvider provider : this.getJavaAttributeMappingProviders()) {
- if (provider.getAnnotationName() == annotationName) {
- return provider;
- }
- }
- throw new IllegalArgumentException("Illegal annotation name: " + annotationName); //$NON-NLS-1$
- }
-
- protected synchronized DefaultJavaAttributeMappingProvider[] getDefaultJavaAttributeMappingProviders() {
- if (this.defaultJavaAttributeMappingProviders == null) {
- this.defaultJavaAttributeMappingProviders = this.buildDefaultJavaAttributeMappingProviders();
- }
- return this.defaultJavaAttributeMappingProviders;
- }
-
- protected DefaultJavaAttributeMappingProvider[] buildDefaultJavaAttributeMappingProviders() {
- ArrayList<DefaultJavaAttributeMappingProvider> providers = new ArrayList<DefaultJavaAttributeMappingProvider>();
- this.addDefaultJavaAttributeMappingProvidersTo(providers);
- return providers.toArray(new DefaultJavaAttributeMappingProvider[providers.size()]);
- }
-
- /**
- * Override this to specify more or different default attribute mapping providers.
- * The default includes the JPA spec-defined attribute mappings of
- * Embedded and Basic.
- */
- protected void addDefaultJavaAttributeMappingProvidersTo(List<DefaultJavaAttributeMappingProvider> providers) {
- providers.add(JavaEmbeddedMappingProvider.instance()); // bug 190344 need to test default embedded before basic
- providers.add(JavaBasicMappingProvider.instance());
- }
-
- protected JavaAttributeMappingProvider getDefaultJavaAttributeMappingProvider(JavaPersistentAttribute attribute) {
- for (DefaultJavaAttributeMappingProvider provider : this.getDefaultJavaAttributeMappingProviders()) {
- if (provider.defaultApplies(attribute)) {
- return provider;
- }
- }
- return this.getNullAttributeMappingProvider();
- }
-
- public String getDefaultJavaAttributeMappingKey(JavaPersistentAttribute attribute) {
- return this.getDefaultJavaAttributeMappingProvider(attribute).getKey();
- }
-
- /**
- * the "null" attribute mapping is used when the attribute is neither
- * modified with a mapping annotation nor mapped by a "default" mapping
- */
- protected JavaAttributeMappingProvider getNullAttributeMappingProvider() {
- return JavaNullAttributeMappingProvider.instance();
- }
-
- // ********** ORM attribute mappings **********
-
-
- public OrmAttributeMapping buildOrmAttributeMappingFromMappingKey(String key, OrmPersistentAttribute attribute) {
- return this.getOrmAttributeMappingProviderForMappingKey(key).buildMapping(attribute, this.getJpaFactory());
- }
-
- public XmlAttributeMapping buildVirtualOrmResourceMappingFromMappingKey(String key, OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping) {
- return this.getOrmAttributeMappingProviderForMappingKey(key).buildVirtualResourceMapping(ormTypeMapping, javaAttributeMapping, this.getJpaFactory());
- }
-
-
- protected synchronized OrmAttributeMappingProvider[] getOrmAttributeMappingProviders() {
- if (this.ormAttributeMappingProviders == null) {
- this.ormAttributeMappingProviders = this.buildOrmAttributeMappingProviders();
- }
- return this.ormAttributeMappingProviders;
- }
-
- protected OrmAttributeMappingProvider[] buildOrmAttributeMappingProviders() {
- ArrayList<OrmAttributeMappingProvider> providers = new ArrayList<OrmAttributeMappingProvider>();
- this.addOrmAttributeMappingProvidersTo(providers);
- return providers.toArray(new OrmAttributeMappingProvider[providers.size()]);
- }
-
- /**
- * Override this to specify more or different attribute mapping providers.
- * The default includes the JPA spec-defined attribute mappings of
- * Basic, Id, Transient OneToOne, OneToMany, ManyToOne, ManyToMany, Embeddable, EmbeddedId, Version.
- */
- protected void addOrmAttributeMappingProvidersTo(List<OrmAttributeMappingProvider> providers) {
- providers.add(OrmEmbeddedMappingProvider.instance()); //bug 190344 need to test default embedded before basic
- providers.add(OrmBasicMappingProvider.instance());
- providers.add(OrmTransientMappingProvider.instance());
- providers.add(OrmIdMappingProvider.instance());
- providers.add(OrmManyToManyMappingProvider.instance());
- providers.add(OrmOneToManyMappingProvider.instance());
- providers.add(OrmManyToOneMappingProvider.instance());
- providers.add(OrmOneToOneMappingProvider.instance());
- providers.add(OrmVersionMappingProvider.instance());
- providers.add(OrmEmbeddedIdMappingProvider.instance());
- }
-
- protected OrmAttributeMappingProvider getOrmAttributeMappingProviderForMappingKey(String key) {
- for (OrmAttributeMappingProvider provider : this.getOrmAttributeMappingProviders()) {
- if (provider.getKey() == key) {
- return provider;
- }
- }
- return OrmNullAttributeMappingProvider.instance();
- }
-
- // ********** database **********
-
- public ConnectionProfileFactory getConnectionProfileFactory() {
- return JptDbPlugin.instance().getConnectionProfileFactory();
- }
-
- public EntityGeneratorDatabaseAnnotationNameBuilder getEntityGeneratorDatabaseAnnotationNameBuilder() {
- return GenericEntityGeneratorDatabaseAnnotationNameBuilder.instance();
- }
-
- public DatabaseFinder getDatabaseFinder() {
- return DatabaseFinder.Default.instance();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JpaPlatformRegistry.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JpaPlatformRegistry.java
deleted file mode 100644
index 38213f9792..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JpaPlatformRegistry.java
+++ /dev/null
@@ -1,237 +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.platform;
-
-import java.util.HashMap;
-import java.util.Iterator;
-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.JptCorePlugin;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * 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 = "jpaPlatform"; //$NON-NLS-1$
- private static final String EL_PLATFORM = "jpaPlatform"; //$NON-NLS-1$
- private static final String AT_ID = "id"; //$NON-NLS-1$
- private static final String AT_LABEL = "label"; //$NON-NLS-1$
- private static final String AT_CLASS = "class"; //$NON-NLS-1$
- private static final String AT_DEFAULT = "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 (Iterator<IConfigurationElement> stream = this.configElements(); stream.hasNext(); ) {
- this.addConfigElementTo(stream.next(), configElements);
- }
- return configElements;
- }
-
- /**
- * Return the configuration elements from the Eclipse platform extension
- * registry.
- */
- private Iterator<IConfigurationElement> configElements() {
- return new CompositeIterator<IConfigurationElement>(
- new TransformationIterator<IExtension, Iterator<IConfigurationElement>>(this.extensions()) {
- @Override
- protected Iterator<IConfigurationElement> transform(IExtension extension) {
- return CollectionTools.iterator(extension.getConfigurationElements());
- }
- }
- );
- }
-
- private Iterator<IExtension> extensions() {
- return CollectionTools.iterator(this.extensionPoint().getExtensions());
- }
-
- private IExtensionPoint extensionPoint() {
- return Platform.getExtensionRegistry().getExtensionPoint(JptCorePlugin.PLUGIN_ID, EXTENSION_ID);
- }
-
- private void addConfigElementTo(IConfigurationElement configElement, HashMap<String, IConfigurationElement> configElements) {
- if ( ! configElement.getName().equals(EL_PLATFORM)) {
- return;
- }
- if ( ! this.configElementIsValid(configElement)) {
- return;
- }
-
- String id = configElement.getAttribute(AT_ID);
- IConfigurationElement prev = configElements.get(id);
- if (prev == null) {
- configElements.put(id, configElement);
- } else {
- this.logDuplicatePlatform(prev, configElement);
- }
- }
-
- /**
- * check *all* attributes before returning
- */
- private boolean configElementIsValid(IConfigurationElement configElement) {
- boolean valid = true;
- if (configElement.getAttribute(AT_ID) == null) {
- this.logMissingAttribute(configElement, AT_ID);
- valid = false;
- }
- if (configElement.getAttribute(AT_LABEL) == null) {
- logMissingAttribute(configElement, AT_LABEL);
- valid = false;
- }
- if (configElement.getAttribute(AT_CLASS) == null) {
- logMissingAttribute(configElement, AT_CLASS);
- 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 Iterator<String> jpaPlatformIds() {
- return new ReadOnlyIterator<String>(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(AT_LABEL);
- }
-
- /**
- * 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() {
- for (String platformId : jpaPlatformConfigurationElements.keySet()) {
- if ("true".equals(jpaPlatformConfigurationElements.get(platformId).getAttribute(AT_DEFAULT))) {
- 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(String id) {
- IConfigurationElement configElement = this.jpaPlatformConfigurationElements.get(id);
- if (configElement == null) {
- throw new IllegalArgumentException(id);
- }
- JpaPlatform platform;
- try {
- platform = (JpaPlatform) configElement.createExecutableExtension(AT_CLASS);
- } catch (CoreException ex) {
- this.logFailedInstantiation(configElement, ex);
- throw new IllegalArgumentException(id);
- }
- platform.setId(id);
- return platform;
- }
-
-
- // ********** errors **********
-
- // TODO externalize strings
- private void logMissingAttribute(IConfigurationElement configElement, String attributeName) {
- String message =
- "An extension element \""
- + configElement.getName()
- + "\" in plugin \""
- + configElement.getContributor().getName()
- + "\" is missing a required attribute \""
- + attributeName
- + "\".";
- JptCorePlugin.log(message);
- }
-
- // TODO externalize strings
- private void logDuplicatePlatform(IConfigurationElement prevConfigElement, IConfigurationElement newConfigElement) {
- String message =
- "The plugins \""
- + prevConfigElement.getContributor().getName()
- + "\" and \""
- + newConfigElement.getContributor().getName()
- + "\" have registered a duplicate attribute \"id\" "
- + "for the extension element \"jpaPlatform\".";
- JptCorePlugin.log(message);
- }
-
- // TODO externalize strings
- private void logFailedInstantiation(IConfigurationElement configElement, CoreException ex) {
- String message =
- "Could not instantiate the class \""
- + configElement.getAttribute(AT_CLASS)
- + "\" for the extension element \""
- + configElement.getName()
- + "\" in the plugin \""
- + configElement.getContributor().getName()
- + "\".";
- JptCorePlugin.log(message);
- JptCorePlugin.log(ex);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceConstants.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceConstants.java
deleted file mode 100644
index 190fdf53c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceConstants.java
+++ /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
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.prefs;
-
-/**
- * Constant definitions for plug-in preferences
- */
-public class JpaPreferenceConstants
-{
- public static final String PREF_DEFAULT_JPA_LIB = "defaultJpaLib";
-
- public static final String PREF_DEFAULT_JPA_PLATFORM = "defaultJpaPlatform";
-}
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 dde4b89381..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceInitializer.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.core.internal.prefs;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.platform.GenericJpaPlatform;
-import org.eclipse.jpt.core.internal.platform.JpaPlatformRegistry;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Class used to initialize default preference values.
- */
-public class JpaPreferenceInitializer extends AbstractPreferenceInitializer
-{
- @Override
- public void initializeDefaultPreferences() {
- IEclipsePreferences node = new DefaultScope().getNode(JptCorePlugin.instance().getBundle().getSymbolicName());
-
- // default JPA platform
- String defaultPlatformId = JpaPlatformRegistry.instance().getDefaultJpaPlatformId();
- if (StringTools.stringIsEmpty(defaultPlatformId)) {
- defaultPlatformId = GenericJpaPlatform.ID;
- }
- node.put(JpaPreferenceConstants.PREF_DEFAULT_JPA_PLATFORM, defaultPlatformId);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/JpaResourceModelProviderManager.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/JpaResourceModelProviderManager.java
deleted file mode 100644
index 289ab52171..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/JpaResourceModelProviderManager.java
+++ /dev/null
@@ -1,260 +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.resource;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import org.eclipse.core.resources.IFile;
-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.IPath;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.JptCoreMessages;
-import org.eclipse.jpt.core.resource.JpaResourceModelProvider;
-import org.eclipse.jpt.core.resource.JpaResourceModelProviderFactory;
-import org.eclipse.jpt.core.utility.PlatformUtilities;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Cache the resource model provider factories as they are requested.
- */
-public class JpaResourceModelProviderManager {
-
- /**
- * key: file content type
- * value: resource model provider factory provider(!)
- */
- private final HashMap<String, FactoryProvider> factoryProviders;
-
- private static final String EXTENSION_ID = "resourceModelProviders"; //$NON-NLS-1$
- private static final String EL_MODEL_PROVIDER = "modelProvider"; //$NON-NLS-1$
- private static final String AT_FILE_CONTENT_TYPE = "fileContentType"; //$NON-NLS-1$
- private static final String AT_FACTORY_CLASS = "factoryClass"; //$NON-NLS-1$
-
-
- // singleton
- private static final JpaResourceModelProviderManager INSTANCE = new JpaResourceModelProviderManager();
-
- /**
- * Return the singleton.
- */
- public static JpaResourceModelProviderManager instance() {
- return INSTANCE;
- }
-
-
- // ********** construction **********
-
- private JpaResourceModelProviderManager() {
- super();
- this.factoryProviders = this.buildFactoryProviders();
- }
-
- private HashMap<String, FactoryProvider> buildFactoryProviders() {
- HashMap<String, FactoryProvider> providers = new HashMap<String, FactoryProvider>();
- for (Iterator<IConfigurationElement> stream = this.configElements(); stream.hasNext(); ) {
- this.addFactoryProviderTo(stream.next(), providers);
- }
- return providers;
- }
-
- /**
- * Return the configuration elements from the Eclipse platform extension
- * registry.
- */
- private Iterator<IConfigurationElement> configElements() {
- return new CompositeIterator<IConfigurationElement>(this.configElementIterators());
- }
-
- private Iterator<Iterator<IConfigurationElement>> configElementIterators() {
- return new TransformationIterator<IExtension, Iterator<IConfigurationElement>>(this.extensions()) {
- @Override
- protected Iterator<IConfigurationElement> transform(IExtension extension) {
- return CollectionTools.iterator(extension.getConfigurationElements());
- }
- };
- }
-
- private Iterator<IExtension> extensions() {
- return CollectionTools.iterator(this.getExtensionPoint().getExtensions());
- }
-
- private IExtensionPoint getExtensionPoint() {
- return Platform.getExtensionRegistry().getExtensionPoint(JptCorePlugin.PLUGIN_ID, EXTENSION_ID);
- }
-
- /**
- * check *all* attributes before returning;
- * log errors, but keep on truckin'
- */
- private void addFactoryProviderTo(IConfigurationElement configElement, HashMap<String, FactoryProvider> providers) {
- if ( ! configElement.getName().equals(EL_MODEL_PROVIDER)) {
- return;
- }
- boolean missingAttribute = false;
- String fileContentType = configElement.getAttribute(AT_FILE_CONTENT_TYPE);
- if (fileContentType == null) {
- logMissingAttribute(configElement, AT_FILE_CONTENT_TYPE);
- missingAttribute = false;
- }
- if (configElement.getAttribute(AT_FACTORY_CLASS) == null) {
- logMissingAttribute(configElement, AT_FACTORY_CLASS);
- missingAttribute = false;
- }
- if (missingAttribute) {
- return;
- }
- FactoryProvider prev = providers.get(fileContentType);
- if (prev == null) {
- providers.put(fileContentType, new FactoryProvider(configElement));
- } else {
- // first config element wins - ignore later elements
- logDuplicateFileContentType(prev.getConfigurationElement(), configElement);
- }
- }
-
-
- // ********** public API **********
-
- /**
- * Returns a resource model provider for the specified file, based on its
- * content type, if there is one registered for that content type, or one
- * of its base content types if no resource model provider is registered
- * for that content type.
- *
- * @param file the file the resource model represents
- * @return the resource model provider for the file
- */
- public JpaResourceModelProvider getModelProvider(IFile file) {
- IProject project = file.getProject();
- IPath path = file.getFullPath();
-
- IContentType contentType = PlatformUtilities.getContentType(file);
- while (contentType != null) {
- JpaResourceModelProvider modelProvider = this.getModelProvider(project, path, contentType.getId());
- if (modelProvider != null) {
- return modelProvider;
- }
- contentType = contentType.getBaseType();
- }
-
- return null;
- }
-
- /**
- * Returns a resource model provider for the specified file path of the given content type
- * in the given project.
- * @param project the project in which the file path exists
- * @param filePath the path of the file for which the model provider should
- * be created
- * @param contentType the content type for which to create a model provider
- * @return the model provider for the file
- */
- public JpaResourceModelProvider getModelProvider(IProject project, IPath filePath, String fileContentType) {
- JpaResourceModelProviderFactory factory = this.getFactory(fileContentType);
- return (factory == null) ? null : factory.create(project, filePath);
- }
-
- private JpaResourceModelProviderFactory getFactory(String fileContentType) {
- FactoryProvider fp = this.factoryProviders.get(fileContentType);
- return (fp == null) ? null : fp.getFactory();
- }
-
-
- // ********** errors **********
-
- private static void logMissingAttribute(IConfigurationElement configElement, String attributeName) {
- JptCorePlugin.log(
- NLS.bind(
- JptCoreMessages.RESOURCE_MODEL_PROVIDER_REGISTRY_MISSING_ATTRIBUTE,
- new String[] {
- configElement.getName(),
- configElement.getContributor().getName(),
- attributeName
- }
- )
- );
- }
-
- private static void logDuplicateFileContentType(IConfigurationElement configElement1, IConfigurationElement configElement2) {
- JptCorePlugin.log(
- NLS.bind(
- JptCoreMessages.RESOURCE_MODEL_PROVIDER_REGISTRY_DUPLICATE_FILE_CONTENT_TYPE,
- new String[] {
- configElement1.getContributor().getName(),
- configElement2.getContributor().getName(),
- AT_FILE_CONTENT_TYPE,
- EL_MODEL_PROVIDER,
- configElement1.getAttribute(AT_FILE_CONTENT_TYPE)
- }
- )
- );
- }
-
-
- // ********** factory provider **********
-
- private static class FactoryProvider {
- private final IConfigurationElement configurationElement;
- private JpaResourceModelProviderFactory factory;
- private boolean factoryBuilt; // factory can be null, so use flag
-
- FactoryProvider(IConfigurationElement configurationElement) {
- super();
- this.configurationElement = configurationElement;
- this.factoryBuilt = false;
- }
-
- IConfigurationElement getConfigurationElement() {
- return this.configurationElement;
- }
-
- synchronized JpaResourceModelProviderFactory getFactory() {
- if ( ! this.factoryBuilt) {
- this.factoryBuilt = true;
- this.factory = this.buildFactory();
- }
- return this.factory;
- }
-
- private JpaResourceModelProviderFactory buildFactory() {
- try {
- return (JpaResourceModelProviderFactory) this.configurationElement.createExecutableExtension(AT_FACTORY_CLASS);
- } catch (CoreException ex) {
- this.logFailedInstantiation(ex);
- return null; // returning null seems to be expected
- }
- }
-
- private void logFailedInstantiation(CoreException ex) {
- JptCorePlugin.log(ex);
- JptCorePlugin.log(
- NLS.bind(
- JptCoreMessages.RESOURCE_MODEL_PROVIDER_REGISTRY_FAILED_INSTANTIATION,
- new String[] {
- this.configurationElement.getAttribute(AT_FACTORY_CLASS),
- this.configurationElement.getName(),
- this.configurationElement.getContributor().getName()
- }
- )
- );
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/common/translators/BooleanTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/common/translators/BooleanTranslator.java
deleted file mode 100644
index 8dcc16aaf0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/common/translators/BooleanTranslator.java
+++ /dev/null
@@ -1,37 +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.resource.common.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 domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, BOOLEAN_FEATURE | BOOLEAN_LOWERCASE);
- }
-
- public BooleanTranslator(String domNameAndPath, EStructuralFeature aFeature, int style) {
- super(domNameAndPath, aFeature, BOOLEAN_FEATURE | BOOLEAN_LOWERCASE | style);
- }
-
- @Override
- public Object convertStringToValue(String strValue, EObject owner) {
- return Boolean.valueOf(strValue);
- }
-
- @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/resource/common/translators/EmptyTagBooleanTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/common/translators/EmptyTagBooleanTranslator.java
deleted file mode 100644
index 2b2ac53d48..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/common/translators/EmptyTagBooleanTranslator.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.resource.common.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 domNameAndPath, EStructuralFeature feature) {
- super(domNameAndPath, feature, EMPTY_TAG | BOOLEAN_FEATURE);
- }
-
- public EmptyTagBooleanTranslator(String domNameAndPath, EStructuralFeature aFeature, int style) {
- super(domNameAndPath, aFeature, 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 == Boolean.TRUE) ? value : null;
- }
-
-}
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 506c3b075a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractJavaResourceNode.java
+++ /dev/null
@@ -1,92 +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.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.core.resource.java.JpaCompilationUnit;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.CallbackChangeSupport;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-
-/**
- * resource containment hierarchy
- */
-public abstract class AbstractJavaResourceNode
- extends AbstractModel
- implements JavaResourceNode, CallbackChangeSupport.Source
-{
- private final JavaResourceNode parent;
-
-
- // ********** construction **********
-
- protected AbstractJavaResourceNode(JavaResourceNode parent) {
- super();
- this.checkParent(parent);
- this.parent = parent;
- }
-
- protected void checkParent(JavaResourceNode p) {
- if (p == null) {
- if (this.requiresParent()) {
- throw new IllegalArgumentException("'parent' cannot be null"); //$NON-NLS-1$
- }
- } else {
- if (this.forbidsParent()) {
- throw new IllegalArgumentException("'parent' must be null"); //$NON-NLS-1$
- }
- }
- }
-
- protected boolean requiresParent() {
- return true;
- }
-
- protected boolean forbidsParent() {
- return ! this.requiresParent(); // assume 'parent' is not optional
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new CallbackChangeSupport(this);
- }
-
-
- // ********** JavaResourceNode implementation **********
-
- public JpaCompilationUnit getJpaCompilationUnit() {
- return this.parent.getJpaCompilationUnit();
- }
-
- public IFile getFile() {
- return (IFile) this.getJpaCompilationUnit().getCompilationUnit().getResource();
- }
-
-
- // ********** CallbackChangeSupport.Source implementation **********
-
- public void aspectChanged(String aspectName) {
- this.getJpaCompilationUnit().resourceModelChanged();
- }
-
-
- // ********** convenience methods **********
-
- protected JavaResourceNode getParent() {
- return this.parent;
- }
-
- protected JpaAnnotationProvider getAnnotationProvider() {
- return this.getJpaCompilationUnit().getAnnotationProvider();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractJavaResourcePersistentMember.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractJavaResourcePersistentMember.java
deleted file mode 100644
index 84d740dee6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractJavaResourcePersistentMember.java
+++ /dev/null
@@ -1,639 +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.resource.java;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.ListIterator;
-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.JDTTools;
-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.MethodSignature;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-
-/**
- *
- */
-public abstract class AbstractJavaResourcePersistentMember<E extends Member>
- extends AbstractJavaResourceNode
- implements JavaResourcePersistentMember
-{
- private final E member;
-
- /**
- * mapping annotations; no duplicates (java compiler has an error for
- * duplicates)
- */
- private final Vector<Annotation> mappingAnnotations;
-
- /**
- * supporting annotations; no duplicates (java compiler has an error for
- * duplicates)
- */
- private final Vector<Annotation> supportingAnnotations;
-
- private boolean persistable;
-
- // ********** construction/initialization **********
-
- protected AbstractJavaResourcePersistentMember(JavaResourceNode parent, E member) {
- super(parent);
- this.member = member;
- this.supportingAnnotations = new Vector<Annotation>();
- this.mappingAnnotations = new Vector<Annotation>();
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.getMember().getBodyDeclaration(astRoot).accept(this.buildInitialAnnotationVisitor(astRoot));
- this.persistable = this.buildPersistable(astRoot);
- }
-
- protected ASTVisitor buildInitialAnnotationVisitor(CompilationUnit astRoot) {
- return new InitialAnnotationVisitor(astRoot, this.getMember().getBodyDeclaration(astRoot));
- }
-
- protected void addInitialAnnotation(org.eclipse.jdt.core.dom.Annotation node, CompilationUnit astRoot) {
- String jdtAnnotationName = JDTTools.resolveAnnotation(node);
- if (jdtAnnotationName == null) {
- return;
- }
- if (this.supportingAnnotationIsValid(jdtAnnotationName)) {
- if (this.getSupportingAnnotation(jdtAnnotationName) == null) { // ignore duplicates
- Annotation annotation = this.buildSupportingAnnotation(jdtAnnotationName);
- annotation.initialize(astRoot);
- this.supportingAnnotations.add(annotation);
- }
- } else if (this.mappingAnnotationIsValid(jdtAnnotationName)) {
- if (this.getMappingAnnotation(jdtAnnotationName) == null) { // ignore duplicates
- Annotation annotation = this.buildMappingAnnotation(jdtAnnotationName);
- annotation.initialize(astRoot);
- this.mappingAnnotations.add(annotation);
- }
- }
- }
-
- // ********** mapping annotations **********
-
- public Iterator<Annotation> mappingAnnotations() {
- return new CloneIterator<Annotation>(this.mappingAnnotations);
- }
-
- public int mappingAnnotationsSize() {
- return this.mappingAnnotations.size();
- }
-
- // TODO need property change notification on this mappingAnnotation changing
- // from the context model we don't really care if their are multiple mapping
- // annotations, just which one we need to use
- public Annotation getMappingAnnotation() {
- synchronized (this.mappingAnnotations) {
- return this.getMappingAnnotation_();
- }
- }
-
- protected Annotation getMappingAnnotation_() {
- for (ListIterator<String> stream = this.validMappingAnnotationNames(); stream.hasNext();) {
- Annotation annotation = this.getMappingAnnotation(stream.next());
- if (annotation != null) {
- return annotation;
- }
- }
- return null;
- }
-
- public Annotation getMappingAnnotation(String annotationName) {
- return getAnnotation(this.mappingAnnotations(), annotationName);
- }
-
- /**
- * Remove all other *mapping* annotations that exist; not just the one
- * returned by #getMappingAnnotation(). #getMappingAnnotation() returns the
- * first mapping annotation found in the source. If there were multiple
- * mapping annotations (which is a validation error) then calling this
- * method would not work because the new mapping annotation would be added
- * to the end of the list of annotations.
- */
- public void setMappingAnnotation(String annotationName) {
- synchronized (this.mappingAnnotations) {
- this.setMappingAnnotation_(annotationName);
- }
- // hold change notification until the end so a project update does not
- // occur
- // before we are finished removing the old mapping(s) and adding the new
- // mapping;
- // just fire "collection changed" since one or more removes and/or one
- // add occurred;
- this.fireCollectionChanged(MAPPING_ANNOTATIONS_COLLECTION);
- }
-
- protected void setMappingAnnotation_(String annotationName) {
- if (annotationName == null) {
- this.removeMappingAnnotations_();
- return;
- }
-
- if (this.getMappingAnnotation(annotationName) != null) {
- throw new IllegalStateException("duplicate mapping annotation: " + annotationName); //$NON-NLS-1$
- }
-
- this.removeMappingAnnotations_();
- Annotation newMapping = this.buildMappingAnnotation(annotationName);
- this.mappingAnnotations.add(newMapping);
- newMapping.newAnnotation();
- }
-
- /**
- * Remove all mapping annotations that already exist. No change notification
- * is fired.
- */
- protected void removeMappingAnnotations() {
- synchronized (this.mappingAnnotations) {
- this.removeMappingAnnotations_();
- }
- }
-
- protected void removeMappingAnnotations_() {
- for (ListIterator<String> stream = this.validMappingAnnotationNames(); stream.hasNext();) {
- Annotation mappingAnnotation = this.getMappingAnnotation(stream.next());
- if (mappingAnnotation != null) {
- this.mappingAnnotations.remove(mappingAnnotation);
- mappingAnnotation.removeAnnotation();
- }
- }
- }
-
- public JavaResourceNode getNullMappingAnnotation(String annotationName) {
- return this.buildNullMappingAnnotation(annotationName);
- }
-
- protected abstract Annotation buildNullMappingAnnotation(String annotationName);
-
- protected boolean mappingAnnotationIsValid(String annotationName) {
- return CollectionTools.contains(this.validMappingAnnotationNames(), annotationName);
- }
-
- protected abstract ListIterator<String> validMappingAnnotationNames();
-
- protected abstract Annotation buildMappingAnnotation(String mappingAnnotationName);
-
- protected void addMappingAnnotation(Annotation annotation) {
- this.addItemToCollection(annotation, this.mappingAnnotations, MAPPING_ANNOTATIONS_COLLECTION);
- }
-
- protected void removeMappingAnnotation(Annotation annotation) {
- this.removeMappingAnnotation_(annotation);
- annotation.removeAnnotation();
- }
-
- protected void removeMappingAnnotation_(Annotation annotation) {
- this.removeItemFromCollection(annotation, this.mappingAnnotations, MAPPING_ANNOTATIONS_COLLECTION);
- }
-
- // ********** supporting annotations **********
-
- public Iterator<Annotation> supportingAnnotations() {
- return new CloneIterator<Annotation>(this.supportingAnnotations);
- }
-
- public int supportingAnnotationsSize() {
- return this.supportingAnnotations.size();
- }
-
- public ListIterator<NestableAnnotation> supportingAnnotations(String nestableAnnotationName, String containerAnnotationName) {
- ContainerAnnotation<NestableAnnotation> containerAnnotation = this.getSupportingContainerAnnotation(containerAnnotationName);
- if (containerAnnotation != null) {
- return containerAnnotation.nestedAnnotations();
- }
- NestableAnnotation nestableAnnotation = this.getSupportingNestableAnnotation(nestableAnnotationName);
- return (nestableAnnotation == null) ? EmptyListIterator.<NestableAnnotation> instance() : new SingleElementListIterator<NestableAnnotation>(nestableAnnotation);
- }
-
- protected NestableAnnotation getSupportingNestableAnnotation(String annotationName) {
- return (NestableAnnotation) this.getSupportingAnnotation(annotationName);
- }
-
- public Annotation getSupportingAnnotation(String annotationName) {
- return getAnnotation(this.supportingAnnotations(), annotationName);
- }
-
- public JavaResourceNode getNonNullSupportingAnnotation(String annotationName) {
- Annotation annotation = this.getSupportingAnnotation(annotationName);
- return (annotation != null) ? annotation : this.buildNullSupportingAnnotation(annotationName);
- }
-
- protected abstract Annotation buildNullSupportingAnnotation(String annotationName);
-
- public Annotation addSupportingAnnotation(String annotationName) {
- Annotation annotation = this.buildSupportingAnnotation(annotationName);
- this.supportingAnnotations.add(annotation);
- annotation.newAnnotation();
- this.fireItemAdded(SUPPORTING_ANNOTATIONS_COLLECTION, annotation);
- return annotation;
- }
-
- protected abstract Annotation buildSupportingAnnotation(String annotationName);
-
- protected void addSupportingAnnotation(Annotation annotation) {
- this.addItemToCollection(annotation, this.supportingAnnotations, SUPPORTING_ANNOTATIONS_COLLECTION);
- }
-
- public void removeSupportingAnnotation(String annotationName) {
- synchronized (this.supportingAnnotations) {
- this.removeSupportingAnnotation_(annotationName);
- }
- }
-
- protected void removeSupportingAnnotation_(String annotationName) {
- Annotation annotation = this.getSupportingAnnotation(annotationName);
- if (annotation != null) {
- this.removeSupportingAnnotation(annotation);
- }
- }
-
- protected void removeSupportingAnnotation(Annotation annotation) {
- this.removeSupportingAnnotation_(annotation);
- // TODO looks odd that we remove the annotation here, but in
- // addAnnotation(Annotation) we don't do the same
- annotation.removeAnnotation();
- }
-
- protected void removeSupportingAnnotation_(Annotation annotation) {
- this.removeItemFromCollection(annotation, this.supportingAnnotations, SUPPORTING_ANNOTATIONS_COLLECTION);
- }
-
- public NestableAnnotation addSupportingAnnotation(int index, String nestableAnnotationName, String containerAnnotationName) {
- synchronized (this.supportingAnnotations) {
- return this.addSupportingAnnotation_(index, nestableAnnotationName, containerAnnotationName);
- }
- }
-
- // TODO it seems we should be firing one change notification here, that a
- // new nestable annotation was added.
- protected NestableAnnotation addSupportingAnnotation_(int index, String nestableAnnotationName, String containerAnnotationName) {
- ContainerAnnotation<NestableAnnotation> containerAnnotation = this.getSupportingContainerAnnotation(containerAnnotationName);
- if (containerAnnotation != null) {
- // ignore any nestable annotation and just add to the container
- // annotation
- NestableAnnotation newNestedAnnotation = ContainerAnnotationTools.addNestedAnnotation(index, containerAnnotation);
- // TODO any event notification being fired for the add???
- return newNestedAnnotation;
- }
-
- NestableAnnotation nestedAnnotation = this.getSupportingNestableAnnotation(nestableAnnotationName);
- if (nestedAnnotation == null) {
- // add the nestable annotation since neither the nestable nor the
- // container exist
- return this.addSupportingNestableAnnotation(nestableAnnotationName);
- }
-
- // move the existing nestable annotation to a new container annotation
- // and add a new one
- ContainerAnnotation<NestableAnnotation> newContainerAnnotation = this.addSupportingContainerAnnotationTwoNestableAnnotations(containerAnnotationName);
- if (index == 0) {
- newContainerAnnotation.nestedAnnotationAt(1).initializeFrom(nestedAnnotation);
- } else {
- newContainerAnnotation.nestedAnnotationAt(0).initializeFrom(nestedAnnotation);
- }
- this.removeSupportingAnnotation(nestedAnnotation);
- return newContainerAnnotation.nestedAnnotationAt(index);
- }
-
- @SuppressWarnings("unchecked")
- protected ContainerAnnotation<NestableAnnotation> getSupportingContainerAnnotation(String annotationName) {
- return (ContainerAnnotation<NestableAnnotation>) this.getSupportingAnnotation(annotationName);
- }
-
- protected NestableAnnotation addSupportingNestableAnnotation(String annotationName) {
- return (NestableAnnotation) this.addSupportingAnnotation(annotationName);
- }
-
- protected ContainerAnnotation<NestableAnnotation> addSupportingContainerAnnotationTwoNestableAnnotations(String annotationName) {
- ContainerAnnotation<NestableAnnotation> containerAnnotation = this.buildContainerAnnotation(annotationName);
- this.supportingAnnotations.add(containerAnnotation);
- containerAnnotation.newAnnotation();
- containerAnnotation.addInternal(0).newAnnotation();
- containerAnnotation.addInternal(1).newAnnotation();
- return containerAnnotation;
- }
-
- @SuppressWarnings("unchecked")
- protected ContainerAnnotation<NestableAnnotation> buildContainerAnnotation(String annotationName) {
- return (ContainerAnnotation<NestableAnnotation>) this.buildSupportingAnnotation(annotationName);
- }
-
- protected boolean supportingAnnotationIsValid(String annotationName) {
- return CollectionTools.contains(this.validSupportingAnnotationNames(), annotationName);
- }
-
- protected abstract ListIterator<String> validSupportingAnnotationNames();
-
- public void removeSupportingAnnotation(int index, String nestableAnnotationName, String containerAnnotationName) {
- synchronized (this.supportingAnnotations) {
- this.removeSupportingAnnotation_(index, nestableAnnotationName, containerAnnotationName);
- }
- }
-
- protected void removeSupportingAnnotation_(int index, String nestableAnnotationName, String containerAnnotationName) {
- ContainerAnnotation<NestableAnnotation> containerAnnotation = this.getSupportingContainerAnnotation(containerAnnotationName);
- if (containerAnnotation == null) {
- Annotation annotation = this.getSupportingAnnotation(nestableAnnotationName);
- this.removeSupportingAnnotation(annotation);
- } else {
- this.removeSupportingAnnotation(index, containerAnnotation);
- }
- }
-
- protected void removeSupportingAnnotation(int index, ContainerAnnotation<NestableAnnotation> containerAnnotation) {
- NestableAnnotation nestableAnnotation = containerAnnotation.nestedAnnotationAt(index);
- containerAnnotation.remove(index);
- // TODO move these 2 lines to the ContainerAnnotation implementation, i think
- nestableAnnotation.removeAnnotation();
- ContainerAnnotationTools.synchAnnotationsAfterRemove(index, containerAnnotation);
-
- if (containerAnnotation.nestedAnnotationsSize() == 0) {
- this.removeSupportingAnnotation(containerAnnotation);
- } else if (containerAnnotation.nestedAnnotationsSize() == 1) {
- NestableAnnotation nestedAnnotation = containerAnnotation.nestedAnnotationAt(0);
-
- this.supportingAnnotations.remove(containerAnnotation);
- containerAnnotation.removeAnnotation();
-
- NestableAnnotation newAnnotation = (NestableAnnotation) this.buildSupportingAnnotation(containerAnnotation.getNestableAnnotationName());
- this.supportingAnnotations.add(newAnnotation);
- newAnnotation.newAnnotation();
-
- newAnnotation.initializeFrom(nestedAnnotation);
-
- this.fireItemAdded(SUPPORTING_ANNOTATIONS_COLLECTION, newAnnotation);
- this.fireItemRemoved(SUPPORTING_ANNOTATIONS_COLLECTION, containerAnnotation);
- }
- }
-
- public void moveSupportingAnnotation(int targetIndex, int sourceIndex, String containerAnnotationName) {
- this.moveAnnotation(targetIndex, sourceIndex, this.getSupportingContainerAnnotation(containerAnnotationName));
- }
-
- protected void moveAnnotation(int targetIndex, int sourceIndex, ContainerAnnotation<NestableAnnotation> containerAnnotation) {
- containerAnnotation.move(targetIndex, sourceIndex);
- ContainerAnnotationTools.synchAnnotationsAfterMove(targetIndex, sourceIndex, containerAnnotation);
- }
-
- // ********** simple state **********
-
- public boolean isPersistable() {
- return this.persistable;
- }
-
- protected void setPersistable(boolean persistable) {
- boolean old = this.persistable;
- this.persistable = persistable;
- this.firePropertyChanged(PERSISTABLE_PROPERTY, old, persistable);
- }
-
- protected boolean buildPersistable(CompilationUnit astRoot) {
- return this.getMember().isPersistable(astRoot);
- }
-
- public boolean isPersisted() {
- return this.getMappingAnnotation() != null;
- }
-
- public boolean isFor(String memberName, int occurrence) {
- return this.member.matches(memberName, occurrence);
- }
-
- public boolean isFor(MethodSignature methodSignature, int occurrence) {
- return false;
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return this.fullTextRange(astRoot);
- }
-
- protected TextRange fullTextRange(CompilationUnit astRoot) {
- return getTextRange(this.getMember().getBodyDeclaration(astRoot));
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getMember().getNameTextRange(astRoot);
- }
-
- // ********** update **********
-
- public void update(CompilationUnit astRoot) {
- this.updateAnnotations(astRoot);
- this.setPersistable(this.buildPersistable(astRoot));
- }
-
- protected void updateAnnotations(CompilationUnit astRoot) {
- synchronized (this.mappingAnnotations) {
- synchronized (this.supportingAnnotations) {
- this.updateAnnotations_(astRoot);
- }
- }
- }
-
- protected void updateAnnotations_(CompilationUnit astRoot) {
- HashSet<Annotation> mappingAnnotationsToRemove = new HashSet<Annotation>(this.mappingAnnotations);
- HashSet<Annotation> supportingAnnotationsToRemove = new HashSet<Annotation>(this.supportingAnnotations);
-
- this.getMember().getBodyDeclaration(astRoot).accept(this.buildUpdateAnnotationVisitor(astRoot, mappingAnnotationsToRemove, supportingAnnotationsToRemove));
-
- for (Annotation annotation : mappingAnnotationsToRemove) {
- this.removeMappingAnnotation_(annotation);
- }
- for (Annotation annotation : supportingAnnotationsToRemove) {
- this.removeSupportingAnnotation_(annotation);
- }
- }
-
- protected ASTVisitor buildUpdateAnnotationVisitor(CompilationUnit astRoot, Set<Annotation> mappingAnnotationsToRemove, Set<Annotation> supportingAnnotationsToRemove) {
- return new UpdateAnnotationVisitor(astRoot, this.getMember().getBodyDeclaration(astRoot), mappingAnnotationsToRemove, supportingAnnotationsToRemove);
- }
-
- protected void addOrUpdateAnnotation(org.eclipse.jdt.core.dom.Annotation node, CompilationUnit astRoot, Set<Annotation> mappingAnnotationsToRemove, Set<Annotation> supportingAnnotationsToRemove) {
- String jdtAnnotationName = JDTTools.resolveAnnotation(node);
- if (jdtAnnotationName == null) {
- return;
- }
- if (this.supportingAnnotationIsValid(jdtAnnotationName)) {
- this.addOrUpdateSupportingAnnotation(jdtAnnotationName, astRoot, supportingAnnotationsToRemove);
- return;
- }
- if (this.mappingAnnotationIsValid(jdtAnnotationName)) {
- this.addOrUpdateMappingAnnotation(jdtAnnotationName, astRoot, mappingAnnotationsToRemove);
- return;
- }
- }
-
- protected void addOrUpdateSupportingAnnotation(String jdtAnnotationName, CompilationUnit astRoot, Set<Annotation> supportingAnnotationsToRemove) {
- Annotation annotation = getAnnotation(supportingAnnotationsToRemove, jdtAnnotationName);
- if (annotation != null) {
- annotation.update(astRoot);
- supportingAnnotationsToRemove.remove(annotation);
- } else {
- annotation = this.buildSupportingAnnotation(jdtAnnotationName);
- annotation.initialize(astRoot);
- this.addSupportingAnnotation(annotation);
- }
- }
-
- protected void addOrUpdateMappingAnnotation(String jdtAnnotationName, CompilationUnit astRoot, Set<Annotation> mappingAnnotationsToRemove) {
- Annotation annotation = getAnnotation(mappingAnnotationsToRemove, jdtAnnotationName);
- if (annotation != null) {
- annotation.update(astRoot);
- mappingAnnotationsToRemove.remove(annotation);
- } else {
- annotation = this.buildMappingAnnotation(jdtAnnotationName);
- annotation.initialize(astRoot);
- this.addMappingAnnotation(annotation);
- }
- }
-
- // ********** miscellaneous **********
-
- public void resolveTypes(CompilationUnit astRoot) {
- this.setPersistable(this.buildPersistable(astRoot));
- }
-
- protected E getMember() {
- return this.member;
- }
-
- protected static Annotation getAnnotation(Iterable<Annotation> annotations, String annotationName) {
- return getAnnotation(annotations.iterator(), annotationName);
- }
-
- protected static Annotation getAnnotation(Iterator<Annotation> annotations, String annotationName) {
- while (annotations.hasNext()) {
- Annotation annotation = annotations.next();
- if (annotation.getAnnotationName().equals(annotationName)) {
- return annotation;
- }
- }
- return null;
- }
-
- protected static TextRange getTextRange(ASTNode astNode) {
- return (astNode == null) ? null : new ASTNodeTextRange(astNode);
- }
-
- protected static <T extends JavaResourcePersistentMember> Iterator<T> persistableMembers(Iterator<T> members) {
- return new FilteringIterator<T, T>(members) {
- @Override
- protected boolean accept(T member) {
- return member.isPersistable();
- }
- };
- }
-
- // ********** AST visitor **********
-
- /**
- * annotation visitor
- */
- protected static abstract class AnnotationVisitor extends ASTVisitor {
- private final CompilationUnit astRoot;
- private final BodyDeclaration bodyDeclaration;
-
- protected AnnotationVisitor(CompilationUnit astRoot, BodyDeclaration bodyDeclaration) {
- super();
- this.astRoot = astRoot;
- this.bodyDeclaration = bodyDeclaration;
- }
-
- @Override
- public boolean visit(SingleMemberAnnotation node) {
- return visit_(node);
- }
-
- @Override
- public boolean visit(NormalAnnotation node) {
- return visit_(node);
- }
-
- @Override
- public boolean visit(MarkerAnnotation node) {
- return 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 CompilationUnit getASTRoot() {
- return this.astRoot;
- }
-
- 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) {
- AbstractJavaResourcePersistentMember.this.addInitialAnnotation(node, this.getASTRoot());
- }
-
- }
-
- /**
- * update annotation visitor
- */
- protected class UpdateAnnotationVisitor extends AnnotationVisitor {
- protected final Set<Annotation> mappingAnnotationsToRemove;
- protected final Set<Annotation> supportingAnnotationsToRemove;
-
- protected UpdateAnnotationVisitor(CompilationUnit astRoot, BodyDeclaration bodyDeclaration, Set<Annotation> mappingAnnotationsToRemove, Set<Annotation> supportingAnnotationsToRemove) {
- super(astRoot, bodyDeclaration);
- this.mappingAnnotationsToRemove = mappingAnnotationsToRemove;
- this.supportingAnnotationsToRemove = supportingAnnotationsToRemove;
- }
-
- @Override
- protected void visitChildAnnotation(org.eclipse.jdt.core.dom.Annotation node) {
- AbstractJavaResourcePersistentMember.this.addOrUpdateAnnotation(node, this.getASTRoot(), this.mappingAnnotationsToRemove, this.supportingAnnotationsToRemove);
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractNamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractNamedColumn.java
deleted file mode 100644
index 600f8cb289..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractNamedColumn.java
+++ /dev/null
@@ -1,152 +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.resource.java;
-
-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.NumberIntegerExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-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;
-
-public abstract class AbstractNamedColumn extends AbstractResourceAnnotation<Member> implements NamedColumnAnnotation
-{
- // hold this so we can get the 'name' text range
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
-
- // hold this so we can get the 'columnDefinition' text range
- private final DeclarationAnnotationElementAdapter<String> columnDefinitionDeclarationAdapter;
-
- private final AnnotationElementAdapter<String> nameAdapter;
-
- private final AnnotationElementAdapter<String> columnDefinitionAdapter;
-
- private String name;
- private String columnDefinition;
-
- public AbstractNamedColumn(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(getDeclarationAnnotationAdapter(), elementName);
- }
-
- protected DeclarationAnnotationElementAdapter<Boolean> buildBooleanElementAdapter(String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(getDeclarationAnnotationAdapter(), elementName, BooleanExpressionConverter.instance());
- }
-
- protected DeclarationAnnotationElementAdapter<Integer> buildIntegerElementAdapter(String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(getDeclarationAnnotationAdapter(), elementName, NumberIntegerExpressionConverter.instance());
- }
-
- protected AnnotationElementAdapter<String> buildShortCircuitElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new ShortCircuitAnnotationElementAdapter<String>(getMember(), daea);
- }
-
- protected AnnotationElementAdapter<Boolean> buildShortCircuitBooleanElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new ShortCircuitAnnotationElementAdapter<Boolean>(getMember(), daea);
- }
-
- protected AnnotationElementAdapter<Integer> buildShortCircuitIntegerElementAdapter(DeclarationAnnotationElementAdapter<Integer> daea) {
- return new ShortCircuitAnnotationElementAdapter<Integer>(getMember(), daea);
- }
-
- protected AnnotationElementAdapter<String> buildShortCircuitStringElementAdapter(String elementName) {
- return this.buildShortCircuitElementAdapter(this.buildStringElementAdapter(elementName));
- }
-
- protected abstract String getNameElementName();
-
- protected abstract String getColumnDefinitionElementName();
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.name(astRoot);
- this.columnDefinition = this.columnDefinition(astRoot);
- }
-
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- NamedColumnAnnotation oldColumn = (NamedColumnAnnotation) oldAnnotation;
- setName(oldColumn.getName());
- setColumnDefinition(oldColumn.getColumnDefinition());
- }
-
- //************* NamedColumn implementation **************
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- if (attributeValueHasNotChanged(this.name, newName)) {
- return;
- }
- String oldName = this.name;
- this.name = newName;
- this.nameAdapter.setValue(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public String getColumnDefinition() {
- return this.columnDefinition;
- }
-
- public void setColumnDefinition(String newColumnDefinition) {
- if (attributeValueHasNotChanged(this.columnDefinition, newColumnDefinition)) {
- return;
- }
- String oldColumnDefinition = this.columnDefinition;
- this.columnDefinition = newColumnDefinition;
- this.columnDefinitionAdapter.setValue(newColumnDefinition);
- firePropertyChanged(COLUMN_DEFINITION_PROPERTY, oldColumnDefinition, newColumnDefinition);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public TextRange getColumnDefinitionTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.columnDefinitionDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setName(this.name(astRoot));
- this.setColumnDefinition(this.columnDefinition(astRoot));
- }
-
- protected String name(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- protected String columnDefinition(CompilationUnit astRoot) {
- return this.columnDefinitionAdapter.getValue(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/resource/java/AbstractNamedQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractNamedQuery.java
deleted file mode 100644
index 41a8ded84a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractNamedQuery.java
+++ /dev/null
@@ -1,324 +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.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-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.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
-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.NestableQueryHint;
-import org.eclipse.jpt.core.resource.java.QueryAnnotation;
-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.iterators.CloneListIterator;
-
-public abstract class AbstractNamedQuery extends AbstractResourceAnnotation<Type>
- implements QueryAnnotation
-{
- // hold this so we can get the 'name' text range
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
-
- // hold this so we can get the 'query' text range
- private final DeclarationAnnotationElementAdapter<String> queryDeclarationAdapter;
-
- private final AnnotationElementAdapter<String> nameAdapter;
-
- private final AnnotationElementAdapter<String> queryAdapter;
-
- private String name;
-
- private String query;
-
- protected final List<NestableQueryHint> hints;
- private final HintsContainerAnnotation hintsContainerAnnotation;
-
- protected AbstractNamedQuery(JavaResourceNode parent, Type type,DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, type, daa, annotationAdapter);
- this.nameDeclarationAdapter = nameAdapter(daa);
- this.queryDeclarationAdapter = queryAdapter(daa);
- this.nameAdapter = this.buildAdapter(this.nameDeclarationAdapter);
- this.queryAdapter = this.buildAdapter(this.queryDeclarationAdapter);
- this.hints = new ArrayList<NestableQueryHint>();
- this.hintsContainerAnnotation = new HintsContainerAnnotation();
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.name(astRoot);
- this.query = this.query(astRoot);
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this.hintsContainerAnnotation);
- }
-
-
- // ********** initialization **********
- protected AnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new ShortCircuitAnnotationElementAdapter<String>(getMember(), daea);
- }
-
- protected DeclarationAnnotationElementAdapter<String> nameAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, getNameElementName());
- }
-
- protected DeclarationAnnotationElementAdapter<String> queryAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, getQueryElementName());
- }
-
- protected abstract String getNameElementName();
-
- protected abstract String getQueryElementName();
-
- /**
- * Return the uniqueConstraints element name
- */
- protected abstract String getHintsElementName();
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- if (attributeValueHasNotChanged(this.name, newName)) {
- return;
- }
- String oldName = this.name;
- this.name = newName;
- this.nameAdapter.setValue(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public String getQuery() {
- return this.query;
- }
-
- public void setQuery(String newQuery) {
- if (attributeValueHasNotChanged(this.query, newQuery)) {
- return;
- }
- String oldQuery = this.query;
- this.query = newQuery;
- this.queryAdapter.setValue(newQuery);
- firePropertyChanged(QUERY_PROPERTY, oldQuery, newQuery);
- }
-
- public ListIterator<QueryHintAnnotation> hints() {
- return new CloneListIterator<QueryHintAnnotation>(this.hints);
- }
-
- public int hintsSize() {
- return this.hints.size();
- }
-
- public NestableQueryHint hintAt(int index) {
- return this.hints.get(index);
- }
-
- public int indexOfHint(QueryHintAnnotation queryHint) {
- return this.hints.indexOf(queryHint);
- }
-
- public NestableQueryHint addHint(int index) {
- NestableQueryHint queryHint = (NestableQueryHint) ContainerAnnotationTools.addNestedAnnotation(index, this.hintsContainerAnnotation);
- fireItemAdded(QueryAnnotation.HINTS_LIST, index, queryHint);
- return queryHint;
- }
-
- protected void addHint(int index, NestableQueryHint queryHint) {
- addItemToList(index, queryHint, this.hints, HINTS_LIST);
- }
-
- public void removeHint(int index) {
- NestableQueryHint queryHint = hintAt(index);
- removeHint(queryHint);
- queryHint.removeAnnotation();
- ContainerAnnotationTools.synchAnnotationsAfterRemove(index, this.hintsContainerAnnotation);
- }
-
- protected void removeHint(NestableQueryHint queryHint) {
- removeItemFromList(queryHint, this.hints, HINTS_LIST);
- }
-
- public void moveHint(int targetIndex, int sourceIndex) {
- moveHintInternal(targetIndex, sourceIndex);
- ContainerAnnotationTools.synchAnnotationsAfterMove(targetIndex, sourceIndex, this.hintsContainerAnnotation);
- fireItemMoved(QueryAnnotation.HINTS_LIST, targetIndex, sourceIndex);
- }
-
- protected void moveHintInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.hints, targetIndex, sourceIndex);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public TextRange getQueryTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.queryDeclarationAdapter, astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setName(this.name(astRoot));
- this.setQuery(this.query(astRoot));
- this.updateQueryHintsFromJava(astRoot);
- }
-
- protected String name(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- protected String query(CompilationUnit astRoot) {
- return this.queryAdapter.getValue(astRoot);
- }
-
- private void updateQueryHintsFromJava(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this.hintsContainerAnnotation);
- }
-
- protected abstract NestableQueryHint createQueryHint(int index);
-
- // ********** persistence model -> java annotations **********
- public IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) super.getAnnotationAdapter();
- }
-
- public void moveAnnotation(int newIndex) {
- getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- AbstractNamedQuery oldNamedQuery = (AbstractNamedQuery) oldAnnotation;
- setName(oldNamedQuery.getName());
- setQuery(oldNamedQuery.getQuery());
- for (QueryHintAnnotation queryHint : CollectionTools.iterable(oldNamedQuery.hints())) {
- NestableQueryHint newQueryHint = addHint(oldNamedQuery.indexOfHint(queryHint));
- newQueryHint.initializeFrom((NestableQueryHint) queryHint);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- private class HintsContainerAnnotation extends AbstractJavaResourceNode implements ContainerAnnotation<NestableQueryHint> {
-
- public HintsContainerAnnotation() {
- super(AbstractNamedQuery.this);
- }
-
- public void initialize(CompilationUnit astRoot) {
- // nothing to initialize
- }
-
- public NestableQueryHint add(int index) {
- NestableQueryHint queryHint = AbstractNamedQuery.this.createQueryHint(index);
- AbstractNamedQuery.this.addHint(index, queryHint);
- return queryHint;
- }
-
- public NestableQueryHint addInternal(int index) {
- NestableQueryHint queryHint = AbstractNamedQuery.this.createQueryHint(index);
- AbstractNamedQuery.this.hints.add(index, queryHint);
- return queryHint;
- }
-
- public String getAnnotationName() {
- return AbstractNamedQuery.this.getAnnotationName();
- }
-
- public String getNestableAnnotationName() {
- return JPA.QUERY_HINT;
- }
-
- public int indexOf(NestableQueryHint hint) {
- return AbstractNamedQuery.this.indexOfHint(hint);
- }
-
- public void move(int targetIndex, int sourceIndex) {
- AbstractNamedQuery.this.moveHint(targetIndex, sourceIndex);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- AbstractNamedQuery.this.moveHintInternal(targetIndex, sourceIndex);
- }
-
- public NestableQueryHint nestedAnnotationAt(int index) {
- return AbstractNamedQuery.this.hintAt(index);
- }
-
- public NestableQueryHint nestedAnnotationFor(Annotation jdtAnnotation) {
- for (NestableQueryHint uniqueConstraint : CollectionTools.iterable(nestedAnnotations())) {
- if (jdtAnnotation == uniqueConstraint.getJdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return uniqueConstraint;
- }
- }
- return null;
- }
-
- public ListIterator<NestableQueryHint> nestedAnnotations() {
- return new CloneListIterator<NestableQueryHint>(AbstractNamedQuery.this.hints);
- }
-
- public int nestedAnnotationsSize() {
- return AbstractNamedQuery.this.hintsSize();
- }
-
- public void remove(NestableQueryHint queryHint) {
- AbstractNamedQuery.this.removeHint(queryHint);
- }
-
- public void remove(int index) {
- AbstractNamedQuery.this.removeHint(nestedAnnotationAt(index));
- }
-
- public Annotation getJdtAnnotation(CompilationUnit astRoot) {
- return AbstractNamedQuery.this.getJdtAnnotation(astRoot);
- }
-
- public void newAnnotation() {
- AbstractNamedQuery.this.newAnnotation();
- }
-
- public void removeAnnotation() {
- AbstractNamedQuery.this.removeAnnotation();
- }
-
- public void update(CompilationUnit astRoot) {
- AbstractNamedQuery.this.update(astRoot);
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return AbstractNamedQuery.this.getTextRange(astRoot);
- }
-
- public String getElementName() {
- return "hints";
- }
-
- @Override
- public void toString(StringBuilder sb) {
- AbstractNamedQuery.this.toString(sb);
- }
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractRelationshipMappingAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractRelationshipMappingAnnotation.java
deleted file mode 100644
index f7a7c6f3df..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractRelationshipMappingAnnotation.java
+++ /dev/null
@@ -1,314 +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.resource.java;
-
-import java.util.List;
-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.JDTTools;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitArrayAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-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.resource.java.RelationshipMappingAnnotation;
-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.CollectionTools;
-
-
-public abstract class AbstractRelationshipMappingAnnotation extends AbstractResourceAnnotation<Attribute> implements RelationshipMappingAnnotation
-{
- // hold this so we can get the 'targetEntity' text range
- private final DeclarationAnnotationElementAdapter<String> targetEntityDeclarationAdapter;
-
- // hold this so we can get the 'fetch' text range
- private final DeclarationAnnotationElementAdapter<String> fetchDeclarationAdapter;
-
- // hold this so we can get the 'cascade' text range
- private final DeclarationAnnotationElementAdapter<String[]> cascadeDeclarationAdapter;
-
- private final AnnotationElementAdapter<String> targetEntityAdapter;
-
- private final AnnotationElementAdapter<String> fetchAdapter;
-
- private final AnnotationElementAdapter<String[]> cascadeAdapter;
-
- private String targetEntity;
-
- private String fullyQualifiedTargetEntity;
-
- private FetchType fetch;
-
- protected boolean cascadeAll;
-
- protected boolean cascadePersist;
-
- protected boolean cascadeMerge;
-
- protected boolean cascadeRemove;
-
- protected boolean cascadeRefresh;
-
-
- public AbstractRelationshipMappingAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, DeclarationAnnotationAdapter daa) {
- super(parent, attribute, daa);
- this.targetEntityDeclarationAdapter = getTargetEntityAdapter();
- this.targetEntityAdapter = buildAnnotationElementAdapter(this.targetEntityDeclarationAdapter);
- this.fetchDeclarationAdapter = getFetchAdapter();
- this.fetchAdapter = buildAnnotationElementAdapter(this.fetchDeclarationAdapter);
- this.cascadeDeclarationAdapter = getCascadeAdapter();
- this.cascadeAdapter = new ShortCircuitArrayAnnotationElementAdapter<String>(attribute, this.cascadeDeclarationAdapter);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new ShortCircuitAnnotationElementAdapter<String>(this.getMember(), daea);
- }
-
- protected AnnotationElementAdapter<Boolean> buildBooleanAnnotationElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new ShortCircuitAnnotationElementAdapter<Boolean>(this.getMember(), daea);
- }
-
- /**
- * return the Java adapter's 'targetEntity' element adapter config
- */
- protected abstract DeclarationAnnotationElementAdapter<String> getTargetEntityAdapter();
-
- /**
- * return the Java adapter's 'cascade' element adapter config
- */
- protected abstract DeclarationAnnotationElementAdapter<String[]> getCascadeAdapter();
-
- /**
- * return the Java adapter's 'fetch' element adapter config
- */
- protected abstract DeclarationAnnotationElementAdapter<String> getFetchAdapter();
-
- public void initialize(CompilationUnit astRoot) {
- this.targetEntity = this.targetEntity(astRoot);
- this.fullyQualifiedTargetEntity = this.fullyQualifiedTargetEntity(astRoot);
- this.fetch = this.fetch(astRoot);
- this.initializeCascadeTypes(astRoot);
- }
-
- protected void initializeCascadeTypes(CompilationUnit astRoot) {
- String[] javaValue = this.cascadeAdapter.getValue(astRoot);
- CascadeType[] cascadeTypes = CascadeType.fromJavaAnnotationValue(javaValue);
-
- this.cascadeAll = CollectionTools.contains(cascadeTypes, CascadeType.ALL);
- this.cascadeMerge = CollectionTools.contains(cascadeTypes, CascadeType.MERGE);
- this.cascadePersist = CollectionTools.contains(cascadeTypes, CascadeType.PERSIST);
- this.cascadeRefresh = CollectionTools.contains(cascadeTypes, CascadeType.REFRESH);
- this.cascadeRemove = CollectionTools.contains(cascadeTypes, CascadeType.REMOVE);
- }
-
- public String getTargetEntity() {
- return this.targetEntity;
- }
-
- public void setTargetEntity(String newTargetEntity) {
- if (attributeValueHasNotChanged(this.targetEntity, newTargetEntity)) {
- return;
- }
- String oldTargetEntity = this.targetEntity;
- this.targetEntity = newTargetEntity;
- this.targetEntityAdapter.setValue(newTargetEntity);
- firePropertyChanged(TARGET_ENTITY_PROPERTY, oldTargetEntity, newTargetEntity);
- }
-
- public String getFullyQualifiedTargetEntity() {
- return this.fullyQualifiedTargetEntity;
- }
-
- protected void setFullyQualifiedTargetEntity(String newTargetEntity) {
- String oldTargetEntity = this.fullyQualifiedTargetEntity;
- this.fullyQualifiedTargetEntity = newTargetEntity;
- firePropertyChanged(FULLY_QUALFIEID_TARGET_ENTITY_PROPERTY, oldTargetEntity, newTargetEntity);
- }
-
- public FetchType getFetch() {
- return this.fetch;
- }
-
- public void setFetch(FetchType newFetch) {
- if (attributeValueHasNotChanged(this.fetch, newFetch)) {
- return;
- }
- FetchType oldFetch = this.fetch;
- this.fetch = newFetch;
- this.fetchAdapter.setValue(FetchType.toJavaAnnotationValue(newFetch));
- firePropertyChanged(FETCH_PROPERTY, oldFetch, newFetch);
- }
-
- public boolean isCascadeAll() {
- return this.cascadeAll;
- }
-
- public void setCascadeAll(boolean newCascadeAll) {
- if (this.cascadeAll == newCascadeAll) {
- return;
- }
- boolean oldCascadeAll = this.cascadeAll;
- this.cascadeAll = newCascadeAll;
- setCascade(newCascadeAll, CascadeType.ALL);
- firePropertyChanged(CASCADE_ALL_PROPERTY, oldCascadeAll, newCascadeAll);
- }
-
- public boolean isCascadePersist() {
- return this.cascadePersist;
- }
-
- public void setCascadePersist(boolean newCascadePersist) {
- if (this.cascadePersist == newCascadePersist) {
- return;
- }
- boolean oldCascadePersist = this.cascadePersist;
- this.cascadePersist = newCascadePersist;
- setCascade(newCascadePersist, CascadeType.PERSIST);
- firePropertyChanged(CASCADE_PERSIST_PROPERTY, oldCascadePersist, newCascadePersist);
- }
-
- public boolean isCascadeMerge() {
- return this.cascadeMerge;
- }
-
- public void setCascadeMerge(boolean newCascadeMerge) {
- if (this.cascadeMerge == newCascadeMerge) {
- return;
- }
- boolean oldCascadeMerge = this.cascadeMerge;
- this.cascadeMerge = newCascadeMerge;
- setCascade(newCascadeMerge, CascadeType.MERGE);
- firePropertyChanged(CASCADE_MERGE_PROPERTY, oldCascadeMerge, newCascadeMerge);
- }
-
- public boolean isCascadeRemove() {
- return this.cascadeRemove;
- }
-
- public void setCascadeRemove(boolean newCascadeRemove) {
- if (this.cascadeRemove == newCascadeRemove) {
- return;
- }
- boolean oldCascadeRemove = this.cascadeRemove;
- this.cascadeRemove = newCascadeRemove;
- setCascade(newCascadeRemove, CascadeType.REMOVE);
- firePropertyChanged(CASCADE_REMOVE_PROPERTY, oldCascadeRemove, newCascadeRemove);
- }
-
- public boolean isCascadeRefresh() {
- return this.cascadeRefresh;
- }
-
- public void setCascadeRefresh(boolean newCascadeRefresh) {
- if (this.cascadeRefresh == newCascadeRefresh) {
- return;
- }
- boolean oldCascadeRefresh = this.cascadeRefresh;
- this.cascadeRefresh = newCascadeRefresh;
- setCascade(newCascadeRefresh, CascadeType.REFRESH);
- firePropertyChanged(CASCADE_REFRESH_PROPERTY, oldCascadeRefresh, newCascadeRefresh);
- }
-
- private void setCascadeTypes(CascadeType[] cascadeTypes) {
- String[] newJavaValue = CascadeType.toJavaAnnotationValue(cascadeTypes);
- this.cascadeAdapter.setValue(newJavaValue);
- }
-
- private void setCascade(boolean isSet, CascadeType cascadeType) {
- String[] javaValue = this.cascadeAdapter.getValue();
- CascadeType[] cascadeTypes = CascadeType.fromJavaAnnotationValue(javaValue);
- List<CascadeType> cascadeCollection = CollectionTools.list(cascadeTypes);
-
- if (cascadeCollection.contains(cascadeType)) {
- if (!isSet) {
- cascadeCollection.remove(cascadeType);
- setCascadeTypes(cascadeCollection.toArray(new CascadeType[cascadeCollection.size()]));
- }
- }
- else {
- if (isSet) {
- cascadeCollection.add(cascadeType);
- setCascadeTypes(cascadeCollection.toArray(new CascadeType[cascadeCollection.size()]));
- }
- }
- }
-
- public TextRange getTargetEntityTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.targetEntityDeclarationAdapter, astRoot);
- }
-
- public TextRange getFetchTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.fetchDeclarationAdapter, astRoot);
- }
-
- public TextRange getCascadeTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.cascadeDeclarationAdapter, astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setFetch(this.fetch(astRoot));
- this.setTargetEntity(this.targetEntity(astRoot));
- this.setFullyQualifiedTargetEntity(this.fullyQualifiedTargetEntity(astRoot));
- this.updateCascadeFromJava(astRoot);
- }
-
- protected FetchType fetch(CompilationUnit astRoot) {
- return FetchType.fromJavaAnnotationValue(this.fetchAdapter.getValue(astRoot));
- }
-
- protected String targetEntity(CompilationUnit astRoot) {
- return this.targetEntityAdapter.getValue(astRoot);
- }
-
- private void updateCascadeFromJava(CompilationUnit astRoot) {
- String[] javaValue = this.cascadeAdapter.getValue(astRoot);
- CascadeType[] cascadeTypes = CascadeType.fromJavaAnnotationValue(javaValue);
- setCascadeAll(CollectionTools.contains(cascadeTypes, CascadeType.ALL));
- setCascadeMerge(CollectionTools.contains(cascadeTypes, CascadeType.MERGE));
- setCascadePersist(CollectionTools.contains(cascadeTypes, CascadeType.PERSIST));
- setCascadeRefresh(CollectionTools.contains(cascadeTypes, CascadeType.REFRESH));
- setCascadeRemove(CollectionTools.contains(cascadeTypes, CascadeType.REMOVE));
- }
-
- private String fullyQualifiedTargetEntity(CompilationUnit astRoot) {
- if (getTargetEntity() == null) {
- return null;
- }
- return JDTTools.resolveFullyQualifiedName(this.targetEntityAdapter.getExpression(astRoot));
- }
-
- // ********** static methods **********
-
- protected static DeclarationAnnotationElementAdapter<String> buildTargetEntityAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- // TODO what about QualifiedType?
- return buildAnnotationElementAdapter(annotationAdapter, elementName, SimpleTypeStringExpressionConverter.instance());
- }
-
- protected static DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, false, converter);
- }
-
- protected static DeclarationAnnotationElementAdapter<String> buildFetchAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new EnumDeclarationAnnotationElementAdapter(annotationAdapter, elementName, false);
- }
-
- protected 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/AbstractResourceAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractResourceAnnotation.java
deleted file mode 100644
index acf1790ccc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractResourceAnnotation.java
+++ /dev/null
@@ -1,138 +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.resource.java;
-
-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;
-
-public abstract class AbstractResourceAnnotation<E extends Member>
- extends AbstractJavaResourceNode
- implements Annotation
-{
- private final E member;
-
- private final DeclarationAnnotationAdapter daa;
-
- private final AnnotationAdapter annotationAdapter;
-
- protected AbstractResourceAnnotation(JavaResourceNode parent, E member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent);
- this.member = member;
- this.daa = daa;
- this.annotationAdapter = annotationAdapter;
- }
-
- public E getMember() {
- return this.member;
- }
-
- protected AbstractResourceAnnotation(JavaResourceNode parent, E member, DeclarationAnnotationAdapter daa) {
- this(parent, member, daa, new MemberAnnotationAdapter(member, daa));
- }
-
-
- public AnnotationAdapter getAnnotationAdapter() {
- return this.annotationAdapter;
- }
-
- public org.eclipse.jdt.core.dom.Annotation getJdtAnnotation(CompilationUnit astRoot) {
- return getAnnotationAdapter().getAnnotation(astRoot);
- }
-
- public DeclarationAnnotationAdapter getDeclarationAnnotationAdapter() {
- return this.daa;
- }
-
- public void removeAnnotation() {
- getAnnotationAdapter().removeAnnotation();
- }
-
- public void newAnnotation() {
- getAnnotationAdapter().newMarkerAnnotation();
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return getAnnotationTextRange(astRoot);
- }
-
- protected TextRange getTextRange(ASTNode astNode) {
- return (astNode == null) ? null : new ASTNodeTextRange(astNode);
- }
-
- /**
- * Return the text range corresponding to the specified annotation.
- * If the annotation is missing, return null.
- */
- protected TextRange getAnnotationTextRange(CompilationUnit astRoot) {
- return this.getTextRange(getAnnotation(astRoot));
- }
-
- protected org.eclipse.jdt.core.dom.Annotation getAnnotation(CompilationUnit astRoot) {
- return this.daa.getAnnotation(getMember().getModifiedDeclaration(astRoot));
-
- }
-
- protected Expression getAnnotationElementExpression(DeclarationAnnotationElementAdapter<?> adapter, CompilationUnit astRoot) {
- return adapter.getExpression(getMember().getModifiedDeclaration(astRoot));
- }
-
- protected TextRange getAnnotationElementTextRange(DeclarationAnnotationElementAdapter<?> adapter, CompilationUnit astRoot) {
- return this.getTextRange(getAnnotationElementExpression(adapter, astRoot));
-
- }
-
- /**
- * Convenience method. If the specified element is missing
- * return the member's text range instead.
- */
- protected TextRange getElementTextRange(DeclarationAnnotationElementAdapter<?> elementAdapter, CompilationUnit astRoot) {
- return this.getElementTextRange(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.getTextRange(astRoot);
- }
-
- /**
- * Convenience method. Return whether the specified position touches the element.
- * Returns false if the element does not exist
- */
- protected boolean elementTouches(DeclarationAnnotationElementAdapter<?> elementAdapter, int pos, CompilationUnit astRoot) {
- return this.elementTouches(getAnnotationElementTextRange(elementAdapter, astRoot), pos);
- }
-
- /**
- * Convenience method. Return whether element's text range is not
- * null (meaning the element exists) and the specified position touches it.
- */
- protected boolean elementTouches(TextRange elementTextRange, int pos) {
- return (elementTextRange != null) && elementTextRange.touches(pos);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getAnnotationName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractResourceTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractResourceTable.java
deleted file mode 100644
index eedd6f999c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractResourceTable.java
+++ /dev/null
@@ -1,353 +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.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableUniqueConstraint;
-import org.eclipse.jpt.core.resource.java.TableAnnotation;
-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.Member;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-public abstract class AbstractResourceTable extends AbstractResourceAnnotation<Member> implements TableAnnotation
-{
- // hold this so we can get the 'name' text range
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
-
- // hold this so we can get the 'schema' text range
- private final DeclarationAnnotationElementAdapter<String> schemaDeclarationAdapter;
-
- // hold this so we can get the 'catalog' text range
- private final DeclarationAnnotationElementAdapter<String> catalogDeclarationAdapter;
-
- private final AnnotationElementAdapter<String> nameAdapter;
-
- private final AnnotationElementAdapter<String> schemaAdapter;
-
- private final AnnotationElementAdapter<String> catalogAdapter;
-
- private String name;
-
- private String catalog;
-
- private String schema;
-
- final List<NestableUniqueConstraint> uniqueConstraints;
-
- private final UniqueConstraintsContainerAnnotation uniqueConstraintsContainerAnnotation;
-
- protected AbstractResourceTable(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 = buildAnnotationElementAdapter(this.nameDeclarationAdapter);
- this.schemaAdapter = buildAnnotationElementAdapter(this.schemaDeclarationAdapter);
- this.catalogAdapter = buildAnnotationElementAdapter(this.catalogDeclarationAdapter);
- this.uniqueConstraints = new ArrayList<NestableUniqueConstraint>();
- this.uniqueConstraintsContainerAnnotation = new UniqueConstraintsContainerAnnotation();
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.name(astRoot);
- this.catalog = this.catalog(astRoot);
- this.schema = this.schema(astRoot);
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this.uniqueConstraintsContainerAnnotation);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new ShortCircuitAnnotationElementAdapter<String>(this.getMember(), daea);
- }
-
- /**
- * Build and return a declaration element adapter for the table's 'name' element
- */
- protected abstract DeclarationAnnotationElementAdapter<String> getNameAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter);
-
- /**
- * Build and return a declaration element adapter for the table's 'schema' element
- */
- protected abstract DeclarationAnnotationElementAdapter<String> getSchemaAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter);
-
- /**
- * Build and return a declaration element adapter for the table's 'catalog' element
- */
- protected abstract DeclarationAnnotationElementAdapter<String> getCatalogAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter);
-
- /**
- * Return the uniqueConstraints element name
- */
- protected abstract String getUniqueConstraintsElementName();
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- if (attributeValueHasNotChanged(this.name, newName)) {
- return;
- }
- String oldName = this.name;
- this.name = newName;
- this.nameAdapter.setValue(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public String getCatalog() {
- return this.catalog;
- }
-
- public void setCatalog(String newCatalog) {
- if (attributeValueHasNotChanged(this.catalog, newCatalog)) {
- return;
- }
- String oldCatalog = this.catalog;
- this.catalog = newCatalog;
- this.catalogAdapter.setValue(newCatalog);
- firePropertyChanged(CATALOG_PROPERTY, oldCatalog, newCatalog);
- }
-
- public String getSchema() {
- return this.schema;
- }
-
- public void setSchema(String newSchema) {
- if (attributeValueHasNotChanged(this.schema, newSchema)) {
- return;
- }
- String oldSchema = this.schema;
- this.schema = newSchema;
- this.schemaAdapter.setValue(newSchema);
- firePropertyChanged(SCHEMA_PROPERTY, oldSchema, newSchema);
- }
-
- public ListIterator<UniqueConstraintAnnotation> uniqueConstraints() {
- return new CloneListIterator<UniqueConstraintAnnotation>(this.uniqueConstraints);
- }
-
- public int uniqueConstraintsSize() {
- return this.uniqueConstraints.size();
- }
-
- public NestableUniqueConstraint uniqueConstraintAt(int index) {
- return this.uniqueConstraints.get(index);
- }
-
- public int indexOfUniqueConstraint(UniqueConstraintAnnotation uniqueConstraint) {
- return this.uniqueConstraints.indexOf(uniqueConstraint);
- }
-
- public NestableUniqueConstraint addUniqueConstraint(int index) {
- NestableUniqueConstraint uniqueConstraint = (NestableUniqueConstraint) ContainerAnnotationTools.addNestedAnnotation(index, this.uniqueConstraintsContainerAnnotation);
- fireItemAdded(TableAnnotation.UNIQUE_CONSTRAINTS_LIST, index, uniqueConstraint);
- return uniqueConstraint;
- }
-
- protected void addUniqueConstraint(int index, NestableUniqueConstraint uniqueConstraint) {
- addItemToList(index, uniqueConstraint, this.uniqueConstraints, UNIQUE_CONSTRAINTS_LIST);
- }
-
- public void removeUniqueConstraint(int index) {
- NestableUniqueConstraint uniqueConstraint = this.uniqueConstraintAt(index);
- removeUniqueConstraint(uniqueConstraint);
- uniqueConstraint.removeAnnotation();
- ContainerAnnotationTools.synchAnnotationsAfterRemove(index, this.uniqueConstraintsContainerAnnotation);
- }
-
- protected void removeUniqueConstraint(NestableUniqueConstraint uniqueConstraint) {
- removeItemFromList(uniqueConstraint, this.uniqueConstraints, UNIQUE_CONSTRAINTS_LIST);
- }
-
- public void moveUniqueConstraint(int targetIndex, int sourceIndex) {
- moveUniqueConstraintInternal(targetIndex, sourceIndex);
- ContainerAnnotationTools.synchAnnotationsAfterMove(targetIndex, sourceIndex, this.uniqueConstraintsContainerAnnotation);
- fireItemMoved(TableAnnotation.UNIQUE_CONSTRAINTS_LIST, targetIndex, sourceIndex);
- }
-
- protected void moveUniqueConstraintInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.uniqueConstraints, targetIndex, sourceIndex);
- }
-
- protected abstract NestableUniqueConstraint createUniqueConstraint(int index);
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public TextRange getSchemaTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.schemaDeclarationAdapter, astRoot);
- }
-
- public TextRange getCatalogTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.catalogDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
- public boolean catalogTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.catalogDeclarationAdapter, pos, astRoot);
- }
-
- public boolean schemaTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.schemaDeclarationAdapter, pos, astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setName(this.name(astRoot));
- this.setSchema(this.schema(astRoot));
- this.setCatalog(this.catalog(astRoot));
- this.updateUniqueConstraintsFromJava(astRoot);
- }
-
- protected String name(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- protected String schema(CompilationUnit astRoot) {
- return this.schemaAdapter.getValue(astRoot);
- }
-
- protected String catalog(CompilationUnit astRoot) {
- return this.catalogAdapter.getValue(astRoot);
- }
-
- /**
- * here we just worry about getting the unique constraints lists the same size;
- * then we delegate to the unique constraints to synch themselves up
- */
- private void updateUniqueConstraintsFromJava(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this.uniqueConstraintsContainerAnnotation);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- private class UniqueConstraintsContainerAnnotation extends AbstractJavaResourceNode
- implements ContainerAnnotation<NestableUniqueConstraint>
- {
- public UniqueConstraintsContainerAnnotation() {
- super(AbstractResourceTable.this);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public NestableUniqueConstraint addInternal(int index) {
- NestableUniqueConstraint uniqueConstraint = AbstractResourceTable.this.createUniqueConstraint(index);
- AbstractResourceTable.this.uniqueConstraints.add(index, uniqueConstraint);
- return uniqueConstraint;
- }
-
- public NestableUniqueConstraint add(int index) {
- NestableUniqueConstraint uniqueConstraint = AbstractResourceTable.this.createUniqueConstraint(index);
- AbstractResourceTable.this.addUniqueConstraint(index, uniqueConstraint);
- return uniqueConstraint;
- }
-
- public String getAnnotationName() {
- return AbstractResourceTable.this.getAnnotationName();
- }
-
- public String getNestableAnnotationName() {
- return JPA.UNIQUE_CONSTRAINT;
- }
-
- public int indexOf(NestableUniqueConstraint uniqueConstraint) {
- return AbstractResourceTable.this.indexOfUniqueConstraint(uniqueConstraint);
- }
-
- public void move(int targetIndex, int sourceIndex) {
- AbstractResourceTable.this.moveUniqueConstraint(targetIndex, sourceIndex);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- AbstractResourceTable.this.moveUniqueConstraintInternal(targetIndex, sourceIndex);
- }
-
- public NestableUniqueConstraint nestedAnnotationAt(int index) {
- return AbstractResourceTable.this.uniqueConstraintAt(index);
- }
-
- public NestableUniqueConstraint nestedAnnotationFor(Annotation jdtAnnotation) {
- for (NestableUniqueConstraint uniqueConstraint : CollectionTools.iterable(nestedAnnotations())) {
- if (jdtAnnotation == uniqueConstraint.getJdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return uniqueConstraint;
- }
- }
- return null;
- }
-
- public ListIterator<NestableUniqueConstraint> nestedAnnotations() {
- return new CloneListIterator<NestableUniqueConstraint>(AbstractResourceTable.this.uniqueConstraints);
- }
-
- public int nestedAnnotationsSize() {
- return AbstractResourceTable.this.uniqueConstraintsSize();
- }
-
- public void remove(NestableUniqueConstraint uniqueConstraint) {
- AbstractResourceTable.this.removeUniqueConstraint(uniqueConstraint);
- }
-
- public void remove(int index) {
- this.remove(nestedAnnotationAt(index));
- }
-
- public Annotation getJdtAnnotation(CompilationUnit astRoot) {
- return AbstractResourceTable.this.getJdtAnnotation(astRoot);
- }
-
- public void newAnnotation() {
- AbstractResourceTable.this.newAnnotation();
- }
-
- public void removeAnnotation() {
- AbstractResourceTable.this.removeAnnotation();
- }
-
- public void update(CompilationUnit astRoot) {
- AbstractResourceTable.this.update(astRoot);
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return AbstractResourceTable.this.getTextRange(astRoot);
- }
-
- public String getElementName() {
- return AbstractResourceTable.this.getUniqueConstraintsElementName();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- AbstractResourceTable.this.toString(sb);
- }
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverrideImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverrideImpl.java
deleted file mode 100644
index 6fe77cebf0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverrideImpl.java
+++ /dev/null
@@ -1,290 +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.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-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.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAssociationOverride;
-import org.eclipse.jpt.core.resource.java.NestableJoinColumn;
-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.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;
-
-public class AssociationOverrideImpl
- extends OverrideImpl
- implements NestableAssociationOverride
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- protected final List<NestableJoinColumn> joinColumns;
-
- private final JoinColumnsContainerAnnotation joinColumnsContainerAnnotation;
-
- protected AssociationOverrideImpl(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.joinColumns = new ArrayList<NestableJoinColumn>();
- this.joinColumnsContainerAnnotation = new JoinColumnsContainerAnnotation();
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this.joinColumnsContainerAnnotation);
- }
-
- public String getAnnotationName() {
- return AssociationOverrideAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- AssociationOverrideAnnotation oldAssociationOverride = (AssociationOverrideAnnotation) oldAnnotation;
- for (JoinColumnAnnotation joinColumn : CollectionTools.iterable(oldAssociationOverride.joinColumns())) {
- NestableJoinColumn newJoinColumn = addJoinColumn(oldAssociationOverride.indexOfJoinColumn(joinColumn));
- newJoinColumn.initializeFrom((NestableAnnotation) joinColumn);
- }
- }
-
-
- // ************* Association implementation *******************
-
- public ListIterator<JoinColumnAnnotation> joinColumns() {
- return new CloneListIterator<JoinColumnAnnotation>(this.joinColumns);
- }
-
- public int joinColumnsSize() {
- return this.joinColumns.size();
- }
-
- public NestableJoinColumn joinColumnAt(int index) {
- return this.joinColumns.get(index);
- }
-
- public int indexOfJoinColumn(JoinColumnAnnotation joinColumn) {
- return this.joinColumns.indexOf(joinColumn);
- }
-
- public NestableJoinColumn addJoinColumn(int index) {
- NestableJoinColumn joinColumn = (NestableJoinColumn) ContainerAnnotationTools.addNestedAnnotation(index, this.joinColumnsContainerAnnotation);
- fireItemAdded(AssociationOverrideAnnotation.JOIN_COLUMNS_LIST, index, joinColumn);
- return joinColumn;
- }
-
- protected void addJoinColumn(int index, NestableJoinColumn joinColumn) {
- addItemToList(index, joinColumn, this.joinColumns, AssociationOverrideAnnotation.JOIN_COLUMNS_LIST);
- }
-
- public void removeJoinColumn(int index) {
- NestableJoinColumn joinColumn = this.joinColumns.get(index);
- removeJoinColumn(joinColumn);
- joinColumn.removeAnnotation();
- ContainerAnnotationTools.synchAnnotationsAfterRemove(index, this.joinColumnsContainerAnnotation);
- }
-
- protected void removeJoinColumn(NestableJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.joinColumns, AssociationOverrideAnnotation.JOIN_COLUMNS_LIST);
- }
-
- public void moveJoinColumn(int targetIndex, int sourceIndex) {
- moveJoinColumnInternal(targetIndex, sourceIndex);
- ContainerAnnotationTools.synchAnnotationsAfterMove(targetIndex, sourceIndex, this.joinColumnsContainerAnnotation);
- fireItemMoved(AssociationOverrideAnnotation.JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- protected void moveJoinColumnInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.joinColumns, targetIndex, sourceIndex);
- }
-
- protected NestableJoinColumn createJoinColumn(int index) {
- return JoinColumnImpl.createAssociationOverrideJoinColumn(getDeclarationAnnotationAdapter(), this, getMember(), index);
- }
-
- @Override
- public void update(CompilationUnit astRoot) {
- super.update(astRoot);
- this.updateJoinColumnsFromJava(astRoot);
- }
-
- private void updateJoinColumnsFromJava(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this.joinColumnsContainerAnnotation);
- }
-
-
- // ********** static methods **********
- static AssociationOverrideImpl createAssociationOverride(JavaResourceNode parent, Member member) {
- return new AssociationOverrideImpl(parent, member, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- static AssociationOverrideImpl createNestedAssociationOverride(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, attributeOverridesAdapter);
- IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa);
- return new AssociationOverrideImpl(parent, member, idaa, annotationAdapter);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
- return new NestedIndexedDeclarationAnnotationAdapter(attributeOverridesAdapter, index, JPA.ASSOCIATION_OVERRIDE);
- }
-
- private class JoinColumnsContainerAnnotation extends AbstractJavaResourceNode
- implements ContainerAnnotation<NestableJoinColumn>
- {
- public JoinColumnsContainerAnnotation() {
- super(AssociationOverrideImpl.this);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public NestableJoinColumn addInternal(int index) {
- NestableJoinColumn joinColumn = AssociationOverrideImpl.this.createJoinColumn(index);
- AssociationOverrideImpl.this.joinColumns.add(index, joinColumn);
- return joinColumn;
- }
-
- public NestableJoinColumn add(int index) {
- NestableJoinColumn joinColumn = AssociationOverrideImpl.this.createJoinColumn(index);
- AssociationOverrideImpl.this.addJoinColumn(index, joinColumn);
- return joinColumn;
- }
-
- public int indexOf(NestableJoinColumn pkJoinColumn) {
- return AssociationOverrideImpl.this.indexOfJoinColumn(pkJoinColumn);
- }
-
- public void move(int targetIndex, int sourceIndex) {
- AssociationOverrideImpl.this.moveJoinColumn(targetIndex, sourceIndex);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- AssociationOverrideImpl.this.moveJoinColumnInternal(targetIndex, sourceIndex);
- }
-
- public NestableJoinColumn nestedAnnotationAt(int index) {
- return AssociationOverrideImpl.this.joinColumnAt(index);
- }
-
- public ListIterator<NestableJoinColumn> nestedAnnotations() {
- return new CloneListIterator<NestableJoinColumn>(AssociationOverrideImpl.this.joinColumns);
- }
-
- public int nestedAnnotationsSize() {
- return joinColumnsSize();
- }
-
- public void remove(int index) {
- this.remove(nestedAnnotationAt(index));
- }
-
- public void remove(NestableJoinColumn joinColumn) {
- AssociationOverrideImpl.this.removeJoinColumn(joinColumn);
- }
-
- public String getAnnotationName() {
- return AssociationOverrideImpl.this.getAnnotationName();
- }
-
- public String getNestableAnnotationName() {
- return JPA.JOIN_COLUMN;
- }
-
- public NestableJoinColumn nestedAnnotationFor(org.eclipse.jdt.core.dom.Annotation jdtAnnotation) {
- for (NestableJoinColumn pkJoinColumn : CollectionTools.iterable(nestedAnnotations())) {
- if (jdtAnnotation == pkJoinColumn.getJdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return pkJoinColumn;
- }
- }
- return null;
- }
-
- public org.eclipse.jdt.core.dom.Annotation getJdtAnnotation(CompilationUnit astRoot) {
- return AssociationOverrideImpl.this.getJdtAnnotation(astRoot);
- }
-
- public void newAnnotation() {
- AssociationOverrideImpl.this.newAnnotation();
- }
-
- public void removeAnnotation() {
- AssociationOverrideImpl.this.removeAnnotation();
- }
-
- public void update(CompilationUnit astRoot) {
- AssociationOverrideImpl.this.update(astRoot);
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return AssociationOverrideImpl.this.getTextRange(astRoot);
- }
-
- public String getElementName() {
- return JPA.ASSOCIATION_OVERRIDE__JOIN_COLUMNS;
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getAnnotationName());
- }
-
- }
-
- public static class AssociationOverrideAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final AssociationOverrideAnnotationDefinition 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 AssociationOverrideImpl.createAssociationOverride(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return AssociationOverrideAnnotation.ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverridesImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverridesImpl.java
deleted file mode 100644
index 1b49bbc9d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverridesImpl.java
+++ /dev/null
@@ -1,153 +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.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-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.AnnotationDefinition;
-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.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NestableAssociationOverride;
-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.iterators.CloneListIterator;
-
-public class AssociationOverridesImpl extends AbstractResourceAnnotation<Member> implements AssociationOverridesAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- protected final List<NestableAssociationOverride> associationOverrides;
-
- protected AssociationOverridesImpl(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.associationOverrides = new ArrayList<NestableAssociationOverride>();
- }
-
- public void initialize(CompilationUnit astRoot) {
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public String getNestableAnnotationName() {
- return AssociationOverrideAnnotation.ANNOTATION_NAME;
- }
-
- public ListIterator<NestableAssociationOverride> nestedAnnotations() {
- return new CloneListIterator<NestableAssociationOverride>(this.associationOverrides);
- }
-
- public int nestedAnnotationsSize() {
- return this.associationOverrides.size();
- }
-
- public NestableAssociationOverride addInternal(int index) {
- NestableAssociationOverride associationOverride = createAssociationOverride(index);
- this.associationOverrides.add(index, associationOverride);
- return associationOverride;
- }
-
- public NestableAssociationOverride add(int index) {
- NestableAssociationOverride associationOverride = createAssociationOverride(index);
- add(index, associationOverride);
- return associationOverride;
- }
-
- private void add(int index, NestableAssociationOverride associationOverride) {
- addItemToList(index, associationOverride, this.associationOverrides, ASSOCIATION_OVERRIDES_LIST);
- }
-
- public void remove(NestableAssociationOverride associationOverride) {
- removeItemFromList(associationOverride, this.associationOverrides, ASSOCIATION_OVERRIDES_LIST);
- }
-
- public void remove(int index) {
- removeItemFromList(index, this.associationOverrides, ASSOCIATION_OVERRIDES_LIST);
- }
-
- public int indexOf(NestableAssociationOverride associationOverride) {
- return this.associationOverrides.indexOf(associationOverride);
- }
-
- public NestableAssociationOverride nestedAnnotationAt(int index) {
- return this.associationOverrides.get(index);
- }
-
- public NestableAssociationOverride nestedAnnotationFor(Annotation jdtAnnotation) {
- for (NestableAssociationOverride associationOverride : this.associationOverrides) {
- if (jdtAnnotation == associationOverride.getJdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return associationOverride;
- }
- }
- return null;
- }
-
- public void move(int targetIndex, int sourceIndex) {
- moveItemInList(targetIndex, sourceIndex, this.associationOverrides, ASSOCIATION_OVERRIDES_LIST);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.associationOverrides, targetIndex, sourceIndex);
- }
-
- public String getElementName() {
- return JPA.ASSOCIATION_OVERRIDES__VALUE;
- }
-
- public void update(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this);
- }
-
- private AssociationOverrideImpl createAssociationOverride(int index) {
- return AssociationOverrideImpl.createNestedAssociationOverride(this, getMember(), index, getDeclarationAnnotationAdapter());
- }
-
- public static class AssociationOverridesAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final AssociationOverridesAnnotationDefinition 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 AssociationOverridesImpl(parent, member);
- }
-
- public AssociationOverridesAnnotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverrideImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverrideImpl.java
deleted file mode 100644
index 46a4a4036f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverrideImpl.java
+++ /dev/null
@@ -1,163 +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.resource.java;
-
-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.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-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.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAttributeOverride;
-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;
-
-public class AttributeOverrideImpl
- extends OverrideImpl
- implements NestableAttributeOverride
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final MemberAnnotationAdapter columnAdapter;
-
- private ColumnImpl column;
-
-
- protected AttributeOverrideImpl(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.columnAdapter = new MemberAnnotationAdapter(getMember(), ColumnImpl.buildAttributeOverrideAnnotationAdapter(getDeclarationAnnotationAdapter()));
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- if (this.columnAdapter.getAnnotation(astRoot) != null) {
- this.column = ColumnImpl.createAttributeOverrideColumn(this, getMember(), getDeclarationAnnotationAdapter());
- this.column.initialize(astRoot);
- }
- }
-
- public String getAnnotationName() {
- return AttributeOverrideAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- AttributeOverrideAnnotation oldAttributeOverride = (AttributeOverrideAnnotation) oldAnnotation;
- if (oldAttributeOverride.getColumn() != null) {
- ColumnAnnotation column = addColumn();
- ((NestableAnnotation) column).initializeFrom((NestableAnnotation) oldAttributeOverride.getColumn());
- }
- }
-
- //************ AttributeOverride implementation ****************
-
- public ColumnAnnotation getNonNullColumn() {
- return (getColumn() != null) ? getColumn() : new NullAttributeOverrideColumn(this);
- }
-
- public ColumnAnnotation getColumn() {
- return this.column;
- }
-
- public ColumnAnnotation addColumn() {
- ColumnImpl column = ColumnImpl.createAttributeOverrideColumn(this, getMember(), getDeclarationAnnotationAdapter());
- column.newAnnotation();
- setColumn(column);
- return column;
- }
-
- public void removeColumn() {
- this.column.removeAnnotation();
- setColumn(null);
- }
-
- protected void setColumn(ColumnImpl newColumn) {
- ColumnImpl oldColumn = this.column;
- this.column = newColumn;
- firePropertyChanged(AttributeOverrideAnnotation.COLUMN_PROPERTY, oldColumn, newColumn);
- }
-
- @Override
- public void update(CompilationUnit astRoot) {
- super.update(astRoot);
- if (this.columnAdapter.getAnnotation(astRoot) == null) {
- this.setColumn(null);
- }
- else {
- if (getColumn() != null) {
- getColumn().update(astRoot);
- }
- else {
- ColumnImpl column = ColumnImpl.createAttributeOverrideColumn(this, getMember(), getDeclarationAnnotationAdapter());
- column.initialize(astRoot);
- this.setColumn(column);
- }
- }
- }
-
- // ********** static methods **********
- static AttributeOverrideImpl createAttributeOverride(JavaResourceNode parent, Member member) {
- return new AttributeOverrideImpl(parent, member, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- static AttributeOverrideImpl createNestedAttributeOverride(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, attributeOverridesAdapter);
- IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa);
- return new AttributeOverrideImpl(parent, member, idaa, annotationAdapter);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
- return new NestedIndexedDeclarationAnnotationAdapter(attributeOverridesAdapter, index, JPA.ATTRIBUTE_OVERRIDE);
- }
-
- public static class AttributeOverrideAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final AttributeOverrideAnnotationDefinition 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 AttributeOverrideImpl.createAttributeOverride(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return AttributeOverrideAnnotation.ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverridesImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverridesImpl.java
deleted file mode 100644
index a92da07cb1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverridesImpl.java
+++ /dev/null
@@ -1,154 +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.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-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.AnnotationDefinition;
-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.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NestableAttributeOverride;
-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.iterators.CloneListIterator;
-
-public class AttributeOverridesImpl extends AbstractResourceAnnotation<Member> implements AttributeOverridesAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final List<NestableAttributeOverride> attributesOverrides;
-
- protected AttributeOverridesImpl(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.attributesOverrides = new ArrayList<NestableAttributeOverride>();
- }
-
- public void initialize(CompilationUnit astRoot) {
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public String getNestableAnnotationName() {
- return AttributeOverrideAnnotation.ANNOTATION_NAME;
- }
-
- public ListIterator<NestableAttributeOverride> nestedAnnotations() {
- return new CloneListIterator<NestableAttributeOverride>(this.attributesOverrides);
- }
-
- public int nestedAnnotationsSize() {
- return this.attributesOverrides.size();
- }
-
- public NestableAttributeOverride addInternal(int index) {
- NestableAttributeOverride attributeOverride = createAttributeOverride(index);
- this.attributesOverrides.add(index, attributeOverride);
- return attributeOverride;
- }
-
- public NestableAttributeOverride add(int index) {
- NestableAttributeOverride attributeOverride = createAttributeOverride(index);
- add(index, attributeOverride);
- return attributeOverride;
- }
-
- private void add(int index, NestableAttributeOverride attributeOverride) {
- addItemToList(index, attributeOverride, this.attributesOverrides, ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public void remove(NestableAttributeOverride attributeOverride) {
- removeItemFromList(attributeOverride, this.attributesOverrides, ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public void remove(int index) {
- removeItemFromList(index, this.attributesOverrides, ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public int indexOf(NestableAttributeOverride attributeOverride) {
- return this.attributesOverrides.indexOf(attributeOverride);
- }
-
- public NestableAttributeOverride nestedAnnotationAt(int index) {
- return this.attributesOverrides.get(index);
- }
-
- public NestableAttributeOverride nestedAnnotationFor(Annotation jdtAnnotation) {
- for (NestableAttributeOverride attributeOverride : this.attributesOverrides) {
- if (jdtAnnotation == attributeOverride.getJdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return attributeOverride;
- }
- }
- return null;
- }
-
- public void move(int targetIndex, int sourceIndex) {
- moveItemInList(targetIndex, sourceIndex, this.attributesOverrides, ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.attributesOverrides, targetIndex, sourceIndex);
- }
-
- public String getElementName() {
- return JPA.ATTRIBUTE_OVERRIDES__VALUE;
- }
-
- public void update(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this);
- }
-
- private AttributeOverrideImpl createAttributeOverride(int index) {
- return AttributeOverrideImpl.createNestedAttributeOverride(this, getMember(), index, getDeclarationAnnotationAdapter());
- }
-
-
- public static class AttributeOverridesAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final AttributeOverridesAnnotationDefinition 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 AttributeOverridesImpl(parent, member);
- }
-
- public AttributeOverridesAnnotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/BaseColumnImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/BaseColumnImpl.java
deleted file mode 100644
index f0ad392c0d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/BaseColumnImpl.java
+++ /dev/null
@@ -1,233 +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.resource.java;
-
-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;
-
-public abstract class BaseColumnImpl extends AbstractNamedColumn implements BaseColumnAnnotation
-{
- // hold this so we can get the 'table' text range
- private final DeclarationAnnotationElementAdapter<String> tableDeclarationAdapter;
-
- // hold this so we can get the 'unique' text range
- private final DeclarationAnnotationElementAdapter<Boolean> uniqueDeclarationAdapter;
-
- // hold this so we can get the 'nullable' text range
- private final DeclarationAnnotationElementAdapter<Boolean> nullableDeclarationAdapter;
-
- // hold this so we can get the 'insertable' text range
- private final DeclarationAnnotationElementAdapter<Boolean> insertableDeclarationAdapter;
-
- // hold this so we can get the 'updatable' text range
- private final DeclarationAnnotationElementAdapter<Boolean> updatableDeclarationAdapter;
-
- private final AnnotationElementAdapter<String> tableAdapter;
-
- private final AnnotationElementAdapter<Boolean> uniqueAdapter;
-
- private final AnnotationElementAdapter<Boolean> nullableAdapter;
-
- private final AnnotationElementAdapter<Boolean> insertableAdapter;
-
- private final AnnotationElementAdapter<Boolean> updatableAdapter;
-
- private String table;
- private Boolean unique;
- private Boolean nullable;
- private Boolean insertable;
- private Boolean updatable;
-
-
- public BaseColumnImpl(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- this(parent, member, daa, new MemberAnnotationAdapter(member, daa));
- }
-
- public BaseColumnImpl(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.table(astRoot);
- this.unique = this.unique(astRoot);
- this.nullable = this.nullable(astRoot);
- this.insertable = this.insertable(astRoot);
- this.updatable = this.updatable(astRoot);
- }
-
- protected abstract String getTableElementName();
-
- protected abstract String getUniqueElementName();
-
- protected abstract String getNullableElementName();
-
- protected abstract String getInsertableElementName();
-
- protected abstract String getUpdatableElementName();
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- BaseColumnAnnotation oldColumn = (BaseColumnAnnotation) oldAnnotation;
- setTable(oldColumn.getTable());
- setUnique(oldColumn.getUnique());
- setNullable(oldColumn.getNullable());
- setInsertable(oldColumn.getInsertable());
- setUpdatable(oldColumn.getUpdatable());
- }
-
- //************* AbstractColumn implementation *************
- public String getTable() {
- return this.table;
- }
-
- public void setTable(String newTable) {
- if (attributeValueHasNotChanged(this.table, newTable)) {
- return;
- }
- String oldTable = this.table;
- this.table = newTable;
- this.tableAdapter.setValue(newTable);
- firePropertyChanged(TABLE_PROPERTY, oldTable, newTable);
- }
-
- public Boolean getUnique() {
- return this.unique;
- }
-
- public void setUnique(Boolean newUnique) {
- if (attributeValueHasNotChanged(this.unique, newUnique)) {
- return;
- }
- Boolean oldUnique = this.unique;
- this.unique = newUnique;
- this.uniqueAdapter.setValue(newUnique);
- firePropertyChanged(UNIQUE_PROPERTY, oldUnique, newUnique);
- }
-
- public Boolean getNullable() {
- return this.nullable;
- }
-
- public void setNullable(Boolean newNullable) {
- if (attributeValueHasNotChanged(this.nullable, newNullable)) {
- return;
- }
- Boolean oldNullable = this.nullable;
- this.nullable = newNullable;
- this.nullableAdapter.setValue(newNullable);
- firePropertyChanged(NULLABLE_PROPERTY, oldNullable, newNullable);
- }
-
- public Boolean getInsertable() {
- return this.insertable;
- }
-
- public void setInsertable(Boolean newInsertable) {
- if (attributeValueHasNotChanged(this.insertable, newInsertable)) {
- return;
- }
- Boolean oldInsertable = this.insertable;
- this.insertable = newInsertable;
- this.insertableAdapter.setValue(newInsertable);
- firePropertyChanged(INSERTABLE_PROPERTY, oldInsertable, newInsertable);
- }
-
- public Boolean getUpdatable() {
- return this.updatable;
- }
-
- public void setUpdatable(Boolean newUpdatable) {
- if (attributeValueHasNotChanged(this.updatable, newUpdatable)) {
- return;
- }
- Boolean oldUpdatable = this.updatable;
- this.updatable = newUpdatable;
- this.updatableAdapter.setValue(newUpdatable);
- firePropertyChanged(UPDATABLE_PROPERTY, oldUpdatable, newUpdatable);
- }
-
- public TextRange getNullableTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nullableDeclarationAdapter, astRoot);
- }
-
- public TextRange getInsertableTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.insertableDeclarationAdapter, astRoot);
- }
-
- public TextRange getUniqueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.uniqueDeclarationAdapter, astRoot);
- }
-
- public TextRange getUpdatableTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.updatableDeclarationAdapter, 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);
- }
-
-
- @Override
- public void update(CompilationUnit astRoot) {
- super.update(astRoot);
- this.setTable(this.table(astRoot));
- this.setUnique(this.unique(astRoot));
- this.setNullable(this.nullable(astRoot));
- this.setInsertable(this.insertable(astRoot));
- this.setUpdatable(this.updatable(astRoot));
- }
-
- protected String table(CompilationUnit astRoot) {
- return this.tableAdapter.getValue(astRoot);
- }
-
- protected Boolean unique(CompilationUnit astRoot) {
- return this.uniqueAdapter.getValue(astRoot);
- }
-
- protected Boolean nullable(CompilationUnit astRoot) {
- return this.nullableAdapter.getValue(astRoot);
- }
-
- protected Boolean insertable(CompilationUnit astRoot) {
- return this.insertableAdapter.getValue(astRoot);
- }
-
- protected Boolean updatable(CompilationUnit astRoot) {
- return this.updatableAdapter.getValue(astRoot);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/BasicImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/BasicImpl.java
deleted file mode 100644
index 4dd4337b0f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/BasicImpl.java
+++ /dev/null
@@ -1,155 +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.resource.java;
-
-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.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-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.FetchType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-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.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;
-
-
-public class BasicImpl extends AbstractResourceAnnotation<Attribute> implements BasicAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final AnnotationElementAdapter<Boolean> optionalAdapter;
-
- private final AnnotationElementAdapter<String> fetchAdapter;
-
- private static final DeclarationAnnotationElementAdapter<Boolean> OPTIONAL_ADAPTER = buildOptionalAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter();
-
- private Boolean optional;
-
- private FetchType fetch;
-
- protected BasicImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.optionalAdapter = new ShortCircuitAnnotationElementAdapter<Boolean>(attribute, OPTIONAL_ADAPTER);
- this.fetchAdapter = new ShortCircuitAnnotationElementAdapter<String>(attribute, FETCH_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.optional = this.optional(astRoot);
- this.fetch = this.fetch(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- //*************** Basic implementation ****************
- public Boolean getOptional() {
- return this.optional;
- }
-
- public void setOptional(Boolean newOptional) {
- if (attributeValueHasNotChanged(this.optional, newOptional)) {
- return;
- }
- Boolean oldOptional = this.optional;
- this.optional = newOptional;
- this.optionalAdapter.setValue(newOptional);
- firePropertyChanged(OPTIONAL_PROPERTY, oldOptional, newOptional);
- }
-
- public FetchType getFetch() {
- return this.fetch;
- }
-
- public void setFetch(FetchType newFetch) {
- if (attributeValueHasNotChanged(this.fetch, newFetch)) {
- return;
- }
- FetchType oldFetch = this.fetch;
- this.fetch = newFetch;
- this.fetchAdapter.setValue(FetchType.toJavaAnnotationValue(newFetch));
- firePropertyChanged(FETCH_PROPERTY, oldFetch, newFetch);
- }
-
- public TextRange getFetchTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(FETCH_ADAPTER, astRoot);
- }
-
- public TextRange getOptionalTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(OPTIONAL_ADAPTER, astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setOptional(this.optional(astRoot));
- this.setFetch(this.fetch(astRoot));
- }
-
- protected FetchType fetch(CompilationUnit astRoot) {
- return FetchType.fromJavaAnnotationValue(this.fetchAdapter.getValue(astRoot));
- }
-
- protected Boolean optional(CompilationUnit astRoot) {
- return this.optionalAdapter.getValue(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);
- }
-
- public static class BasicAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final BasicAnnotationDefinition INSTANCE = new BasicAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static BasicAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private BasicAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new BasicImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullBasic(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ColumnImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ColumnImpl.java
deleted file mode 100644
index f275b53e33..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ColumnImpl.java
+++ /dev/null
@@ -1,242 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-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.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-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.JavaResourcePersistentMember;
-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.Member;
-
-public class ColumnImpl extends BaseColumnImpl implements ColumnAnnotation, NestableAnnotation
-{
- // 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);
-
- // hold this so we can get the 'length' text range
- private final DeclarationAnnotationElementAdapter<Integer> lengthDeclarationAdapter;
-
- // hold this so we can get the 'precision' text range
- private final DeclarationAnnotationElementAdapter<Integer> precisionDeclarationAdapter;
-
- // hold this so we can get the 'scale' text range
- private final DeclarationAnnotationElementAdapter<Integer> scaleDeclarationAdapter;
-
- private final AnnotationElementAdapter<Integer> lengthAdapter;
-
- private final AnnotationElementAdapter<Integer> precisionAdapter;
-
- private final AnnotationElementAdapter<Integer> scaleAdapter;
-
- private Integer length;
-
- private Integer precision;
-
- private Integer scale;
-
- public ColumnImpl(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- super(parent, member, daa);
- this.lengthDeclarationAdapter = this.buildIntegerElementAdapter(JPA.COLUMN__LENGTH);
- this.lengthAdapter = this.buildShortCircuitIntegerElementAdapter(this.lengthDeclarationAdapter);
- this.precisionDeclarationAdapter = this.buildIntegerElementAdapter(JPA.COLUMN__PRECISION);
- this.precisionAdapter = this.buildShortCircuitIntegerElementAdapter(this.precisionDeclarationAdapter);
- this.scaleDeclarationAdapter = this.buildIntegerElementAdapter(JPA.COLUMN__SCALE);
- this.scaleAdapter = this.buildShortCircuitIntegerElementAdapter(this.scaleDeclarationAdapter);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.length = this.length(astRoot);
- this.precision = this.precision(astRoot);
- this.scale = this.scale(astRoot);
- }
-
- @Override
- protected String getNameElementName() {
- return JPA.COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA.COLUMN__COLUMN_DEFINITION;
- }
-
- @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;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void moveAnnotation(int newIndex) {
- //TODO move makes no sense for Column. maybe NestableAnnotation
- //needs to be split up and we could have IndexableAnnotation
- }
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- ColumnAnnotation oldColumn = (ColumnAnnotation) oldAnnotation;
- setLength(oldColumn.getLength());
- setPrecision(oldColumn.getPrecision());
- setScale(oldColumn.getScale());
- }
-
- //************** Column implementation **************
- public Integer getLength() {
- return this.length;
- }
-
- public void setLength(Integer newLength) {
- if (attributeValueHasNotChanged(this.length, newLength)) {
- return;
- }
- Integer oldLength = this.length;
- this.length = newLength;
- this.lengthAdapter.setValue(newLength);
- firePropertyChanged(LENGTH_PROPERTY, oldLength, newLength);
- }
-
- public Integer getPrecision() {
- return this.precision;
- }
-
- public void setPrecision(Integer newPrecision) {
- if (attributeValueHasNotChanged(this.precision, newPrecision)) {
- return;
- }
- Integer oldPrecision = this.precision;
- this.precision = newPrecision;
- this.precisionAdapter.setValue(newPrecision);
- firePropertyChanged(PRECISION_PROPERTY, oldPrecision, newPrecision);
- }
-
- public Integer getScale() {
- return this.scale;
- }
-
- public void setScale(Integer newScale) {
- if (attributeValueHasNotChanged(this.scale, newScale)) {
- return;
- }
- Integer oldScale = this.scale;
- this.scale = newScale;
- this.scaleAdapter.setValue(newScale);
- firePropertyChanged(SCALE_PROPERTY, oldScale, newScale);
- }
-
- public TextRange getLengthTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.lengthDeclarationAdapter, astRoot);
- }
-
- public TextRange getPrecisionTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.precisionDeclarationAdapter, astRoot);
- }
-
- public TextRange getScaleTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.scaleDeclarationAdapter, astRoot);
- }
-
- @Override
- public void update(CompilationUnit astRoot) {
- super.update(astRoot);
- this.setLength(this.length(astRoot));
- this.setPrecision(this.precision(astRoot));
- this.setScale(this.scale(astRoot));
- }
-
- protected Integer length(CompilationUnit astRoot) {
- return this.lengthAdapter.getValue(astRoot);
- }
-
- protected Integer precision(CompilationUnit astRoot) {
- return this.precisionAdapter.getValue(astRoot);
- }
-
- protected Integer scale(CompilationUnit astRoot) {
- return this.scaleAdapter.getValue(astRoot);
- }
-
- // ********** static methods **********
-
- static ColumnImpl createAttributeOverrideColumn(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter attributeOverrideAnnotationAdapter) {
- return new ColumnImpl(parent, member, buildAttributeOverrideAnnotationAdapter(attributeOverrideAnnotationAdapter));
- }
-
- static DeclarationAnnotationAdapter buildAttributeOverrideAnnotationAdapter(DeclarationAnnotationAdapter attributeOverrideAnnotationAdapter) {
- return new NestedDeclarationAnnotationAdapter(attributeOverrideAnnotationAdapter, JPA.ATTRIBUTE_OVERRIDE__COLUMN, JPA.COLUMN);
- }
-
- public static class ColumnAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final ColumnAnnotationDefinition 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 ColumnImpl(parent, member, ColumnImpl.MAPPING_DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullColumn(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ContainerAnnotationTools.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ContainerAnnotationTools.java
deleted file mode 100644
index 4d9dff0812..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ContainerAnnotationTools.java
+++ /dev/null
@@ -1,214 +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.resource.java;
-
-import java.util.List;
-
-import org.eclipse.jdt.core.dom.ASTVisitor;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.JDTTools;
-import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-public class ContainerAnnotationTools
-{
-
- public static NestableAnnotation addNestedAnnotation(int index, ContainerAnnotation<? extends NestableAnnotation> containerAnnotation) {
- int size = containerAnnotation.nestedAnnotationsSize();
- NestableAnnotation nestedAnnotation = containerAnnotation.addInternal(size);
- nestedAnnotation.newAnnotation();
- containerAnnotation.moveInternal(index, size);
- synchAnnotationsAfterMove(index, size, containerAnnotation);
- return nestedAnnotation;
- }
-
- /**
- * synchronize the source annotations with the model nestableAnnotations,
- * starting at the end of the list to prevent overlap
- */
- public static void synchAnnotationsAfterAdd(int index, ContainerAnnotation<? extends NestableAnnotation> containerAnnotation) {
- List<NestableAnnotation> nestableAnnotations = CollectionTools.list(containerAnnotation.nestedAnnotations());
- for (int i = nestableAnnotations.size(); i-- > index;) {
- synch(nestableAnnotations.get(i), i);
- }
- }
-
- /**
- * synchronize the source annotations with the model nestableAnnotations,
- * starting at the specified index to prevent overlap
- */
- public static void synchAnnotationsAfterRemove(int index, ContainerAnnotation<? extends NestableAnnotation> pluralAnnotation) {
- List<NestableAnnotation> nestableAnnotations = CollectionTools.list(pluralAnnotation.nestedAnnotations());
- for (int i = index; i < nestableAnnotations.size(); i++) {
- synch(nestableAnnotations.get(i), i);
- }
- }
-
- private static void synch(NestableAnnotation nestableAnnotation, int index) {
- nestableAnnotation.moveAnnotation(index);
- }
-
- /**
- * synchronize the annotations with the model nestableAnnotations
- */
- public static void synchAnnotationsAfterMove(int targetIndex, int sourceIndex, ContainerAnnotation<? extends NestableAnnotation> containerAnnotation) {
- NestableAnnotation nestableAnnotation = containerAnnotation.nestedAnnotationAt(targetIndex);
-
- synch(nestableAnnotation, containerAnnotation.nestedAnnotationsSize());
-
- List<NestableAnnotation> nestableAnnotations = CollectionTools.list(containerAnnotation.nestedAnnotations());
- if (sourceIndex < targetIndex) {
- for (int i = sourceIndex; i < targetIndex; i++) {
- synch(nestableAnnotations.get(i), i);
- }
- }
- else {
- for (int i = sourceIndex; i > targetIndex; i-- ) {
- synch(nestableAnnotations.get(i), i);
- }
- }
- synch(nestableAnnotation, targetIndex);
- }
-
-
- public static void initializeNestedAnnotations(CompilationUnit astRoot, ContainerAnnotation<?> containerAnnotation) {
- addAnnotationsFromSource(astRoot, containerAnnotation);
- }
-
- private static void addAnnotationsFromSource(CompilationUnit astRoot, ContainerAnnotation<? extends NestableAnnotation> containerAnnotation) {
- containerAnnotation.getJdtAnnotation(astRoot).accept(buildInitialAnnotationVisitor(astRoot, containerAnnotation));
- }
-
- private static ASTVisitor buildInitialAnnotationVisitor(CompilationUnit astRoot, ContainerAnnotation<? extends NestableAnnotation> containerAnnotation) {
- return new InitialAnnotationVisitor(astRoot, containerAnnotation);
- }
-
- public static void updateNestedAnnotationsFromJava(CompilationUnit astRoot, ContainerAnnotation<? extends NestableAnnotation> containerAnnotation) {
- addOrUpdateAnnotationInSource(astRoot, containerAnnotation);
- //TODO not sure how to handle generics here and get rid of this warning
- removeAnnotationsNotInSource(astRoot, (ContainerAnnotation<NestableAnnotation>) containerAnnotation);
- }
-
- private static void addOrUpdateAnnotationInSource(CompilationUnit astRoot, ContainerAnnotation<? extends NestableAnnotation> containerAnnotation) {
- containerAnnotation.getJdtAnnotation(astRoot).accept(buildUpdateAnnotationVisitor(astRoot, containerAnnotation));
- }
-
- private static void removeAnnotationsNotInSource(CompilationUnit astRoot, ContainerAnnotation<NestableAnnotation> containerAnnotation) {
- for (NestableAnnotation annotation : CollectionTools.iterable(containerAnnotation.nestedAnnotations())) {
- if (annotation.getJdtAnnotation(astRoot) == null) {
- containerAnnotation.remove(annotation);
- }
- }
- }
-
- private static ASTVisitor buildUpdateAnnotationVisitor(CompilationUnit astRoot, ContainerAnnotation<? extends NestableAnnotation> containerAnnotation) {
- return new UpdateAnnotationVisitor(astRoot, containerAnnotation);
- }
-
- private ContainerAnnotationTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-
- // ********** annotation visitor **********
-
- /**
- * Only visit the member value pair for the container annotation's element name.
- */
- private abstract static class AnnotationVisitor extends ASTVisitor {
- protected final CompilationUnit astRoot;
- protected final ContainerAnnotation<? extends NestableAnnotation> containerAnnotation;
-
- AnnotationVisitor(CompilationUnit astRoot, ContainerAnnotation<? extends NestableAnnotation> containerAnnotation) {
- this.astRoot = astRoot;
- this.containerAnnotation = containerAnnotation;
- }
-
- @Override
- public boolean visit(MemberValuePair node) {
- return node.getName().getFullyQualifiedName().equals(this.containerAnnotation.getElementName());
- }
-
- @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) {
- String jdtAnnotationName = JDTTools.resolveAnnotation(node);
- if (this.containerAnnotation.getAnnotationName().equals(jdtAnnotationName)) {
- return true;
- }
- if (this.containerAnnotation.getNestableAnnotationName().equals(jdtAnnotationName)) {
- this.visitNestedAnnotation(node);
- }
- return false;
- }
-
- protected abstract void visitNestedAnnotation(org.eclipse.jdt.core.dom.Annotation node);
-
- }
-
-
- // ********** initial annotation visitor **********
-
- private static class InitialAnnotationVisitor extends AnnotationVisitor {
-
- InitialAnnotationVisitor(CompilationUnit astRoot, ContainerAnnotation<? extends NestableAnnotation> containerAnnotation) {
- super(astRoot, containerAnnotation);
- }
-
- @Override
- protected void visitNestedAnnotation(org.eclipse.jdt.core.dom.Annotation node) {
- NestableAnnotation nestedAnnotation = this.containerAnnotation.addInternal(this.containerAnnotation.nestedAnnotationsSize());
- nestedAnnotation.initialize(this.astRoot);
- }
-
- }
-
-
- // ********** update annotation visitor **********
-
- private static class UpdateAnnotationVisitor extends AnnotationVisitor {
-
- UpdateAnnotationVisitor(CompilationUnit astRoot, ContainerAnnotation<? extends NestableAnnotation> containerAnnotation) {
- super(astRoot, containerAnnotation);
- }
-
- @Override
- protected void visitNestedAnnotation(org.eclipse.jdt.core.dom.Annotation node) {
- NestableAnnotation nestedAnnotation = this.containerAnnotation.nestedAnnotationFor(node);
- if (nestedAnnotation == null) {
- nestedAnnotation = this.containerAnnotation.add(this.containerAnnotation.nestedAnnotationsSize());
- nestedAnnotation.initialize(this.astRoot);
- } else {
- nestedAnnotation.update(this.astRoot);
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorColumnImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorColumnImpl.java
deleted file mode 100644
index 8d11554af8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorColumnImpl.java
+++ /dev/null
@@ -1,168 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-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.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-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.DiscriminatorType;
-import org.eclipse.jpt.core.resource.java.JPA;
-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.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;
-
-public class DiscriminatorColumnImpl extends AbstractNamedColumn implements DiscriminatorColumnAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> DISCRIMINATOR_TYPE_ADAPTER = buildDiscriminatorTypeAdapter();
-
- // hold this so we can get the 'length' text range
- private final DeclarationAnnotationElementAdapter<Integer> lengthDeclarationAdapter;
-
- private final AnnotationElementAdapter<String> discriminatorTypeAdapter;
-
- private final AnnotationElementAdapter<Integer> lengthAdapter;
-
- private DiscriminatorType discriminatorType;
-
- private Integer length;
-
- protected DiscriminatorColumnImpl(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- super(parent, member, daa, new MemberAnnotationAdapter(member, daa));
- this.discriminatorTypeAdapter = new ShortCircuitAnnotationElementAdapter<String>(member, DISCRIMINATOR_TYPE_ADAPTER);
- this.lengthDeclarationAdapter = this.buildIntegerElementAdapter(JPA.DISCRIMINATOR_COLUMN__LENGTH);
- this.lengthAdapter = this.buildShortCircuitIntegerElementAdapter(this.lengthDeclarationAdapter);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.discriminatorType = this.discriminatorType(astRoot);
- this.length = this.length(astRoot);
- }
-
- @Override
- protected String getNameElementName() {
- return JPA.DISCRIMINATOR_COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA.DISCRIMINATOR_COLUMN__COLUMN_DEFINITION;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void moveAnnotation(int newIndex) {
- //TODO move makes no sense for DiscriminatorColumn. maybe NestableAnnotation
- //needs to be split up and we could have IndexableAnnotation
- }
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- DiscriminatorColumnAnnotation oldColumn = (DiscriminatorColumnAnnotation) oldAnnotation;
- setLength(oldColumn.getLength());
- setDiscriminatorType(oldColumn.getDiscriminatorType());
- }
-
- public DiscriminatorType getDiscriminatorType() {
- return this.discriminatorType;
- }
-
- public void setDiscriminatorType(DiscriminatorType newDiscriminatorType) {
- if (attributeValueHasNotChanged(this.discriminatorType, newDiscriminatorType)) {
- return;
- }
- DiscriminatorType oldDiscriminatorType = this.discriminatorType;
- this.discriminatorType = newDiscriminatorType;
- this.discriminatorTypeAdapter.setValue(DiscriminatorType.toJavaAnnotationValue(newDiscriminatorType));
- firePropertyChanged(DISCRIMINATOR_TYPE_PROPERTY, oldDiscriminatorType, newDiscriminatorType);
- }
-
- public Integer getLength() {
- return this.length;
- }
-
- public void setLength(Integer newLength) {
- if (attributeValueHasNotChanged(this.length, newLength)) {
- return;
- }
- Integer oldLength = this.length;
- this.length = newLength;
- this.lengthAdapter.setValue(newLength);
- firePropertyChanged(LENGTH_PROPERTY, oldLength, newLength);
- }
-
- @Override
- public void update(CompilationUnit astRoot) {
- super.update(astRoot);
- this.setLength(this.length(astRoot));
- this.setDiscriminatorType(this.discriminatorType(astRoot));
- }
-
- protected Integer length(CompilationUnit astRoot) {
- return this.lengthAdapter.getValue(astRoot);
- }
-
- protected DiscriminatorType discriminatorType(CompilationUnit astRoot) {
- return DiscriminatorType.fromJavaAnnotationValue(this.discriminatorTypeAdapter.getValue(astRoot));
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<String> buildDiscriminatorTypeAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE);
- }
-
- public static class DiscriminatorColumnAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final DiscriminatorColumnAnnotationDefinition 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 DiscriminatorColumnImpl(parent, member, DiscriminatorColumnImpl.DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullDiscriminatorColumn(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorValueImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorValueImpl.java
deleted file mode 100644
index 011d122a7f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorValueImpl.java
+++ /dev/null
@@ -1,115 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-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.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-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.core.utility.jdt.Type;
-
-public class DiscriminatorValueImpl extends AbstractResourceAnnotation<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;
-
- protected DiscriminatorValueImpl(JavaResourceNode parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new ShortCircuitAnnotationElementAdapter<String>(type, VALUE_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.value(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String newValue) {
- if (attributeValueHasNotChanged(this.value, newValue)) {
- return;
- }
- String oldValue = this.value;
- this.value = newValue;
- this.valueAdapter.setValue(newValue);
- firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setValue(this.value(astRoot));
- }
-
- protected String value(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.DISCRIMINATOR_VALUE__VALUE);
- }
-
-
- public static class DiscriminatorValueAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final DiscriminatorValueAnnotationDefinition 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 DiscriminatorValueImpl(parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullDiscriminatorValue(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddableImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddableImpl.java
deleted file mode 100644
index 4290cbd379..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddableImpl.java
+++ /dev/null
@@ -1,76 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-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.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-
-public class EmbeddableImpl extends AbstractResourceAnnotation<Type> implements EmbeddableAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- protected EmbeddableImpl(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void update(CompilationUnit astRoot) {
- //no annotation members
- }
-
-
- public static class EmbeddableAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final EmbeddableAnnotationDefinition INSTANCE = new EmbeddableAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static EmbeddableAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EmbeddableAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new EmbeddableImpl((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedIdImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedIdImpl.java
deleted file mode 100644
index 39257f4576..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedIdImpl.java
+++ /dev/null
@@ -1,75 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-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.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-public class EmbeddedIdImpl extends AbstractResourceAnnotation<Attribute> implements EmbeddedIdAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- protected EmbeddedIdImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void update(CompilationUnit astRoot) {
- //no annotation members
- }
-
-
- public static class EmbeddedIdAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final EmbeddedIdAnnotationDefinition INSTANCE = new EmbeddedIdAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static EmbeddedIdAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EmbeddedIdAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new EmbeddedIdImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedImpl.java
deleted file mode 100644
index 7d198c77a0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedImpl.java
+++ /dev/null
@@ -1,75 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-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.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-
-public class EmbeddedImpl extends AbstractResourceAnnotation<Attribute> implements EmbeddedAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- protected EmbeddedImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void update(CompilationUnit astRoot) {
- //no annotation members
- }
-
- public static class EmbeddedAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final EmbeddedAnnotationDefinition INSTANCE = new EmbeddedAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static EmbeddedAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EmbeddedAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new EmbeddedImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullEmbedded(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EntityImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EntityImpl.java
deleted file mode 100644
index c716307cd5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EntityImpl.java
+++ /dev/null
@@ -1,125 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-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.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-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;
-
-
-public class EntityImpl extends AbstractResourceAnnotation<Type> implements EntityAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final AnnotationElementAdapter<String> nameAdapter;
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildNameAdapter();
-
- private String name;
-
- protected EntityImpl(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.nameAdapter = new ShortCircuitAnnotationElementAdapter<String>(getMember(), NAME_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.name(astRoot);
- }
-
- //*********** Annotation implementation ****************
- public String getAnnotationName() {
- return EntityAnnotation.ANNOTATION_NAME;
- }
-
- //*********** Entity implementation ****************
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- if (attributeValueHasNotChanged(this.name, newName)) {
- return;
- }
- String oldName = this.name;
- this.name = newName;
- this.nameAdapter.setValue(newName);
- firePropertyChanged(EntityAnnotation.NAME_PROPERTY, oldName, newName);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(NAME_ADAPTER, astRoot);
- }
-
- //*********** JavaResource implementation ****************
- public void update(CompilationUnit astRoot) {
- this.setName(this.name(astRoot));
- }
-
- protected String name(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
- //*********** static methods ****************
- private static DeclarationAnnotationElementAdapter<String> buildNameAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.ENTITY__NAME, false); // false = do not remove annotation when empty
- }
-
-
- public static class EntityAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final EntityAnnotationDefinition INSTANCE = new EntityAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static EntityAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EntityAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new EntityImpl((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
-
- public String getAnnotationName() {
- return EntityAnnotation.ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EnumeratedImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EnumeratedImpl.java
deleted file mode 100644
index 4e32305bec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EnumeratedImpl.java
+++ /dev/null
@@ -1,116 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.EnumType;
-import org.eclipse.jpt.core.resource.java.EnumeratedAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-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.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;
-
-public class EnumeratedImpl extends AbstractResourceAnnotation<Attribute> implements EnumeratedAnnotation
-{
-
- 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 EnumType value;
-
- protected EnumeratedImpl(JavaResourceNode parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new ShortCircuitAnnotationElementAdapter<String>(attribute, VALUE_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.value(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public EnumType getValue() {
- return this.value;
- }
-
- public void setValue(EnumType newValue) {
- if (attributeValueHasNotChanged(this.value, newValue)) {
- return;
- }
- EnumType oldValue = this.value;
- this.value = newValue;
- this.valueAdapter.setValue(EnumType.toJavaAnnotationValue(newValue));
- firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setValue(this.value(astRoot));
- }
-
- protected EnumType value(CompilationUnit astRoot) {
- return EnumType.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot));
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ENUMERATED__VALUE, false);
- }
-
- public static class EnumeratedAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final EnumeratedAnnotationDefinition 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 EnumeratedImpl(parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullEnumerated(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/GeneratedValueImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/GeneratedValueImpl.java
deleted file mode 100644
index c160ec212a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/GeneratedValueImpl.java
+++ /dev/null
@@ -1,152 +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.resource.java;
-
-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.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-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.GenerationType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-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;
-
-public class GeneratedValueImpl extends AbstractResourceAnnotation<Member> implements GeneratedValueAnnotation
-{
- private final AnnotationElementAdapter<String> strategyAdapter;
-
- private final AnnotationElementAdapter<String> generatorAdapter;
-
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> STRATEGY_ADAPTER = buildStrategyAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> GENERATOR_ADAPTER = buildGeneratorAdapter();
-
- private GenerationType strategy;
-
- private String generator;
-
-
- protected GeneratedValueImpl(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.strategyAdapter = new ShortCircuitAnnotationElementAdapter<String>(member, STRATEGY_ADAPTER);
- this.generatorAdapter = new ShortCircuitAnnotationElementAdapter<String>(member, GENERATOR_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.strategy = this.strategy(astRoot);
- this.generator = this.generator(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public GenerationType getStrategy() {
- return this.strategy;
- }
-
- public void setStrategy(GenerationType newStrategy) {
- if (attributeValueHasNotChanged(this.strategy, newStrategy)) {
- return;
- }
- GenerationType oldStrategy = this.strategy;
- this.strategy = newStrategy;
- this.strategyAdapter.setValue(GenerationType.toJavaAnnotationValue(newStrategy));
- firePropertyChanged(STRATEGY_PROPERTY, oldStrategy, newStrategy);
- }
-
- public String getGenerator() {
- return this.generator;
- }
-
- public void setGenerator(String newGenerator) {
- if (attributeValueHasNotChanged(this.generator, newGenerator)) {
- return;
- }
- String oldGenerator = this.generator;
- this.generator = newGenerator;
- this.generatorAdapter.setValue(newGenerator);
- firePropertyChanged(GENERATOR_PROPERTY, oldGenerator, newGenerator);
- }
-
- public TextRange getStrategyTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(STRATEGY_ADAPTER, astRoot);
- }
-
- public TextRange getGeneratorTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(GENERATOR_ADAPTER, astRoot);
- }
-
- // ********** java annotations -> persistence model **********
- public void update(CompilationUnit astRoot) {
- this.setStrategy(this.strategy(astRoot));
- this.setGenerator(this.generator(astRoot));
- }
-
- protected GenerationType strategy(CompilationUnit astRoot) {
- return GenerationType.fromJavaAnnotationValue(this.strategyAdapter.getValue(astRoot));
- }
-
- protected String generator(CompilationUnit astRoot) {
- return this.generatorAdapter.getValue(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);
- }
-
- public static class GeneratedValueAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final GeneratedValueAnnotationDefinition 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 GeneratedValueImpl(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/GeneratorImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/GeneratorImpl.java
deleted file mode 100644
index a28a2bb3c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/GeneratorImpl.java
+++ /dev/null
@@ -1,168 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NumberIntegerExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-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;
-
-public abstract class GeneratorImpl
- extends AbstractResourceAnnotation<Member>
- implements GeneratorAnnotation
-{
- // hold this so we can get the 'name' text range
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
-
- // hold this so we can get the 'initialValue' text range
- private final DeclarationAnnotationElementAdapter<Integer> initialValueDeclarationAdapter;
-
- // hold this so we can get the 'allocationSize' text range
- private final DeclarationAnnotationElementAdapter<Integer> allocationSizeDeclarationAdapter;
-
- private final AnnotationElementAdapter<String> nameAdapter;
-
- private final AnnotationElementAdapter<Integer> initialValueAdapter;
-
- private final AnnotationElementAdapter<Integer> allocationSizeAdapter;
-
- private String name;
-
- private Integer initialValue;
-
- private Integer allocationSize;
-
- public GeneratorImpl(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);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.name(astRoot);
- this.initialValue = this.initialValue(astRoot);
- this.allocationSize = this.allocationSize(astRoot);
- }
-
- // ********** initialization **********
- protected AnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new ShortCircuitAnnotationElementAdapter<String>(getMember(), daea);
- }
-
- protected AnnotationElementAdapter<Integer> buildIntegerAdapter(DeclarationAnnotationElementAdapter<Integer> daea) {
- return new ShortCircuitAnnotationElementAdapter<Integer>(getMember(), daea);
- }
-
- protected abstract DeclarationAnnotationElementAdapter<String> getNameAdapter();
-
- protected abstract DeclarationAnnotationElementAdapter<Integer> getInitialValueAdapter();
-
- protected abstract DeclarationAnnotationElementAdapter<Integer> getAllocationSizeAdapter();
-
-
-
- public Integer getAllocationSize() {
- return this.allocationSize;
- }
-
- public void setAllocationSize(Integer newAllocationSize) {
- if (attributeValueHasNotChanged(this.allocationSize, newAllocationSize)) {
- return;
- }
- Integer oldAllocationSize = this.allocationSize;
- this.allocationSize = newAllocationSize;
- this.allocationSizeAdapter.setValue(newAllocationSize);
- firePropertyChanged(ALLOCATION_SIZE_PROPERTY, oldAllocationSize, newAllocationSize);
- }
-
- public Integer getInitialValue() {
- return this.initialValue;
- }
-
- public void setInitialValue(Integer newInitialValue) {
- if (attributeValueHasNotChanged(this.initialValue, newInitialValue)) {
- return;
- }
- Integer oldInitialValue = this.initialValue;
- this.initialValue = newInitialValue;
- this.initialValueAdapter.setValue(newInitialValue);
- firePropertyChanged(INITIAL_VALUE_PROPERTY, oldInitialValue, newInitialValue);
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- if (attributeValueHasNotChanged(this.name, newName)) {
- return;
- }
- String oldName = this.name;
- this.name = newName;
- this.nameAdapter.setValue(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public TextRange getInitialValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.initialValueDeclarationAdapter, astRoot);
- }
-
- public TextRange getAllocationSizeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.allocationSizeDeclarationAdapter, astRoot);
- }
-
- // ********** java annotations -> persistence model **********
- public void update(CompilationUnit astRoot) {
- this.setName(this.name(astRoot));
- this.setAllocationSize(this.allocationSize(astRoot));
- this.setInitialValue(this.initialValue(astRoot));
- }
-
- protected String name(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- protected Integer allocationSize(CompilationUnit astRoot) {
- return this.allocationSizeAdapter.getValue(astRoot);
- }
-
- protected Integer initialValue(CompilationUnit astRoot) {
- return this.initialValueAdapter.getValue(astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
- // ********** static methods **********
- protected static DeclarationAnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(annotationAdapter, elementName);
- }
-
- protected 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/IdClassImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdClassImpl.java
deleted file mode 100644
index bb64600347..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdClassImpl.java
+++ /dev/null
@@ -1,139 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.JDTTools;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-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.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.IdClassAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-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.core.utility.jdt.Type;
-
-public class IdClassImpl extends AbstractResourceAnnotation<Type> implements IdClassAnnotation
-{
- private final AnnotationElementAdapter<String> valueAdapter;
-
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
-
- private String value;
-
- private String fullyQualifiedValue;
-
- public IdClassImpl(JavaResourceNode parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new ShortCircuitAnnotationElementAdapter<String>(type, VALUE_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.value(astRoot);
- this.fullyQualifiedValue = fullyQualifiedClass(astRoot);
- }
-
- public String getAnnotationName() {
- return IdClassAnnotation.ANNOTATION_NAME;
- }
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String newValue) {
- if (attributeValueHasNotChanged(this.value, newValue)) {
- return;
- }
- String oldValue = this.value;
- this.value = newValue;
- this.valueAdapter.setValue(newValue);
- firePropertyChanged(IdClassAnnotation.VALUE_PROPERTY, oldValue, newValue);
- }
-
- public String getFullyQualifiedClass() {
- return this.fullyQualifiedValue;
- }
-
- private void setFullyQualifiedClass(String newQualifiedClass) {
- String oldQualifiedClass = this.fullyQualifiedValue;
- this.fullyQualifiedValue = newQualifiedClass;
- firePropertyChanged(IdClassAnnotation.FULLY_QUALIFIED_CLASS_PROPERTY, oldQualifiedClass, newQualifiedClass);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setValue(this.value(astRoot));
- this.setFullyQualifiedClass(this.fullyQualifiedClass(astRoot));
- }
-
- protected String value(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- private String fullyQualifiedClass(CompilationUnit astRoot) {
- if (getValue() == null) {
- return null;
- }
- return JDTTools.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());
- }
-
-
- public static class IdClassAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final IdClassAnnotationDefinition 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 IdClassImpl(parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdImpl.java
deleted file mode 100644
index 31dde60793..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdImpl.java
+++ /dev/null
@@ -1,77 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-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.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-
-public class IdImpl extends AbstractResourceAnnotation<Attribute> implements IdAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- protected IdImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void update(CompilationUnit astRoot) {
- //no annotation members
- }
-
- public static class IdAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final IdAnnotationDefinition INSTANCE = new IdAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static IdAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private IdAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new IdImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/InheritanceImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/InheritanceImpl.java
deleted file mode 100644
index 47fd924bbf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/InheritanceImpl.java
+++ /dev/null
@@ -1,115 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-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.InheritanceType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-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.core.utility.jdt.Type;
-
-public class InheritanceImpl extends AbstractResourceAnnotation<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;
-
- protected InheritanceImpl(JavaResourceNode parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.strategyAdapter = new ShortCircuitAnnotationElementAdapter<String>(type, STRATEGY_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.strategy = this.strategy(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public InheritanceType getStrategy() {
- return this.strategy;
- }
-
- public void setStrategy(InheritanceType newStrategy) {
- if (attributeValueHasNotChanged(this.strategy, newStrategy)) {
- return;
- }
- InheritanceType oldStrategy = this.strategy;
- this.strategy = newStrategy;
- this.strategyAdapter.setValue(InheritanceType.toJavaAnnotationValue(newStrategy));
- firePropertyChanged(STRATEGY_PROPERTY, oldStrategy, newStrategy);
- }
-
- public TextRange getStrategyTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(STRATEGY_ADAPTER, astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setStrategy(this.strategy(astRoot));
- }
-
- protected InheritanceType strategy(CompilationUnit astRoot) {
- return InheritanceType.fromJavaAnnotationValue(this.strategyAdapter.getValue(astRoot));
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<String> buildStrategyAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.INHERITANCE__STRATEGY);
- }
-
- public static class InheritanceAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final InheritanceAnnotationDefinition 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 InheritanceImpl(parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullInheritance(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JavaResourcePersistentAttributeImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JavaResourcePersistentAttributeImpl.java
deleted file mode 100644
index 5ff6e77793..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JavaResourcePersistentAttributeImpl.java
+++ /dev/null
@@ -1,553 +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.resource.java;
-
-import java.util.ListIterator;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.IBinding;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jdt.core.dom.Modifier;
-import org.eclipse.jpt.core.internal.utility.jdt.JDTFieldAttribute;
-import org.eclipse.jpt.core.internal.utility.jdt.JDTMethodAttribute;
-import org.eclipse.jpt.core.internal.utility.jdt.JDTTools;
-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.resource.java.JpaCompilationUnit;
-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.CollectionTools;
-
-/**
- *
- */
-public class JavaResourcePersistentAttributeImpl
- extends AbstractJavaResourcePersistentMember<Attribute>
- implements JavaResourcePersistentAttribute
-{
-
- private boolean typeIsBasic;
-
- private String qualifiedTypeName;
-
- private boolean typeIsSerializable;
-
- private boolean typeIsDateOrCalendar;
-
- private boolean typeIsContainer;
-
- private String qualifiedReferenceEntityTypeName;
-
- private String qualifiedReferenceEntityElementTypeName;
-
- private boolean public_; // 'public' is a reserved word
-
- private boolean final_; // 'final' is a reserved word
-
- /**
- * construct field attribute
- */
- public static JavaResourcePersistentAttribute newInstance(
- JavaResourcePersistentType parent,
- Type declaringType,
- String name,
- int occurrence,
- JpaCompilationUnit jpaCompilationUnit,
- CompilationUnit astRoot) {
- Attribute attribute = new JDTFieldAttribute(
- declaringType,
- name,
- occurrence,
- jpaCompilationUnit.getCompilationUnit(),
- jpaCompilationUnit.getModifySharedDocumentCommandExecutorProvider(),
- jpaCompilationUnit.getAnnotationEditFormatter());
- JavaResourcePersistentAttribute field = new JavaResourcePersistentAttributeImpl(parent, attribute);
- field.initialize(astRoot);
- return field;
- }
-
- /**
- * construct property attribute
- */
- public static JavaResourcePersistentAttribute newInstance(
- JavaResourcePersistentType parent,
- Type declaringType,
- MethodSignature signature,
- int occurrence,
- JpaCompilationUnit jpaCompilationUnit,
- CompilationUnit astRoot) {
- Attribute attribute = JDTMethodAttribute.newInstance(
- declaringType,
- signature,
- occurrence,
- jpaCompilationUnit.getCompilationUnit(),
- jpaCompilationUnit.getModifySharedDocumentCommandExecutorProvider(),
- jpaCompilationUnit.getAnnotationEditFormatter());
- JavaResourcePersistentAttribute field = new JavaResourcePersistentAttributeImpl(parent, attribute);
- field.initialize(astRoot);
- return field;
- }
-
- public JavaResourcePersistentAttributeImpl(JavaResourcePersistentType parent, Attribute attribute){
- super(parent, attribute);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.typeIsBasic = this.buildTypeIsBasic(astRoot);
- this.qualifiedTypeName = this.buildQualifiedTypeName(astRoot);
- this.qualifiedReferenceEntityTypeName = this.buildQualifiedReferenceEntityTypeName(astRoot);
- this.qualifiedReferenceEntityElementTypeName = this.buildQualifiedReferenceEntityElementTypeName(astRoot);
- this.typeIsSerializable = this.buildTypeIsSerializable(astRoot);
- this.typeIsDateOrCalendar = this.buildTypeIsDateOrCalendar(astRoot);
- this.typeIsContainer = this.buildTypeIsContainer(astRoot);
- this.final_ = this.buildFinal(astRoot);
- this.public_ = this.buildPublic(astRoot);
- }
-
- public String getName() {
- return this.getMember().getAttributeName();
- }
-
- // ******** AbstractJavaPersistentResource implementation ********
-
- @Override
- protected Annotation buildMappingAnnotation(String mappingAnnotationName) {
- return this.getAnnotationProvider().buildAttributeMappingAnnotation(this, this.getMember(), mappingAnnotationName);
- }
-
- @Override
- protected Annotation buildSupportingAnnotation(String annotationName) {
- return this.getAnnotationProvider().buildAttributeSupportingAnnotation(this, this.getMember(), annotationName);
- }
-
- @Override
- protected Annotation buildNullSupportingAnnotation(String annotationName) {
- return this.getAnnotationProvider().buildNullAttributeSupportingAnnotation(this, this.getMember(), annotationName);
- }
-
- @Override
- protected Annotation buildNullMappingAnnotation(String annotationName) {
- return this.getAnnotationProvider().buildNullAttributeMappingAnnotation(this, this.getMember(), annotationName);
- }
-
- @Override
- protected ListIterator<String> validMappingAnnotationNames() {
- return this.getAnnotationProvider().attributeMappingAnnotationNames();
- }
-
- @Override
- protected ListIterator<String> validSupportingAnnotationNames() {
- return this.getAnnotationProvider().attributeSupportingAnnotationNames();
- }
-
- @Override
- public boolean isFor(MethodSignature signature, int occurrence) {
- return ((MethodAttribute) this.getMember()).matches(signature, occurrence);
- }
-
- // ******** JavaPersistentAttributeResource implementation ********
-
- public boolean isForField() {
- return this.getMember().isField();
- }
-
- public boolean isForProperty() {
- return ! this.isForField();
- }
-
- public boolean hasAnyAnnotations() {
- if (this.mappingAnnotationsSize() > 0) {
- return true;
- }
- if (this.supportingAnnotationsSize() > 0) {
- return true;
- }
- return false;
- }
-
- public boolean isPublic() {
- return this.public_;
- }
-
- protected void setPublic(boolean public_) {
- boolean old = this.public_;
- this.public_ = public_;
- this.firePropertyChanged(PUBLIC_PROPERTY, old, public_);
- }
-
- public boolean isFinal() {
- return this.final_;
- }
-
- protected void setFinal(boolean final_) {
- boolean old = this.final_;
- this.final_ = final_;
- this.firePropertyChanged(FINAL_PROPERTY, old, final_);
- }
-
- public boolean typeIsBasic() {
- return this.typeIsBasic;
- }
-
- protected void setTypeIsBasic(boolean typeIsBasic) {
- boolean old = this.typeIsBasic;
- this.typeIsBasic = typeIsBasic;
- this.firePropertyChanged(TYPE_IS_BASIC_PROPERTY, old, typeIsBasic);
- }
-
- public String getQualifiedTypeName() {
- return this.qualifiedTypeName;
- }
-
- protected void setQualifiedTypeName(String qualifiedTypeName) {
- String old = this.qualifiedTypeName;
- this.qualifiedTypeName = qualifiedTypeName;
- this.firePropertyChanged(QUALIFIED_TYPE_NAME_PROPERTY, old, qualifiedTypeName);
- }
-
- public String getQualifiedReferenceEntityTypeName() {
- return this.qualifiedReferenceEntityTypeName;
- }
-
- protected void setQualifiedReferenceEntityTypeName(String qualifiedReferenceEntityTypeName) {
- String old = this.qualifiedReferenceEntityTypeName;
- this.qualifiedReferenceEntityTypeName = qualifiedReferenceEntityTypeName;
- this.firePropertyChanged(QUALIFIED_REFERENCE_ENTITY_TYPE_NAME_PROPERTY, old, qualifiedReferenceEntityTypeName);
- }
-
- public String getQualifiedReferenceEntityElementTypeName() {
- return this.qualifiedReferenceEntityElementTypeName;
- }
-
- protected void setQualifiedReferenceEntityElementTypeName(String qualifiedReferenceEntityElementTypeName) {
- String old = this.qualifiedReferenceEntityElementTypeName;
- this.qualifiedReferenceEntityElementTypeName = qualifiedReferenceEntityElementTypeName;
- this.firePropertyChanged(QUALIFIED_REFERENCE_ENTITY_ELEMENT_TYPE_NAME_PROPERTY, old, qualifiedReferenceEntityElementTypeName);
- }
-
- public boolean typeIsSerializable() {
- return this.typeIsSerializable;
- }
-
- protected void setTypeIsSerializable(boolean typeIsSerializable) {
- boolean old = this.typeIsSerializable;
- this.typeIsSerializable = typeIsSerializable;
- this.firePropertyChanged(TYPE_IS_SERIALIZABLE_PROPERTY, old, typeIsSerializable);
- }
-
- public boolean typeIsDateOrCalendar() {
- return this.typeIsDateOrCalendar;
- }
-
- protected void setTypeIsDateOrCalendar(boolean typeIsDateOrCalendar) {
- boolean old = this.typeIsDateOrCalendar;
- this.typeIsDateOrCalendar = typeIsDateOrCalendar;
- firePropertyChanged(TYPE_IS_DATE_OR_CALENDAR_PROPERTY, old, typeIsDateOrCalendar);
- }
-
- public boolean typeIsContainer() {
- return this.typeIsContainer;
- }
-
- protected void setTypeIsContainer(boolean typeIsContainer) {
- boolean old = this.typeIsContainer;
- this.typeIsContainer = typeIsContainer;
- this.firePropertyChanged(TYPE_IS_CONTAINER_PROPERTY, old, typeIsContainer);
- }
-
- @Override
- public void update(CompilationUnit astRoot) {
- super.update(astRoot);
- this.setTypeIsBasic(this.buildTypeIsBasic(astRoot));
- this.setQualifiedTypeName(this.buildQualifiedTypeName(astRoot));
- this.setQualifiedReferenceEntityTypeName(this.buildQualifiedReferenceEntityTypeName(astRoot));
- this.setQualifiedReferenceEntityElementTypeName(this.buildQualifiedReferenceEntityElementTypeName(astRoot));
- this.setTypeIsSerializable(this.buildTypeIsSerializable(astRoot));
- this.setTypeIsDateOrCalendar(this.buildTypeIsDateOrCalendar(astRoot));
- this.setTypeIsContainer(this.buildTypeIsContainer(astRoot));
- this.setFinal(this.buildFinal(astRoot));
- this.setPublic(this.buildPublic(astRoot));
- }
-
- @Override
- public void resolveTypes(CompilationUnit astRoot) {
- super.resolveTypes(astRoot);
- this.setTypeIsBasic(this.buildTypeIsBasic(astRoot));
- this.setQualifiedTypeName(this.buildQualifiedTypeName(astRoot));
- this.setQualifiedReferenceEntityTypeName(this.buildQualifiedReferenceEntityTypeName(astRoot));
- this.setQualifiedReferenceEntityElementTypeName(this.buildQualifiedReferenceEntityElementTypeName(astRoot));
- this.setTypeIsSerializable(this.buildTypeIsSerializable(astRoot));
- this.setTypeIsDateOrCalendar(this.buildTypeIsDateOrCalendar(astRoot));
- this.setTypeIsContainer(this.buildTypeIsContainer(astRoot));
- }
-
- protected boolean buildTypeIsBasic(CompilationUnit astRoot) {
- return typeIsBasic(this.getMember().getTypeBinding(astRoot), astRoot.getAST());
- }
-
- protected boolean buildFinal(CompilationUnit astRoot) {
- IBinding binding = this.getMember().getBinding(astRoot);
- return (binding == null) ? false : Modifier.isFinal(binding.getModifiers());
- }
-
- protected boolean buildPublic(CompilationUnit astRoot) {
- IBinding binding = this.getMember().getBinding(astRoot);
- return (binding == null) ? false : Modifier.isPublic(binding.getModifiers());
- }
-
- protected String buildQualifiedReferenceEntityTypeName(CompilationUnit astRoot) {
- ITypeBinding typeBinding = this.getMember().getTypeBinding(astRoot);
- return (typeBinding == null) ? null : buildReferenceEntityTypeName(typeBinding);
- }
-
- public static String buildReferenceEntityTypeName(ITypeBinding typeBinding) {
- if (typeBinding == null) {
- return null;
- }
- if (typeBinding.isArray()) {
- return null; // arrays cannot be entities
- }
- return typeBinding.getTypeDeclaration().getQualifiedName();
- }
-
- protected String buildQualifiedReferenceEntityElementTypeName(CompilationUnit astRoot) {
- ITypeBinding typeBinding = this.getMember().getTypeBinding(astRoot);
- if (typeBinding == null) {
- return null;
- }
-
- ITypeBinding[] typeArguments = typeBinding.getTypeArguments();
- ITypeBinding elementTypeBinding;
- if (typeArguments.length == 1) {
- elementTypeBinding = typeArguments[0];
- }
- else if (typeArguments.length == 2 && typeNamedIsMap(buildQualifiedTypeName(astRoot))) {
- elementTypeBinding = typeArguments[1];
- }
- else {
- return null;
- }
- String elementTypeName = buildReferenceEntityTypeName(elementTypeBinding);
- return typeNamedIsContainer(elementTypeName) ? null : elementTypeName;
- }
-
-
- protected boolean buildTypeIsSerializable(CompilationUnit astRoot) {
- return typeImplementsSerializable(this.getMember().getTypeBinding(astRoot), astRoot.getAST());
- }
-
- protected boolean buildTypeIsDateOrCalendar(CompilationUnit astRoot) {
- return typeImplementsDateOrCalendar(this.getMember().getTypeBinding(astRoot));
- }
-
-
- protected boolean buildTypeIsContainer(CompilationUnit astRoot) {
- String typeName = buildReferenceEntityTypeName(this.getMember().getTypeBinding(astRoot));
- return (typeName == null) ? false : typeNamedIsContainer(typeName);
- }
-
- private static final String MAP_TYPE_NAME = java.util.Map.class.getName();
-
- /**
- * return whether the specified non-array type is one of the container
- * types allowed by the JPA spec
- */
- public static boolean typeNamedIsMap(String typeName) {
- return MAP_TYPE_NAME.equals(typeName);
- }
-
- /**
- * return whether the specified non-array type is one of the container
- * types allowed by the JPA spec
- */
- public static boolean typeNamedIsContainer(String typeName) {
- return CollectionTools.contains(CONTAINER_TYPE_NAMES, typeName);
- }
-
- private static final String[] CONTAINER_TYPE_NAMES = {
- java.util.Collection.class.getName(),
- java.util.Set.class.getName(),
- java.util.List.class.getName(),
- MAP_TYPE_NAME,
- };
-
-
- protected String buildQualifiedTypeName(CompilationUnit astRoot) {
- ITypeBinding typeBinding = this.getMember().getTypeBinding(astRoot);
- return (typeBinding == null) ? null : typeBinding.getTypeDeclaration().getQualifiedName();
- }
-
-
- /**
- * 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:
- * primitive types
- * byte[]
- * Byte[]
- * char[]
- * Character[]
- * primitive wrappers
- * 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 static boolean typeIsBasic(ITypeBinding typeBinding, AST ast) {
- if (typeBinding == null) {
- return false; // type not found
- }
- if (typeBinding.isPrimitive()) {
- return true;
- }
- if (typeBinding.isArray()) {
- if (typeBinding.getDimensions() > 1) {
- return false; // multi-dimensional arrays are not supported
- }
- ITypeBinding elementTypeBinding = typeBinding.getElementType();
- if (elementTypeBinding == null) {
- return false;// unable to resolve the type
- }
- return elementTypeIsValid(elementTypeBinding.getQualifiedName());
- }
- String typeName = typeBinding.getQualifiedName();
- if (typeIsPrimitiveWrapper(typeName)) {
- return true;
- }
- if (typeIsOtherSupportedType(typeName)) {
- return true;
- }
- if (typeBinding.isEnum()) {
- return true;
- }
- if (typeImplementsSerializable(typeBinding, ast)) {
- return true;
- }
- return false;
- }
-
- /**
- * Return whether the specified type is a valid element type for
- * a one-dimensional array:
- * byte
- * char
- * java.lang.Byte
- * java.lang.Character
- */
- private static boolean elementTypeIsValid(String elementTypeName) {
- return CollectionTools.contains(VALID_ELEMENT_TYPE_NAMES, elementTypeName);
- }
-
- private static final String[] VALID_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 a primitive wrapper.
- */
- private static boolean typeIsPrimitiveWrapper(String typeName) {
- return CollectionTools.contains(PRIMITIVE_WRAPPER_TYPE_NAMES, typeName);
- }
-
- private static final String[] PRIMITIVE_WRAPPER_TYPE_NAMES = {
- java.lang.Byte.class.getName(),
- java.lang.Character.class.getName(),
- java.lang.Double.class.getName(),
- java.lang.Float.class.getName(),
- java.lang.Integer.class.getName(),
- java.lang.Long.class.getName(),
- java.lang.Short.class.getName(),
- java.lang.Boolean.class.getName(),
- };
-
- /**
- * Return whether the specified type is among the various other types
- * that default to a Basic mapping.
- */
- private static boolean typeIsOtherSupportedType(String typeName) {
- return CollectionTools.contains(OTHER_SUPPORTED_TYPE_NAMES, typeName);
- }
-
- private static final String[] OTHER_SUPPORTED_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(),
- };
-
- /**
- * Return whether the specified type implements java.io.Serializable.
- */
- private static boolean typeImplementsSerializable(ITypeBinding typeBinding, AST ast) {
- if (typeBinding == null) {
- return false;
- }
- ITypeBinding serializableTypeBinding = ast.resolveWellKnownType(SERIALIZABLE_TYPE_NAME);
- return typeBinding.isAssignmentCompatible(serializableTypeBinding);
- }
-
- private static final String SERIALIZABLE_TYPE_NAME = java.io.Serializable.class.getName();
-
- /**
- * Return whether the specified type implements java.util.Date or java.util.Calendar.
- */
- private static boolean typeImplementsDateOrCalendar(ITypeBinding typeBinding) {
- return typeImplementsDate(typeBinding) || typeImplementsCalendar(typeBinding);
- }
-
- /**
- * Return whether the specified type implements java.util.Date.
- */
- private static boolean typeImplementsDate(ITypeBinding typeBinding) {
- if (typeBinding == null) {
- return false;
- }
- return JDTTools.findTypeInHierarchy(typeBinding, DATE_TYPE_NAME) != null;
- }
-
- private static final String DATE_TYPE_NAME = java.util.Date.class.getName();
-
- /**
- * Return whether the specified type implements java.util.Calendar.
- */
- private static boolean typeImplementsCalendar(ITypeBinding typeBinding) {
- if (typeBinding == null) {
- return false;
- }
- return JDTTools.findTypeInHierarchy(typeBinding, CALENDAR_TYPE_NAME) != null;
- }
-
- private static final String CALENDAR_TYPE_NAME = java.util.Calendar.class.getName();
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JavaResourcePersistentTypeImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JavaResourcePersistentTypeImpl.java
deleted file mode 100644
index 403dbbba89..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JavaResourcePersistentTypeImpl.java
+++ /dev/null
@@ -1,599 +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.resource.java;
-
-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.Vector;
-
-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.Modifier;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
-import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
-import org.eclipse.jpt.core.internal.utility.jdt.JDTTools;
-import org.eclipse.jpt.core.internal.utility.jdt.JDTType;
-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.core.resource.java.JpaCompilationUnit;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.utility.MethodSignature;
-import org.eclipse.jpt.utility.internal.Counter;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.TreeIterator;
-
-/**
- *
- */
-public class JavaResourcePersistentTypeImpl
- extends AbstractJavaResourcePersistentMember<Type>
- implements JavaResourcePersistentType
-{
- private String name;
-
- private String qualifiedName;
-
- private String superClassQualifiedName;
-
- 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;
-
-
- // ********** construction **********
-
- /**
- * build top-level persistent type
- */
- public static JavaResourcePersistentType newInstance(
- JpaCompilationUnit jpaCompilationUnit,
- TypeDeclaration typeDeclaration,
- CompilationUnit astRoot) {
- Type type = new JDTType(
- typeDeclaration,
- jpaCompilationUnit.getCompilationUnit(),
- jpaCompilationUnit.getModifySharedDocumentCommandExecutorProvider(),
- jpaCompilationUnit.getAnnotationEditFormatter());
- JavaResourcePersistentType jrpt = new JavaResourcePersistentTypeImpl(jpaCompilationUnit, type);
- jrpt.initialize(astRoot);
- return jrpt;
- }
-
- /**
- * build nested persistent type
- */
- protected static JavaResourcePersistentType newInstance(
- JpaCompilationUnit jpaCompilationUnit,
- Type declaringType,
- TypeDeclaration typeDeclaration,
- int occurrence,
- CompilationUnit astRoot) {
- Type type = new JDTType(
- declaringType,
- typeDeclaration,
- occurrence,
- jpaCompilationUnit.getCompilationUnit(),
- jpaCompilationUnit.getModifySharedDocumentCommandExecutorProvider(),
- jpaCompilationUnit.getAnnotationEditFormatter());
- JavaResourcePersistentType jrpt = new JavaResourcePersistentTypeImpl(jpaCompilationUnit, type);
- jrpt.initialize(astRoot);
- return jrpt;
- }
-
- public JavaResourcePersistentTypeImpl(JpaCompilationUnit jpaCompilationUnit, Type type) {
- super(jpaCompilationUnit, 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.abstract_ = this.buildAbstract(astRoot);
- this.initializeTypes(astRoot);
- this.initializeFields(astRoot);
- this.initializeMethods(astRoot);
- this.access = this.buildAccess();
- }
-
- protected void initializeTypes(CompilationUnit astRoot) {
- TypeDeclaration[] typeDeclarations = this.getMember().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));
- }
- }
-
- protected void initializeFields(CompilationUnit astRoot) {
- FieldDeclaration[] fieldDeclarations = this.getMember().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));
- }
- }
- }
-
- protected void initializeMethods(CompilationUnit astRoot) {
- MethodDeclaration[] methodDeclarations = this.getMember().getMethods(astRoot);
- CounterMap counters = new CounterMap(methodDeclarations.length);
- for (MethodDeclaration methodDeclaration : methodDeclarations) {
- MethodSignature signature = JDTTools.buildMethodSignature(methodDeclaration);
- int occurrence = counters.increment(signature);
- this.methods.add(this.buildMethod(signature, occurrence, astRoot));
- }
- }
-
-
- // ********** AbstractJavaResourcePersistentMember implementation **********
-
- @Override
- protected Annotation buildMappingAnnotation(String mappingAnnotationName) {
- return this.getAnnotationProvider().buildTypeMappingAnnotation(this, this.getMember(), mappingAnnotationName);
- }
-
- @Override
- protected Annotation buildNullMappingAnnotation(String annotationName) {
- return this.getAnnotationProvider().buildNullTypeMappingAnnotation(this, this.getMember(), annotationName);
- }
-
- @Override
- protected Annotation buildSupportingAnnotation(String annotationName) {
- return this.getAnnotationProvider().buildTypeSupportingAnnotation(this, this.getMember(), annotationName);
- }
-
- @Override
- protected Annotation buildNullSupportingAnnotation(String annotationName) {
- return this.getAnnotationProvider().buildNullTypeSupportingAnnotation(this, this.getMember(), annotationName);
- }
-
- @Override
- protected ListIterator<String> validMappingAnnotationNames() {
- return this.getAnnotationProvider().typeMappingAnnotationNames();
- }
-
- @Override
- protected ListIterator<String> validSupportingAnnotationNames() {
- return this.getAnnotationProvider().typeSupportingAnnotationNames();
- }
-
- @Override
- public void resolveTypes(CompilationUnit astRoot) {
- super.resolveTypes(astRoot);
-
- this.setSuperClassQualifiedName(this.buildSuperClassQualifiedName(astRoot));
-
- for (Iterator<JavaResourcePersistentAttribute> stream = this.fields(); stream.hasNext(); ) {
- stream.next().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.updateMethods(astRoot);
-
- for (Iterator<JavaResourcePersistentAttribute> stream = this.methods(); stream.hasNext(); ) {
- stream.next().resolveTypes(astRoot);
- }
- synchronized (this.types) {
- for (JavaResourcePersistentType type : this.types) {
- type.resolveTypes(astRoot);
- }
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ******** JavaResourcePersistentType implementation ********
-
- public String getName() {
- return this.name;
- }
-
- protected void setName(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- public String getQualifiedName() {
- return this.qualifiedName;
- }
-
- protected void setQualifiedName(String qualifiedName) {
- String old = this.qualifiedName;
- this.qualifiedName = qualifiedName;
- this.firePropertyChanged(QUALIFIED_NAME_PROPERTY, old, qualifiedName);
- }
-
- public String getSuperClassQualifiedName() {
- return this.superClassQualifiedName;
- }
-
- protected void setSuperClassQualifiedName(String superClassQualifiedName) {
- String old = this.superClassQualifiedName;
- this.superClassQualifiedName = superClassQualifiedName;
- this.firePropertyChanged(SUPER_CLASS_QUALIFIED_NAME_PROPERTY, old, superClassQualifiedName);
- }
-
- public boolean isAbstract() {
- return this.abstract_;
- }
-
- protected void setAbstract(boolean abstract_) {
- boolean old = this.abstract_;
- this.abstract_ = abstract_;
- this.firePropertyChanged(ABSTRACT_PROPERTY, old, abstract_);
- }
-
- 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
- protected void setAccess(AccessType access) {
- AccessType old = this.access;
- this.access = access;
- this.firePropertyChanged(ACCESS_PROPERTY, old, access);
- }
-
- /**
- * check only persistable attributes
- */
- public boolean hasAnyAttributeAnnotations() {
- for (Iterator<JavaResourcePersistentAttribute> stream = this.persistableAttributes(); stream.hasNext(); ) {
- if (stream.next().hasAnyAnnotations()) {
- return true;
- }
- }
- return false;
- }
-
-
- // ********** types **********
-
- public Iterator<JavaResourcePersistentType> types() {
- return new CloneIterator<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 persistableMembers(this.types());
- }
-
- public Iterator<JavaResourcePersistentType> allPersistableTypes() {
- return persistableMembers(this.allTypes());
- }
-
- protected JavaResourcePersistentType getType(String typeName, int occurrence) {
- for (JavaResourcePersistentType type : this.types) {
- if (type.isFor(typeName, occurrence)) {
- return type;
- }
- }
- return null;
- }
-
- protected void addType(JavaResourcePersistentType type) {
- this.addItemToCollection(type, this.types, TYPES_COLLECTION);
- }
-
- protected void removeTypes(Collection<JavaResourcePersistentType> remove) {
- this.removeItemsFromCollection(remove, this.types, TYPES_COLLECTION);
- }
-
-
- // ********** fields **********
-
- public Iterator<JavaResourcePersistentAttribute> fields() {
- return new CloneIterator<JavaResourcePersistentAttribute>(this.fields);
- }
-
- public Iterator<JavaResourcePersistentAttribute> persistableFields() {
- return persistableMembers(this.fields());
- }
-
- protected void addField(JavaResourcePersistentAttribute field) {
- this.addItemToCollection(field, this.fields, FIELDS_COLLECTION);
- }
-
- protected JavaResourcePersistentAttribute getField(String fieldName, int occurrence) {
- for (JavaResourcePersistentAttribute field : this.fields) {
- if (field.isFor(fieldName, occurrence)) {
- return field;
- }
- }
- return null;
- }
-
- protected void removeFields(Collection<JavaResourcePersistentAttribute> remove) {
- this.removeItemsFromCollection(remove, this.fields, FIELDS_COLLECTION);
- }
-
-
- // ********** methods **********
-
- public Iterator<JavaResourcePersistentAttribute> methods() {
- return new CloneIterator<JavaResourcePersistentAttribute>(this.methods);
- }
-
- public Iterator<JavaResourcePersistentAttribute> persistableProperties() {
- return persistableMembers(this.methods());
- }
-
- protected JavaResourcePersistentAttribute getMethod(MethodSignature signature, int occurrence) {
- for (JavaResourcePersistentAttribute method : this.methods) {
- if (method.isFor(signature, occurrence)) {
- return method;
- }
- }
- return null;
- }
-
- protected void addMethod(JavaResourcePersistentAttribute method) {
- this.addItemToCollection(method, this.methods, METHODS_COLLECTION);
- }
-
- protected void removeMethods(Collection<JavaResourcePersistentAttribute> remove) {
- this.removeItemsFromCollection(remove, this.methods, METHODS_COLLECTION);
- }
-
-
-
- // ********** attributes **********
-
- @SuppressWarnings("unchecked")
- public Iterator<JavaResourcePersistentAttribute> persistableAttributes() {
- return new CompositeIterator<JavaResourcePersistentAttribute>(this.persistableFields(), this.persistableProperties());
- }
-
-
- // ********** update from Java **********
-
- @Override
- public void update(CompilationUnit astRoot) {
- super.update(astRoot);
- this.setName(this.buildName(astRoot));
- this.setQualifiedName(this.buildQualifiedName(astRoot));
- this.setSuperClassQualifiedName(this.buildSuperClassQualifiedName(astRoot));
- this.setAbstract(this.buildAbstract(astRoot));
- this.updateTypes(astRoot);
- this.updateFields(astRoot);
- this.updateMethods(astRoot);
- this.setAccess(this.buildAccess());
- }
-
- protected String buildName(CompilationUnit astRoot) {
- return this.getMember().getBinding(astRoot).getName();
- }
-
- protected String buildQualifiedName(CompilationUnit astRoot) {
- return this.getMember().getBinding(astRoot).getQualifiedName();
- }
-
- protected String buildSuperClassQualifiedName(CompilationUnit astRoot) {
- ITypeBinding typeBinding = this.getMember().getBinding(astRoot);
- if (typeBinding == null) {
- return null;
- }
- ITypeBinding superClassTypeBinding = typeBinding.getSuperclass();
- if (superClassTypeBinding == null) {
- return null;
- }
- return superClassTypeBinding.getTypeDeclaration().getQualifiedName();
- }
-
- protected boolean buildAbstract(CompilationUnit astRoot) {
- return Modifier.isAbstract(this.getMember().getBinding(astRoot).getModifiers());
- }
-
- protected void updateTypes(CompilationUnit astRoot) {
- synchronized (this.types) {
- this.updateTypes_(astRoot);
- }
- }
-
- protected void updateTypes_(CompilationUnit astRoot) {
- TypeDeclaration[] typeDeclarations = this.getMember().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.update(astRoot);
- }
- }
- this.removeTypes(typesToRemove);
- }
-
- protected JavaResourcePersistentType buildType(TypeDeclaration nestedTypeDeclaration, int occurrence, CompilationUnit astRoot) {
- return newInstance(this.getJpaCompilationUnit(), this.getMember(), nestedTypeDeclaration, occurrence, astRoot);
- }
-
- protected void updateFields(CompilationUnit astRoot) {
- synchronized (this.fields) {
- this.updateFields_(astRoot);
- }
- }
-
- protected void updateFields_(CompilationUnit astRoot) {
- FieldDeclaration[] fieldDeclarations = this.getMember().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.update(astRoot);
- }
- }
- }
- this.removeFields(fieldsToRemove);
- }
-
- protected JavaResourcePersistentAttribute buildField(String fieldName, int occurrence, CompilationUnit astRoot) {
- return JavaResourcePersistentAttributeImpl.newInstance(this, this.getMember(), fieldName, occurrence, this.getJpaCompilationUnit(), astRoot);
- }
-
- protected void updateMethods(CompilationUnit astRoot) {
- synchronized (this.methods) {
- this.updateMethods_(astRoot);
- }
- }
-
- protected void updateMethods_(CompilationUnit astRoot) {
- MethodDeclaration[] methodDeclarations = this.getMember().getMethods(astRoot);
- CounterMap counters = new CounterMap(methodDeclarations.length);
- HashSet<JavaResourcePersistentAttribute> methodsToRemove = new HashSet<JavaResourcePersistentAttribute>(this.methods);
- for (MethodDeclaration methodDeclaration : methodDeclarations) {
- MethodSignature signature = JDTTools.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.update(astRoot);
- }
- }
- this.removeMethods(methodsToRemove);
- }
-
- protected JavaResourcePersistentAttribute buildMethod(MethodSignature signature, int occurrence, CompilationUnit astRoot) {
- return JavaResourcePersistentAttributeImpl.newInstance(this, this.getMember(), signature, occurrence, this.getJpaCompilationUnit(), astRoot);
- }
-
- /**
- * Return the AccessType currently implied by the Java source code:
- * - 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)
- */
- protected AccessType buildAccess() {
- boolean hasPersistableFields = false;
- for (Iterator<JavaResourcePersistentAttribute> stream = this.persistableFields(); stream.hasNext(); ) {
- hasPersistableFields = true;
- if (stream.next().hasAnyAnnotations()) {
- // any field is annotated => FIELD
- return AccessType.FIELD;
- }
- }
-
- boolean hasPersistableProperties = false;
- for (Iterator<JavaResourcePersistentAttribute> stream = this.persistableProperties(); stream.hasNext(); ) {
- hasPersistableProperties = true;
- if (stream.next().hasAnyAnnotations()) {
- // 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;
- }
-
-
- // ********** static methods **********
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected static List<VariableDeclarationFragment> fragments(FieldDeclaration fd) {
- return fd.fragments();
- }
-
-
- // ********** CounterMap **********
-
- protected static class CounterMap {
- private final HashMap<Object, Counter> counters;
-
- protected CounterMap(int initialCapacity) {
- super();
- this.counters = new HashMap<Object, Counter>(initialCapacity);
- }
-
- /**
- * Return the incremented count for the specified object.
- */
- int increment(Object o) {
- Counter counter = this.counters.get(o);
- if (counter == null) {
- counter = new Counter();
- this.counters.put(o, counter);
- }
- counter.increment();
- return counter.count();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnImpl.java
deleted file mode 100644
index a0e41d45f1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnImpl.java
+++ /dev/null
@@ -1,225 +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.resource.java;
-
-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.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableJoinColumn;
-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;
-
-public class JoinColumnImpl extends BaseColumnImpl implements NestableJoinColumn
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- // hold this so we can get the 'referenced column name' text range
- private final DeclarationAnnotationElementAdapter<String> referencedColumnNameDeclarationAdapter;
-
- private final AnnotationElementAdapter<String> referencedColumnNameAdapter;
-
- private String referencedColumnName;
-
- public JoinColumnImpl(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.referencedColumnNameDeclarationAdapter = this.buildStringElementAdapter(JPA.JOIN_COLUMN__REFERENCED_COLUMN_NAME);
- this.referencedColumnNameAdapter = this.buildShortCircuitElementAdapter(this.referencedColumnNameDeclarationAdapter);
- }
-
- public JoinColumnImpl(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- this(parent, member, daa, new MemberAnnotationAdapter(member, daa));
- }
-
- public JoinColumnImpl(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.referencedColumnName(astRoot);
- }
-
- @Override
- protected String getNameElementName() {
- return JPA.JOIN_COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA.JOIN_COLUMN__COLUMN_DEFINITION;
- }
-
- @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;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) super.getAnnotationAdapter();
- }
-
- public void moveAnnotation(int newIndex) {
- getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- JoinColumnAnnotation oldColumn = (JoinColumnAnnotation) oldAnnotation;
- setReferencedColumnName(oldColumn.getReferencedColumnName());
- }
-
- //************ JoinColumn implementation ***************
- public String getReferencedColumnName() {
- return this.referencedColumnName;
- }
-
- public void setReferencedColumnName(String newReferencedColumnName) {
- if (attributeValueHasNotChanged(this.referencedColumnName, newReferencedColumnName)) {
- return;
- }
- String oldReferencedColumnName = this.referencedColumnName;
- this.referencedColumnName = newReferencedColumnName;
- this.referencedColumnNameAdapter.setValue(newReferencedColumnName);
- firePropertyChanged(REFERENCED_COLUMN_NAME_PROPERTY, oldReferencedColumnName, newReferencedColumnName);
- }
-
- 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);
- }
-
- @Override
- public void update(CompilationUnit astRoot) {
- super.update(astRoot);
- this.setReferencedColumnName(this.referencedColumnName(astRoot));
- }
-
- protected String referencedColumnName(CompilationUnit astRoot) {
- return this.referencedColumnNameAdapter.getValue(astRoot);
- }
-
- // ********** static methods **********
-
- static JoinColumnImpl createJoinColumn(JavaResourceNode parent, Member member) {
- return new JoinColumnImpl(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- static JoinColumnImpl createNestedJoinColumn(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter joinColumnsAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, joinColumnsAdapter);
- IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa);
- return new JoinColumnImpl(parent, member, idaa, annotationAdapter);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter joinColumnsAdapter) {
- return new NestedIndexedDeclarationAnnotationAdapter(joinColumnsAdapter, index, JPA.JOIN_COLUMN);
- }
- static NestableJoinColumn createJoinTableJoinColumn(JavaResourceNode parent, Member member, int index) {
- return new JoinColumnImpl(parent, member, buildJoinTableAnnotationAdapter(index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildJoinTableAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(JoinTableImpl.DECLARATION_ANNOTATION_ADAPTER, JPA.JOIN_TABLE__JOIN_COLUMNS, index, JPA.JOIN_COLUMN);
- }
-
- static NestableJoinColumn createJoinTableInverseJoinColumn(JavaResourceNode parent, Member member, int index) {
- return new JoinColumnImpl(parent, member, buildJoinTableInverseAnnotationAdapter(index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildJoinTableInverseAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(JoinTableImpl.DECLARATION_ANNOTATION_ADAPTER, JPA.JOIN_TABLE__INVERSE_JOIN_COLUMNS, index, JPA.JOIN_COLUMN);
- }
-
-
- static NestableJoinColumn createAssociationOverrideJoinColumn(DeclarationAnnotationAdapter associationOverrideAdapter, JavaResourceNode parent, Member member, int index) {
- return new JoinColumnImpl(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);
- }
-
-
- public static class JoinColumnAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final JoinColumnAnnotationDefinition 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 JoinColumnImpl.createJoinColumn(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnsImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnsImpl.java
deleted file mode 100644
index 905541069c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnsImpl.java
+++ /dev/null
@@ -1,157 +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.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-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.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JoinColumnsAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableJoinColumn;
-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.iterators.CloneListIterator;
-
-public class JoinColumnsImpl extends AbstractResourceAnnotation<Member> implements JoinColumnsAnnotation
-{
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private List<NestableJoinColumn> joinColumns;
-
- protected JoinColumnsImpl(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.joinColumns = new ArrayList<NestableJoinColumn>();
- }
-
- public void initialize(CompilationUnit astRoot) {
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public String getNestableAnnotationName() {
- return JoinColumnAnnotation.ANNOTATION_NAME;
- }
-
- public ListIterator<NestableJoinColumn> nestedAnnotations() {
- return new CloneListIterator<NestableJoinColumn>(this.joinColumns);
- }
-
- public int nestedAnnotationsSize() {
- return this.joinColumns.size();
- }
-
- public NestableJoinColumn addInternal(int index) {
- JoinColumnImpl joinColumn = createJoinColumn(index);
- this.joinColumns.add(index, joinColumn);
- return joinColumn;
- }
-
- public NestableJoinColumn add(int index) {
- JoinColumnImpl joinColumn = createJoinColumn(index);
- add(index, joinColumn);
- return joinColumn;
- }
-
- protected void add(int index, NestableJoinColumn joinColumn) {
- addItemToList(index, joinColumn, this.joinColumns, JOIN_COLUMNS_LIST);
- }
-
- public void remove(NestableJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.joinColumns, JOIN_COLUMNS_LIST);
- }
-
- public void remove(int index) {
- removeItemFromList(index, this.joinColumns, JOIN_COLUMNS_LIST);
- }
-
- public int indexOf(NestableJoinColumn joinColumn) {
- return this.joinColumns.indexOf(joinColumn);
- }
-
- public NestableJoinColumn nestedAnnotationAt(int index) {
- return this.joinColumns.get(index);
- }
-
- public NestableJoinColumn nestedAnnotationFor(Annotation jdtAnnotation) {
- for (NestableJoinColumn joinColumn : this.joinColumns) {
- if (jdtAnnotation == joinColumn.getJdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return joinColumn;
- }
- }
- return null;
- }
-
- public void move(int targetIndex, int sourceIndex) {
- moveItemInList(targetIndex, sourceIndex, this.joinColumns, JOIN_COLUMNS_LIST);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.joinColumns, targetIndex, sourceIndex);
- }
-
- public String getElementName() {
- return JPA.JOIN_COLUMNS__VALUE;
- }
-
- public void update(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this);
- }
-
- private JoinColumnImpl createJoinColumn(int index) {
- return JoinColumnImpl.createNestedJoinColumn(this, getMember(), index, getDeclarationAnnotationAdapter());
- }
-
-
- public static class JoinColumnsAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final JoinColumnsAnnotationDefinition 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 JoinColumnsImpl(parent, member);
- }
-
- public JoinColumnsAnnotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinTableImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinTableImpl.java
deleted file mode 100644
index 361853ae7f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinTableImpl.java
+++ /dev/null
@@ -1,400 +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.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-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.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableJoinColumn;
-import org.eclipse.jpt.core.resource.java.NestableUniqueConstraint;
-import org.eclipse.jpt.core.utility.TextRange;
-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.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-public class JoinTableImpl extends AbstractResourceTable implements JoinTableAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JoinTableAnnotation.ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.JOIN_TABLE__NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> SCHEMA_ADAPTER = ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.JOIN_TABLE__SCHEMA);
-
- private static final DeclarationAnnotationElementAdapter<String> CATALOG_ADAPTER = ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.JOIN_TABLE__CATALOG);
-
- protected final List<NestableJoinColumn> joinColumns;
-
- protected final List<NestableJoinColumn> inverseJoinColumns;
-
- private final JoinColumnsContainerAnnotation joinColumnsContainerAnnotation;
-
- private final InverseJoinColumnsContainerAnnotation inverseJoinColumnsContainerAnnotation;
-
- protected JoinTableImpl(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER));
- this.joinColumns = new ArrayList<NestableJoinColumn>();
- this.inverseJoinColumns = new ArrayList<NestableJoinColumn>();
- this.joinColumnsContainerAnnotation = new JoinColumnsContainerAnnotation();
- this.inverseJoinColumnsContainerAnnotation = new InverseJoinColumnsContainerAnnotation();
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this.joinColumnsContainerAnnotation);
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this.inverseJoinColumnsContainerAnnotation);
- }
-
- public String getAnnotationName() {
- return JoinTableAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getNameAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- // ignore the daa passed in, @JoinTable is never nested
- return NAME_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getSchemaAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- // ignore the daa passed in, @JoinTable is never nested
- return SCHEMA_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getCatalogAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- // ignore the daa passed in, @JoinTable is never nested
- return CATALOG_ADAPTER;
- }
-
- @Override
- protected String getUniqueConstraintsElementName() {
- return JPA.JOIN_TABLE__UNIQUE_CONSTRAINTS;
- }
-
- @Override
- protected NestableUniqueConstraint createUniqueConstraint(int index) {
- return UniqueConstraintImpl.createJoinTableUniqueConstraint(this, this.getMember(), index);
- }
-
- @Override
- public void update(CompilationUnit astRoot) {
- super.update(astRoot);
- this.updateJoinColumnsFromJava(astRoot);
- this.updateInverseJoinColumnsFromJava(astRoot);
- }
-
- private void updateJoinColumnsFromJava(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this.joinColumnsContainerAnnotation);
- }
-
- private void updateInverseJoinColumnsFromJava(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this.inverseJoinColumnsContainerAnnotation);
- }
-
- public ListIterator<JoinColumnAnnotation> joinColumns() {
- return new CloneListIterator<JoinColumnAnnotation>(this.joinColumns);
- }
-
- public int joinColumnsSize() {
- return this.joinColumns.size();
- }
-
- public NestableJoinColumn joinColumnAt(int index) {
- return this.joinColumns.get(index);
- }
-
- public int indexOfJoinColumn(JoinColumnAnnotation joinColumn) {
- return this.joinColumns.indexOf(joinColumn);
- }
-
- public JoinColumnAnnotation addJoinColumn(int index) {
- NestableJoinColumn joinColumn = (NestableJoinColumn) ContainerAnnotationTools.addNestedAnnotation(index, this.joinColumnsContainerAnnotation);
- fireItemAdded(JoinTableAnnotation.JOIN_COLUMNS_LIST, index, joinColumn);
- return joinColumn;
- }
-
- protected void addJoinColumn(int index, NestableJoinColumn joinColumn) {
- addItemToList(index, joinColumn, this.joinColumns, JOIN_COLUMNS_LIST);
- }
-
- public void removeJoinColumn(int index) {
- NestableJoinColumn joinColumn = this.joinColumns.get(index);
- removeJoinColumn(joinColumn);
- joinColumn.removeAnnotation();
- ContainerAnnotationTools.synchAnnotationsAfterRemove(index, this.joinColumnsContainerAnnotation);
- }
-
- protected void removeJoinColumn(NestableJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.joinColumns, JOIN_COLUMNS_LIST);
- }
-
- public void moveJoinColumn(int targetIndex, int sourceIndex) {
- moveJoinColumnInternal(targetIndex, sourceIndex);
- ContainerAnnotationTools.synchAnnotationsAfterMove(targetIndex, sourceIndex, this.joinColumnsContainerAnnotation);
- fireItemMoved(JoinTableAnnotation.JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- protected void moveJoinColumnInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.joinColumns, targetIndex, sourceIndex);
- }
-
- public ListIterator<JoinColumnAnnotation> inverseJoinColumns() {
- return new CloneListIterator<JoinColumnAnnotation>(this.inverseJoinColumns);
- }
-
- public int inverseJoinColumnsSize() {
- return this.inverseJoinColumns.size();
- }
-
- public NestableJoinColumn inverseJoinColumnAt(int index) {
- return this.inverseJoinColumns.get(index);
- }
-
- public int indexOfInverseJoinColumn(JoinColumnAnnotation joinColumn) {
- return this.inverseJoinColumns.indexOf(joinColumn);
- }
-
- public JoinColumnAnnotation addInverseJoinColumn(int index) {
- NestableJoinColumn inverseJoinColumn = (NestableJoinColumn) ContainerAnnotationTools.addNestedAnnotation(index, this.inverseJoinColumnsContainerAnnotation);
- fireItemAdded(JoinTableAnnotation.INVERSE_JOIN_COLUMNS_LIST, index, inverseJoinColumn);
- return inverseJoinColumn;
- }
-
- protected void addInverseJoinColumn(int index, NestableJoinColumn joinColumn) {
- addItemToList(index, joinColumn, this.inverseJoinColumns, INVERSE_JOIN_COLUMNS_LIST);
- }
-
- public void removeInverseJoinColumn(int index) {
- NestableJoinColumn joinColumn = this.inverseJoinColumns.get(index);
- this.removeInverseJoinColumn(joinColumn);
- joinColumn.removeAnnotation();
- ContainerAnnotationTools.synchAnnotationsAfterRemove(index, this.inverseJoinColumnsContainerAnnotation);
- }
-
- protected void removeInverseJoinColumn(NestableJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.inverseJoinColumns, INVERSE_JOIN_COLUMNS_LIST);
- }
-
- public void moveInverseJoinColumn(int targetIndex, int sourceIndex) {
- moveInverseJoinColumnInternal(targetIndex, sourceIndex);
- ContainerAnnotationTools.synchAnnotationsAfterMove(targetIndex, sourceIndex, this.inverseJoinColumnsContainerAnnotation);
- fireItemMoved(JoinTableAnnotation.INVERSE_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- protected void moveInverseJoinColumnInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.inverseJoinColumns, targetIndex, sourceIndex);
- }
-
- protected NestableJoinColumn createJoinColumn(int index) {
- return JoinColumnImpl.createJoinTableJoinColumn(this, getMember(), index);
- }
-
- protected NestableJoinColumn createInverseJoinColumn(int index) {
- return JoinColumnImpl.createJoinTableInverseJoinColumn(this, getMember(), index);
- }
-
- protected class JoinColumnsContainerAnnotation extends AbstractContainerAnnotation {
-
- public NestableJoinColumn addInternal(int index) {
- NestableJoinColumn joinColumn = JoinTableImpl.this.createJoinColumn(index);
- JoinTableImpl.this.joinColumns.add(index, joinColumn);
- return joinColumn;
- }
-
- public NestableJoinColumn add(int index) {
- NestableJoinColumn joinColumn = JoinTableImpl.this.createJoinColumn(index);
- JoinTableImpl.this.addJoinColumn(index, joinColumn);
- return joinColumn;
- }
-
- public int indexOf(NestableJoinColumn joinColumn) {
- return JoinTableImpl.this.indexOfJoinColumn(joinColumn);
- }
-
- public void move(int targetIndex, int sourceIndex) {
- JoinTableImpl.this.moveJoinColumn(targetIndex, sourceIndex);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- JoinTableImpl.this.moveJoinColumnInternal(targetIndex, sourceIndex);
- }
-
- public NestableJoinColumn nestedAnnotationAt(int index) {
- return JoinTableImpl.this.joinColumnAt(index);
- }
-
- public ListIterator<NestableJoinColumn> nestedAnnotations() {
- return new CloneListIterator<NestableJoinColumn>(JoinTableImpl.this.joinColumns);
- }
-
- public int nestedAnnotationsSize() {
- return joinColumnsSize();
- }
-
- public void remove(NestableJoinColumn nestedAnnotation) {
- JoinTableImpl.this.removeJoinColumn(nestedAnnotation);
- }
- public String getElementName() {
- return JPA.JOIN_TABLE__JOIN_COLUMNS;
- }
- }
-
- protected class InverseJoinColumnsContainerAnnotation extends AbstractContainerAnnotation {
-
- public NestableJoinColumn addInternal(int index) {
- NestableJoinColumn joinColumn = JoinTableImpl.this.createInverseJoinColumn(index);
- JoinTableImpl.this.inverseJoinColumns.add(index, joinColumn);
- return joinColumn;
- }
-
- public NestableJoinColumn add(int index) {
- NestableJoinColumn joinColumn = JoinTableImpl.this.createInverseJoinColumn(index);
- JoinTableImpl.this.addInverseJoinColumn(index, joinColumn);
- return joinColumn;
- }
-
- public int indexOf(NestableJoinColumn joinColumn) {
- return JoinTableImpl.this.indexOfInverseJoinColumn(joinColumn);
- }
-
- public void move(int targetIndex, int sourceIndex) {
- JoinTableImpl.this.moveInverseJoinColumn(targetIndex, sourceIndex);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- JoinTableImpl.this.moveInverseJoinColumnInternal(targetIndex, sourceIndex);
- }
-
- public NestableJoinColumn nestedAnnotationAt(int index) {
- return JoinTableImpl.this.inverseJoinColumnAt(index);
- }
-
- public ListIterator<NestableJoinColumn> nestedAnnotations() {
- return new CloneListIterator<NestableJoinColumn>(JoinTableImpl.this.inverseJoinColumns);
- }
-
- public int nestedAnnotationsSize() {
- return inverseJoinColumnsSize();
- }
-
- public void remove(NestableJoinColumn nestedAnnotation) {
- JoinTableImpl.this.removeInverseJoinColumn(nestedAnnotation);
- }
-
- public String getElementName() {
- return JPA.JOIN_TABLE__INVERSE_JOIN_COLUMNS;
- }
- }
-
- private abstract class AbstractContainerAnnotation extends AbstractJavaResourceNode implements ContainerAnnotation<NestableJoinColumn> {
-
- public AbstractContainerAnnotation() {
- super(JoinTableImpl.this);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public String getAnnotationName() {
- return JoinTableImpl.this.getAnnotationName();
- }
-
- public String getNestableAnnotationName() {
- return JPA.JOIN_COLUMN;
- }
-
- public void remove(int index) {
- this.remove(nestedAnnotationAt(index));
- }
-
- public NestableJoinColumn nestedAnnotationFor(org.eclipse.jdt.core.dom.Annotation jdtAnnotation) {
- for (NestableJoinColumn joinColumn : CollectionTools.iterable(nestedAnnotations())) {
- if (jdtAnnotation == joinColumn.getJdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return joinColumn;
- }
- }
- return null;
- }
-
- public org.eclipse.jdt.core.dom.Annotation getJdtAnnotation(CompilationUnit astRoot) {
- return JoinTableImpl.this.getJdtAnnotation(astRoot);
- }
-
- public void newAnnotation() {
- JoinTableImpl.this.newAnnotation();
- }
-
- public void removeAnnotation() {
- JoinTableImpl.this.removeAnnotation();
- }
-
- public void update(CompilationUnit astRoot) {
- JoinTableImpl.this.update(astRoot);
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return JoinTableImpl.this.getTextRange(astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getAnnotationName());
- }
-
- }
- public static class JoinTableAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final JoinTableAnnotationDefinition 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 JoinTableImpl(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullJoinTable(parent);
- }
-
- public String getAnnotationName() {
- return JoinTableAnnotation.ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JpaCompilationUnitImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JpaCompilationUnitImpl.java
deleted file mode 100644
index eea34364cf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JpaCompilationUnitImpl.java
+++ /dev/null
@@ -1,306 +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.resource.java;
-
-import java.util.Iterator;
-import java.util.List;
-
-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.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.ResourceModelListener;
-import org.eclipse.jpt.core.internal.utility.jdt.JDTTools;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.JpaCompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.utility.CommandExecutorProvider;
-import org.eclipse.jpt.utility.internal.BitTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-/**
- *
- */
-public class JpaCompilationUnitImpl
- extends AbstractJavaResourceNode
- implements JpaCompilationUnit
-{
- private final ICompilationUnit compilationUnit;
-
- private final JpaAnnotationProvider annotationProvider;
-
- private final CommandExecutorProvider modifySharedDocumentCommandExecutorProvider;
-
- private final AnnotationEditFormatter annotationEditFormatter;
-
- private final ResourceModelListener resourceModelListener;
-
- /**
- * 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).
- */
- protected JavaResourcePersistentType persistentType;
-
-
- // ********** construction **********
-
- public JpaCompilationUnitImpl(
- ICompilationUnit compilationUnit,
- JpaAnnotationProvider annotationProvider,
- CommandExecutorProvider modifySharedDocumentCommandExecutorProvider,
- AnnotationEditFormatter annotationEditFormatter,
- ResourceModelListener resourceModelListener) {
- super(null); // the JPA compilation unit is the root of its sub-tree
- this.compilationUnit = compilationUnit;
- this.annotationProvider = annotationProvider;
- this.modifySharedDocumentCommandExecutorProvider = modifySharedDocumentCommandExecutorProvider;
- this.annotationEditFormatter = annotationEditFormatter;
- this.resourceModelListener = resourceModelListener;
- this.persistentType = this.buildPersistentType();
- }
-
- protected JavaResourcePersistentType buildPersistentType() {
- this.openCompilationUnit();
- CompilationUnit astRoot = this.buildASTRoot();
- this.closeCompilationUnit();
- return this.buildPersistentType(astRoot);
- }
-
- protected void openCompilationUnit() {
- try {
- this.compilationUnit.open(null);
- } catch (JavaModelException ex) {
- // do nothing - we just won't have a primary type in this case
- }
- }
-
- protected void closeCompilationUnit() {
- try {
- this.compilationUnit.close();
- } catch (JavaModelException ex) {
- // hmmm
- }
- }
-
- protected JavaResourcePersistentType buildPersistentType(CompilationUnit astRoot) {
- TypeDeclaration td = this.getPrimaryType(astRoot);
- return (td == null) ? null : this.buildPersistentType(astRoot, td);
- }
-
- public void initialize(CompilationUnit astRoot) {
- // never called?
- }
-
-
- // ********** AbstractJavaResourceNode overrides **********
-
- @Override
- protected boolean requiresParent() {
- return false;
- }
-
- @Override
- public JpaCompilationUnit getJpaCompilationUnit() {
- return this;
- }
-
- @Override
- public JpaAnnotationProvider getAnnotationProvider() {
- return this.annotationProvider;
- }
-
-
- // ********** JavaResourceNode implementation **********
-
- public void update(CompilationUnit astRoot) {
- TypeDeclaration td = this.getPrimaryType(astRoot);
- if (td == null) {
- this.persistentType = null;
- } else {
- if (this.persistentType == null) {
- this.persistentType = this.buildPersistentType(astRoot, td);
- } else {
- this.persistentType.update(astRoot);
- }
- }
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-
- // ********** JpaCompilationUnit implementation **********
-
- public ICompilationUnit getCompilationUnit() {
- return this.compilationUnit;
- }
-
- public Iterator<JavaResourcePersistentType> persistableTypes() {
- return (this.persistentType == null) ?
- EmptyIterator.<JavaResourcePersistentType>instance() :
- this.persistentType.allPersistableTypes();
- }
-
- public void resourceModelChanged() {
- this.resourceModelListener.resourceModelChanged();
- }
-
- public void resolveTypes() {
- if (this.persistentType != null) {
- this.persistentType.resolveTypes(this.buildASTRoot());
- }
- }
-
- public CommandExecutorProvider getModifySharedDocumentCommandExecutorProvider() {
- return this.modifySharedDocumentCommandExecutorProvider;
- }
-
- public AnnotationEditFormatter getAnnotationEditFormatter() {
- return this.annotationEditFormatter;
- }
-
-
- // ********** Java changes **********
-
- public void javaElementChanged(ElementChangedEvent event) {
- this.synchWithJavaDelta(event.getDelta());
- }
-
- protected void synchWithJavaDelta(IJavaElementDelta delta) {
- switch (delta.getElement().getElementType()) {
- case IJavaElement.JAVA_PROJECT :
- if (this.classpathHasChanged(delta)) {
- this.updateFromJava();
- break; // no need to check further
- }
- case IJavaElement.JAVA_MODEL :
- case IJavaElement.PACKAGE_FRAGMENT_ROOT :
- case IJavaElement.PACKAGE_FRAGMENT :
- this.synchChildrenWithJavaDelta(delta);
- break;
- case IJavaElement.COMPILATION_UNIT :
- if (this.deltaIsRelevant(delta)) {
- this.updateFromJava();
- }
- break;
- default :
- break; // the element type is somehow held by a compilation unit (i.e. probably doesn't happen)
- }
- }
-
- protected void synchChildrenWithJavaDelta(IJavaElementDelta delta) {
- for (IJavaElementDelta child : delta.getAffectedChildren()) {
- this.synchWithJavaDelta(child); // recurse
- }
- }
-
- // 235384 - We need to update all compilation units when a classpath change occurs.
- // The persistence.jar could have been added to or removed from the
- // classpath which affects whether we know about the JPA annotations.
- protected boolean classpathHasChanged(IJavaElementDelta delta) {
- return BitTools.anyFlagsAreSet(delta.getFlags(), this.getClasspathChangedFlags());
- }
-
- protected int getClasspathChangedFlags() {
- return CLASSPATH_CHANGED_FLAGS;
- }
-
- protected static final int CLASSPATH_CHANGED_FLAGS =
- IJavaElementDelta.F_RESOLVED_CLASSPATH_CHANGED |
- IJavaElementDelta.F_CLASSPATH_CHANGED;
-
- protected boolean deltaIsRelevant(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;
- }
-
- // we get the java notification for removal before we get the resource notification;
- // we do not need to handle this event and will get exceptions building an astRoot if we try
- if (delta.getKind() == IJavaElementDelta.REMOVED) {
- return false;
- }
-
- return delta.getElement().equals(this.compilationUnit);
- }
-
- protected void updateFromJava() {
- this.update(this.buildASTRoot());
- }
-
-
- // ********** internal **********
-
- protected CompilationUnit buildASTRoot() {
- return JDTTools.buildASTRoot(this.compilationUnit);
- }
-
- protected JavaResourcePersistentType buildPersistentType(CompilationUnit astRoot, TypeDeclaration typeDeclaration) {
- return JavaResourcePersistentTypeImpl.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 resolveBinding() on the TypeDeclaration returns null
- * This can occur if the project JRE is removed (bug 225332)
- */
- protected TypeDeclaration getPrimaryType(CompilationUnit astRoot) {
- String primaryTypeName = this.getPrimaryTypeName();
- for (AbstractTypeDeclaration atd : types(astRoot)) {
- if ((atd.getNodeType() == ASTNode.TYPE_DECLARATION)
- && atd.getName().getFullyQualifiedName().equals(primaryTypeName)) {
- return (atd.resolveBinding()) != null ? (TypeDeclaration) atd : null;
- }
- }
- return null;
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected static List<AbstractTypeDeclaration> types(CompilationUnit astRoot) {
- return astRoot.types();
- }
-
- /**
- * i.e. the name of the compilation unit
- */
- protected String getPrimaryTypeName() {
- return removeJavaExtension(this.compilationUnit.getElementName());
- }
-
- protected static 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.persistentType.getName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/LobImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/LobImpl.java
deleted file mode 100644
index 8d3e73fadd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/LobImpl.java
+++ /dev/null
@@ -1,75 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-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.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-public class LobImpl extends AbstractResourceAnnotation<Attribute> implements LobAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- protected LobImpl(JavaResourceNode parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public void update(CompilationUnit astRoot) {
- //nothing to update
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- public static class LobAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final LobAnnotationDefinition 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 LobImpl(parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToManyImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToManyImpl.java
deleted file mode 100644
index afb48b8294..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToManyImpl.java
+++ /dev/null
@@ -1,165 +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.resource.java;
-
-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.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-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.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;
-
-
-public class ManyToManyImpl extends AbstractRelationshipMappingAnnotation implements ManyToManyAnnotation
-{
- 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[]> CASCADE_ADAPTER = buildCascadeAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> MAPPED_BY_ADAPTER = buildMappedByAdapter();
-
- private final AnnotationElementAdapter<String> mappedByAdapter;
-
- private String mappedBy;
-
- protected ManyToManyImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.mappedByAdapter = buildAnnotationElementAdapter(MAPPED_BY_ADAPTER);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.mappedBy = this.mappedBy(astRoot);
- }
-
- //**************** AbstractRelationshipMappingAnnotation implementation **************
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getTargetEntityAdapter() {
- return TARGET_ENTITY_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String[]> getCascadeAdapter() {
- return CASCADE_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getFetchAdapter() {
- return FETCH_ADAPTER;
- }
-
-
- //**************** Annotation implementation **************
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String newMappedBy) {
- if (attributeValueHasNotChanged(this.mappedBy, newMappedBy)) {
- return;
- }
- String oldMappedBy = this.mappedBy;
- this.mappedBy = newMappedBy;
- this.mappedByAdapter.setValue(newMappedBy);
- firePropertyChanged(MAPPED_BY_PROPERTY, oldMappedBy, newMappedBy);
- }
-
- @Override
- public void update(CompilationUnit astRoot) {
- super.update(astRoot);
- this.setMappedBy(this.mappedBy(astRoot));
- }
-
- protected String mappedBy(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);
- }
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildTargetEntityAdapter() {
- return buildTargetEntityAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_MANY__TARGET_ENTITY);
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildCascadeAdapter() {
- return buildEnumArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_MANY__CASCADE);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildFetchAdapter() {
- return buildFetchAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_MANY__FETCH);
- }
-
-
- 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
- }
-
-
- public static class ManyToManyAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final ManyToManyAnnotationDefinition INSTANCE = new ManyToManyAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static ManyToManyAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private ManyToManyAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new ManyToManyImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToOneImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToOneImpl.java
deleted file mode 100644
index 5206043595..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToOneImpl.java
+++ /dev/null
@@ -1,164 +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.resource.java;
-
-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.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-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.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;
-
-
-public class ManyToOneImpl extends AbstractRelationshipMappingAnnotation implements ManyToOneAnnotation
-{
- 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[]> CASCADE_ADAPTER = buildCascadeAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter();
-
- private static final DeclarationAnnotationElementAdapter<Boolean> OPTIONAL_ADAPTER = buildOptionalAdapter();
-
- private final AnnotationElementAdapter<Boolean> optionalAdapter;
-
- private Boolean optional;
-
- protected ManyToOneImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.optionalAdapter = this.buildBooleanAnnotationElementAdapter(OPTIONAL_ADAPTER);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.optional = this.optional(astRoot);
- }
-
- //**************** AbstractRelationshipMappingAnnotation implementation **************
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getTargetEntityAdapter() {
- return TARGET_ENTITY_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String[]> getCascadeAdapter() {
- return CASCADE_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getFetchAdapter() {
- return FETCH_ADAPTER;
- }
-
- //**************** Annotation implementation **************
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- public Boolean getOptional() {
- return this.optional;
- }
-
- public void setOptional(Boolean newOptional) {
- if (attributeValueHasNotChanged(this.optional, newOptional)) {
- return;
- }
- Boolean oldOptional = this.optional;
- this.optional = newOptional;
- this.optionalAdapter.setValue(newOptional);
- firePropertyChanged(OPTIONAL_PROPERTY, oldOptional, newOptional);
- }
-
- public TextRange getOptionalTextRange(CompilationUnit astRoot) {
- return getElementTextRange(OPTIONAL_ADAPTER, astRoot);
- }
-
- @Override
- public void update(CompilationUnit astRoot) {
- super.update(astRoot);
- this.setOptional(this.optional(astRoot));
- }
-
- protected Boolean optional(CompilationUnit astRoot) {
- return this.optionalAdapter.getValue(astRoot);
- }
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildTargetEntityAdapter() {
- return buildTargetEntityAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_ONE__TARGET_ENTITY);
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildCascadeAdapter() {
- return buildEnumArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_ONE__CASCADE);
- }
-
- 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<Boolean> buildOptionalAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(annotationAdapter, elementName, false, BooleanExpressionConverter.instance());
- }
-
-
- public static class ManyToOneAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final ManyToOneAnnotationDefinition INSTANCE = new ManyToOneAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static ManyToOneAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private ManyToOneAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new ManyToOneImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MapKeyImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MapKeyImpl.java
deleted file mode 100644
index bc3d3e4f8e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MapKeyImpl.java
+++ /dev/null
@@ -1,125 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-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;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-public class MapKeyImpl extends AbstractResourceAnnotation<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;
-
- protected MapKeyImpl(JavaResourceNode parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.nameAdapter = new ShortCircuitAnnotationElementAdapter<String>(attribute, NAME_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = name(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- if (attributeValueHasNotChanged(this.name, newName)) {
- return;
- }
- String oldName = this.name;
- this.name = newName;
- this.nameAdapter.setValue(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- 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);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setName(this.name(astRoot));
- }
-
- protected String name(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<String> buildNameAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.MAP_KEY__NAME, false);
- }
-
-
- public static class MapKeyAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final MapKeyAnnotationDefinition 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 MapKeyImpl(parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MappedSuperclassImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MappedSuperclassImpl.java
deleted file mode 100644
index 05b35fad72..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MappedSuperclassImpl.java
+++ /dev/null
@@ -1,75 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-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.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-
-public class MappedSuperclassImpl extends AbstractResourceAnnotation<Type> implements MappedSuperclassAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- protected MappedSuperclassImpl(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void update(CompilationUnit astRoot) {
- //no annotation members
- }
-
- public static class MappedSuperclassAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final MappedSuperclassAnnotationDefinition INSTANCE = new MappedSuperclassAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static MappedSuperclassAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private MappedSuperclassAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new MappedSuperclassImpl((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueriesImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueriesImpl.java
deleted file mode 100644
index 5ccddc9a82..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueriesImpl.java
+++ /dev/null
@@ -1,157 +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.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-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.NestableNamedNativeQuery;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-public class NamedNativeQueriesImpl extends AbstractResourceAnnotation<Type> implements NamedNativeQueriesAnnotation
-{
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private List<NestableNamedNativeQuery> namedNativeQueries;
-
- protected NamedNativeQueriesImpl(JavaResourceNode parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.namedNativeQueries = new ArrayList<NestableNamedNativeQuery>();
- }
-
- public void initialize(CompilationUnit astRoot) {
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this);
- }
-
- public String getAnnotationName() {
- return NamedNativeQueriesAnnotation.ANNOTATION_NAME;
- }
-
- public String getNestableAnnotationName() {
- return NamedNativeQueryAnnotation.ANNOTATION_NAME;
- }
-
- public String getElementName() {
- return JPA.NAMED_NATIVE_QUERIES__VALUE;
- }
-
- public ListIterator<NestableNamedNativeQuery> nestedAnnotations() {
- return new CloneListIterator<NestableNamedNativeQuery>(this.namedNativeQueries);
- }
-
- public int nestedAnnotationsSize() {
- return this.namedNativeQueries.size();
- }
-
- public NestableNamedNativeQuery addInternal(int index) {
- NestableNamedNativeQuery namedNativeQuery = createNamedNativeQuery(index);
- this.namedNativeQueries.add(index, namedNativeQuery);
- return namedNativeQuery;
- }
-
- public NestableNamedNativeQuery add(int index) {
- NestableNamedNativeQuery namedNativeQuery = createNamedNativeQuery(index);
- add(index, namedNativeQuery);
- return namedNativeQuery;
- }
-
- protected void add(int index, NestableNamedNativeQuery query) {
- addItemToList(index, query, this.namedNativeQueries, NamedNativeQueriesAnnotation.NAMED_NATIVE_QUERIES_LIST);
- }
-
- public void remove(NestableNamedNativeQuery query) {
- removeItemFromList(query, this.namedNativeQueries, NamedNativeQueriesAnnotation.NAMED_NATIVE_QUERIES_LIST);
- }
-
- public void remove(int index) {
- removeItemFromList(index, this.namedNativeQueries, NamedNativeQueriesAnnotation.NAMED_NATIVE_QUERIES_LIST);
- }
-
- public int indexOf(NestableNamedNativeQuery query) {
- return this.namedNativeQueries.indexOf(query);
- }
-
- public NestableNamedNativeQuery nestedAnnotationAt(int index) {
- return this.namedNativeQueries.get(index);
- }
-
- public NestableNamedNativeQuery nestedAnnotationFor(org.eclipse.jdt.core.dom.Annotation jdtAnnotation) {
- for (NestableNamedNativeQuery namedQuery : this.namedNativeQueries) {
- if (jdtAnnotation == namedQuery.getJdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return namedQuery;
- }
- }
- return null;
- }
-
- public void move(int targetIndex, int sourceIndex) {
- moveItemInList(targetIndex, sourceIndex, this.namedNativeQueries, NAMED_NATIVE_QUERIES_LIST);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.namedNativeQueries, targetIndex, sourceIndex);
- }
-
- public void update(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this);
- }
-
- private NamedNativeQueryImpl createNamedNativeQuery(int index) {
- return NamedNativeQueryImpl.createNestedNamedNativeQuery(this, getMember(), index, getDeclarationAnnotationAdapter());
- }
-
-
- public static class NamedNativeQueriesAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final NamedNativeQueriesAnnotationDefinition 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 NamedNativeQueriesImpl(parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueryImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueryImpl.java
deleted file mode 100644
index 7fda779a80..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueryImpl.java
+++ /dev/null
@@ -1,238 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.JDTTools;
-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.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NamedNativeQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableNamedNativeQuery;
-import org.eclipse.jpt.core.resource.java.NestableQueryHint;
-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;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-public class NamedNativeQueryImpl extends AbstractNamedQuery
- implements NestableNamedNativeQuery
-{
-
- public static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- // hold this so we can get the 'resultClass' text range
- private final DeclarationAnnotationElementAdapter<String> resultClassDeclarationAdapter;
-
- // hold this so we can get the 'resultSetMapping' text range
- private final DeclarationAnnotationElementAdapter<String> resultSetMappingDeclarationAdapter;
-
-
- private final AnnotationElementAdapter<String> resultClassAdapter;
-
- private final AnnotationElementAdapter<String> resultSetMappingAdapter;
-
- private String resultClass;
-
- private String fullyQualifiedResultClass;
-
- private String resultSetMapping;
-
- protected NamedNativeQueryImpl(JavaResourceNode parent, Type type, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, type, daa, annotationAdapter);
- this.resultClassDeclarationAdapter = resultClassAdapter(daa);
- this.resultClassAdapter = this.buildAdapter(this.resultClassDeclarationAdapter);
- this.resultSetMappingDeclarationAdapter = resultSetMappingAdapter(daa);
- this.resultSetMappingAdapter = this.buildAdapter(this.resultSetMappingDeclarationAdapter);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.resultClass = this.resultClass(astRoot);
- this.fullyQualifiedResultClass = this.fullyQualifiedResultClass(astRoot);
- this.resultSetMapping = this.resultSetMapping(astRoot);
- }
-
-
- // ********** initialization **********
- protected DeclarationAnnotationElementAdapter<String> resultClassAdapter(DeclarationAnnotationAdapter daa) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(daa, JPA.NAMED_NATIVE_QUERY__RESULT_CLASS, SimpleTypeStringExpressionConverter.instance());
- }
-
- protected DeclarationAnnotationElementAdapter<String> resultSetMappingAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JPA.NAMED_NATIVE_QUERY__RESULT_SET_MAPPING);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- //************* AbstractNamedQuery implementation *************
-
- @Override
- protected String getNameElementName() {
- return JPA.NAMED_NATIVE_QUERY__NAME;
- }
-
- @Override
- protected String getQueryElementName() {
- return JPA.NAMED_NATIVE_QUERY__QUERY;
- }
-
- @Override
- protected String getHintsElementName() {
- return JPA.NAMED_NATIVE_QUERY__HINTS;
- }
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- NamedNativeQueryAnnotation oldNamedQuery = (NamedNativeQueryAnnotation) oldAnnotation;
- setResultClass(oldNamedQuery.getResultClass());
- setResultSetMapping(oldNamedQuery.getResultSetMapping());
- }
-
- public String getResultClass() {
- return this.resultClass;
- }
-
- public void setResultClass(String newResultClass) {
- if (attributeValueHasNotChanged(this.resultClass, newResultClass)) {
- return;
- }
- String oldResultClass = this.resultClass;
- this.resultClass = newResultClass;
- this.resultClassAdapter.setValue(newResultClass);
- firePropertyChanged(RESULT_CLASS_PROPERTY, oldResultClass, newResultClass);
- }
-
- public String getFullyQualifiedResultClass() {
- return this.fullyQualifiedResultClass;
- }
-
- protected void setFullyQualifiedResultClass(String newQualifiedResultClass) {
- String oldFullyQualifiedResultClass = this.fullyQualifiedResultClass;
- this.fullyQualifiedResultClass = newQualifiedResultClass;
- firePropertyChanged(FULLY_QUALIFIED_RESULT_CLASS_PROPERTY, oldFullyQualifiedResultClass, newQualifiedResultClass);
- }
-
- public String getResultSetMapping() {
- return this.resultSetMapping;
- }
-
- public void setResultSetMapping(String newResultSetMapping) {
- if (attributeValueHasNotChanged(this.resultSetMapping, newResultSetMapping)) {
- return;
- }
- String oldResultSetMapping = this.resultSetMapping;
- this.resultSetMapping = newResultSetMapping;
- this.resultSetMappingAdapter.setValue(newResultSetMapping);
- firePropertyChanged(RESULT_SET_MAPPING_PROPERTY, oldResultSetMapping, newResultSetMapping);
- }
-
- public TextRange getResultClassTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.resultClassDeclarationAdapter, astRoot);
- }
-
- public TextRange getResultSetMappingTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.resultSetMappingDeclarationAdapter, astRoot);
- }
-
- @Override
- public void update(CompilationUnit astRoot) {
- super.update(astRoot);
- this.setResultClass(this.resultClass(astRoot));
- this.setFullyQualifiedResultClass(this.fullyQualifiedResultClass(astRoot));
- this.setResultSetMapping(this.resultSetMapping(astRoot));
- }
-
- protected String resultClass(CompilationUnit astRoot) {
- return this.resultClassAdapter.getValue(astRoot);
- }
-
- protected String resultSetMapping(CompilationUnit astRoot) {
- return this.resultSetMappingAdapter.getValue(astRoot);
- }
-
- protected String fullyQualifiedResultClass(CompilationUnit astRoot) {
- if (getResultClass() == null) {
- return null;
- }
- return JDTTools.resolveFullyQualifiedName(this.resultClassAdapter.getExpression(astRoot));
- }
-
- @Override
- protected NestableQueryHint createQueryHint(int index) {
- return QueryHintImpl.createNamedNativeQueryQueryHint(this, this.getMember(), this.getDeclarationAnnotationAdapter(), index);
- }
-
- // ********** static methods **********
- static NamedNativeQueryImpl createNamedNativeQuery(JavaResourceNode parent, Type type) {
- return new NamedNativeQueryImpl(parent, type, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(type, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- static NamedNativeQueryImpl createNestedNamedNativeQuery(JavaResourceNode parent, Type type, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, attributeOverridesAdapter);
- IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(type, idaa);
- return new NamedNativeQueryImpl(parent, type, idaa, annotationAdapter);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter namedQueriesAdapter) {
- return new NestedIndexedDeclarationAnnotationAdapter(namedQueriesAdapter, index, JPA.NAMED_NATIVE_QUERY);
- }
-
- public static class NamedNativeQueryAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final NamedNativeQueryAnnotationDefinition 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 NamedNativeQueryImpl.createNamedNativeQuery(parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueriesImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueriesImpl.java
deleted file mode 100644
index 0f8f19a4c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueriesImpl.java
+++ /dev/null
@@ -1,156 +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.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NamedQueriesAnnotation;
-import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableNamedQuery;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-public class NamedQueriesImpl extends AbstractResourceAnnotation<Type> implements NamedQueriesAnnotation
-{
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(NamedQueriesAnnotation.ANNOTATION_NAME);
-
- private List<NestableNamedQuery> namedQueries;
-
- protected NamedQueriesImpl(JavaResourceNode parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.namedQueries = new ArrayList<NestableNamedQuery>();
- }
-
- public void initialize(CompilationUnit astRoot) {
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this);
- }
-
- public String getAnnotationName() {
- return NamedQueriesAnnotation.ANNOTATION_NAME;
- }
-
- public String getNestableAnnotationName() {
- return NamedQueryAnnotation.ANNOTATION_NAME;
- }
-
- public String getElementName() {
- return JPA.NAMED_QUERIES__VALUE;
- }
-
- public ListIterator<NestableNamedQuery> nestedAnnotations() {
- return new CloneListIterator<NestableNamedQuery>(this.namedQueries);
- }
-
- public int nestedAnnotationsSize() {
- return this.namedQueries.size();
- }
-
- public NestableNamedQuery addInternal(int index) {
- NestableNamedQuery namedQuery = createNamedQuery(index);
- this.namedQueries.add(index, namedQuery);
- return namedQuery;
- }
-
- public NestableNamedQuery add(int index) {
- NestableNamedQuery namedQuery = createNamedQuery(index);
- add(index, namedQuery);
- return namedQuery;
- }
-
- protected void add(int index, NestableNamedQuery namedQuery) {
- addItemToList(index, namedQuery, this.namedQueries, NamedQueriesAnnotation.NAMED_QUERIES_LIST);
- }
-
- public void remove(NestableNamedQuery namedQuery) {
- removeItemFromList(namedQuery, this.namedQueries, NamedQueriesAnnotation.NAMED_QUERIES_LIST);
- }
-
- public void remove(int index) {
- removeItemFromList(index, this.namedQueries, NamedQueriesAnnotation.NAMED_QUERIES_LIST);
- }
-
- public int indexOf(NestableNamedQuery attributeOverride) {
- return this.namedQueries.indexOf(attributeOverride);
- }
-
- public NestableNamedQuery nestedAnnotationAt(int index) {
- return this.namedQueries.get(index);
- }
-
- public NestableNamedQuery nestedAnnotationFor(org.eclipse.jdt.core.dom.Annotation jdtAnnotation) {
- for (NestableNamedQuery namedQuery : this.namedQueries) {
- if (jdtAnnotation == namedQuery.getJdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return namedQuery;
- }
- }
- return null;
- }
-
- public void move(int targetIndex, int sourceIndex) {
- moveItemInList(targetIndex, sourceIndex, this.namedQueries, NamedQueriesAnnotation.NAMED_QUERIES_LIST);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.namedQueries, targetIndex, sourceIndex);
- }
-
- public void update(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this);
- }
-
- private NamedQueryImpl createNamedQuery(int index) {
- return NamedQueryImpl.createNestedNamedQuery(this, getMember(), index, getDeclarationAnnotationAdapter());
- }
-
- public static class NamedQueriesAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final NamedQueriesAnnotationDefinition 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 NamedQueriesImpl(parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueryImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueryImpl.java
deleted file mode 100644
index d8977a604e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueryImpl.java
+++ /dev/null
@@ -1,112 +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.resource.java;
-
-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.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NestableNamedQuery;
-import org.eclipse.jpt.core.resource.java.NestableQueryHint;
-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;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-public class NamedQueryImpl extends AbstractNamedQuery
- implements NestableNamedQuery
-{
-
- public static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- protected NamedQueryImpl(JavaResourceNode parent, Type type, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, type, daa, annotationAdapter);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- //************* AbstractNamedQuery implementation *************
- @Override
- protected String getNameElementName() {
- return JPA.NAMED_QUERY__NAME;
- }
-
- @Override
- protected String getQueryElementName() {
- return JPA.NAMED_QUERY__QUERY;
- }
-
- @Override
- protected String getHintsElementName() {
- return JPA.NAMED_QUERY__HINTS;
- }
-
- @Override
- protected NestableQueryHint createQueryHint(int index) {
- return QueryHintImpl.createNamedQueryQueryHint(this, getMember(), this.getDeclarationAnnotationAdapter(), index);
- }
-
- // ********** static methods **********
- static NamedQueryImpl createNamedQuery(JavaResourceNode parent, Type type) {
- return new NamedQueryImpl(parent, type, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(type, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- static NamedQueryImpl createNestedNamedQuery(JavaResourceNode parent, Type type, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, attributeOverridesAdapter);
- IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(type, idaa);
- return new NamedQueryImpl(parent, type, idaa, annotationAdapter);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter namedQueriesAdapter) {
- return new NestedIndexedDeclarationAnnotationAdapter(namedQueriesAdapter, index, JPA.NAMED_QUERY);
- }
-
- public static class NamedQueryAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final NamedQueryAnnotationDefinition 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 NamedQueryImpl.createNamedQuery(parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAssociationOverride.java
deleted file mode 100644
index ee2838208f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAssociationOverride.java
+++ /dev/null
@@ -1,121 +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.resource.java;
-
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-
-
-public class NullAssociationOverride extends AbstractJavaResourceNode implements AssociationOverrideAnnotation, Annotation
-{
- private String name;
-
- public NullAssociationOverride(JavaResourceNode parent, String name) {
- super(parent);
- this.name = name;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation getJdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public String getAnnotationName() {
- return AssociationOverrideAnnotation.ANNOTATION_NAME;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (name != null) {
- createAssociationOverrideResource().setName(name);
- }
- }
-
- public ListIterator<JoinColumnAnnotation> joinColumns() {
- return EmptyListIterator.instance();
- }
-
- public JoinColumnAnnotation joinColumnAt(int index) {
- return null;
- }
-
- public int indexOfJoinColumn(JoinColumnAnnotation joinColumn) {
- throw new UnsupportedOperationException();
- }
-
- public int joinColumnsSize() {
- return 0;
- }
-
- 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 JavaResourcePersistentMember getParent() {
- return (JavaResourcePersistentMember) super.getParent();
- }
-
- protected AssociationOverrideAnnotation createAssociationOverrideResource() {
- return (AssociationOverrideAnnotation) getParent().addSupportingAnnotation(getAnnotationName());
- }
-
- public void update(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
-
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAttributeOverrideColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAttributeOverrideColumn.java
deleted file mode 100644
index 45aa4585d4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAttributeOverrideColumn.java
+++ /dev/null
@@ -1,80 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-public class NullAttributeOverrideColumn extends NullBaseColumn implements ColumnAnnotation, Annotation
-{
- public NullAttributeOverrideColumn(AttributeOverrideAnnotation parent) {
- super(parent);
- }
-
- @Override
- public AttributeOverrideAnnotation getParent() {
- return (AttributeOverrideAnnotation) super.getParent();
- }
-
- public String getAnnotationName() {
- return ColumnAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected ColumnAnnotation createResourceColumn() {
- return getParent().addColumn();
- }
-
- public Integer getLength() {
- return null;
- }
-
- public void setLength(Integer length) {
- if (length != null) {
- createResourceColumn().setLength(length);
- }
- }
-
- public Integer getScale() {
- return null;
- }
-
- public void setScale(Integer scale) {
- if (scale != null) {
- createResourceColumn().setScale(scale);
- }
- }
-
- public Integer getPrecision() {
- return null;
- }
-
- public void setPrecision(Integer precision) {
- if (precision != null) {
- createResourceColumn().setPrecision(precision);
- }
- }
-
- public TextRange getScaleTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getLengthTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getPrecisionTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBaseColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBaseColumn.java
deleted file mode 100644
index a4cd238c1b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBaseColumn.java
+++ /dev/null
@@ -1,101 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.BaseColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-public abstract class NullBaseColumn extends NullNamedColumn implements BaseColumnAnnotation, Annotation
-{
- protected NullBaseColumn(JavaResourceNode parent) {
- super(parent);
- }
-
- @Override
- protected abstract BaseColumnAnnotation createResourceColumn();
-
- public String getTable() {
- return null;
- }
-
- public void setTable(String table) {
- if (table != null) {
- createResourceColumn().setTable(table);
- }
- }
-
- public Boolean getUnique() {
- return null;
- }
-
- public void setUnique(Boolean unique) {
- if (unique != null) {
- createResourceColumn().setUnique(unique);
- }
- }
-
- public Boolean getUpdatable() {
- return null;
- }
-
- public void setUpdatable(Boolean updatable) {
- if (updatable != null) {
- createResourceColumn().setUpdatable(updatable);
- }
- }
-
- public Boolean getInsertable() {
- return null;
- }
-
- public void setInsertable(Boolean insertable) {
- if (insertable != null) {
- createResourceColumn().setInsertable(insertable);
- }
- }
-
- public Boolean getNullable() {
- return null;
- }
-
- public void setNullable(Boolean nullable) {
- if (nullable != null) {
- createResourceColumn().setNullable(nullable);
- }
- }
-
- public TextRange getTableTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getUniqueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getUpdatableTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getInsertableTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getNullableTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean tableTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBaseTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBaseTable.java
deleted file mode 100644
index ac5216bcac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBaseTable.java
+++ /dev/null
@@ -1,146 +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.resource.java;
-
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.TableAnnotation;
-import org.eclipse.jpt.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-
-public abstract class NullBaseTable extends AbstractJavaResourceNode implements Annotation
-{
- protected NullBaseTable(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- @Override
- public JavaResourcePersistentMember getParent() {
- return (JavaResourcePersistentMember) super.getParent();
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation getJdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- protected TableAnnotation createTableResource() {
- return (TableAnnotation) getParent().addSupportingAnnotation(getAnnotationName());
- }
-
- public String getName() {
- return null;
- }
-
- public void setName(String name) {
- if (name != null) {
- createTableResource().setName(name);
- }
- }
-
- public String getCatalog() {
- return null;
- }
-
- public void setCatalog(String catalog) {
- if (catalog != null) {
- createTableResource().setCatalog(catalog);
- }
- }
-
- public String getSchema() {
- return null;
- }
-
- public void setSchema(String schema) {
- if (schema != null) {
- createTableResource().setSchema(schema);
- }
- }
-
- public UniqueConstraintAnnotation addUniqueConstraint(int index) {
- return createTableResource().addUniqueConstraint(index);
- }
-
- public void removeUniqueConstraint(@SuppressWarnings("unused") int index) {
- throw new UnsupportedOperationException();
- }
-
- public int indexOfUniqueConstraint(@SuppressWarnings("unused") UniqueConstraintAnnotation uniqueConstraint) {
- throw new UnsupportedOperationException();
- }
-
- public void moveUniqueConstraint(@SuppressWarnings("unused") int targetIndex, @SuppressWarnings("unused") int sourceIndex) {
- throw new UnsupportedOperationException();
- }
- public UniqueConstraintAnnotation uniqueConstraintAt(@SuppressWarnings("unused") int index) {
- throw new UnsupportedOperationException();
- }
-
- public ListIterator<UniqueConstraintAnnotation> uniqueConstraints() {
- return EmptyListIterator.instance();
- }
-
- public int uniqueConstraintsSize() {
- return 0;
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getNameTextRange(@SuppressWarnings("unused") CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getCatalogTextRange(@SuppressWarnings("unused") CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getSchemaTextRange(@SuppressWarnings("unused") CompilationUnit astRoot) {
- return null;
- }
-
- public boolean nameTouches(@SuppressWarnings("unused") int pos, @SuppressWarnings("unused") CompilationUnit astRoot) {
- return false;
- }
-
- public boolean catalogTouches(@SuppressWarnings("unused") int pos, @SuppressWarnings("unused") CompilationUnit astRoot) {
- return false;
- }
-
- public boolean schemaTouches(@SuppressWarnings("unused") int pos, @SuppressWarnings("unused") CompilationUnit astRoot) {
- return false;
- }
-
- public void update(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBasic.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBasic.java
deleted file mode 100644
index a3c65b2adf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBasic.java
+++ /dev/null
@@ -1,91 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.core.resource.java.FetchType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-public class NullBasic extends AbstractJavaResourceNode implements BasicAnnotation, Annotation
-{
- protected NullBasic(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation getJdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public String getAnnotationName() {
- return BasicAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- public JavaResourcePersistentMember getParent() {
- return (JavaResourcePersistentMember) super.getParent();
- }
-
- protected BasicAnnotation createBasicResource() {
- getParent().setMappingAnnotation(getAnnotationName());
- return (BasicAnnotation) getParent().getMappingAnnotation();
- }
-
- public FetchType getFetch() {
- return null;
- }
-
- public void setFetch(FetchType fetch) {
- if (fetch != null) {
- createBasicResource().setFetch(fetch);
- }
- }
-
- public Boolean getOptional() {
- return null;
- }
-
- public void setOptional(Boolean optional) {
- if (optional != null) {
- createBasicResource().setOptional(optional);
- }
- }
-
- public void update(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getFetchTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getOptionalTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullColumn.java
deleted file mode 100644
index 255fe7615b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullColumn.java
+++ /dev/null
@@ -1,80 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-public class NullColumn extends NullBaseColumn implements ColumnAnnotation, Annotation
-{
- public NullColumn(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- @Override
- public JavaResourcePersistentMember getParent() {
- return (JavaResourcePersistentMember) super.getParent();
- }
-
- public String getAnnotationName() {
- return ColumnAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected ColumnAnnotation createResourceColumn() {
- return (ColumnAnnotation) getParent().addSupportingAnnotation(getAnnotationName());
- }
-
- public Integer getLength() {
- return null;
- }
-
- public void setLength(Integer length) {
- if (length != null) {
- createResourceColumn().setLength(length);
- }
- }
-
- public Integer getScale() {
- return null;
- }
-
- public void setScale(Integer scale) {
- if (scale != null) {
- createResourceColumn().setScale(scale);
- }
- }
-
- public Integer getPrecision() {
- return null;
- }
-
- public void setPrecision(Integer precision) {
- if (precision != null) {
- createResourceColumn().setPrecision(precision);
- }
- }
-
- public TextRange getScaleTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getLengthTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getPrecisionTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullDiscriminatorColumn.java
deleted file mode 100644
index 7925517bba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullDiscriminatorColumn.java
+++ /dev/null
@@ -1,58 +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.resource.java;
-
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.DiscriminatorColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.DiscriminatorType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-
-
-public class NullDiscriminatorColumn extends NullNamedColumn implements DiscriminatorColumnAnnotation, Annotation
-{
- public NullDiscriminatorColumn(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- @Override
- public JavaResourcePersistentMember getParent() {
- return (JavaResourcePersistentMember) super.getParent();
- }
-
- public String getAnnotationName() {
- return DiscriminatorColumnAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected DiscriminatorColumnAnnotation createResourceColumn() {
- return (DiscriminatorColumnAnnotation) getParent().addSupportingAnnotation(getAnnotationName());
- }
-
- public DiscriminatorType getDiscriminatorType() {
- return null;
- }
-
- public void setDiscriminatorType(DiscriminatorType discriminatorType) {
- if (discriminatorType != null) {
- createResourceColumn().setDiscriminatorType(discriminatorType);
- }
- }
-
- public Integer getLength() {
- return null;
- }
-
- public void setLength(Integer length) {
- if (length != null) {
- createResourceColumn().setLength(length);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullDiscriminatorValue.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullDiscriminatorValue.java
deleted file mode 100644
index 261edfbe7c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullDiscriminatorValue.java
+++ /dev/null
@@ -1,77 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.DiscriminatorValueAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-public class NullDiscriminatorValue extends AbstractJavaResourceNode implements DiscriminatorValueAnnotation, Annotation
-{
- protected NullDiscriminatorValue(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- @Override
- public JavaResourcePersistentMember getParent() {
- return (JavaResourcePersistentMember) super.getParent();
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation getJdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public String getAnnotationName() {
- return DiscriminatorValueAnnotation.ANNOTATION_NAME;
- }
-
- public String getValue() {
- return null;
- }
-
- public void setValue(String value) {
- if (value != null) {
- createDiscriminatorValueResource().setValue(value);
- }
- }
-
- protected DiscriminatorValueAnnotation createDiscriminatorValueResource() {
- return (DiscriminatorValueAnnotation) getParent().addSupportingAnnotation(getAnnotationName());
- }
-
- public void update(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
-
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullEmbedded.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullEmbedded.java
deleted file mode 100644
index a015e0b4ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullEmbedded.java
+++ /dev/null
@@ -1,60 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-public class NullEmbedded extends AbstractJavaResourceNode implements EmbeddedAnnotation, Annotation
-{
- protected NullEmbedded(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation getJdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public String getAnnotationName() {
- return EmbeddedAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- public JavaResourcePersistentMember getParent() {
- return (JavaResourcePersistentMember) super.getParent();
- }
-
-
- public void update(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullEnumerated.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullEnumerated.java
deleted file mode 100644
index d471c738fc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullEnumerated.java
+++ /dev/null
@@ -1,77 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.EnumType;
-import org.eclipse.jpt.core.resource.java.EnumeratedAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-public class NullEnumerated extends AbstractJavaResourceNode implements EnumeratedAnnotation, Annotation
-{
- protected NullEnumerated(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- @Override
- public JavaResourcePersistentMember getParent() {
- return (JavaResourcePersistentMember) super.getParent();
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation getJdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public String getAnnotationName() {
- return EnumeratedAnnotation.ANNOTATION_NAME;
- }
-
- protected EnumeratedAnnotation createEnumeratedResource() {
- return (EnumeratedAnnotation) getParent().addSupportingAnnotation(getAnnotationName());
- }
-
-
- public EnumType getValue() {
- return null;
- }
-
- public void setValue(EnumType value) {
- if (value != null) {
- createEnumeratedResource().setValue(value);
- }
- }
-
- public void update(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullInheritance.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullInheritance.java
deleted file mode 100644
index c50f01d1d5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullInheritance.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.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.InheritanceAnnotation;
-import org.eclipse.jpt.core.resource.java.InheritanceType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-public class NullInheritance extends AbstractJavaResourceNode implements InheritanceAnnotation, Annotation
-{
- protected NullInheritance(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- @Override
- public JavaResourcePersistentMember getParent() {
- return (JavaResourcePersistentMember) super.getParent();
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation getJdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public String getAnnotationName() {
- return InheritanceAnnotation.ANNOTATION_NAME;
- }
-
- public InheritanceType getStrategy() {
- return null;
- }
-
- public void setStrategy(InheritanceType strategy) {
- if (strategy != null) {
- createInheritanceResource().setStrategy(strategy);
- }
-
- }
-
- protected InheritanceAnnotation createInheritanceResource() {
- return (InheritanceAnnotation) getParent().addSupportingAnnotation(getAnnotationName());
- }
-
- public void update(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
-
- }
-
- public TextRange getStrategyTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullJoinColumn.java
deleted file mode 100644
index 499e200d11..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullJoinColumn.java
+++ /dev/null
@@ -1,50 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-
-public class NullJoinColumn extends NullBaseColumn implements JoinColumnAnnotation, Annotation
-{
- public NullJoinColumn(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return JoinColumnAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected JoinColumnAnnotation createResourceColumn() {
- throw new UnsupportedOperationException();
- }
-
- 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/NullJoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullJoinTable.java
deleted file mode 100644
index cd6098a296..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullJoinTable.java
+++ /dev/null
@@ -1,84 +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.resource.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-
-
-public class NullJoinTable extends NullBaseTable implements JoinTableAnnotation
-{
- protected NullJoinTable(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public JoinColumnAnnotation addInverseJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- public JoinColumnAnnotation addJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- public int indexOfInverseJoinColumn(JoinColumnAnnotation joinColumn) {
- throw new UnsupportedOperationException();
- }
-
- public int indexOfJoinColumn(JoinColumnAnnotation joinColumn) {
- throw new UnsupportedOperationException();
- }
-
- public JoinColumnAnnotation inverseJoinColumnAt(int index) {
- return null;
- }
-
- public ListIterator<JoinColumnAnnotation> inverseJoinColumns() {
- return EmptyListIterator.instance();
- }
-
- public int inverseJoinColumnsSize() {
- return 0;
- }
-
- public JoinColumnAnnotation joinColumnAt(int index) {
- return null;
- }
-
- public ListIterator<JoinColumnAnnotation> joinColumns() {
- return EmptyListIterator.instance();
- }
-
- public int joinColumnsSize() {
- return 0;
- }
-
- public void moveInverseJoinColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void moveJoinColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeInverseJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void removeJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullNamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullNamedColumn.java
deleted file mode 100644
index a0948a92c9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullNamedColumn.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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NamedColumnAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-public abstract class NullNamedColumn extends AbstractJavaResourceNode implements NamedColumnAnnotation, Annotation
-{
- protected NullNamedColumn(JavaResourceNode parent) {
- super(parent);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation getJdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- protected abstract NamedColumnAnnotation createResourceColumn();
-
- public String getName() {
- return null;
- }
-
- public void setName(String name) {
- if (name != null) {
- createResourceColumn().setName(name);
- }
- }
-
- public String getColumnDefinition() {
- return null;
- }
-
- public void setColumnDefinition(String columnDefinition) {
- if (columnDefinition != null) {
- createResourceColumn().setColumnDefinition(columnDefinition);
- }
- }
-
- public void update(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getColumnDefinitionTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- 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/resource/java/NullOneToMany.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullOneToMany.java
deleted file mode 100644
index fed1896426..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullOneToMany.java
+++ /dev/null
@@ -1,163 +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.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.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-public class NullOneToMany extends AbstractJavaResourceNode implements OneToManyAnnotation, Annotation
-{
- protected NullOneToMany(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation getJdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public String getAnnotationName() {
- return OneToManyAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- public JavaResourcePersistentMember getParent() {
- return (JavaResourcePersistentMember) super.getParent();
- }
-
- protected OneToManyAnnotation createOneToManyResource() {
- getParent().setMappingAnnotation(getAnnotationName());
- return (OneToManyAnnotation) getParent().getMappingAnnotation();
- }
-
- public FetchType getFetch() {
- return null;
- }
-
- public void setFetch(FetchType fetch) {
- if (fetch != null) {
- createOneToManyResource().setFetch(fetch);
- }
- }
-
- public String getMappedBy() {
- return null;
- }
-
- public void setMappedBy(String mappedBy) {
- if (mappedBy != null) {
- createOneToManyResource().setMappedBy(mappedBy);
- }
- }
-
- public String getFullyQualifiedTargetEntity() {
- return null;
- }
-
- public String getTargetEntity() {
- return null;
- }
-
- public void setTargetEntity(String targetEntity) {
- if (targetEntity != null) {
- createOneToManyResource().setTargetEntity(targetEntity);
- }
- }
-
- public boolean isCascadeAll() {
- return false;
- }
-
- public void setCascadeAll(boolean all) {
- createOneToManyResource().setCascadeAll(all);
- }
-
- public boolean isCascadeMerge() {
- return false;
- }
-
- public void setCascadeMerge(boolean merge) {
- createOneToManyResource().setCascadeMerge(merge);
- }
-
- public boolean isCascadePersist() {
- return false;
- }
-
- public void setCascadePersist(boolean persist) {
- createOneToManyResource().setCascadePersist(persist);
- }
-
- public boolean isCascadeRefresh() {
- return false;
- }
-
- public void setCascadeRefresh(boolean refresh) {
- createOneToManyResource().setCascadeRefresh(refresh);
- }
-
- public boolean isCascadeRemove() {
- return false;
- }
-
- public void setCascadeRemove(boolean remove) {
- createOneToManyResource().setCascadeRemove(remove);
- }
-
- public void update(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getFetchTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getOptionalTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getMappedByTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getCascadeTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getTargetEntityTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullOneToOne.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullOneToOne.java
deleted file mode 100644
index 7219282afb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullOneToOne.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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.FetchType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-public class NullOneToOne extends AbstractJavaResourceNode implements OneToOneAnnotation, Annotation
-{
- protected NullOneToOne(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation getJdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public String getAnnotationName() {
- return OneToOneAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- public JavaResourcePersistentMember getParent() {
- return (JavaResourcePersistentMember) super.getParent();
- }
-
- protected OneToOneAnnotation createOneToOneResource() {
- getParent().setMappingAnnotation(getAnnotationName());
- return (OneToOneAnnotation) getParent().getMappingAnnotation();
- }
-
- public FetchType getFetch() {
- return null;
- }
-
- public void setFetch(FetchType fetch) {
- if (fetch != null) {
- createOneToOneResource().setFetch(fetch);
- }
- }
-
- public Boolean getOptional() {
- return null;
- }
-
- public void setOptional(Boolean optional) {
- if (optional != null) {
- createOneToOneResource().setOptional(optional);
- }
- }
-
- public String getMappedBy() {
- return null;
- }
-
- public void setMappedBy(String mappedBy) {
- if (mappedBy != null) {
- createOneToOneResource().setMappedBy(mappedBy);
- }
- }
-
- public String getFullyQualifiedTargetEntity() {
- return null;
- }
-
- public String getTargetEntity() {
- return null;
- }
-
- public void setTargetEntity(String targetEntity) {
- if (targetEntity != null) {
- createOneToOneResource().setTargetEntity(targetEntity);
- }
- }
-
- public boolean isCascadeAll() {
- return false;
- }
-
- public void setCascadeAll(boolean all) {
- createOneToOneResource().setCascadeAll(all);
- }
-
- public boolean isCascadeMerge() {
- return false;
- }
-
- public void setCascadeMerge(boolean merge) {
- createOneToOneResource().setCascadeMerge(merge);
- }
-
- public boolean isCascadePersist() {
- return false;
- }
-
- public void setCascadePersist(boolean persist) {
- createOneToOneResource().setCascadePersist(persist);
- }
-
- public boolean isCascadeRefresh() {
- return false;
- }
-
- public void setCascadeRefresh(boolean refresh) {
- createOneToOneResource().setCascadeRefresh(refresh);
- }
-
- public boolean isCascadeRemove() {
- return false;
- }
-
- public void setCascadeRemove(boolean remove) {
- createOneToOneResource().setCascadeRemove(remove);
- }
-
- public void update(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getFetchTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getOptionalTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getMappedByTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getCascadeTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getTargetEntityTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullPrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullPrimaryKeyJoinColumn.java
deleted file mode 100644
index 689b4b3c8b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullPrimaryKeyJoinColumn.java
+++ /dev/null
@@ -1,50 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-
-public class NullPrimaryKeyJoinColumn extends NullNamedColumn implements PrimaryKeyJoinColumnAnnotation, Annotation
-{
- public NullPrimaryKeyJoinColumn(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected PrimaryKeyJoinColumnAnnotation createResourceColumn() {
- throw new UnsupportedOperationException();
- }
-
- 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/NullTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullTable.java
deleted file mode 100644
index 1d5f9f6185..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullTable.java
+++ /dev/null
@@ -1,28 +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.resource.java;
-
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.TableAnnotation;
-
-
-public class NullTable extends NullBaseTable implements TableAnnotation
-{
- protected NullTable(JavaResourcePersistentMember 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/NullTemporal.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullTemporal.java
deleted file mode 100644
index 416e4d46b5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullTemporal.java
+++ /dev/null
@@ -1,77 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.core.resource.java.TemporalType;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-public class NullTemporal extends AbstractJavaResourceNode implements TemporalAnnotation, Annotation
-{
- protected NullTemporal(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation getJdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public String getAnnotationName() {
- return TemporalAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- public JavaResourcePersistentMember getParent() {
- return (JavaResourcePersistentMember) super.getParent();
- }
-
- protected TemporalAnnotation createTemporalResource() {
- return (TemporalAnnotation) getParent().addSupportingAnnotation(getAnnotationName());
- }
-
-
- public TemporalType getValue() {
- return null;
- }
-
- public void setValue(TemporalType value) {
- if (value != null) {
- createTemporalResource().setValue(value);
- }
- }
-
- public void update(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToManyImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToManyImpl.java
deleted file mode 100644
index dfb1ed5601..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToManyImpl.java
+++ /dev/null
@@ -1,161 +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.resource.java;
-
-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.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-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.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;
-
-public class OneToManyImpl extends AbstractRelationshipMappingAnnotation implements OneToManyAnnotation
-{
- 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[]> CASCADE_ADAPTER = buildCascadeAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> MAPPED_BY_ADAPTER = buildMappedByAdapter();
-
- private final AnnotationElementAdapter<String> mappedByAdapter;
-
- private String mappedBy;
-
- protected OneToManyImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.mappedByAdapter = buildAnnotationElementAdapter(MAPPED_BY_ADAPTER);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.mappedBy = this.mappedBy(astRoot);
- }
-
- //**************** AbstractRelationshipMappingAnnotation implementation **************
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getTargetEntityAdapter() {
- return TARGET_ENTITY_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String[]> getCascadeAdapter() {
- return CASCADE_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getFetchAdapter() {
- return FETCH_ADAPTER;
- }
-
- //**************** Annotation implementation **************
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String newMappedBy) {
- if (attributeValueHasNotChanged(this.mappedBy, newMappedBy)) {
- return;
- }
- String oldMappedBy = this.mappedBy;
- this.mappedBy = newMappedBy;
- this.mappedByAdapter.setValue(newMappedBy);
- firePropertyChanged(MAPPED_BY_PROPERTY, oldMappedBy, newMappedBy);
- }
-
- 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);
- }
-
- @Override
- public void update(CompilationUnit astRoot) {
- super.update(astRoot);
- this.setMappedBy(this.mappedBy(astRoot));
- }
-
- protected String mappedBy(CompilationUnit astRoot) {
- return this.mappedByAdapter.getValue(astRoot);
- }
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildTargetEntityAdapter() {
- return buildTargetEntityAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_MANY__TARGET_ENTITY);
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildCascadeAdapter() {
- return buildEnumArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_MANY__CASCADE);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildFetchAdapter() {
- return buildFetchAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_MANY__FETCH);
- }
-
- 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
- }
-
- public static class OneToManyAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final OneToManyAnnotationDefinition INSTANCE = new OneToManyAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static OneToManyAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private OneToManyAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new OneToManyImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullOneToMany(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToOneImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToOneImpl.java
deleted file mode 100644
index d71a616c83..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToOneImpl.java
+++ /dev/null
@@ -1,205 +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.resource.java;
-
-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.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-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.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;
-
-public class OneToOneImpl extends AbstractRelationshipMappingAnnotation implements OneToOneAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- static final DeclarationAnnotationElementAdapter<String> TARGET_ENTITY_ADAPTER = buildTargetEntityAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String[]> CASCADE_ADAPTER = buildCascadeAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter();
-
- private static final DeclarationAnnotationElementAdapter<Boolean> OPTIONAL_ADAPTER = buildOptionalAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> MAPPED_BY_ADAPTER = buildMappedByAdapter();
-
- private final AnnotationElementAdapter<Boolean> optionalAdapter;
-
- private final AnnotationElementAdapter<String> mappedByAdapter;
-
-
- private Boolean optional;
-
- private String mappedBy;
-
- public OneToOneImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.mappedByAdapter = buildAnnotationElementAdapter(MAPPED_BY_ADAPTER);
- this.optionalAdapter = this.buildBooleanAnnotationElementAdapter(OPTIONAL_ADAPTER);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.mappedBy = this.mappedBy(astRoot);
- this.optional = this.optional(astRoot);
- }
-
- //**************** AbstractRelationshipMappingAnnotation implementation **************
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getTargetEntityAdapter() {
- return TARGET_ENTITY_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String[]> getCascadeAdapter() {
- return CASCADE_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getFetchAdapter() {
- return FETCH_ADAPTER;
- }
-
- //**************** Annotation implementation **************
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- public Boolean getOptional() {
- return this.optional;
- }
-
- public void setOptional(Boolean newOptional) {
- if (attributeValueHasNotChanged(this.optional, newOptional)) {
- return;
- }
- Boolean oldOptional = this.optional;
- this.optional = newOptional;
- this.optionalAdapter.setValue(newOptional);
- firePropertyChanged(OPTIONAL_PROPERTY, oldOptional, newOptional);
- }
-
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String newMappedBy) {
- if (attributeValueHasNotChanged(this.mappedBy, newMappedBy)) {
- return;
- }
- String oldMappedBy = this.mappedBy;
- this.mappedBy = newMappedBy;
- this.mappedByAdapter.setValue(newMappedBy);
- firePropertyChanged(MAPPED_BY_PROPERTY, oldMappedBy, newMappedBy);
- }
-
- public TextRange getMappedByTextRange(CompilationUnit astRoot) {
- return getElementTextRange(MAPPED_BY_ADAPTER, astRoot);
- }
-
- public TextRange getOptionalTextRange(CompilationUnit astRoot) {
- return getElementTextRange(OPTIONAL_ADAPTER, astRoot);
- }
-
- public boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(MAPPED_BY_ADAPTER, pos, astRoot);
- }
-
- @Override
- public void update(CompilationUnit astRoot) {
- super.update(astRoot);
- this.setOptional(this.optional(astRoot));
- this.setMappedBy(this.mappedByAdapter.getValue(astRoot));
- }
-
- protected String mappedBy(CompilationUnit astRoot) {
- return this.mappedByAdapter.getValue(astRoot);
- }
-
- protected Boolean optional(CompilationUnit astRoot) {
- return this.optionalAdapter.getValue(astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildTargetEntityAdapter() {
- return buildTargetEntityAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__TARGET_ENTITY);
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildCascadeAdapter() {
- return buildEnumArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__CASCADE);
- }
-
- 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> buildMappedByAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__MAPPED_BY, false); // false = do not remove annotation when empty
- }
-
- public static class OneToOneAnnotationDefinition implements AnnotationDefinition
- {
-
- // singleton
- private static final OneToOneAnnotationDefinition INSTANCE = new OneToOneAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static OneToOneAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private OneToOneAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new OneToOneImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullOneToOne(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OrderByImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OrderByImpl.java
deleted file mode 100644
index 627907f6dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OrderByImpl.java
+++ /dev/null
@@ -1,116 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-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;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-public class OrderByImpl extends AbstractResourceAnnotation<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;
-
- protected OrderByImpl(JavaResourceNode parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new ShortCircuitAnnotationElementAdapter<String>(attribute, VALUE_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.value(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String newValue) {
- if (attributeValueHasNotChanged(this.value, newValue)) {
- return;
- }
- String oldValue = this.value;
- this.value = newValue;
- this.valueAdapter.setValue(newValue);
- firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setValue(this.value(astRoot));
- }
-
- protected String value(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);
- }
-
-
- public static class OrderByAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final OrderByAnnotationDefinition 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 OrderByImpl(parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OverrideImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OverrideImpl.java
deleted file mode 100644
index 0d5a551650..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OverrideImpl.java
+++ /dev/null
@@ -1,98 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-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.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;
-
-public abstract class OverrideImpl
- extends AbstractResourceAnnotation<Member>
- implements OverrideAnnotation
-{
- // hold this so we can get the 'name' text range
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
-
- private final AnnotationElementAdapter<String> nameAdapter;
-
- private String name;
-
-
- protected OverrideImpl(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.nameDeclarationAdapter = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JPA.ATTRIBUTE_OVERRIDE__NAME, false); // false = do not remove annotation when empty
- this.nameAdapter = new ShortCircuitAnnotationElementAdapter<String>(getMember(),this.nameDeclarationAdapter);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.name(astRoot);
- }
-
- public IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) super.getAnnotationAdapter();
- }
-
- public void moveAnnotation(int newIndex) {
- getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- OverrideAnnotation oldOverride = (OverrideAnnotation) oldAnnotation;
- setName(oldOverride.getName());
- }
-
- //************ AttriubteOverride implementation ****************
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- if (attributeValueHasNotChanged(this.name, newName)) {
- return;
- }
- String oldName = this.name;
- this.name = newName;
- this.nameAdapter.setValue(newName);
- firePropertyChanged(OverrideAnnotation.NAME_PROPERTY, oldName, newName);
- }
-
- 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);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setName(this.name(astRoot));
- }
-
- protected String name(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(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/resource/java/PrimaryKeyJoinColumnImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnImpl.java
deleted file mode 100644
index c9cb053e41..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnImpl.java
+++ /dev/null
@@ -1,184 +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.resource.java;
-
-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.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-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.resource.java.NestablePrimaryKeyJoinColumn;
-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;
-
-public class PrimaryKeyJoinColumnImpl extends AbstractNamedColumn implements NestablePrimaryKeyJoinColumn
-{
-
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- // hold this so we can get the 'referenced column name' text range
- private final DeclarationAnnotationElementAdapter<String> referencedColumnNameDeclarationAdapter;
-
- private final AnnotationElementAdapter<String> referencedColumnNameAdapter;
-
- private String referencedColumnName;
-
- protected PrimaryKeyJoinColumnImpl(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);
- }
-
- protected PrimaryKeyJoinColumnImpl(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- this(parent, member, daa, new MemberAnnotationAdapter(member, daa));
- }
-
- protected PrimaryKeyJoinColumnImpl(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.referencedColumnName(astRoot);
- }
-
- @Override
- protected String getNameElementName() {
- return JPA.PRIMARY_KEY_JOIN_COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA.PRIMARY_KEY_JOIN_COLUMN__COLUMN_DEFINITION;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) super.getAnnotationAdapter();
- }
-
- public void moveAnnotation(int newIndex) {
- getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- PrimaryKeyJoinColumnAnnotation oldColumn = (PrimaryKeyJoinColumnAnnotation) oldAnnotation;
- setReferencedColumnName(oldColumn.getReferencedColumnName());
- }
-
- public String getReferencedColumnName() {
- return this.referencedColumnName;
- }
-
- public void setReferencedColumnName(String newReferencedColumnName) {
- if (attributeValueHasNotChanged(this.referencedColumnName, newReferencedColumnName)) {
- return;
- }
- String oldReferencedColumnName = this.referencedColumnName;
- this.referencedColumnName = newReferencedColumnName;
- this.referencedColumnNameAdapter.setValue(newReferencedColumnName);
- firePropertyChanged(REFERENCED_COLUMN_NAME_PROPERTY, oldReferencedColumnName, newReferencedColumnName);
- }
-
- @Override
- public void update(CompilationUnit astRoot) {
- super.update(astRoot);
- this.setReferencedColumnName(this.referencedColumnName(astRoot));
- }
-
- protected String referencedColumnName(CompilationUnit astRoot) {
- return this.referencedColumnNameAdapter.getValue(astRoot);
- }
-
- public boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.referencedColumnNameDeclarationAdapter, pos, astRoot);
- }
-
- public TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.referencedColumnNameDeclarationAdapter, astRoot);
- }
-
- // ********** static methods **********
-
- static PrimaryKeyJoinColumnImpl createPrimaryKeyJoinColumn(JavaResourceNode parent, Member member) {
- return new PrimaryKeyJoinColumnImpl(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- static PrimaryKeyJoinColumnImpl createNestedPrimaryKeyJoinColumn(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter pkJoinColumnsAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, pkJoinColumnsAdapter);
- IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa);
- return new PrimaryKeyJoinColumnImpl(parent, member, idaa, annotationAdapter);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter pkJoinColumnsAdapter) {
- return new NestedIndexedDeclarationAnnotationAdapter(pkJoinColumnsAdapter, index, JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
-
-
- static NestablePrimaryKeyJoinColumn createSecondaryTablePrimaryKeyJoinColumn(DeclarationAnnotationAdapter secondaryTableAdapter, JavaResourceNode parent, Member member, int index) {
- return new PrimaryKeyJoinColumnImpl(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);
- }
-
- public static class PrimaryKeyJoinColumnAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final PrimaryKeyJoinColumnAnnotationDefinition 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 PrimaryKeyJoinColumnImpl.createPrimaryKeyJoinColumn(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnsImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnsImpl.java
deleted file mode 100644
index d08876d3ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnsImpl.java
+++ /dev/null
@@ -1,157 +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.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-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.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NestablePrimaryKeyJoinColumn;
-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.iterators.CloneListIterator;
-
-public class PrimaryKeyJoinColumnsImpl extends AbstractResourceAnnotation<Member> implements PrimaryKeyJoinColumnsAnnotation
-{
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private List<NestablePrimaryKeyJoinColumn> pkJoinColumns;
-
- protected PrimaryKeyJoinColumnsImpl(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.pkJoinColumns = new ArrayList<NestablePrimaryKeyJoinColumn>();
- }
-
- public void initialize(CompilationUnit astRoot) {
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public String getNestableAnnotationName() {
- return PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME;
- }
-
- public String getElementName() {
- return JPA.PRIMARY_KEY_JOIN_COLUMNS__VALUE;
- }
-
- public ListIterator<NestablePrimaryKeyJoinColumn> nestedAnnotations() {
- return new CloneListIterator<NestablePrimaryKeyJoinColumn>(this.pkJoinColumns);
- }
-
- public int nestedAnnotationsSize() {
- return this.pkJoinColumns.size();
- }
-
- public NestablePrimaryKeyJoinColumn addInternal(int index) {
- NestablePrimaryKeyJoinColumn pkJoinColumn = createPrimaryKeyJoinColumn(index);
- this.pkJoinColumns.add(index, pkJoinColumn);
- return pkJoinColumn;
- }
-
- public NestablePrimaryKeyJoinColumn add(int index) {
- NestablePrimaryKeyJoinColumn pkJoinColumn = createPrimaryKeyJoinColumn(index);
- add(index, pkJoinColumn);
- return pkJoinColumn;
- }
-
- protected void add(int index, NestablePrimaryKeyJoinColumn pkJoinColumn) {
- addItemToList(index, pkJoinColumn, this.pkJoinColumns, PK_JOIN_COLUMNS_LIST);
- }
-
- public void remove(NestablePrimaryKeyJoinColumn pkJoinColumn) {
- removeItemFromList(pkJoinColumn, this.pkJoinColumns, PK_JOIN_COLUMNS_LIST);
- }
-
- public void remove(int index) {
- removeItemFromList(index, this.pkJoinColumns, PK_JOIN_COLUMNS_LIST);
- }
-
- public int indexOf(NestablePrimaryKeyJoinColumn pkJoinColumn) {
- return this.pkJoinColumns.indexOf(pkJoinColumn);
- }
-
- public NestablePrimaryKeyJoinColumn nestedAnnotationAt(int index) {
- return this.pkJoinColumns.get(index);
- }
-
- public NestablePrimaryKeyJoinColumn nestedAnnotationFor(Annotation jdtAnnotation) {
- for (NestablePrimaryKeyJoinColumn pkJoinColumn : this.pkJoinColumns) {
- if (jdtAnnotation == pkJoinColumn.getJdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return pkJoinColumn;
- }
- }
- return null;
- }
-
- public void move(int targetIndex, int sourceIndex) {
- moveItemInList(targetIndex, sourceIndex, this.pkJoinColumns, PK_JOIN_COLUMNS_LIST);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.pkJoinColumns, targetIndex, sourceIndex);
- }
-
- public void update(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this);
- }
-
- private PrimaryKeyJoinColumnImpl createPrimaryKeyJoinColumn(int index) {
- return PrimaryKeyJoinColumnImpl.createNestedPrimaryKeyJoinColumn(this, getMember(), index, getDeclarationAnnotationAdapter());
- }
-
-
- public static class PrimaryKeyJoinColumnsAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final PrimaryKeyJoinColumnsAnnotationDefinition 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 PrimaryKeyJoinColumnsImpl(parent, member);
- }
-
- public PrimaryKeyJoinColumnsAnnotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/QueryHintImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/QueryHintImpl.java
deleted file mode 100644
index 51d1392d5e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/QueryHintImpl.java
+++ /dev/null
@@ -1,164 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-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.ShortCircuitAnnotationElementAdapter;
-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.NestableQueryHint;
-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;
-
-public class QueryHintImpl extends AbstractResourceAnnotation<Type>
- implements NestableQueryHint
-{
-
- // hold this so we can get the 'name' text range
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
-
- // hold this so we can get the 'value' text range
- private final DeclarationAnnotationElementAdapter<String> valueDeclarationAdapter;
-
- private final AnnotationElementAdapter<String> nameAdapter;
-
- private final AnnotationElementAdapter<String> valueAdapter;
-
- private String name;
-
- private String value;
-
- public QueryHintImpl(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 void initialize(CompilationUnit astRoot) {
- this.name = this.name(astRoot);
- this.value = this.value(astRoot);
- }
-
- // ********** initialization **********
- protected AnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new ShortCircuitAnnotationElementAdapter<String>(getMember(), daea);
- }
-
- protected DeclarationAnnotationElementAdapter<String> buildNameAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JPA.QUERY_HINT__NAME);
- }
-
- protected DeclarationAnnotationElementAdapter<String> buildValueAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JPA.QUERY_HINT__VALUE);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public IndexedAnnotationAdapter getAnnotationAdapter() {
- return (IndexedAnnotationAdapter) super.getAnnotationAdapter();
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- if (attributeValueHasNotChanged(this.name, newName)) {
- return;
- }
- String oldName = this.name;
- this.name = newName;
- this.nameAdapter.setValue(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String newValue) {
- if (attributeValueHasNotChanged(this.value, newValue)) {
- return;
- }
- String oldValue = this.value;
- this.value = newValue;
- this.valueAdapter.setValue(newValue);
- firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.valueDeclarationAdapter, astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setName(this.name(astRoot));
- this.setValue(this.value(astRoot));
- }
-
- protected String name(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- protected String value(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- // ********** persistence model -> java annotations **********
- public void moveAnnotation(int newIndex) {
- getAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- QueryHintAnnotation oldQueryHint = (QueryHintAnnotation) oldAnnotation;
- setName(oldQueryHint.getName());
- setValue(oldQueryHint.getValue());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
- // ********** static methods **********
- static QueryHintImpl createNamedQueryQueryHint(JavaResourceNode parent, Type type, DeclarationAnnotationAdapter namedQueryAdapter, int index) {
- return new QueryHintImpl(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 QueryHintImpl createNamedNativeQueryQueryHint(JavaResourceNode parent, Type type, DeclarationAnnotationAdapter namedNativeQueryAdapter, int index) {
- return new QueryHintImpl(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/SecondaryTableImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTableImpl.java
deleted file mode 100644
index 6d69fcf65d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTableImpl.java
+++ /dev/null
@@ -1,333 +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.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-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.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-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.resource.java.NestablePrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.java.NestableSecondaryTable;
-import org.eclipse.jpt.core.resource.java.NestableUniqueConstraint;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.SecondaryTableAnnotation;
-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.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.iterators.CloneListIterator;
-
-public class SecondaryTableImpl extends AbstractResourceTable implements NestableSecondaryTable
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(SecondaryTableAnnotation.ANNOTATION_NAME);
-
- protected final List<NestablePrimaryKeyJoinColumn> pkJoinColumns;
-
- private final PkJoinColumnsContainerAnnotation pkJoinColumnsContainerAnnotation;
-
-
- protected SecondaryTableImpl(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.pkJoinColumns = new ArrayList<NestablePrimaryKeyJoinColumn>();
- this.pkJoinColumnsContainerAnnotation = new PkJoinColumnsContainerAnnotation();
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this.pkJoinColumnsContainerAnnotation);
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getCatalogAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(declarationAnnotationAdapter, JPA.SECONDARY_TABLE__CATALOG);
- }
-
- @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);
- }
-
- public IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) super.getAnnotationAdapter();
- }
-
- public String getAnnotationName() {
- return SecondaryTableAnnotation.ANNOTATION_NAME;
- }
-
- public void moveAnnotation(int newIndex) {
- getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- SecondaryTableAnnotation oldSecondaryTable = (SecondaryTableAnnotation) oldAnnotation;
- setName(oldSecondaryTable.getName());
- setCatalog(oldSecondaryTable.getCatalog());
- setSchema(oldSecondaryTable.getSchema());
- for (UniqueConstraintAnnotation uniqueConstraint : CollectionTools.iterable(oldSecondaryTable.uniqueConstraints())) {
- NestableUniqueConstraint newUniqueConstraint = addUniqueConstraint(oldSecondaryTable.indexOfUniqueConstraint(uniqueConstraint));
- newUniqueConstraint.initializeFrom((NestableAnnotation) uniqueConstraint);
- }
- for (PrimaryKeyJoinColumnAnnotation pkJoinColumn : CollectionTools.iterable(oldSecondaryTable.pkJoinColumns())) {
- NestablePrimaryKeyJoinColumn newPkJoinColumn = addPkJoinColumn(oldSecondaryTable.indexOfPkJoinColumn(pkJoinColumn));
- newPkJoinColumn.initializeFrom((NestableAnnotation) pkJoinColumn);
- }
- }
-
- @Override
- protected String getUniqueConstraintsElementName() {
- return JPA.SECONDARY_TABLE__UNIQUE_CONSTRAINTS;
- }
-
- @Override
- protected NestableUniqueConstraint createUniqueConstraint(int index) {
- return UniqueConstraintImpl.createSecondaryTableUniqueConstraint(this, this.getMember(), this.getDeclarationAnnotationAdapter(), index);
- }
-
- // ************* SecondaryTable implementation *******************
-
-
- public ListIterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumns() {
- return new CloneListIterator<PrimaryKeyJoinColumnAnnotation>(this.pkJoinColumns);
- }
-
- public int pkJoinColumnsSize() {
- return this.pkJoinColumns.size();
- }
-
- public NestablePrimaryKeyJoinColumn pkJoinColumnAt(int index) {
- return this.pkJoinColumns.get(index);
- }
-
- public int indexOfPkJoinColumn(PrimaryKeyJoinColumnAnnotation joinColumn) {
- return this.pkJoinColumns.indexOf(joinColumn);
- }
-
- public NestablePrimaryKeyJoinColumn addPkJoinColumn(int index) {
- NestablePrimaryKeyJoinColumn pkJoinColumn = (NestablePrimaryKeyJoinColumn) ContainerAnnotationTools.addNestedAnnotation(index, this.pkJoinColumnsContainerAnnotation);
- fireItemAdded(SecondaryTableAnnotation.PK_JOIN_COLUMNS_LIST, index, pkJoinColumn);
- return pkJoinColumn;
- }
-
- protected void addPkJoinColumn(int index, NestablePrimaryKeyJoinColumn pkJoinColumn) {
- addItemToList(index, pkJoinColumn, this.pkJoinColumns, PK_JOIN_COLUMNS_LIST);
- }
-
- public void removePkJoinColumn(int index) {
- NestablePrimaryKeyJoinColumn pkJoinColumn = this.pkJoinColumns.get(index);
- removePkJoinColumn(pkJoinColumn);
- pkJoinColumn.removeAnnotation();
- ContainerAnnotationTools.synchAnnotationsAfterRemove(index, this.pkJoinColumnsContainerAnnotation);
- }
-
- protected void removePkJoinColumn(NestablePrimaryKeyJoinColumn pkJoinColumn) {
- removeItemFromList(pkJoinColumn, this.pkJoinColumns, SecondaryTableAnnotation.PK_JOIN_COLUMNS_LIST);
- }
-
- public void movePkJoinColumn(int targetIndex, int sourceIndex) {
- movePkJoinColumnInternal(targetIndex, sourceIndex);
- ContainerAnnotationTools.synchAnnotationsAfterMove(targetIndex, sourceIndex, this.pkJoinColumnsContainerAnnotation);
- fireItemMoved(SecondaryTableAnnotation.PK_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- protected void movePkJoinColumnInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.pkJoinColumns, targetIndex, sourceIndex);
- }
-
-
- protected NestablePrimaryKeyJoinColumn createPrimaryKeyJoinColumn(int index) {
- return PrimaryKeyJoinColumnImpl.createSecondaryTablePrimaryKeyJoinColumn(getDeclarationAnnotationAdapter(), this, getMember(), index);
- }
-
- @Override
- public void update(CompilationUnit astRoot) {
- super.update(astRoot);
- this.updatePkJoinColumnsFromJava(astRoot);
- }
-
- private void updatePkJoinColumnsFromJava(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this.pkJoinColumnsContainerAnnotation);
- }
-
- // ********** static methods **********
- static SecondaryTableImpl createSecondaryTable(JavaResourceNode parent, Member member) {
- return new SecondaryTableImpl(parent, member, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- static SecondaryTableImpl createNestedSecondaryTable(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter secondaryTablesAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, secondaryTablesAdapter);
- IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa);
- return new SecondaryTableImpl(parent, member, idaa, annotationAdapter);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter secondaryTablesAdapter) {
- return new NestedIndexedDeclarationAnnotationAdapter(secondaryTablesAdapter, index, JPA.SECONDARY_TABLE);
- }
-
-
- private class PkJoinColumnsContainerAnnotation extends AbstractJavaResourceNode
- implements ContainerAnnotation<NestablePrimaryKeyJoinColumn>
- {
- public PkJoinColumnsContainerAnnotation() {
- super(SecondaryTableImpl.this);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public NestablePrimaryKeyJoinColumn addInternal(int index) {
- NestablePrimaryKeyJoinColumn pKJoinColumn = SecondaryTableImpl.this.createPrimaryKeyJoinColumn(index);
- SecondaryTableImpl.this.pkJoinColumns.add(index, pKJoinColumn);
- return pKJoinColumn;
- }
-
- public NestablePrimaryKeyJoinColumn add(int index) {
- NestablePrimaryKeyJoinColumn pKJoinColumn = SecondaryTableImpl.this.createPrimaryKeyJoinColumn(index);
- SecondaryTableImpl.this.addPkJoinColumn(index, pKJoinColumn);
- return pKJoinColumn;
- }
-
- public int indexOf(NestablePrimaryKeyJoinColumn pkJoinColumn) {
- return SecondaryTableImpl.this.indexOfPkJoinColumn(pkJoinColumn);
- }
-
- public void move(int targetIndex, int sourceIndex) {
- SecondaryTableImpl.this.movePkJoinColumn(targetIndex, sourceIndex);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- SecondaryTableImpl.this.movePkJoinColumnInternal(targetIndex, sourceIndex);
- }
-
- public NestablePrimaryKeyJoinColumn nestedAnnotationAt(int index) {
- return SecondaryTableImpl.this.pkJoinColumnAt(index);
- }
-
- public ListIterator<NestablePrimaryKeyJoinColumn> nestedAnnotations() {
- return new CloneListIterator<NestablePrimaryKeyJoinColumn>(SecondaryTableImpl.this.pkJoinColumns);
- }
-
- public int nestedAnnotationsSize() {
- return pkJoinColumnsSize();
- }
-
- public String getAnnotationName() {
- return SecondaryTableImpl.this.getAnnotationName();
- }
-
- public String getNestableAnnotationName() {
- return JPA.PRIMARY_KEY_JOIN_COLUMN;
- }
-
- public NestablePrimaryKeyJoinColumn nestedAnnotationFor(org.eclipse.jdt.core.dom.Annotation jdtAnnotation) {
- for (NestablePrimaryKeyJoinColumn pkJoinColumn : CollectionTools.iterable(nestedAnnotations())) {
- if (jdtAnnotation == pkJoinColumn.getJdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return pkJoinColumn;
- }
- }
- return null;
- }
-
- public void remove(int index) {
- this.remove(nestedAnnotationAt(index));
- }
-
- public void remove(NestablePrimaryKeyJoinColumn pkJoinColumn) {
- SecondaryTableImpl.this.removePkJoinColumn(pkJoinColumn);
- }
-
- public org.eclipse.jdt.core.dom.Annotation getJdtAnnotation(CompilationUnit astRoot) {
- return SecondaryTableImpl.this.getJdtAnnotation(astRoot);
- }
-
- public void newAnnotation() {
- SecondaryTableImpl.this.newAnnotation();
- }
-
- public void removeAnnotation() {
- SecondaryTableImpl.this.removeAnnotation();
- }
-
- public void update(CompilationUnit astRoot) {
- SecondaryTableImpl.this.update(astRoot);
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return SecondaryTableImpl.this.getTextRange(astRoot);
- }
-
- public String getElementName() {
- return JPA.SECONDARY_TABLE__PK_JOIN_COLUMNS;
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getAnnotationName());
- }
-
- }
-
- public static class SecondaryTableAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final SecondaryTableAnnotationDefinition 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 SecondaryTableImpl.createSecondaryTable(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return SecondaryTableAnnotation.ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTablesImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTablesImpl.java
deleted file mode 100644
index 8502bb4cec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTablesImpl.java
+++ /dev/null
@@ -1,161 +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.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.NestableSecondaryTable;
-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.iterators.CloneListIterator;
-
-public class SecondaryTablesImpl extends AbstractResourceAnnotation<Member> implements SecondaryTablesAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final List<NestableSecondaryTable> secondaryTables;
-
- protected SecondaryTablesImpl(JavaResourcePersistentType parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.secondaryTables = new ArrayList<NestableSecondaryTable>();
- }
-
- public void initialize(CompilationUnit astRoot) {
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public String getNestableAnnotationName() {
- return SecondaryTableAnnotation.ANNOTATION_NAME;
- }
-
- public String getElementName() {
- return JPA.SECONDARY_TABLES__VALUE;
- }
-
- public ListIterator<NestableSecondaryTable> nestedAnnotations() {
- return new CloneListIterator<NestableSecondaryTable>(this.secondaryTables);
- }
-
- public int nestedAnnotationsSize() {
- return this.secondaryTables.size();
- }
-
- public NestableSecondaryTable addInternal(int index) {
- NestableSecondaryTable secondaryTable = createSecondaryTable(index);
- this.secondaryTables.add(index, secondaryTable);
- return secondaryTable;
- }
-
- public NestableSecondaryTable add(int index) {
- NestableSecondaryTable secondaryTable = createSecondaryTable(index);
- this.add(index, secondaryTable);
- return secondaryTable;
- }
-
- protected void add(int index, NestableSecondaryTable secondaryTable) {
- addItemToList(index, secondaryTable, this.secondaryTables, SECONDARY_TABLES_LIST);
- }
-
- public void remove(NestableSecondaryTable secondaryTable) {
- removeItemFromList(secondaryTable, this.secondaryTables, SECONDARY_TABLES_LIST);
- }
-
- public void remove(int index) {
- removeItemFromList(index, this.secondaryTables, SECONDARY_TABLES_LIST);
- }
-
- public int indexOf(NestableSecondaryTable secondaryTable) {
- return this.secondaryTables.indexOf(secondaryTable);
- }
-
- public NestableSecondaryTable nestedAnnotationAt(int index) {
- return this.secondaryTables.get(index);
- }
-
- public NestableSecondaryTable nestedAnnotationFor(org.eclipse.jdt.core.dom.Annotation jdtAnnotation) {
- for (NestableSecondaryTable secondaryTable : this.secondaryTables) {
- if (jdtAnnotation == secondaryTable.getJdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return secondaryTable;
- }
- }
- return null;
- }
-
- public void move(int targetIndex, int sourceIndex) {
- moveItemInList(targetIndex, sourceIndex, this.secondaryTables, SECONDARY_TABLES_LIST);
- }
- //TODO this move is different than how we handle SecondarTable.pkJoinColumns
-// public void movePkJoinColumn(int oldIndex, int newIndex) {
-// movePkJoinColumnInternal(oldIndex, newIndex);
-// ContainerAnnotationTools.synchAnnotationsAfterMove(newIndex, oldIndex, this.pkJoinColumnsContainerAnnotation);
-// fireItemMoved(SecondaryTable.PK_JOIN_COLUMNS_LIST, newIndex, oldIndex);
-// }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.secondaryTables, targetIndex, sourceIndex);
- }
-
- public void update(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this);
- }
-
- private SecondaryTableImpl createSecondaryTable(int index) {
- return SecondaryTableImpl.createNestedSecondaryTable(this, getMember(), index, getDeclarationAnnotationAdapter());
- }
-
- public static class SecondaryTablesAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final SecondaryTablesAnnotationDefinition 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 SecondaryTablesImpl((JavaResourcePersistentType) parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SequenceGeneratorImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SequenceGeneratorImpl.java
deleted file mode 100644
index 930e87a5bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SequenceGeneratorImpl.java
+++ /dev/null
@@ -1,157 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-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;
-
-public class SequenceGeneratorImpl
- extends GeneratorImpl
- implements SequenceGeneratorAnnotation
-{
- private final AnnotationElementAdapter<String> sequenceNameAdapter;
-
- 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 String sequenceName;
-
- protected SequenceGeneratorImpl(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.sequenceNameAdapter = this.buildAdapter(SEQUENCE_NAME_ADAPTER);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.sequenceName = this.sequenceName(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- //************ GeneratorImpl implementation **************
-
- @Override
- protected DeclarationAnnotationElementAdapter<Integer> getAllocationSizeAdapter() {
- return ALLOCATION_SIZE_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<Integer> getInitialValueAdapter() {
- return INITIAL_VALUE_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getNameAdapter() {
- return NAME_ADAPTER;
- }
-
-
- public String getSequenceName() {
- return this.sequenceName;
- }
-
- public void setSequenceName(String newSequenceName) {
- if (attributeValueHasNotChanged(this.sequenceName, newSequenceName)) {
- return;
- }
- String oldSequenceName = this.sequenceName;
- this.sequenceName = newSequenceName;
- this.sequenceNameAdapter.setValue(newSequenceName);
- firePropertyChanged(SEQUENCE_NAME_PROPERTY, oldSequenceName, newSequenceName);
- }
-
- 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);
- }
-
- // ********** java annotations -> persistence model **********
- @Override
- public void update(CompilationUnit astRoot) {
- super.update(astRoot);
- this.setSequenceName(this.sequenceName(astRoot));
- }
-
- protected String sequenceName(CompilationUnit astRoot) {
- return this.sequenceNameAdapter.getValue(astRoot);
- }
-
-
- // ********** 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);
- }
-
-
- // ********** annotation definition **********
-
- public static class SequenceGeneratorAnnotationDefinition
- implements AnnotationDefinition
- {
- // singleton
- private static final SequenceGeneratorAnnotationDefinition INSTANCE = new SequenceGeneratorAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private SequenceGeneratorAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SequenceGeneratorImpl(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableGeneratorImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableGeneratorImpl.java
deleted file mode 100644
index ee33090640..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableGeneratorImpl.java
+++ /dev/null
@@ -1,525 +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.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NestableUniqueConstraint;
-import org.eclipse.jpt.core.resource.java.TableAnnotation;
-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.Member;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- *
- */
-public class TableGeneratorImpl
- extends GeneratorImpl
- implements TableGeneratorAnnotation
-{
- private final AnnotationElementAdapter<String> tableAdapter;
-
- private final AnnotationElementAdapter<String> catalogAdapter;
-
- private final AnnotationElementAdapter<String> schemaAdapter;
-
- private final AnnotationElementAdapter<String> pkColumnNameAdapter;
-
- private final AnnotationElementAdapter<String> valueColumnNameAdapter;
-
- private final AnnotationElementAdapter<String> pkColumnValueAdapter;
-
- 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 static final DeclarationAnnotationElementAdapter<String> CATALOG_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__CATALOG);
-
- private static final DeclarationAnnotationElementAdapter<String> SCHEMA_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__SCHEMA);
-
- private static final DeclarationAnnotationElementAdapter<String> PK_COLUMN_NAME_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__PK_COLUMN_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_COLUMN_NAME_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__VALUE_COLUMN_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> PK_COLUMN_VALUE_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__PK_COLUMN_VALUE);
-
- private String table;
-
- private String catalog;
-
- private String schema;
-
- private String pkColumnName;
-
- private String valueColumnName;
-
- private String pkColumnValue;
-
- final List<NestableUniqueConstraint> uniqueConstraints;
-
- private final UniqueConstraintsContainerAnnotation uniqueConstraintsContainerAnnotation;
-
-
- protected TableGeneratorImpl(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);
- this.uniqueConstraints = new ArrayList<NestableUniqueConstraint>();
- this.uniqueConstraintsContainerAnnotation = new UniqueConstraintsContainerAnnotation();
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.table = this.table(astRoot);
- this.catalog = this.catalog(astRoot);
- this.schema = this.schema(astRoot);
- this.pkColumnName = this.pkColumnName(astRoot);
- this.valueColumnName = this.valueColumnName(astRoot);
- this.pkColumnValue = this.pkColumnValue(astRoot);
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this.uniqueConstraintsContainerAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- //************ GeneratorImpl implementation **************
-
- @Override
- protected DeclarationAnnotationElementAdapter<Integer> getAllocationSizeAdapter() {
- return ALLOCATION_SIZE_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<Integer> getInitialValueAdapter() {
- return INITIAL_VALUE_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getNameAdapter() {
- return NAME_ADAPTER;
- }
-
- public String getTable() {
- return this.table;
- }
-
- public void setTable(String newTable) {
- if (attributeValueHasNotChanged(this.table, newTable)) {
- return;
- }
- String oldTable = this.table;
- this.table = newTable;
- this.tableAdapter.setValue(newTable);
- firePropertyChanged(TABLE_PROPERTY, oldTable, newTable);
- }
-
- public String getCatalog() {
- return this.catalog;
- }
-
- public void setCatalog(String newCatalog) {
- if (attributeValueHasNotChanged(this.catalog, newCatalog)) {
- return;
- }
- String oldCatalog = this.catalog;
- this.catalog = newCatalog;
- this.catalogAdapter.setValue(newCatalog);
- firePropertyChanged(CATALOG_PROPERTY, oldCatalog, newCatalog);
- }
-
- public String getSchema() {
- return this.schema;
- }
-
- public void setSchema(String newSchema) {
- if (attributeValueHasNotChanged(this.schema, newSchema)) {
- return;
- }
- String oldSchema = this.schema;
- this.schema = newSchema;
- this.schemaAdapter.setValue(newSchema);
- firePropertyChanged(SCHEMA_PROPERTY, oldSchema, newSchema);
- }
-
- public String getPkColumnName() {
- return this.pkColumnName;
- }
-
- public void setPkColumnName(String newPkColumnName) {
- if (attributeValueHasNotChanged(this.pkColumnName, newPkColumnName)) {
- return;
- }
- String oldPkColumnName = this.pkColumnName;
- this.pkColumnName = newPkColumnName;
- this.pkColumnNameAdapter.setValue(newPkColumnName);
- firePropertyChanged(PK_COLUMN_NAME_PROPERTY, oldPkColumnName, newPkColumnName);
- }
-
- public String getValueColumnName() {
- return this.valueColumnName;
- }
-
- public void setValueColumnName(String newValueColumnName) {
- if (attributeValueHasNotChanged(this.valueColumnName, newValueColumnName)) {
- return;
- }
- String oldValueColumnName = this.valueColumnName;
- this.valueColumnName = newValueColumnName;
- this.valueColumnNameAdapter.setValue(newValueColumnName);
- firePropertyChanged(VALUE_COLUMN_NAME_PROPERTY, oldValueColumnName, newValueColumnName);
- }
-
- public String getPkColumnValue() {
- return this.pkColumnValue;
- }
-
- public void setPkColumnValue(String newPkColumnValue) {
- if (attributeValueHasNotChanged(this.pkColumnValue, newPkColumnValue)) {
- return;
- }
- String oldPkColumnValue = this.pkColumnValue;
- this.pkColumnValue = newPkColumnValue;
- this.pkColumnValueAdapter.setValue(newPkColumnValue);
- firePropertyChanged(PK_COLUMN_VALUE_PROPERTY, oldPkColumnValue, newPkColumnValue);
- }
-
- public ListIterator<UniqueConstraintAnnotation> uniqueConstraints() {
- return new CloneListIterator<UniqueConstraintAnnotation>(this.uniqueConstraints);
- }
-
- public int uniqueConstraintsSize() {
- return this.uniqueConstraints.size();
- }
-
- public NestableUniqueConstraint uniqueConstraintAt(int index) {
- return this.uniqueConstraints.get(index);
- }
-
- public int indexOfUniqueConstraint(UniqueConstraintAnnotation uniqueConstraint) {
- return this.uniqueConstraints.indexOf(uniqueConstraint);
- }
-
- public NestableUniqueConstraint addUniqueConstraint(int index) {
- NestableUniqueConstraint uniqueConstraint = (NestableUniqueConstraint) ContainerAnnotationTools.addNestedAnnotation(index, this.uniqueConstraintsContainerAnnotation);
- fireItemAdded(TableGeneratorAnnotation.UNIQUE_CONSTRAINTS_LIST, index, uniqueConstraint);
- return uniqueConstraint;
- }
-
- protected void addUniqueConstraint(int index, NestableUniqueConstraint uniqueConstraint) {
- addItemToList(index, uniqueConstraint, this.uniqueConstraints, UNIQUE_CONSTRAINTS_LIST);
- }
-
- public void removeUniqueConstraint(int index) {
- NestableUniqueConstraint uniqueConstraint = this.uniqueConstraints.get(index);
- removeUniqueConstraint(uniqueConstraint);
- uniqueConstraint.removeAnnotation();
- synchUniqueConstraintAnnotationsAfterRemove(index);
- }
-
- protected void removeUniqueConstraint(NestableUniqueConstraint uniqueConstraint) {
- removeItemFromList(uniqueConstraint, this.uniqueConstraints, UNIQUE_CONSTRAINTS_LIST);
- }
-
- public void moveUniqueConstraint(int targetIndex, int sourceIndex) {
- moveUniqueConstraintInternal(targetIndex, sourceIndex);
- ContainerAnnotationTools.synchAnnotationsAfterMove(targetIndex, sourceIndex, this.uniqueConstraintsContainerAnnotation);
- fireItemMoved(TableAnnotation.UNIQUE_CONSTRAINTS_LIST, targetIndex, sourceIndex);
- }
-
- protected void moveUniqueConstraintInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.uniqueConstraints, targetIndex, sourceIndex);
- }
-
- /**
- * synchronize the annotations with the model join columns,
- * starting at the specified index to prevent overlap
- */
- private void synchUniqueConstraintAnnotationsAfterRemove(int index) {
- ContainerAnnotationTools.synchAnnotationsAfterRemove(index, this.uniqueConstraintsContainerAnnotation);
- }
-
- protected NestableUniqueConstraint createUniqueConstraint(int index) {
- return UniqueConstraintImpl.createTableGeneratorUniqueConstraint(this, this.getMember(), index);
- }
-
-
- // ********** text ranges **********
-
- 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);
- }
-
- 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);
- }
-
- 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);
- }
-
- 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);
- }
-
- 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);
- }
-
- 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);
- }
-
- // ********** java annotations -> persistence model **********
- @Override
- public void update(CompilationUnit astRoot) {
- super.update(astRoot);
- this.setTable(this.table(astRoot));
- this.setCatalog(this.catalog(astRoot));
- this.setSchema(this.schema(astRoot));
- this.setPkColumnName(this.pkColumnName(astRoot));
- this.setValueColumnName(this.valueColumnName(astRoot));
- this.setPkColumnValue(this.pkColumnValue(astRoot));
- this.updateUniqueConstraintsFromJava(astRoot);
- }
-
- protected String table(CompilationUnit astRoot) {
- return this.tableAdapter.getValue(astRoot);
- }
- protected String catalog(CompilationUnit astRoot) {
- return this.catalogAdapter.getValue(astRoot);
- }
- protected String schema(CompilationUnit astRoot) {
- return this.schemaAdapter.getValue(astRoot);
- }
- protected String pkColumnName(CompilationUnit astRoot) {
- return this.pkColumnNameAdapter.getValue(astRoot);
- }
- protected String valueColumnName(CompilationUnit astRoot) {
- return this.valueColumnNameAdapter.getValue(astRoot);
- }
- protected String pkColumnValue(CompilationUnit astRoot) {
- return this.pkColumnValueAdapter.getValue(astRoot);
- }
-
- /**
- * here we just worry about getting the unique constraints lists the same size;
- * then we delegate to the unique constraints to synch themselves up
- */
- private void updateUniqueConstraintsFromJava(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this.uniqueConstraintsContainerAnnotation);
- }
-
-
- // ********** 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 constraints container annotation **********
-
- private class UniqueConstraintsContainerAnnotation
- extends AbstractJavaResourceNode
- implements ContainerAnnotation<NestableUniqueConstraint>
- {
- public UniqueConstraintsContainerAnnotation() {
- super(TableGeneratorImpl.this);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public NestableUniqueConstraint addInternal(int index) {
- NestableUniqueConstraint uniqueConstraint = TableGeneratorImpl.this.createUniqueConstraint(index);
- TableGeneratorImpl.this.uniqueConstraints.add(index, uniqueConstraint);
- return uniqueConstraint;
- }
-
- public NestableUniqueConstraint add(int index) {
- NestableUniqueConstraint uniqueConstraint = TableGeneratorImpl.this.createUniqueConstraint(index);
- TableGeneratorImpl.this.addUniqueConstraint(index, uniqueConstraint);
- return uniqueConstraint;
- }
-
- public String getAnnotationName() {
- return TableGeneratorImpl.this.getAnnotationName();
- }
-
- public String getNestableAnnotationName() {
- return JPA.UNIQUE_CONSTRAINT;
- }
-
- public int indexOf(NestableUniqueConstraint uniqueConstraint) {
- return TableGeneratorImpl.this.indexOfUniqueConstraint(uniqueConstraint);
- }
-
- public void move(int targetIndex, int sourceIndex) {
- TableGeneratorImpl.this.moveUniqueConstraint(targetIndex, sourceIndex);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- TableGeneratorImpl.this.moveUniqueConstraintInternal(targetIndex, sourceIndex);
- }
-
- public NestableUniqueConstraint nestedAnnotationAt(int index) {
- return TableGeneratorImpl.this.uniqueConstraintAt(index);
- }
-
- public NestableUniqueConstraint nestedAnnotationFor(org.eclipse.jdt.core.dom.Annotation jdtAnnotation) {
- for (NestableUniqueConstraint uniqueConstraint : CollectionTools.iterable(nestedAnnotations())) {
- if (jdtAnnotation == uniqueConstraint.getJdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return uniqueConstraint;
- }
- }
- return null;
- }
-
- public ListIterator<NestableUniqueConstraint> nestedAnnotations() {
- return new CloneListIterator<NestableUniqueConstraint>(TableGeneratorImpl.this.uniqueConstraints);
- }
-
- public int nestedAnnotationsSize() {
- return TableGeneratorImpl.this.uniqueConstraints.size();
- }
-
- public void remove(NestableUniqueConstraint uniqueConstraint) {
- TableGeneratorImpl.this.removeUniqueConstraint(uniqueConstraint);
- }
-
- public void remove(int index) {
- this.remove(nestedAnnotationAt(index));
- }
-
- public org.eclipse.jdt.core.dom.Annotation getJdtAnnotation(CompilationUnit astRoot) {
- return TableGeneratorImpl.this.getJdtAnnotation(astRoot);
- }
-
- public void newAnnotation() {
- TableGeneratorImpl.this.newAnnotation();
- }
-
- public void removeAnnotation() {
- TableGeneratorImpl.this.removeAnnotation();
- }
-
- public void update(CompilationUnit astRoot) {
- TableGeneratorImpl.this.update(astRoot);
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return TableGeneratorImpl.this.getTextRange(astRoot);
- }
-
- public String getElementName() {
- return JPA.TABLE_GENERATOR__UNIQUE_CONSTRAINTS;
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getAnnotationName());
- }
-
- }
-
-
- // ********** annotation definition **********
-
- public static class TableGeneratorAnnotationDefinition
- implements AnnotationDefinition
- {
- // singleton
- private static final TableGeneratorAnnotationDefinition 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 TableGeneratorImpl(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableImpl.java
deleted file mode 100644
index 1e6b4c4df0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableImpl.java
+++ /dev/null
@@ -1,104 +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.resource.java;
-
-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.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NestableUniqueConstraint;
-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.Member;
-
-public class TableImpl extends AbstractResourceTable
-{
- 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);
-
- protected TableImpl(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- public String getAnnotationName() {
- return TableAnnotation.ANNOTATION_NAME;
- }
-
- @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;
- }
-
- @Override
- protected NestableUniqueConstraint createUniqueConstraint(int index) {
- return UniqueConstraintImpl.createTableUniqueConstraint(this, this.getMember(), index);
- }
-
- public static class TableAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final TableAnnotationDefinition 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 TableImpl(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullTable(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TemporalImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TemporalImpl.java
deleted file mode 100644
index af42e97778..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TemporalImpl.java
+++ /dev/null
@@ -1,116 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-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;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-public class TemporalImpl extends AbstractResourceAnnotation<Attribute> implements TemporalAnnotation
-{
- 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 TemporalType value;
-
- protected TemporalImpl(JavaResourceNode parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new ShortCircuitAnnotationElementAdapter<String>(attribute, VALUE_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.value(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public TemporalType getValue() {
- return this.value;
- }
-
- public void setValue(TemporalType newValue) {
- if (attributeValueHasNotChanged(this.value, newValue)) {
- return;
- }
- TemporalType oldValue = this.value;
- this.value = newValue;
- this.valueAdapter.setValue(TemporalType.toJavaAnnotationValue(newValue));
- firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setValue(this.value(astRoot));
- }
-
- protected TemporalType value(CompilationUnit astRoot) {
- return TemporalType.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot));
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.TEMPORAL__VALUE);
- }
-
- public static class TemporalAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final TemporalAnnotationDefinition 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 TemporalImpl(parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullTemporal(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TransientImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TransientImpl.java
deleted file mode 100644
index e4f348bbe4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TransientImpl.java
+++ /dev/null
@@ -1,75 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-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.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-public class TransientImpl extends AbstractResourceAnnotation<Attribute> implements TransientAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- protected TransientImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void update(CompilationUnit astRoot) {
- //no annotation members
- }
-
- public static class TransientAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final TransientAnnotationDefinition INSTANCE = new TransientAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static TransientAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private TransientAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new TransientImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/UniqueConstraintImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/UniqueConstraintImpl.java
deleted file mode 100644
index 6ad1c8eb89..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/UniqueConstraintImpl.java
+++ /dev/null
@@ -1,188 +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.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-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.MemberIndexedAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitArrayAnnotationElementAdapter;
-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.NestableUniqueConstraint;
-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;
-
-public class UniqueConstraintImpl extends AbstractResourceAnnotation<Member> implements NestableUniqueConstraint
-{
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.UNIQUE_CONSTRAINT);
-
- private final DeclarationAnnotationElementAdapter<String[]> columnNamesDeclarationAdapter;
-
- private final AnnotationElementAdapter<String[]> columnNamesAdapter;
-
- private final List<String> columnNames;
-
-
- public UniqueConstraintImpl(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);
- this.columnNames = new ArrayList<String>();
- }
-
- public void initialize(CompilationUnit astRoot) {
- String[] javaColumnNames = this.columnNamesAdapter.getValue(astRoot);
- for (int i = 0; i < javaColumnNames.length; i++) {
- this.columnNames.add(javaColumnNames[i]);
- }
- }
-
- protected AnnotationElementAdapter<String[]> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String[]> daea) {
- return new ShortCircuitArrayAnnotationElementAdapter<String>(getMember(), daea);
- }
-
- protected static DeclarationAnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return buildArrayAnnotationElementAdapter(annotationAdapter, elementName, AnnotationStringArrayExpressionConverter.forStrings());
- }
-
- protected static DeclarationAnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String[]> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String[]>(annotationAdapter, elementName, false, converter);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public IndexedAnnotationAdapter getAnnotationAdapter() {
- return (IndexedAnnotationAdapter) super.getAnnotationAdapter();
- }
-
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- UniqueConstraintAnnotation oldUniqueConstraint = (UniqueConstraintAnnotation) oldAnnotation;
- for (String columnName : CollectionTools.iterable(oldUniqueConstraint.columnNames())) {
- addColumnName(columnName);
- }
- }
-
- public ListIterator<String> columnNames() {
- return new CloneListIterator<String>(this.columnNames);
- }
-
- public int columnNamesSize() {
- return this.columnNames.size();
- }
-
- public void addColumnName(String columnName) {
- addColumnName(columnNamesSize(), columnName);
- }
-
- public void addColumnName(int index, String columnName) {
- addColumnName_(index, columnName);
- this.columnNamesAdapter.setValue(this.columnNames.toArray(new String[this.columnNames.size()]));
- }
-
- protected void addColumnName_(String columnName) {
- this.addColumnName_(this.columnNames.size(), columnName);
- }
-
- protected void addColumnName_(int index, String columnName) {
- addItemToList(index, columnName, this.columnNames, COLUMN_NAMES_LIST);
- }
-
- public void removeColumnName(String columnName) {
- removeItemFromList(columnName, this.columnNames, COLUMN_NAMES_LIST);
- this.columnNamesAdapter.setValue(this.columnNames.toArray(new String[this.columnNames.size()]));
- }
-
- public void removeColumnName(int index) {
- removeItemFromList(index, this.columnNames, COLUMN_NAMES_LIST);
- this.columnNamesAdapter.setValue(this.columnNames.toArray(new String[this.columnNames.size()]));
- }
-
- public void moveColumnName(int targetIndex, int sourceIndex) {
- moveItemInList(targetIndex, sourceIndex, this.columnNames, COLUMN_NAMES_LIST);
- this.columnNamesAdapter.setValue(this.columnNames.toArray(new String[this.columnNames.size()]));
- }
-
- public boolean columnNamesTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.columnNamesDeclarationAdapter, pos, astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.updateColumnNamesFromJava(astRoot);
- }
-
- protected void updateColumnNamesFromJava(CompilationUnit astRoot) {
- String[] javaColumnNames = this.columnNamesAdapter.getValue(astRoot);
- //TODO hmm, seems we need change notification for this
- CollectionTools.retainAll(this.columnNames, javaColumnNames);
- for (int i = 0; i < javaColumnNames.length; i++) {
- String columnName = javaColumnNames[i];
- if (!this.columnNames.contains(columnName)) {
- addColumnName_(columnName);
- }
- }
- }
-
- // ********** persistence model -> java annotations **********
- public void moveAnnotation(int newIndex) {
- getAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- // ********** static methods **********
- static NestableUniqueConstraint createSecondaryTableUniqueConstraint(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter declarationAnnotationAdapter, int index) {
- return new UniqueConstraintImpl(parent, member, buildSecondaryTableUniqueConstraintAnnotationAdapter(declarationAnnotationAdapter, index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildSecondaryTableUniqueConstraintAnnotationAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter, int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(declarationAnnotationAdapter, JPA.SECONDARY_TABLE__UNIQUE_CONSTRAINTS, index, JPA.UNIQUE_CONSTRAINT);
- }
-
- static NestableUniqueConstraint createJoinTableUniqueConstraint(JavaResourceNode parent, Member member, int index) {
- return new UniqueConstraintImpl(parent, member, buildJoinTableUniqueConstraintAnnotationAdapter(index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildJoinTableUniqueConstraintAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(JoinTableImpl.DECLARATION_ANNOTATION_ADAPTER, JPA.JOIN_TABLE__UNIQUE_CONSTRAINTS, index, JPA.UNIQUE_CONSTRAINT);
- }
-
- static NestableUniqueConstraint createTableUniqueConstraint(JavaResourceNode parent, Member member, int index) {
- return new UniqueConstraintImpl(parent, member, buildTableUniqueConstraintAnnotationAdapter(index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildTableUniqueConstraintAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(TableImpl.DECLARATION_ANNOTATION_ADAPTER, JPA.TABLE__UNIQUE_CONSTRAINTS, index, JPA.UNIQUE_CONSTRAINT);
- }
-
- static NestableUniqueConstraint createTableGeneratorUniqueConstraint(JavaResourceNode parent, Member member, int index) {
- return new UniqueConstraintImpl(parent, member, buildTableGeneratorUniqueConstraintAnnotationAdapter(index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildTableGeneratorUniqueConstraintAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(TableGeneratorImpl.DECLARATION_ANNOTATION_ADAPTER, JPA.TABLE_GENERATOR__UNIQUE_CONSTRAINTS, index, JPA.UNIQUE_CONSTRAINT);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/VersionImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/VersionImpl.java
deleted file mode 100644
index e9c4431f1f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/VersionImpl.java
+++ /dev/null
@@ -1,75 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-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.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-public class VersionImpl extends AbstractResourceAnnotation<Attribute> implements VersionAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- public VersionImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void update(CompilationUnit astRoot) {
- //no annotation members
- }
-
- public static class VersionAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final VersionAnnotationDefinition INSTANCE = new VersionAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static VersionAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private VersionAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new VersionImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/OrmResourceModelProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/OrmResourceModelProvider.java
deleted file mode 100644
index fe716a1356..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/OrmResourceModelProvider.java
+++ /dev/null
@@ -1,87 +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.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.emf.ecore.resource.Resource;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.JpaConstants;
-import org.eclipse.jpt.core.internal.resource.JpaResourceModelProviderManager;
-import org.eclipse.jpt.core.resource.AbstractResourceModelProvider;
-import org.eclipse.jpt.core.resource.common.JpaXmlResource;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.OrmResource;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-
-public class OrmResourceModelProvider
- extends AbstractResourceModelProvider<OrmResource>
-{
- /**
- * (Convenience method) Returns an ORM resource model provider for
- * the given file.
- */
- public static OrmResourceModelProvider getModelProvider(IFile file) {
- return getModelProvider_(file.getProject(), file.getFullPath().toString());
- }
-
- /**
- * (Convenience method) Returns an ORM resource model provider for
- * the given project in the specified deploy location
- */
- public static OrmResourceModelProvider getModelProvider(IProject project, String deployLocation) {
- return getModelProvider_(project, JptCorePlugin.getDeploymentURI(project, deployLocation));
- }
-
- /**
- * (Convenience method) Returns an ORM resource model provider for
- * the given project in the default deploy location
- */
- public static OrmResourceModelProvider getDefaultModelProvider(IProject project) {
- return getModelProvider(project, JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- }
-
- private static OrmResourceModelProvider getModelProvider_(IProject project, String location) {
- return (OrmResourceModelProvider) JpaResourceModelProviderManager.instance().getModelProvider(
- project,
- new Path(location),
- JptCorePlugin.ORM_XML_CONTENT_TYPE);
- }
-
-
- public OrmResourceModelProvider(IProject project) {
- this(project, new Path(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH));
- }
-
- public OrmResourceModelProvider(IProject project, IPath filePath) {
- super(project, filePath);
- }
-
-
- @Override
- protected String getContentTypeDescriber() {
- return JptCorePlugin.ORM_XML_CONTENT_TYPE;
- }
-
- @Override
- protected void populateRoot(JpaXmlResource resource) {
- XmlEntityMappings entityMappings = OrmFactory.eINSTANCE.createXmlEntityMappings();
- entityMappings.setVersion(JpaConstants.VERSION_1_0_TEXT);
- getResourceContents(resource).add(entityMappings);
- }
-
- @Override
- protected OrmResource ensureCorrectType(Resource resource) throws ClassCastException {
- return (OrmResource) resource;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/OrmResourceModelProviderFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/OrmResourceModelProviderFactory.java
deleted file mode 100644
index 10ecdab893..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/OrmResourceModelProviderFactory.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.core.internal.resource.orm;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jpt.core.resource.JpaResourceModelProvider;
-import org.eclipse.jpt.core.resource.JpaResourceModelProviderFactory;
-
-public class OrmResourceModelProviderFactory implements JpaResourceModelProviderFactory
-{
- public JpaResourceModelProvider create(IProject project, IPath filePath) {
- return new OrmResourceModelProvider(project, filePath);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/AssociationOverrideTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/AssociationOverrideTranslator.java
deleted file mode 100644
index b104f1160a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/AssociationOverrideTranslator.java
+++ /dev/null
@@ -1,53 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class AssociationOverrideTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public AssociationOverrideTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createJoinColumnTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAssociationOverride_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createJoinColumnTranslator() {
- return new JoinColumnTranslator(JOIN_COLUMN, ORM_PKG.getXmlAssociationOverride_JoinColumns());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/AttributeOverrideTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/AttributeOverrideTranslator.java
deleted file mode 100644
index b099c16acb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/AttributeOverrideTranslator.java
+++ /dev/null
@@ -1,53 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class AttributeOverrideTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public AttributeOverrideTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createColumnTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeOverride_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createColumnTranslator() {
- return new ColumnTranslator(COLUMN, ORM_PKG.getXmlAttributeOverride_Column());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/AttributesTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/AttributesTranslator.java
deleted file mode 100644
index acf31eb163..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/AttributesTranslator.java
+++ /dev/null
@@ -1,88 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class AttributesTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public AttributesTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createIdTranslator(),
- createEmbeddedIdTranslator(),
- createBasicTranslator(),
- createVersionTranslator(),
- createManyToOneTranslator(),
- createOneToManyTranslator(),
- createOneToOneTranslator(),
- createManyToManyTranslator(),
- createEmbeddedTranslator(),
- createTransientTranslator()
- };
- }
-
- protected Translator createIdTranslator() {
- return new IdTranslator(ID, ORM_PKG.getAttributes_Ids());
- }
-
- protected Translator createEmbeddedIdTranslator() {
- return new EmbeddedIdTranslator(EMBEDDED_ID, ORM_PKG.getAttributes_EmbeddedIds());
- }
-
- protected Translator createBasicTranslator() {
- return new BasicTranslator(BASIC, ORM_PKG.getAttributes_Basics());
- }
-
- protected Translator createVersionTranslator() {
- return new VersionTranslator(VERSION, ORM_PKG.getAttributes_Versions());
- }
-
- protected Translator createManyToOneTranslator() {
- return new ManyToOneTranslator(MANY_TO_ONE, ORM_PKG.getAttributes_ManyToOnes());
- }
-
- protected Translator createOneToManyTranslator() {
- return new OneToManyTranslator(ONE_TO_MANY, ORM_PKG.getAttributes_OneToManys());
- }
-
- protected Translator createOneToOneTranslator() {
- return new OneToOneTranslator(ONE_TO_ONE, ORM_PKG.getAttributes_OneToOnes());
- }
-
- protected Translator createManyToManyTranslator() {
- return new ManyToManyTranslator(MANY_TO_MANY, ORM_PKG.getAttributes_ManyToManys());
- }
-
- protected Translator createEmbeddedTranslator() {
- return new EmbeddedTranslator(EMBEDDED, ORM_PKG.getAttributes_Embeddeds());
- }
-
- protected Translator createTransientTranslator() {
- return new TransientTranslator(TRANSIENT, ORM_PKG.getAttributes_Transients());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/BasicTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/BasicTranslator.java
deleted file mode 100644
index fd920bf0cf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/BasicTranslator.java
+++ /dev/null
@@ -1,81 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.common.translators.BooleanTranslator;
-import org.eclipse.jpt.core.internal.resource.common.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class BasicTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public BasicTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlBasicImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createFetchTranslator(),
- createOptionalTranslator(),
- createColumnTranslator(),
- createLobTranslator(),
- createTemporalTranslator(),
- createEnumeratedTranslator()
- };
- }
-
- protected Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE);
- }
-
- protected Translator createFetchTranslator() {
- return new Translator(FETCH, ORM_PKG.getXmlBasic_Fetch(), DOM_ATTRIBUTE);
- }
-
- protected Translator createOptionalTranslator() {
- return new BooleanTranslator(OPTIONAL, ORM_PKG.getXmlBasic_Optional(), DOM_ATTRIBUTE);
- }
-
- protected Translator createColumnTranslator() {
- return new ColumnTranslator(COLUMN, ORM_PKG.getColumnMapping_Column());
- }
-
- protected Translator createLobTranslator() {
- return new EmptyTagBooleanTranslator(LOB, ORM_PKG.getXmlConvertibleMapping_Lob());
- }
-
- protected Translator createTemporalTranslator() {
- return new Translator(TEMPORAL, ORM_PKG.getXmlConvertibleMapping_Temporal());
- }
-
- protected Translator createEnumeratedTranslator() {
- return new Translator(ENUMERATED, ORM_PKG.getXmlConvertibleMapping_Enumerated());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/CascadeTypeTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/CascadeTypeTranslator.java
deleted file mode 100644
index ae54af6938..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/CascadeTypeTranslator.java
+++ /dev/null
@@ -1,69 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.common.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class CascadeTypeTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public CascadeTypeTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createCascadeTypeImpl();
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createCascadeAllTranslator(),
- createCascadePersistTranslator(),
- createCascadeMergeTranslator(),
- createCascadeRemoveTranslator(),
- createCascadeRefreshTranslator()
- };
- }
-
- private Translator createCascadeAllTranslator() {
- return new EmptyTagBooleanTranslator(CASCADE_ALL, ORM_PKG.getCascadeType_CascadeAll());
- }
-
- private Translator createCascadePersistTranslator() {
- return new EmptyTagBooleanTranslator(CASCADE_PERSIST, ORM_PKG.getCascadeType_CascadePersist());
- }
-
- private Translator createCascadeMergeTranslator() {
- return new EmptyTagBooleanTranslator(CASCADE_MERGE, ORM_PKG.getCascadeType_CascadeMerge());
- }
-
- private Translator createCascadeRemoveTranslator() {
- return new EmptyTagBooleanTranslator(CASCADE_REMOVE, ORM_PKG.getCascadeType_CascadeRemove());
- }
-
- private Translator createCascadeRefreshTranslator() {
- return new EmptyTagBooleanTranslator(CASCADE_REFRESH, ORM_PKG.getCascadeType_CascadeRefresh());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ColumnResultTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ColumnResultTranslator.java
deleted file mode 100644
index 8481894a5d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ColumnResultTranslator.java
+++ /dev/null
@@ -1,43 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class ColumnResultTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public ColumnResultTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getColumnResult_Name(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ColumnTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ColumnTranslator.java
deleted file mode 100644
index 2f2ddab567..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ColumnTranslator.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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.common.translators.BooleanTranslator;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class ColumnTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public ColumnTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlColumnImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createUniqueTranslator(),
- createNullableTranslator(),
- createInsertableTranslator(),
- createUpdatableTranslator(),
- createColumnDefinitionTranslator(),
- createTableTranslator(),
- createLengthTranslator(),
- createPrecisionTranslator(),
- createScaleTranslator(),
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlNamedColumn_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createUniqueTranslator() {
- return new BooleanTranslator(UNIQUE, ORM_PKG.getXmlAbstractColumn_Unique(), DOM_ATTRIBUTE);
- }
-
- private Translator createNullableTranslator() {
- return new BooleanTranslator(NULLABLE, ORM_PKG.getXmlAbstractColumn_Nullable(), DOM_ATTRIBUTE);
- }
-
- private Translator createInsertableTranslator() {
- return new BooleanTranslator(INSERTABLE, ORM_PKG.getXmlAbstractColumn_Insertable(), DOM_ATTRIBUTE);
- }
-
- private Translator createUpdatableTranslator() {
- return new BooleanTranslator(UPDATABLE, ORM_PKG.getXmlAbstractColumn_Updatable(), DOM_ATTRIBUTE);
- }
-
- private Translator createColumnDefinitionTranslator() {
- return new Translator(COLUMN_DEFINITION, ORM_PKG.getXmlNamedColumn_ColumnDefinition(), DOM_ATTRIBUTE);
- }
-
- private Translator createTableTranslator() {
- return new Translator(TABLE, ORM_PKG.getXmlAbstractColumn_Table(), DOM_ATTRIBUTE);
- }
-
- private Translator createLengthTranslator() {
- return new Translator(LENGTH, ORM_PKG.getXmlColumn_Length(), DOM_ATTRIBUTE);
- }
-
- private Translator createPrecisionTranslator() {
- return new Translator(PRECISION, ORM_PKG.getXmlColumn_Precision(), DOM_ATTRIBUTE);
- }
-
- private Translator createScaleTranslator() {
- return new Translator(SCALE, ORM_PKG.getXmlColumn_Scale(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/DiscriminatorColumnTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/DiscriminatorColumnTranslator.java
deleted file mode 100644
index 8d2d31cd42..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/DiscriminatorColumnTranslator.java
+++ /dev/null
@@ -1,56 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class DiscriminatorColumnTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public DiscriminatorColumnTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createDiscrminiatorTypeTranslator(),
- createColumnDefinitionTranslator(),
- createLengthTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlNamedColumn_Name(), DOM_ATTRIBUTE);
- }
-
- protected Translator createDiscrminiatorTypeTranslator() {
- return new Translator(DISCRIMINATOR_TYPE, ORM_PKG.getXmlDiscriminatorColumn_DiscriminatorType(), DOM_ATTRIBUTE);
- }
-
- private Translator createColumnDefinitionTranslator() {
- return new Translator(COLUMN_DEFINITION, ORM_PKG.getXmlNamedColumn_ColumnDefinition(), DOM_ATTRIBUTE);
- }
-
- protected Translator createLengthTranslator() {
- return new Translator(LENGTH, ORM_PKG.getXmlDiscriminatorColumn_Length(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmbeddableTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmbeddableTranslator.java
deleted file mode 100644
index a72b8850c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmbeddableTranslator.java
+++ /dev/null
@@ -1,61 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EmbeddableTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public EmbeddableTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createClassTranslator(),
- createAccessTranslator(),
- createMetadataCompleteTranslator(),
- createDescriptionTranslator(),
- createAttributesTranslator()
- };
- }
-
- protected Translator createClassTranslator() {
- return new Translator(CLASS, ORM_PKG.getAbstractXmlTypeMapping_ClassName(), DOM_ATTRIBUTE);
- }
-
- protected Translator createAccessTranslator() {
- return new Translator(ACCESS, ORM_PKG.getAbstractXmlTypeMapping_Access(), DOM_ATTRIBUTE);
- }
-
- protected Translator createMetadataCompleteTranslator() {
- return new Translator(METADATA_COMPLETE, ORM_PKG.getAbstractXmlTypeMapping_MetadataComplete(), DOM_ATTRIBUTE);
- }
-
- protected Translator createDescriptionTranslator() {
- return new Translator(DESCRIPTION, ORM_PKG.getAbstractXmlTypeMapping_Description());
- }
-
- protected Translator createAttributesTranslator() {
- return new AttributesTranslator(ATTRIBUTES, ORM_PKG.getAbstractXmlTypeMapping_Attributes());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmbeddedIdTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmbeddedIdTranslator.java
deleted file mode 100644
index 36c491e2f0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmbeddedIdTranslator.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.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EmbeddedIdTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public EmbeddedIdTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlEmbeddedIdImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createAttributeOverrideTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createAttributeOverrideTranslator() {
- return new AttributeOverrideTranslator(ATTRIBUTE_OVERRIDE, ORM_PKG.getBaseXmlEmbedded_AttributeOverrides());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmbeddedTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmbeddedTranslator.java
deleted file mode 100644
index 49df8907f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmbeddedTranslator.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.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EmbeddedTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public EmbeddedTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlEmbeddedImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createAttributeOverrideTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createAttributeOverrideTranslator() {
- return new AttributeOverrideTranslator(ATTRIBUTE_OVERRIDE, ORM_PKG.getBaseXmlEmbedded_AttributeOverrides());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityListenerTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityListenerTranslator.java
deleted file mode 100644
index 5235578c54..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityListenerTranslator.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.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EntityListenerTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public EntityListenerTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- private Translator[] createChildren() {
- return new Translator[] {
- createClassTranslator(),
- createPrePersistTranslator(),
- createPostPersistTranslator(),
- createPreRemoveTranslator(),
- createPostRemoveTranslator(),
- createPreUpdateTranslator(),
- createPostUpdateTranslator(),
- createPostLoadTranslator()
- };
- }
-
- private Translator createClassTranslator() {
- return new Translator(CLASS, ORM_PKG.getEntityListener_ClassName());
- }
-
- private Translator createPrePersistTranslator() {
- return new EventMethodTranslator(PRE_PERSIST, ORM_PKG.getEntityListener_PrePersist());
- }
-
- private Translator createPostPersistTranslator() {
- return new EventMethodTranslator(POST_PERSIST, ORM_PKG.getEntityListener_PostPersist());
- }
-
- private Translator createPreRemoveTranslator() {
- return new EventMethodTranslator(PRE_REMOVE, ORM_PKG.getEntityListener_PreRemove());
- }
-
- private Translator createPostRemoveTranslator() {
- return new EventMethodTranslator(POST_REMOVE, ORM_PKG.getEntityListener_PostRemove());
- }
-
- private Translator createPreUpdateTranslator() {
- return new EventMethodTranslator(PRE_UPDATE, ORM_PKG.getEntityListener_PreUpdate());
- }
-
- private Translator createPostUpdateTranslator() {
- return new EventMethodTranslator(POST_UPDATE, ORM_PKG.getEntityListener_PostUpdate());
- }
-
- private Translator createPostLoadTranslator() {
- return new EventMethodTranslator(POST_LOAD, ORM_PKG.getEntityListener_PostLoad());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityListenersTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityListenersTranslator.java
deleted file mode 100644
index cfcd966791..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityListenersTranslator.java
+++ /dev/null
@@ -1,43 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EntityListenersTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public EntityListenersTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- private Translator[] createChildren() {
- return new Translator[] {
- createEntityListenerTranslator()
- };
- }
-
- private Translator createEntityListenerTranslator() {
- return new EntityListenerTranslator(ENTITY_LISTENER, ORM_PKG.getEntityListeners_EntityListeners());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityMappingsTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityMappingsTranslator.java
deleted file mode 100644
index 36353c5796..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityMappingsTranslator.java
+++ /dev/null
@@ -1,136 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.wst.common.internal.emf.resource.ConstantAttributeTranslator;
-import org.eclipse.wst.common.internal.emf.resource.RootTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EntityMappingsTranslator extends RootTranslator
- implements OrmXmlMapper
-{
- public static EntityMappingsTranslator INSTANCE = new EntityMappingsTranslator();
-
-
- private Translator[] children;
-
-
- protected EntityMappingsTranslator(String domNameAndPath, EClass eClass) {
- super(domNameAndPath, eClass);
- }
-
-
- public EntityMappingsTranslator() {
- this(ENTITY_MAPPINGS, ORM_PKG.getXmlEntityMappings());
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createVersionTranslator(),
- createNamespaceTranslator(),
- createSchemaNamespaceTranslator(),
- createSchemaLocationTranslator(),
- createDescriptionTranslator(),
- createPersistenceUnitMetadataTranslator(),
- createPackageTranslator(),
- createSchemaTranslator(),
- createCatalogTranslator(),
- createAccessTranslator(),
- createSequenceGeneratorTranslator(),
- createTableGeneratorTranslator(),
- createNamedQueryTranslator(),
- createNamedNativeQueryTranslator(),
- createSqlResultSetMappingTranslator(),
- createMappedSuperclassTranslator(),
- createEntityTranslator(),
- createEmbeddableTranslator()
- };
- }
-
- protected Translator createNamespaceTranslator() {
- return new ConstantAttributeTranslator(XML_NS, ORM_NS_URL);
- }
-
- protected Translator createSchemaNamespaceTranslator() {
- return new ConstantAttributeTranslator(XML_NS_XSI, XSI_NS_URL);
- }
-
- protected Translator createSchemaLocationTranslator() {
- return new ConstantAttributeTranslator(XSI_SCHEMA_LOCATION, ORM_NS_URL + ' ' + ORM_SCHEMA_LOC_1_0);
- }
-
- protected Translator createVersionTranslator() {
- return new Translator(VERSION, ORM_PKG.getXmlEntityMappings_Version(), DOM_ATTRIBUTE);
- }
-
- protected Translator createDescriptionTranslator() {
- return new Translator(DESCRIPTION, ORM_PKG.getXmlEntityMappings_Description());
- }
-
- protected Translator createPersistenceUnitMetadataTranslator() {
- return new PersistenceUnitMetadataTranslator(PERSISTENCE_UNIT_METADATA, ORM_PKG.getXmlEntityMappings_PersistenceUnitMetadata());
- }
-
- protected Translator createPackageTranslator() {
- return new Translator(PACKAGE, ORM_PKG.getXmlEntityMappings_Package());
- }
-
- protected Translator createSchemaTranslator() {
- return new Translator(SCHEMA, ORM_PKG.getXmlEntityMappings_Schema());
- }
-
- protected Translator createCatalogTranslator() {
- return new Translator(CATALOG, ORM_PKG.getXmlEntityMappings_Catalog());
- }
-
- protected Translator createAccessTranslator() {
- return new Translator(ACCESS, ORM_PKG.getXmlEntityMappings_Access());
- }
-
- protected Translator createSequenceGeneratorTranslator() {
- return new SequenceGeneratorTranslator(SEQUENCE_GENERATOR, ORM_PKG.getXmlEntityMappings_SequenceGenerators());
- }
-
- protected Translator createTableGeneratorTranslator() {
- return new TableGeneratorTranslator(TABLE_GENERATOR, ORM_PKG.getXmlEntityMappings_TableGenerators());
- }
-
- protected Translator createNamedQueryTranslator() {
- return new NamedQueryTranslator(NAMED_QUERY, ORM_PKG.getXmlEntityMappings_NamedQueries());
- }
-
- protected Translator createNamedNativeQueryTranslator() {
- return new NamedNativeQueryTranslator(NAMED_NATIVE_QUERY, ORM_PKG.getXmlEntityMappings_NamedNativeQueries());
- }
-
- protected Translator createSqlResultSetMappingTranslator() {
- return new SqlResultSetMappingTranslator(SQL_RESULT_SET_MAPPING, ORM_PKG.getXmlEntityMappings_SqlResultSetMappings());
- }
-
- protected Translator createMappedSuperclassTranslator() {
- return new MappedSuperclassTranslator(MAPPED_SUPERCLASS, ORM_PKG.getXmlEntityMappings_MappedSuperclasses());
- }
-
- protected Translator createEntityTranslator() {
- return new EntityTranslator(ENTITY, ORM_PKG.getXmlEntityMappings_Entities());
- }
-
- protected Translator createEmbeddableTranslator() {
- return new EmbeddableTranslator(EMBEDDABLE, ORM_PKG.getXmlEntityMappings_Embeddables());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityResultTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityResultTranslator.java
deleted file mode 100644
index 7173f593a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityResultTranslator.java
+++ /dev/null
@@ -1,53 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EntityResultTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public EntityResultTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createEntityClassTranslator(),
- createDiscriminatorColumnTranslator(),
- createFieldResultTranslator()
- };
- }
-
- private Translator createEntityClassTranslator() {
- return new Translator(ENTITY_CLASS, ORM_PKG.getEntityResult_EntityClass(), DOM_ATTRIBUTE);
- }
-
- private Translator createDiscriminatorColumnTranslator() {
- return new Translator(DISCRIMINATOR_COLUMN, ORM_PKG.getEntityResult_DiscriminatorColumn(), DOM_ATTRIBUTE);
- }
-
- private Translator createFieldResultTranslator() {
- return new FieldResultTranslator(FIELD_RESULT, ORM_PKG.getEntityResult_FieldResults());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityTranslator.java
deleted file mode 100644
index 7586de94bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityTranslator.java
+++ /dev/null
@@ -1,187 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.common.translators.EmptyTagBooleanTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EntityTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public EntityTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createClassTranslator(),
- createAccessTranslator(),
- createMetadataCompleteTranslator(),
- createDescriptionTranslator(),
- createTableTranslator(),
- createSecondaryTableTranslator(),
- createPrimaryKeyJoinColumnTranslator(),
- createIdClassTranslator(),
- createInheritanceTranslator(),
- createDiscriminatorValueTranslator(),
- createDiscriminatorColumnTranslator(),
- createSequenceGeneratorTranslator(),
- createTableGeneratorTranslator(),
- createNamedQueryTranslator(),
- createNamedNativeQueryTranslator(),
- createSqlResultSetMappingTranslator(),
- createExcludeDefaultListenersTranslator(),
- createExcludeSuperclassListenersTranslator(),
- createEntityListenersTranslator(),
- createPrePersistTranslator(),
- createPostPersistTranslator(),
- createPreRemoveTranslator(),
- createPostRemoveTranslator(),
- createPreUpdateTranslator(),
- createPostUpdateTranslator(),
- createPostLoadTranslator(),
- createAttributeOverrideTranslator(),
- createAssociationOverrideTranslator(),
- createAttributesTranslator()
- };
- }
-
- protected Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlEntity_Name(), DOM_ATTRIBUTE);
- }
-
- protected Translator createClassTranslator() {
- return new Translator(CLASS, ORM_PKG.getAbstractXmlTypeMapping_ClassName(), DOM_ATTRIBUTE);
- }
-
- protected Translator createAccessTranslator() {
- return new Translator(ACCESS, ORM_PKG.getAbstractXmlTypeMapping_Access(), DOM_ATTRIBUTE);
- }
-
- protected Translator createMetadataCompleteTranslator() {
- return new Translator(METADATA_COMPLETE, ORM_PKG.getAbstractXmlTypeMapping_MetadataComplete(), DOM_ATTRIBUTE);
- }
-
- protected Translator createDescriptionTranslator() {
- return new Translator(DESCRIPTION, ORM_PKG.getAbstractXmlTypeMapping_Description());
- }
-
- protected Translator createTableTranslator() {
- return new TableTranslator(TABLE, ORM_PKG.getXmlEntity_Table());
- }
-
- protected Translator createSecondaryTableTranslator() {
- return new SecondaryTableTranslator(SECONDARY_TABLE, ORM_PKG.getXmlEntity_SecondaryTables());
- }
-
- protected Translator createPrimaryKeyJoinColumnTranslator() {
- return new PrimaryKeyJoinColumnTranslator(PRIMARY_KEY_JOIN_COLUMN, ORM_PKG.getXmlEntity_PrimaryKeyJoinColumns());
- }
-
- protected Translator createIdClassTranslator() {
- return new IdClassTranslator(ID_CLASS, ORM_PKG.getXmlEntity_IdClass());
- }
-
- protected Translator createInheritanceTranslator() {
- return new InheritanceTranslator(INHERITANCE, ORM_PKG.getXmlEntity_Inheritance());
- }
-
- protected Translator createDiscriminatorValueTranslator() {
- return new Translator(DISCRIMINATOR_VALUE, ORM_PKG.getXmlEntity_DiscriminatorValue());
- }
-
- protected Translator createDiscriminatorColumnTranslator() {
- return new DiscriminatorColumnTranslator(DISCRIMINATOR_COLUMN, ORM_PKG.getXmlEntity_DiscriminatorColumn());
- }
-
- protected Translator createSequenceGeneratorTranslator() {
- return new SequenceGeneratorTranslator(SEQUENCE_GENERATOR, ORM_PKG.getXmlEntity_SequenceGenerator());
- }
-
- protected Translator createTableGeneratorTranslator() {
- return new TableGeneratorTranslator(TABLE_GENERATOR, ORM_PKG.getXmlEntity_TableGenerator());
- }
-
- protected Translator createNamedQueryTranslator() {
- return new NamedQueryTranslator(NAMED_QUERY, ORM_PKG.getXmlEntity_NamedQueries());
- }
-
- protected Translator createNamedNativeQueryTranslator() {
- return new NamedNativeQueryTranslator(NAMED_NATIVE_QUERY, ORM_PKG.getXmlEntity_NamedNativeQueries());
- }
-
- protected Translator createSqlResultSetMappingTranslator() {
- return new SqlResultSetMappingTranslator(SQL_RESULT_SET_MAPPING, ORM_PKG.getXmlEntity_SqlResultSetMappings());
- }
-
- protected Translator createExcludeDefaultListenersTranslator() {
- return new EmptyTagBooleanTranslator(EXCLUDE_DEFAULT_LISTENERS, ORM_PKG.getXmlEntity_ExcludeDefaultListeners());
- }
-
- protected Translator createExcludeSuperclassListenersTranslator() {
- return new EmptyTagBooleanTranslator(EXCLUDE_SUPERCLASS_LISTENERS, ORM_PKG.getXmlEntity_ExcludeSuperclassListeners());
- }
-
- protected Translator createEntityListenersTranslator() {
- return new EntityListenersTranslator(ENTITY_LISTENERS, ORM_PKG.getXmlEntity_EntityListeners());
- }
-
- protected Translator createPrePersistTranslator() {
- return new EventMethodTranslator(PRE_PERSIST, ORM_PKG.getXmlEntity_PrePersist());
- }
-
- protected Translator createPostPersistTranslator() {
- return new EventMethodTranslator(POST_PERSIST, ORM_PKG.getXmlEntity_PostPersist());
- }
-
- protected Translator createPreRemoveTranslator() {
- return new EventMethodTranslator(PRE_REMOVE, ORM_PKG.getXmlEntity_PreRemove());
- }
-
- protected Translator createPostRemoveTranslator() {
- return new EventMethodTranslator(POST_REMOVE, ORM_PKG.getXmlEntity_PostRemove());
- }
-
- protected Translator createPreUpdateTranslator() {
- return new EventMethodTranslator(PRE_UPDATE, ORM_PKG.getXmlEntity_PreUpdate());
- }
-
- protected Translator createPostUpdateTranslator() {
- return new EventMethodTranslator(POST_UPDATE, ORM_PKG.getXmlEntity_PostUpdate());
- }
-
- protected Translator createPostLoadTranslator() {
- return new EventMethodTranslator(POST_LOAD, ORM_PKG.getXmlEntity_PostLoad());
- }
-
- protected Translator createAttributeOverrideTranslator() {
- return new AttributeOverrideTranslator(ATTRIBUTE_OVERRIDE, ORM_PKG.getXmlEntity_AttributeOverrides());
- }
-
- protected Translator createAssociationOverrideTranslator() {
- return new AssociationOverrideTranslator(ASSOCIATION_OVERRIDE, ORM_PKG.getXmlEntity_AssociationOverrides());
- }
-
- protected Translator createAttributesTranslator() {
- return new AttributesTranslator(ATTRIBUTES, ORM_PKG.getAbstractXmlTypeMapping_Attributes());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EventMethodTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EventMethodTranslator.java
deleted file mode 100644
index f0515d01f6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EventMethodTranslator.java
+++ /dev/null
@@ -1,43 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EventMethodTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public EventMethodTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- private Translator[] createChildren() {
- return new Translator[] {
- createMethodNameTranslator()
- };
- }
-
- private Translator createMethodNameTranslator() {
- return new Translator(METHOD_NAME, ORM_PKG.getEventMethod_MethodName(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/FieldResultTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/FieldResultTranslator.java
deleted file mode 100644
index 860248103a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/FieldResultTranslator.java
+++ /dev/null
@@ -1,48 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class FieldResultTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public FieldResultTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createColumnTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getFieldResult_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createColumnTranslator() {
- return new Translator(COLUMN, ORM_PKG.getFieldResult_Column(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/GeneratedValueTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/GeneratedValueTranslator.java
deleted file mode 100644
index 2419654090..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/GeneratedValueTranslator.java
+++ /dev/null
@@ -1,53 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class GeneratedValueTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public GeneratedValueTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlGeneratedValueImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createStrategyTranslator(),
- createGeneratorTranslator()
- };
- }
-
- protected Translator createStrategyTranslator() {
- return new Translator(STRATEGY, ORM_PKG.getXmlGeneratedValue_Strategy(), DOM_ATTRIBUTE);
- }
-
- protected Translator createGeneratorTranslator() {
- return new Translator(GENERATOR, ORM_PKG.getXmlGeneratedValue_Generator(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/IdClassTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/IdClassTranslator.java
deleted file mode 100644
index b5d9bcfd70..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/IdClassTranslator.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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class IdClassTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public IdClassTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createClassTranslator()
- };
- }
-
- protected Translator createClassTranslator() {
- return new Translator(CLASS, ORM_PKG.getXmlIdClass_ClassName(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/IdTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/IdTranslator.java
deleted file mode 100644
index 1b22a327e8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/IdTranslator.java
+++ /dev/null
@@ -1,73 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class IdTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public IdTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlIdImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createColumnTranslator(),
- createGeneratedValueTranslator(),
- createTemporalTranslator(),
- createTableGeneratorTranslator(),
- createSequenceGeneratorTranslator()
- };
- }
-
- protected Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE);
- }
-
- protected Translator createColumnTranslator() {
- return new ColumnTranslator(COLUMN, ORM_PKG.getColumnMapping_Column());
- }
-
- protected Translator createGeneratedValueTranslator() {
- return new GeneratedValueTranslator(GENERATED_VALUE, ORM_PKG.getXmlId_GeneratedValue());
- }
-
- protected Translator createTemporalTranslator() {
- return new Translator(TEMPORAL, ORM_PKG.getXmlConvertibleMapping_Temporal());
- }
-
- protected Translator createTableGeneratorTranslator() {
- return new TableGeneratorTranslator(TABLE_GENERATOR, ORM_PKG.getXmlId_TableGenerator());
- }
-
- protected Translator createSequenceGeneratorTranslator() {
- return new SequenceGeneratorTranslator(SEQUENCE_GENERATOR, ORM_PKG.getXmlId_SequenceGenerator());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/InheritanceTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/InheritanceTranslator.java
deleted file mode 100644
index 3d8f19d68d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/InheritanceTranslator.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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class InheritanceTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public InheritanceTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createStrategyTranslator(),
- };
- }
-
- private Translator createStrategyTranslator() {
- return new Translator(STRATEGY, ORM_PKG.getInheritance_Strategy(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/JoinColumnTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/JoinColumnTranslator.java
deleted file mode 100644
index 5f8fadfd5d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/JoinColumnTranslator.java
+++ /dev/null
@@ -1,85 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.common.translators.BooleanTranslator;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class JoinColumnTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public JoinColumnTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlJoinColumnImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createReferencedColumnNameTranslator(),
- createUniqueTranslator(),
- createNullableTranslator(),
- createInsertableTranslator(),
- createUpdatableTranslator(),
- createColumnDefinitionTranslator(),
- createTableTranslator(),
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlNamedColumn_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createReferencedColumnNameTranslator() {
- return new Translator(REFERENCED_COLUMN_NAME, ORM_PKG.getXmlJoinColumn_ReferencedColumnName(), DOM_ATTRIBUTE);
- }
-
- private Translator createUniqueTranslator() {
- return new BooleanTranslator(UNIQUE, ORM_PKG.getXmlAbstractColumn_Unique(), DOM_ATTRIBUTE);
- }
-
- private Translator createNullableTranslator() {
- return new BooleanTranslator(NULLABLE, ORM_PKG.getXmlAbstractColumn_Nullable(), DOM_ATTRIBUTE);
- }
-
- private Translator createInsertableTranslator() {
- return new BooleanTranslator(INSERTABLE, ORM_PKG.getXmlAbstractColumn_Insertable(), DOM_ATTRIBUTE);
- }
-
- private Translator createUpdatableTranslator() {
- return new BooleanTranslator(UPDATABLE, ORM_PKG.getXmlAbstractColumn_Updatable(), DOM_ATTRIBUTE);
- }
-
- private Translator createColumnDefinitionTranslator() {
- return new Translator(COLUMN_DEFINITION, ORM_PKG.getXmlNamedColumn_ColumnDefinition(), DOM_ATTRIBUTE);
- }
-
- private Translator createTableTranslator() {
- return new Translator(TABLE, ORM_PKG.getXmlAbstractColumn_Table(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/JoinTableTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/JoinTableTranslator.java
deleted file mode 100644
index d997a9e7b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/JoinTableTranslator.java
+++ /dev/null
@@ -1,73 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class JoinTableTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public JoinTableTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlJoinTableImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createCatalogTranslator(),
- createSchemaTranslator(),
- createJoinColumnTranslator(),
- createInverseJoinColumnTranslator(),
- createUniqueConstraintTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlBaseTable_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createCatalogTranslator() {
- return new Translator(CATALOG, ORM_PKG.getXmlBaseTable_Catalog(), DOM_ATTRIBUTE);
- }
-
- private Translator createSchemaTranslator() {
- return new Translator(SCHEMA, ORM_PKG.getXmlBaseTable_Schema(), DOM_ATTRIBUTE);
- }
-
- private Translator createJoinColumnTranslator() {
- return new JoinColumnTranslator(JOIN_COLUMN, ORM_PKG.getXmlJoinTable_JoinColumns());
- }
-
- private Translator createInverseJoinColumnTranslator() {
- return new JoinColumnTranslator(INVERSE_JOIN_COLUMN, ORM_PKG.getXmlJoinTable_InverseJoinColumns());
- }
-
- private Translator createUniqueConstraintTranslator() {
- return new UniqueConstraintTranslator(UNIQUE_CONSTRAINT, ORM_PKG.getXmlBaseTable_UniqueConstraints());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ManyToManyTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ManyToManyTranslator.java
deleted file mode 100644
index 790cb690fa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ManyToManyTranslator.java
+++ /dev/null
@@ -1,83 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class ManyToManyTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public ManyToManyTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlManyToManyImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createTargetEntityTranslator(),
- createFetchTranslator(),
- createMappedByTranslator(),
- createOrderByTranslator(),
- createMapKeyTranslator(),
- createJoinTableTranslator(),
- createCascadeTranslator()
- };
- }
-
- protected Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE);
- }
-
- protected Translator createTargetEntityTranslator() {
- return new Translator(TARGET_ENTITY, ORM_PKG.getXmlRelationshipMapping_TargetEntity(), DOM_ATTRIBUTE);
- }
-
- protected Translator createFetchTranslator() {
- return new Translator(FETCH, ORM_PKG.getXmlRelationshipMapping_Fetch(), DOM_ATTRIBUTE);
- }
-
- protected Translator createMappedByTranslator() {
- return new Translator(MAPPED_BY, ORM_PKG.getXmlMultiRelationshipMapping_MappedBy(), DOM_ATTRIBUTE);
- }
-
- protected Translator createOrderByTranslator() {
- return new Translator(ORDER_BY, ORM_PKG.getXmlMultiRelationshipMapping_OrderBy());
- }
-
- protected Translator createMapKeyTranslator() {
- return new MapKeyTranslator(MAP_KEY, ORM_PKG.getXmlMultiRelationshipMapping_MapKey());
- }
-
- protected Translator createJoinTableTranslator() {
- return new JoinTableTranslator(JOIN_TABLE, ORM_PKG.getXmlRelationshipMapping_JoinTable());
- }
-
- protected Translator createCascadeTranslator() {
- return new CascadeTypeTranslator(CASCADE, ORM_PKG.getXmlRelationshipMapping_Cascade());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ManyToOneTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ManyToOneTranslator.java
deleted file mode 100644
index c47ed0d162..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ManyToOneTranslator.java
+++ /dev/null
@@ -1,78 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class ManyToOneTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public ManyToOneTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlManyToOneImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createTargetEntityTranslator(),
- createFetchTranslator(),
- createOptionalTranslator(),
- createJoinColumnTranslator(),
- createJoinTableTranslator(),
- createCascadeTranslator()
- };
- }
-
- protected Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE);
- }
-
- protected Translator createTargetEntityTranslator() {
- return new Translator(TARGET_ENTITY, ORM_PKG.getXmlRelationshipMapping_TargetEntity(), DOM_ATTRIBUTE);
- }
-
- protected Translator createFetchTranslator() {
- return new Translator(FETCH, ORM_PKG.getXmlRelationshipMapping_Fetch(), DOM_ATTRIBUTE);
- }
-
- protected Translator createOptionalTranslator() {
- return new Translator(OPTIONAL, ORM_PKG.getXmlSingleRelationshipMapping_Optional(), DOM_ATTRIBUTE);
- }
-
- protected Translator createJoinColumnTranslator() {
- return new JoinColumnTranslator(JOIN_COLUMN, ORM_PKG.getXmlSingleRelationshipMapping_JoinColumns());
- }
-
- protected Translator createJoinTableTranslator() {
- return new JoinTableTranslator(JOIN_TABLE, ORM_PKG.getXmlRelationshipMapping_JoinTable());
- }
-
- protected Translator createCascadeTranslator() {
- return new CascadeTypeTranslator(CASCADE, ORM_PKG.getXmlRelationshipMapping_Cascade());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/MapKeyTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/MapKeyTranslator.java
deleted file mode 100644
index cefc3574df..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/MapKeyTranslator.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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-
-public class MapKeyTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public MapKeyTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator()
- };
- }
-
- protected Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getMapKey_Name(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/MappedSuperclassTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/MappedSuperclassTranslator.java
deleted file mode 100644
index 1b2797c13e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/MappedSuperclassTranslator.java
+++ /dev/null
@@ -1,117 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.common.translators.EmptyTagBooleanTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class MappedSuperclassTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public MappedSuperclassTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createClassTranslator(),
- createAccessTranslator(),
- createMetadataCompleteTranslator(),
- createDescriptionTranslator(),
- createIdClassTranslator(),
- createExcludeDefaultListenersTranslator(),
- createExcludeSuperclassListenersTranslator(),
- createEntityListenersTranslator(),
- createPrePersistTranslator(),
- createPostPersistTranslator(),
- createPreRemoveTranslator(),
- createPostRemoveTranslator(),
- createPreUpdateTranslator(),
- createPostUpdateTranslator(),
- createPostLoadTranslator(),
- createAttributesTranslator()
- };
- }
-
- protected Translator createClassTranslator() {
- return new Translator(CLASS, ORM_PKG.getAbstractXmlTypeMapping_ClassName(), DOM_ATTRIBUTE);
- }
-
- protected Translator createAccessTranslator() {
- return new Translator(ACCESS, ORM_PKG.getAbstractXmlTypeMapping_Access(), DOM_ATTRIBUTE);
- }
-
- protected Translator createMetadataCompleteTranslator() {
- return new Translator(METADATA_COMPLETE, ORM_PKG.getAbstractXmlTypeMapping_MetadataComplete(), DOM_ATTRIBUTE);
- }
-
- protected Translator createDescriptionTranslator() {
- return new Translator(DESCRIPTION, ORM_PKG.getAbstractXmlTypeMapping_Description());
- }
-
- protected Translator createIdClassTranslator() {
- return new IdClassTranslator(ID_CLASS, ORM_PKG.getXmlMappedSuperclass_IdClass());
- }
-
- protected Translator createExcludeDefaultListenersTranslator() {
- return new EmptyTagBooleanTranslator(EXCLUDE_DEFAULT_LISTENERS, ORM_PKG.getXmlMappedSuperclass_ExcludeDefaultListeners());
- }
-
- protected Translator createExcludeSuperclassListenersTranslator() {
- return new EmptyTagBooleanTranslator(EXCLUDE_SUPERCLASS_LISTENERS, ORM_PKG.getXmlMappedSuperclass_ExcludeSuperclassListeners());
- }
-
- protected Translator createEntityListenersTranslator() {
- return new EntityListenersTranslator(ENTITY_LISTENERS, ORM_PKG.getXmlMappedSuperclass_EntityListeners());
- }
-
- protected Translator createPrePersistTranslator() {
- return new EventMethodTranslator(PRE_PERSIST, ORM_PKG.getXmlMappedSuperclass_PrePersist());
- }
-
- protected Translator createPostPersistTranslator() {
- return new EventMethodTranslator(POST_PERSIST, ORM_PKG.getXmlMappedSuperclass_PostPersist());
- }
-
- protected Translator createPreRemoveTranslator() {
- return new EventMethodTranslator(PRE_REMOVE, ORM_PKG.getXmlMappedSuperclass_PreRemove());
- }
-
- protected Translator createPostRemoveTranslator() {
- return new EventMethodTranslator(POST_REMOVE, ORM_PKG.getXmlMappedSuperclass_PostRemove());
- }
-
- protected Translator createPreUpdateTranslator() {
- return new EventMethodTranslator(PRE_UPDATE, ORM_PKG.getXmlMappedSuperclass_PreUpdate());
- }
-
- protected Translator createPostUpdateTranslator() {
- return new EventMethodTranslator(POST_UPDATE, ORM_PKG.getXmlMappedSuperclass_PostUpdate());
- }
-
- protected Translator createPostLoadTranslator() {
- return new EventMethodTranslator(POST_LOAD, ORM_PKG.getXmlMappedSuperclass_PostLoad());
- }
-
- protected Translator createAttributesTranslator() {
- return new AttributesTranslator(ATTRIBUTES, ORM_PKG.getAbstractXmlTypeMapping_Attributes());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/NamedNativeQueryTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/NamedNativeQueryTranslator.java
deleted file mode 100644
index da6943a6eb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/NamedNativeQueryTranslator.java
+++ /dev/null
@@ -1,61 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class NamedNativeQueryTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public NamedNativeQueryTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createResultClassTranslator(),
- createResultSetMappingTranslator(),
- createQueryTranslator(),
- createHintTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlQuery_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createResultClassTranslator() {
- return new Translator(RESULT_CLASS, ORM_PKG.getXmlNamedNativeQuery_ResultClass(), DOM_ATTRIBUTE);
- }
-
- private Translator createResultSetMappingTranslator() {
- return new Translator(RESULT_SET_MAPPING, ORM_PKG.getXmlNamedNativeQuery_ResultSetMapping(), DOM_ATTRIBUTE);
- }
-
- private Translator createQueryTranslator() {
- return new Translator(QUERY, ORM_PKG.getXmlQuery_Query());
- }
-
- private Translator createHintTranslator() {
- return new QueryHintTranslator(HINT, ORM_PKG.getXmlQuery_Hints());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/NamedQueryTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/NamedQueryTranslator.java
deleted file mode 100644
index 4b5dc4d503..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/NamedQueryTranslator.java
+++ /dev/null
@@ -1,51 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class NamedQueryTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public NamedQueryTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createQueryTranslator(),
- createHintTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlQuery_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createQueryTranslator() {
- return new Translator(QUERY, ORM_PKG.getXmlQuery_Query());
- }
-
- private Translator createHintTranslator() {
- return new QueryHintTranslator(HINT, ORM_PKG.getXmlQuery_Hints());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/OneToManyTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/OneToManyTranslator.java
deleted file mode 100644
index 648ed4b6e2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/OneToManyTranslator.java
+++ /dev/null
@@ -1,88 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class OneToManyTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public OneToManyTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlOneToManyImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createTargetEntityTranslator(),
- createFetchTranslator(),
- createMappedByTranslator(),
- createOrderByTranslator(),
- createMapKeyTranslator(),
- createJoinTableTranslator(),
- createJoinColumnTranslator(),
- createCascadeTranslator()
- };
- }
-
- protected Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE);
- }
-
- protected Translator createTargetEntityTranslator() {
- return new Translator(TARGET_ENTITY, ORM_PKG.getXmlRelationshipMapping_TargetEntity(), DOM_ATTRIBUTE);
- }
-
- protected Translator createFetchTranslator() {
- return new Translator(FETCH, ORM_PKG.getXmlRelationshipMapping_Fetch(), DOM_ATTRIBUTE);
- }
-
- protected Translator createMappedByTranslator() {
- return new Translator(MAPPED_BY, ORM_PKG.getXmlMultiRelationshipMapping_MappedBy(), DOM_ATTRIBUTE);
- }
-
- protected Translator createOrderByTranslator() {
- return new Translator(ORDER_BY, ORM_PKG.getXmlMultiRelationshipMapping_OrderBy());
- }
-
- protected Translator createMapKeyTranslator() {
- return new MapKeyTranslator(MAP_KEY, ORM_PKG.getXmlMultiRelationshipMapping_MapKey());
- }
-
- protected Translator createJoinTableTranslator() {
- return new JoinTableTranslator(JOIN_TABLE, ORM_PKG.getXmlRelationshipMapping_JoinTable());
- }
-
- protected Translator createJoinColumnTranslator() {
- return new JoinColumnTranslator(JOIN_COLUMN, ORM_PKG.getXmlOneToMany_JoinColumns());
- }
-
- protected Translator createCascadeTranslator() {
- return new CascadeTypeTranslator(CASCADE, ORM_PKG.getXmlRelationshipMapping_Cascade());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/OneToOneTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/OneToOneTranslator.java
deleted file mode 100644
index 808306e28b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/OneToOneTranslator.java
+++ /dev/null
@@ -1,90 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class OneToOneTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public OneToOneTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlOneToOneImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createTargetEntityTranslator(),
- createFetchTranslator(),
- createOptionalTranslator(),
- createMappedByTranslator(),
- createPrimaryKeyJoinColumnTranslator(),
- createJoinColumnTranslator(),
- createJoinTableTranslator(),
- createCascadeTranslator()
- };
- }
-
- protected Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE);
- }
-
- protected Translator createTargetEntityTranslator() {
- return new Translator(TARGET_ENTITY, ORM_PKG.getXmlRelationshipMapping_TargetEntity(), DOM_ATTRIBUTE);
- }
-
- protected Translator createFetchTranslator() {
- return new Translator(FETCH, ORM_PKG.getXmlRelationshipMapping_Fetch(), DOM_ATTRIBUTE);
- }
-
- protected Translator createOptionalTranslator() {
- return new Translator(OPTIONAL, ORM_PKG.getXmlSingleRelationshipMapping_Optional(), DOM_ATTRIBUTE);
- }
-
- protected Translator createMappedByTranslator() {
- return new Translator(MAPPED_BY, ORM_PKG.getXmlOneToOne_MappedBy(), DOM_ATTRIBUTE);
- }
-
- protected Translator createPrimaryKeyJoinColumnTranslator() {
- return new PrimaryKeyJoinColumnTranslator(PRIMARY_KEY_JOIN_COLUMN, ORM_PKG.getXmlOneToOne_PrimaryKeyJoinColumns());
- }
-
- protected Translator createJoinColumnTranslator() {
- return new JoinColumnTranslator(JOIN_COLUMN, ORM_PKG.getXmlSingleRelationshipMapping_JoinColumns());
- }
-
- protected Translator createJoinTableTranslator() {
- return new JoinTableTranslator(JOIN_TABLE, ORM_PKG.getXmlRelationshipMapping_JoinTable());
- }
-
- protected Translator createCascadeTranslator() {
- return new CascadeTypeTranslator(CASCADE, ORM_PKG.getXmlRelationshipMapping_Cascade());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/OrmXmlMapper.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/OrmXmlMapper.java
deleted file mode 100644
index a346af2a81..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/OrmXmlMapper.java
+++ /dev/null
@@ -1,120 +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.resource.orm.translators;
-
-import org.eclipse.jpt.core.internal.JpaConstants;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-
-public interface OrmXmlMapper
- extends JpaConstants
-{
- OrmPackage ORM_PKG = OrmPackage.eINSTANCE;
-
- String ACCESS = "access"; //$NON-NLS-1$
- String ALLOCATION_SIZE = "allocation-size"; //$NON-NLS-1$
- String ASSOCIATION_OVERRIDE = "association-override"; //$NON-NLS-1$
- String ATTRIBUTE_OVERRIDE = "attribute-override"; //$NON-NLS-1$
- String ATTRIBUTES = "attributes"; //$NON-NLS-1$
- String BASIC = "basic"; //$NON-NLS-1$
- String CASCADE = "cascade"; //$NON-NLS-1$
- String CASCADE_ALL = "cascade-all"; //$NON-NLS-1$
- String CASCADE_MERGE = "cascade-merge"; //$NON-NLS-1$
- String CASCADE_PERSIST = "cascade-persist"; //$NON-NLS-1$
- String CASCADE_REFRESH = "cascade-refresh"; //$NON-NLS-1$
- String CASCADE_REMOVE = "cascade-remove"; //$NON-NLS-1$
- String CATALOG = "catalog"; //$NON-NLS-1$
- String CLASS = "class"; //$NON-NLS-1$
- String COLUMN = "column"; //$NON-NLS-1$
- String COLUMN_DEFINITION= "column-definition"; //$NON-NLS-1$
- String COLUMN_NAME = "column-name"; //$NON-NLS-1$
- String COLUMN_RESULT = "column-result"; //$NON-NLS-1$
- String DESCRIPTION = "description"; //$NON-NLS-1$
- String DISCRIMINATOR_COLUMN = "discriminator-column"; //$NON-NLS-1$
- String DISCRIMINATOR_TYPE = "discriminator-type"; //$NON-NLS-1$
- String DISCRIMINATOR_VALUE = "discriminator-value"; //$NON-NLS-1$
- String EMBEDDABLE = "embeddable"; //$NON-NLS-1$
- String EMBEDDED = "embedded"; //$NON-NLS-1$
- String EMBEDDED_ID = "embedded-id"; //$NON-NLS-1$
- String ENTITY = "entity"; //$NON-NLS-1$
- String ENTITY_CLASS = "entity-class"; //$NON-NLS-1$
- String ENTITY_LISTENER = "entity-listener"; //$NON-NLS-1$
- String ENTITY_LISTENERS = "entity-listeners"; //$NON-NLS-1$
- String ENTITY_MAPPINGS = "entity-mappings"; //$NON-NLS-1$
- String ENTITY_RESULT = "entity-result"; //$NON-NLS-1$
- String ENUMERATED = "enumerated"; //$NON-NLS-1$
- String EXCLUDE_DEFAULT_LISTENERS = "exclude-default-listeners"; //$NON-NLS-1$
- String EXCLUDE_SUPERCLASS_LISTENERS = "exclude-superclass-listeners"; //$NON-NLS-1$
- String FETCH = "fetch"; //$NON-NLS-1$
- String FIELD_RESULT = "field-result"; //$NON-NLS-1$
- String GENERATED_VALUE = "generated-value"; //$NON-NLS-1$
- String GENERATOR = "generator"; //$NON-NLS-1$
- String HINT = "hint"; //$NON-NLS-1$
- String ID = "id"; //$NON-NLS-1$
- String ID_CLASS = "id-class"; //$NON-NLS-1$
- String INHERITANCE = "inheritance"; //$NON-NLS-1$
- String INITIAL_VALUE = "initial-value"; //$NON-NLS-1$
- String INSERTABLE = "insertable"; //$NON-NLS-1$
- String INVERSE_JOIN_COLUMN = "inverse-join-column"; //$NON-NLS-1$
- String JOIN_COLUMN = "join-column"; //$NON-NLS-1$
- String JOIN_TABLE = "join-table"; //$NON-NLS-1$
- String LENGTH = "length"; //$NON-NLS-1$
- String LOB = "lob"; //$NON-NLS-1$
- String MANY_TO_MANY = "many-to-many"; //$NON-NLS-1$
- String MANY_TO_ONE = "many-to-one"; //$NON-NLS-1$
- String MAP_KEY = "map-key"; //$NON-NLS-1$
- String MAPPED_BY = "mapped-by"; //$NON-NLS-1$
- String MAPPED_SUPERCLASS = "mapped-superclass"; //$NON-NLS-1$
- String METADATA_COMPLETE = "metadata-complete"; //$NON-NLS-1$
- String METHOD_NAME = "method-name"; //$NON-NLS-1$
- String NAME = "name"; //$NON-NLS-1$
- String NAMED_NATIVE_QUERY = "named-native-query"; //$NON-NLS-1$
- String NAMED_QUERY = "named-query"; //$NON-NLS-1$
- String NULLABLE = "nullable"; //$NON-NLS-1$
- String ONE_TO_MANY = "one-to-many"; //$NON-NLS-1$
- String ONE_TO_ONE = "one-to-one"; //$NON-NLS-1$
- String OPTIONAL = "optional"; //$NON-NLS-1$
- String ORDER_BY = "order-by"; //$NON-NLS-1$
- String PACKAGE = "package"; //$NON-NLS-1$
- String PERSISTENCE_UNIT_DEFAULTS = "persistence-unit-defaults"; //$NON-NLS-1$
- String PERSISTENCE_UNIT_METADATA = "persistence-unit-metadata"; //$NON-NLS-1$
- String PK_COLUMN_NAME = "pk-column-name"; //$NON-NLS-1$
- String PK_COLUMN_VALUE = "pk-column-value"; //$NON-NLS-1$
- String POST_LOAD = "post-load"; //$NON-NLS-1$
- String POST_PERSIST = "post-persist"; //$NON-NLS-1$
- String POST_REMOVE = "post-remove"; //$NON-NLS-1$
- String POST_UPDATE = "post-update"; //$NON-NLS-1$
- String PRE_PERSIST = "pre-persist"; //$NON-NLS-1$
- String PRE_REMOVE = "pre-remove"; //$NON-NLS-1$
- String PRE_UPDATE = "pre-update"; //$NON-NLS-1$
- String PRECISION= "precision"; //$NON-NLS-1$
- String PRIMARY_KEY_JOIN_COLUMN = "primary-key-join-column"; //$NON-NLS-1$
- String QUERY = "query"; //$NON-NLS-1$
- String REFERENCED_COLUMN_NAME = "referenced-column-name"; //$NON-NLS-1$
- String RESULT_CLASS = "result-class"; //$NON-NLS-1$
- String RESULT_SET_MAPPING = "result-set-mapping"; //$NON-NLS-1$
- String SCALE= "scale"; //$NON-NLS-1$
- String SCHEMA = "schema"; //$NON-NLS-1$
- String SECONDARY_TABLE = "secondary-table"; //$NON-NLS-1$
- String SEQUENCE_GENERATOR = "sequence-generator"; //$NON-NLS-1$
- String SEQUENCE_NAME = "sequence-name"; //$NON-NLS-1$
- String SQL_RESULT_SET_MAPPING = "sql-result-set-mapping"; //$NON-NLS-1$
- String STRATEGY = "strategy"; //$NON-NLS-1$
- String TABLE = "table"; //$NON-NLS-1$
- String TABLE_GENERATOR = "table-generator"; //$NON-NLS-1$
- String TARGET_ENTITY = "target-entity"; //$NON-NLS-1$
- String TEMPORAL = "temporal"; //$NON-NLS-1$
- String TRANSIENT = "transient"; //$NON-NLS-1$
- String UNIQUE = "unique"; //$NON-NLS-1$
- String UNIQUE_CONSTRAINT = "unique-constraint"; //$NON-NLS-1$
- String UPDATABLE = "updatable"; //$NON-NLS-1$
- String VALUE = "value"; //$NON-NLS-1$
- String VALUE_COLUMN_NAME = "value-column-name"; //$NON-NLS-1$
- String VERSION = "version"; //$NON-NLS-1$
- String XML_MAPPING_METADATA_COMPLETE = "xml-mapping-metadata-complete"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/PersistenceUnitDefaultsTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/PersistenceUnitDefaultsTranslator.java
deleted file mode 100644
index 1e27eb7d3c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/PersistenceUnitDefaultsTranslator.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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.common.translators.EmptyTagBooleanTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class PersistenceUnitDefaultsTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public PersistenceUnitDefaultsTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- private Translator[] createChildren() {
- return new Translator[] {
- createSchemaTranslator(),
- createCatalogTranslator(),
- createAccessTranslator(),
- createCascadePersistTranslator(),
- createEntityListenersTranslator()
- };
- }
-
- private Translator createSchemaTranslator() {
- return new Translator(SCHEMA, ORM_PKG.getXmlPersistenceUnitDefaults_Schema());
- }
-
- private Translator createCatalogTranslator() {
- return new Translator(CATALOG, ORM_PKG.getXmlPersistenceUnitDefaults_Catalog());
- }
-
- private Translator createAccessTranslator() {
- return new Translator(ACCESS, ORM_PKG.getXmlPersistenceUnitDefaults_Access());
- }
-
- private Translator createCascadePersistTranslator() {
- return new EmptyTagBooleanTranslator(CASCADE_PERSIST, ORM_PKG.getXmlPersistenceUnitDefaults_CascadePersist());
- }
-
- private Translator createEntityListenersTranslator() {
- return new EntityListenersTranslator(ENTITY_LISTENERS, ORM_PKG.getXmlPersistenceUnitDefaults_EntityListeners());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/PersistenceUnitMetadataTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/PersistenceUnitMetadataTranslator.java
deleted file mode 100644
index 5fa3227743..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/PersistenceUnitMetadataTranslator.java
+++ /dev/null
@@ -1,46 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.common.translators.EmptyTagBooleanTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class PersistenceUnitMetadataTranslator extends Translator implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public PersistenceUnitMetadataTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- private Translator[] createChildren() {
- return new Translator[] {
- createXmlMappingMetadataCompleteTranslator(),
- createPersistenceUnitDefaultsTranslator(),
- };
- }
-
- private Translator createXmlMappingMetadataCompleteTranslator() {
- return new EmptyTagBooleanTranslator(XML_MAPPING_METADATA_COMPLETE, ORM_PKG.getXmlPersistenceUnitMetadata_XmlMappingMetadataComplete());
- }
-
- private Translator createPersistenceUnitDefaultsTranslator() {
- return new PersistenceUnitDefaultsTranslator(PERSISTENCE_UNIT_DEFAULTS, ORM_PKG.getXmlPersistenceUnitMetadata_PersistenceUnitDefaults());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/PrimaryKeyJoinColumnTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/PrimaryKeyJoinColumnTranslator.java
deleted file mode 100644
index 8a0f51d3f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/PrimaryKeyJoinColumnTranslator.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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class PrimaryKeyJoinColumnTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public PrimaryKeyJoinColumnTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumnImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createReferencedColumnNameTranslator(),
- createColumnDefinitionTranslator(),
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlNamedColumn_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createReferencedColumnNameTranslator() {
- return new Translator(REFERENCED_COLUMN_NAME, ORM_PKG.getXmlPrimaryKeyJoinColumn_ReferencedColumnName(), DOM_ATTRIBUTE);
- }
-
- private Translator createColumnDefinitionTranslator() {
- return new Translator(COLUMN_DEFINITION, ORM_PKG.getXmlNamedColumn_ColumnDefinition(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/QueryHintTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/QueryHintTranslator.java
deleted file mode 100644
index bb43828675..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/QueryHintTranslator.java
+++ /dev/null
@@ -1,46 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class QueryHintTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public QueryHintTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createValueTranslator(),
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlQueryHint_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createValueTranslator() {
- return new Translator(VALUE, ORM_PKG.getXmlQueryHint_Value(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/SecondaryTableTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/SecondaryTableTranslator.java
deleted file mode 100644
index c3fce243d7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/SecondaryTableTranslator.java
+++ /dev/null
@@ -1,69 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class SecondaryTableTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public SecondaryTableTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlSecondaryTableImpl();
- }
-
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createCatalogTranslator(),
- createSchemaTranslator(),
- createPrimaryKeyJoinColumnsTranslator(),
- createUniqueConstraintTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlBaseTable_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createCatalogTranslator() {
- return new Translator(CATALOG, ORM_PKG.getXmlBaseTable_Catalog(), DOM_ATTRIBUTE);
- }
-
- private Translator createSchemaTranslator() {
- return new Translator(SCHEMA, ORM_PKG.getXmlBaseTable_Schema(), DOM_ATTRIBUTE);
- }
-
- protected Translator createPrimaryKeyJoinColumnsTranslator() {
- return new PrimaryKeyJoinColumnTranslator(PRIMARY_KEY_JOIN_COLUMN, ORM_PKG.getXmlSecondaryTable_PrimaryKeyJoinColumns());
- }
-
- private Translator createUniqueConstraintTranslator() {
- return new UniqueConstraintTranslator(UNIQUE_CONSTRAINT, ORM_PKG.getXmlBaseTable_UniqueConstraints());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/SequenceGeneratorTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/SequenceGeneratorTranslator.java
deleted file mode 100644
index b77b56a509..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/SequenceGeneratorTranslator.java
+++ /dev/null
@@ -1,63 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class SequenceGeneratorTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public SequenceGeneratorTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlSequenceGeneratorImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createSequenceNameTranslator(),
- createInitialValueTranslator(),
- createAllocationSizeTranslator(),
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlGenerator_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createSequenceNameTranslator() {
- return new Translator(SEQUENCE_NAME, ORM_PKG.getXmlSequenceGenerator_SequenceName(), DOM_ATTRIBUTE);
- }
-
- private Translator createInitialValueTranslator() {
- return new Translator(INITIAL_VALUE, ORM_PKG.getXmlGenerator_InitialValue(), DOM_ATTRIBUTE);
- }
-
- private Translator createAllocationSizeTranslator() {
- return new Translator(ALLOCATION_SIZE, ORM_PKG.getXmlGenerator_AllocationSize(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/SqlResultSetMappingTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/SqlResultSetMappingTranslator.java
deleted file mode 100644
index 7678c5f300..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/SqlResultSetMappingTranslator.java
+++ /dev/null
@@ -1,53 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class SqlResultSetMappingTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public SqlResultSetMappingTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createEntityResultTranslator(),
- createColumnResultTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getSqlResultSetMapping_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createEntityResultTranslator() {
- return new EntityResultTranslator(ENTITY_RESULT, ORM_PKG.getSqlResultSetMapping_EntityResults());
- }
-
- private Translator createColumnResultTranslator() {
- return new ColumnResultTranslator(COLUMN_RESULT, ORM_PKG.getSqlResultSetMapping_ColumnResults());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/TableGeneratorTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/TableGeneratorTranslator.java
deleted file mode 100644
index 49375adf44..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/TableGeneratorTranslator.java
+++ /dev/null
@@ -1,93 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class TableGeneratorTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public TableGeneratorTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlTableGeneratorImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createTableTranslator(),
- createCatalogTranslator(),
- createSchemaTranslator(),
- createPkColumnNameTranslator(),
- createValueColumnNameTranslator(),
- createPkColumnValueTranslator(),
- createInitialValueTranslator(),
- createAllocationSizeTranslator(),
- createUniqueConstraintTranslator(),
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlGenerator_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createTableTranslator() {
- return new Translator(TABLE, ORM_PKG.getXmlTableGenerator_Table(), DOM_ATTRIBUTE);
- }
-
- private Translator createCatalogTranslator() {
- return new Translator(CATALOG, ORM_PKG.getXmlTableGenerator_Catalog(), DOM_ATTRIBUTE);
- }
-
- private Translator createSchemaTranslator() {
- return new Translator(SCHEMA, ORM_PKG.getXmlTableGenerator_Schema(), DOM_ATTRIBUTE);
- }
-
- private Translator createPkColumnNameTranslator() {
- return new Translator(PK_COLUMN_NAME, ORM_PKG.getXmlTableGenerator_PkColumnName(), DOM_ATTRIBUTE);
- }
-
- private Translator createValueColumnNameTranslator() {
- return new Translator(VALUE_COLUMN_NAME, ORM_PKG.getXmlTableGenerator_ValueColumnName(), DOM_ATTRIBUTE);
- }
-
- private Translator createPkColumnValueTranslator() {
- return new Translator(PK_COLUMN_VALUE, ORM_PKG.getXmlTableGenerator_PkColumnValue(), DOM_ATTRIBUTE);
- }
-
- private Translator createInitialValueTranslator() {
- return new Translator(INITIAL_VALUE, ORM_PKG.getXmlGenerator_InitialValue(), DOM_ATTRIBUTE);
- }
-
- private Translator createAllocationSizeTranslator() {
- return new Translator(ALLOCATION_SIZE, ORM_PKG.getXmlGenerator_AllocationSize(), DOM_ATTRIBUTE);
- }
-
- private Translator createUniqueConstraintTranslator() {
- return new UniqueConstraintTranslator(UNIQUE_CONSTRAINT, ORM_PKG.getXmlTableGenerator_UniqueConstraints());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/TableTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/TableTranslator.java
deleted file mode 100644
index b0183b0c62..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/TableTranslator.java
+++ /dev/null
@@ -1,56 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class TableTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public TableTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createCatalogTranslator(),
- createSchemaTranslator(),
- createUniqueConstraintTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlBaseTable_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createCatalogTranslator() {
- return new Translator(CATALOG, ORM_PKG.getXmlBaseTable_Catalog(), DOM_ATTRIBUTE);
- }
-
- private Translator createSchemaTranslator() {
- return new Translator(SCHEMA, ORM_PKG.getXmlBaseTable_Schema(), DOM_ATTRIBUTE);
- }
-
- private Translator createUniqueConstraintTranslator() {
- return new UniqueConstraintTranslator(UNIQUE_CONSTRAINT, ORM_PKG.getXmlBaseTable_UniqueConstraints());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/TransientTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/TransientTranslator.java
deleted file mode 100644
index e724961eb3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/TransientTranslator.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.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class TransientTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public TransientTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlTransientImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/UniqueConstraintTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/UniqueConstraintTranslator.java
deleted file mode 100644
index 62db060175..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/UniqueConstraintTranslator.java
+++ /dev/null
@@ -1,48 +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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class UniqueConstraintTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public UniqueConstraintTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createColumnNameTranslator(),
- };
- }
-
- private Translator createColumnNameTranslator() {
- return new Translator(COLUMN_NAME, ORM_PKG.getXmlUniqueConstraint_ColumnNames());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/VersionTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/VersionTranslator.java
deleted file mode 100644
index df573b5182..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/VersionTranslator.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.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class VersionTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public VersionTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlVersionImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createColumnTranslator(),
- createTemporalTranslator(),
- };
- }
-
- protected Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE);
- }
-
- protected Translator createColumnTranslator() {
- return new ColumnTranslator(COLUMN, ORM_PKG.getColumnMapping_Column());
- }
-
- protected Translator createTemporalTranslator() {
- return new Translator(TEMPORAL, ORM_PKG.getXmlConvertibleMapping_Temporal());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/PersistenceResourceModelProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/PersistenceResourceModelProvider.java
deleted file mode 100644
index 18337a7940..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/PersistenceResourceModelProvider.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.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.emf.ecore.resource.Resource;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.JpaConstants;
-import org.eclipse.jpt.core.internal.resource.JpaResourceModelProviderManager;
-import org.eclipse.jpt.core.resource.AbstractResourceModelProvider;
-import org.eclipse.jpt.core.resource.common.JpaXmlResource;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.PersistenceResource;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistence;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-
-public class PersistenceResourceModelProvider
- extends AbstractResourceModelProvider<PersistenceResource>
-{
- /**
- * (Convenience method) Returns a persistence resource model provider for
- * the given file.
- */
- public static PersistenceResourceModelProvider getModelProvider(IFile file) {
- return getModelProvider_(file.getProject(), file.getFullPath().toString());
- }
-
- /**
- * (Convenience method) Returns an persistence resource model provider for
- * the given project in the specified deploy location
- */
- public static PersistenceResourceModelProvider getModelProvider(IProject project, String deployLocation) {
- return getModelProvider_(project, JptCorePlugin.getDeploymentURI(project, deployLocation));
- }
-
- /**
- * (Convenience method) Returns a persistence resource model provider for
- * the given project in the default deploy location
- */
- public static PersistenceResourceModelProvider getDefaultModelProvider(IProject project) {
- return getModelProvider(project, JptCorePlugin.DEFAULT_PERSISTENCE_XML_FILE_PATH);
- }
-
- private static PersistenceResourceModelProvider getModelProvider_(IProject project, String location) {
- return (PersistenceResourceModelProvider) JpaResourceModelProviderManager.instance().getModelProvider(
- project,
- new Path(location),
- JptCorePlugin.PERSISTENCE_XML_CONTENT_TYPE);
- }
-
-
- public PersistenceResourceModelProvider(IProject project) {
- this(project, new Path(JptCorePlugin.DEFAULT_PERSISTENCE_XML_FILE_PATH));
- }
-
- public PersistenceResourceModelProvider(IProject project, IPath filePath) {
- super(project, filePath);
- }
-
-
- @Override
- protected String getContentTypeDescriber() {
- return JptCorePlugin.PERSISTENCE_XML_CONTENT_TYPE;
- }
-
- @Override
- protected void populateRoot(JpaXmlResource resource) {
- XmlPersistence persistence = PersistenceFactory.eINSTANCE.createXmlPersistence();
- persistence.setVersion(JpaConstants.VERSION_1_0_TEXT);
- XmlPersistenceUnit persistenceUnit = PersistenceFactory.eINSTANCE.createXmlPersistenceUnit();
- persistenceUnit.setName(getProject().getName());
- persistence.getPersistenceUnits().add(persistenceUnit);
- getResourceContents(resource).add(persistence);
- }
-
- @Override
- protected PersistenceResource ensureCorrectType(Resource resource) throws ClassCastException {
- return (PersistenceResource) resource;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/PersistenceResourceModelProviderFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/PersistenceResourceModelProviderFactory.java
deleted file mode 100644
index 4dccaaf683..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/PersistenceResourceModelProviderFactory.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.core.internal.resource.persistence;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jpt.core.resource.JpaResourceModelProvider;
-import org.eclipse.jpt.core.resource.JpaResourceModelProviderFactory;
-
-public class PersistenceResourceModelProviderFactory implements JpaResourceModelProviderFactory
-{
- public JpaResourceModelProvider create(IProject project, IPath filePath) {
- return new PersistenceResourceModelProvider(project, filePath);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/JavaClassRefTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/JavaClassRefTranslator.java
deleted file mode 100644
index 0be988e001..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/JavaClassRefTranslator.java
+++ /dev/null
@@ -1,44 +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.resource.persistence.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.persistence.PersistencePackage;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class JavaClassRefTranslator extends Translator
-{
- private static Translator[] children;
-
-
- public JavaClassRefTranslator(String domNameAndPath, EStructuralFeature feature, int style) {
- super(domNameAndPath, feature, style);
- }
-
- public JavaClassRefTranslator(String domNameAndPath, EStructuralFeature feature) {
- super(domNameAndPath, feature);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (children == null) {
- children = createChildren();
- }
- return children;
- }
-
- private static Translator[] createChildren() {
- return new Translator[] {
- new Translator(TEXT_ATTRIBUTE_VALUE, PersistencePackage.eINSTANCE.getXmlJavaClassRef_JavaClass())
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/MappingFileTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/MappingFileTranslator.java
deleted file mode 100644
index f1f312bb36..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/MappingFileTranslator.java
+++ /dev/null
@@ -1,40 +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.resource.persistence.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.persistence.PersistencePackage;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class MappingFileTranslator extends Translator
-{
- private Translator[] children;
-
-
- public MappingFileTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, Translator.END_TAG_NO_INDENT);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (children == null) {
- children = createChildren();
- }
- return children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- new Translator(TEXT_ATTRIBUTE_VALUE, PersistencePackage.eINSTANCE.getXmlMappingFileRef_FileName())
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PersistenceTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PersistenceTranslator.java
deleted file mode 100644
index 59820ad886..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PersistenceTranslator.java
+++ /dev/null
@@ -1,54 +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.resource.persistence.translators;
-
-import org.eclipse.wst.common.internal.emf.resource.ConstantAttributeTranslator;
-import org.eclipse.wst.common.internal.emf.resource.RootTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class PersistenceTranslator extends RootTranslator
- implements PersistenceXmlMapper
-{
- public static PersistenceTranslator INSTANCE = new PersistenceTranslator();
-
- private Translator[] children;
-
-
- public PersistenceTranslator() {
- super(PERSISTENCE, PERSISTENCE_PKG.getXmlPersistence());
- }
-
- @Override
- protected Translator[] getChildren() {
- if (children == null) {
- children = createChildren();
- }
- return children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createVersionTranslator(),
- new ConstantAttributeTranslator(XML_NS, PERSISTENCE_NS_URL),
- new ConstantAttributeTranslator(XML_NS_XSI, XSI_NS_URL),
- new ConstantAttributeTranslator(XSI_SCHEMA_LOCATION, PERSISTENCE_NS_URL + ' ' + PERSISTENCE_SCHEMA_LOC_1_0),
- createPersistenceUnitTranslator()
- };
- }
-
- private Translator createVersionTranslator() {
- return new Translator(VERSION, PERSISTENCE_PKG.getXmlPersistence_Version(), DOM_ATTRIBUTE);
- }
-
- private Translator createPersistenceUnitTranslator() {
- return new PersistenceUnitTranslator(PERSISTENCE_UNIT, PERSISTENCE_PKG.getXmlPersistence_PersistenceUnits());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PersistenceUnitTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PersistenceUnitTranslator.java
deleted file mode 100644
index 8afcfce7ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PersistenceUnitTranslator.java
+++ /dev/null
@@ -1,94 +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.resource.persistence.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.common.translators.BooleanTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class PersistenceUnitTranslator extends Translator
- implements PersistenceXmlMapper
-{
- private Translator[] children;
-
-
- public PersistenceUnitTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (children == null) {
- children = createChildren();
- }
- return children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createTransactionTypeTranslator(),
- createDescriptionTranslator(),
- createProviderTranslator(),
- createJtaDataSourceTranslator(),
- createNonJtaDataSourceTranslator(),
- createMappingFileTranslator(),
- createJarFileTranslator(),
- createClassTranslator(),
- createExcludeUnlistedClassesTranslator(),
- createPropertiesTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, PERSISTENCE_PKG.getXmlPersistenceUnit_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createTransactionTypeTranslator() {
- return new Translator(TRANSACTION_TYPE, PERSISTENCE_PKG.getXmlPersistenceUnit_TransactionType(), DOM_ATTRIBUTE | UNSET_IF_NULL);
- }
-
- private Translator createDescriptionTranslator() {
- return new Translator(DESCRIPTION, PERSISTENCE_PKG.getXmlPersistenceUnit_Description());
- }
-
- private Translator createProviderTranslator() {
- return new Translator(PROVIDER, PERSISTENCE_PKG.getXmlPersistenceUnit_Provider());
- }
-
- private Translator createJtaDataSourceTranslator() {
- return new Translator(JTA_DATA_SOURCE, PERSISTENCE_PKG.getXmlPersistenceUnit_JtaDataSource());
- }
-
- private Translator createNonJtaDataSourceTranslator() {
- return new Translator(NON_JTA_DATA_SOURCE, PERSISTENCE_PKG.getXmlPersistenceUnit_NonJtaDataSource());
- }
-
- private Translator createMappingFileTranslator() {
- return new MappingFileTranslator(MAPPING_FILE, PERSISTENCE_PKG.getXmlPersistenceUnit_MappingFiles());
- }
-
- private Translator createJarFileTranslator() {
- return new Translator(JAR_FILE, PERSISTENCE_PKG.getXmlPersistenceUnit_JarFiles(), Translator.END_TAG_NO_INDENT);
- }
-
- private Translator createClassTranslator() {
- return new JavaClassRefTranslator(CLASS, PERSISTENCE_PKG.getXmlPersistenceUnit_Classes(), Translator.END_TAG_NO_INDENT);
- }
-
- private Translator createExcludeUnlistedClassesTranslator() {
- return new BooleanTranslator(EXCLUDE_UNLISTED_CLASSES, PERSISTENCE_PKG.getXmlPersistenceUnit_ExcludeUnlistedClasses());
- }
-
- private Translator createPropertiesTranslator() {
- return new PropertiesTranslator(PROPERTIES, PERSISTENCE_PKG.getXmlPersistenceUnit_Properties());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PersistenceXmlMapper.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PersistenceXmlMapper.java
deleted file mode 100644
index aaee7bd810..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PersistenceXmlMapper.java
+++ /dev/null
@@ -1,37 +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.resource.persistence.translators;
-
-import org.eclipse.jpt.core.internal.JpaConstants;
-import org.eclipse.jpt.core.resource.persistence.PersistencePackage;
-
-public interface PersistenceXmlMapper
- extends JpaConstants
-{
- PersistencePackage PERSISTENCE_PKG = PersistencePackage.eINSTANCE;
-
- String CLASS = "class"; //$NON-NLS-1$
- String DESCRIPTION = "description"; //$NON-NLS-1$
- String EXCLUDE_UNLISTED_CLASSES = "exclude-unlisted-classes"; //$NON-NLS-1$
- String JAR_FILE = "jar-file"; //$NON-NLS-1$
- String JTA_DATA_SOURCE = "jta-data-source"; //$NON-NLS-1$
- String MAPPING_FILE = "mapping-file"; //$NON-NLS-1$
- String NAME = "name"; //$NON-NLS-1$
- String NON_JTA_DATA_SOURCE = "non-jta-data-source"; //$NON-NLS-1$
- String PERSISTENCE = "persistence"; //$NON-NLS-1$
- String PERSISTENCE_UNIT = "persistence-unit"; //$NON-NLS-1$
- String PROPERTIES = "properties"; //$NON-NLS-1$
- String PROPERTY = "property"; //$NON-NLS-1$
- String PROVIDER = "provider"; //$NON-NLS-1$
- String TRANSACTION_TYPE = "transaction-type"; //$NON-NLS-1$
- String VALUE = "value"; //$NON-NLS-1$
- String VERSION = "version"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PropertiesTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PropertiesTranslator.java
deleted file mode 100644
index bb48ebf5ab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PropertiesTranslator.java
+++ /dev/null
@@ -1,43 +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.resource.persistence.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class PropertiesTranslator extends Translator
- implements PersistenceXmlMapper
-{
- private Translator[] children;
-
-
- public PropertiesTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (children == null) {
- children = createChildren();
- }
- return children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createPropertyTranslator()
- };
- }
-
- private Translator createPropertyTranslator() {
- return new PropertyTranslator(PROPERTY, PERSISTENCE_PKG.getXmlProperties_Properties());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PropertyTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PropertyTranslator.java
deleted file mode 100644
index 6f22349966..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PropertyTranslator.java
+++ /dev/null
@@ -1,48 +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.resource.persistence.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class PropertyTranslator extends Translator
- implements PersistenceXmlMapper
-{
- private Translator[] children;
-
-
- public PropertyTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (children == null) {
- children = createChildren();
- }
- return children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createValueTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, PERSISTENCE_PKG.getXmlProperty_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createValueTranslator() {
- return new Translator(VALUE, PERSISTENCE_PKG.getXmlProperty_Value(), DOM_ATTRIBUTE);
- }
-}
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 de759897b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/synch/SynchronizeClassesJob.java
+++ /dev/null
@@ -1,127 +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.synch;
-
-import java.util.Iterator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-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.internal.resource.persistence.PersistenceResourceModelProvider;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.PersistenceResource;
-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.utility.internal.CollectionTools;
-
-/**
- * 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);
- setRule(file.getProject());
- this.persistenceXmlFile = file;
- }
-
- @Override
- public IStatus runInWorkspace(final IProgressMonitor monitor) throws CoreException {
- monitor.beginTask(JptCoreMessages.SYNCHRONIZING_CLASSES_TASK, 200);
-
- if (monitor.isCanceled()) {
- return Status.CANCEL_STATUS;
- }
-
- final JpaProject jpaProject = JptCorePlugin.getJpaProject(this.persistenceXmlFile.getProject());
-
- PersistenceResourceModelProvider modelProvider =
- PersistenceResourceModelProvider.getDefaultModelProvider(jpaProject.getProject());
- final PersistenceResource resource = modelProvider.getResource();
-
- monitor.worked(25);
-
- modelProvider.modify(new Runnable() {
- public void run() {
- XmlPersistence persistence = resource.getPersistence();
-
- if (persistence == null) {
- persistence = PersistenceFactory.eINSTANCE.createXmlPersistence();
- resource.getContents().add(persistence);
- }
-
- 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 = jpaProject.annotatedClassNames(); 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;
- }
-
- private 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/SimpleSchedulingRule.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/SimpleSchedulingRule.java
deleted file mode 100644
index a77b0c03aa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/SimpleSchedulingRule.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.internal.utility;
-
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-
-/**
- * A job scheduling rule that conflicts only with itself.
- */
-public final class SimpleSchedulingRule
- implements ISchedulingRule
-{
-
- // singleton
- private static final SimpleSchedulingRule INSTANCE = new SimpleSchedulingRule();
-
- /**
- * Return the singleton.
- */
- public static ISchedulingRule instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private SimpleSchedulingRule() {
- super();
- }
-
- public boolean contains(ISchedulingRule rule) {
- return rule == this;
- }
-
- public boolean isConflicting(ISchedulingRule rule) {
- return rule == 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/emf/ComponentUtilities.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/emf/ComponentUtilities.java
deleted file mode 100644
index ecd26d1f84..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/emf/ComponentUtilities.java
+++ /dev/null
@@ -1,76 +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.emf;
-
-import java.util.Iterator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TreeIterator;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-
-public class ComponentUtilities
-{
- /**
- * Return the deployment path for the given source file. If there is no
- * corresponding deployment file, null will be returned.
- */
- public static IPath computeDeployPath(IFile sourceFile) {
- // Unfortunately, the only current way to do this is to exhaustively
- // search all deployment files and attempt to match to this file.
- // Bug 202943 has been logged to track this issue.
- for (IVirtualFile virtualFile : CollectionTools.iterable(allVirtualFiles(sourceFile.getProject()))) {
- for (IFile underlyingFile : virtualFile.getUnderlyingFiles()) {
- if (sourceFile.equals(underlyingFile)) {
- return virtualFile.getRuntimePath();
- }
- }
- }
- return null;
- }
-
- private static Iterator<IVirtualFile> allVirtualFiles(IProject project) {
- return new FilteringIterator<IVirtualResource, IVirtualFile>(allVirtualResources(project)) {
- @Override
- protected boolean accept(IVirtualResource o) {
- return o.getType() == IVirtualResource.FILE;
- }
- };
- }
-
- private static Iterator<IVirtualResource> allVirtualResources(IProject project) {
- IVirtualComponent virtualComponent = ComponentCore.createComponent(project);
-
- if (virtualComponent == null) {
- return EmptyIterator.instance();
- }
-
- return new TreeIterator<IVirtualResource>(virtualComponent.getRootFolder()) {
- @Override
- protected Iterator<? extends IVirtualResource> children(IVirtualResource next) {
- if (next.getType() == IVirtualResource.FOLDER) {
- try {
- return CollectionTools.iterator(((IVirtualFolder) next).members());
- }
- catch (CoreException ce) { /* fall through, return default case */ }
- }
- return EmptyIterator.instance();
- }
- };
- }
-}
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/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 31ffe65292..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * 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 JDTTools.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 4fe7f9c115..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * 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 JDTTools.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 0de59055c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTAttribute.java
+++ /dev/null
@@ -1,70 +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.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.CommandExecutorProvider;
-
-/**
- * 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,
- CommandExecutorProvider modifySharedDocumentCommandExecutorProvider) {
- super(declaringType, name, occurrence, compilationUnit, modifySharedDocumentCommandExecutorProvider);
- }
-
- protected JDTAttribute(
- Type declaringType,
- String name,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutorProvider modifySharedDocumentCommandExecutorProvider,
- AnnotationEditFormatter annotationEditFormatter) {
- super(declaringType, name, occurrence, compilationUnit, modifySharedDocumentCommandExecutorProvider, annotationEditFormatter);
- }
-
-
- // ********** Member/Attribute implementation **********
-
- public boolean isField() {
- return false;
- }
-
- public boolean isMethod() {
- 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 dfa9e51852..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTFieldAttribute.java
+++ /dev/null
@@ -1,181 +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 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.CommandExecutorProvider;
-
-/**
- * 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,
- CommandExecutorProvider modifySharedDocumentCommandExecutorProvider) {
- this(declaringType, name, occurrence, compilationUnit, modifySharedDocumentCommandExecutorProvider, DefaultAnnotationEditFormatter.instance());
- }
-
- public JDTFieldAttribute(
- Type declaringType,
- String name,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutorProvider modifySharedDocumentCommandExecutorProvider,
- AnnotationEditFormatter annotationEditFormatter) {
- super(declaringType, name, occurrence, compilationUnit, modifySharedDocumentCommandExecutorProvider, annotationEditFormatter);
- }
-
- /**
- * constructor for testing
- */
- public JDTFieldAttribute(Type declaringType, String name, int occurrence, ICompilationUnit compilationUnit) {
- this(declaringType, name, occurrence, compilationUnit, CommandExecutorProvider.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(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$
- }
- };
-
-}
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 fec82d670a..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * 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.CommandExecutorProvider;
-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 CommandExecutorProvider modifySharedDocumentCommandExecutorProvider;
-
- /** this will format the member's annotations a bit */
- private final AnnotationEditFormatter annotationEditFormatter;
-
-
- // ********** constructors **********
-
- protected JDTMember(
- Type declaringType,
- String name,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutorProvider modifySharedDocumentCommandExecutorProvider) {
- this(declaringType, name, occurrence, compilationUnit, modifySharedDocumentCommandExecutorProvider, DefaultAnnotationEditFormatter.instance());
- }
-
- protected JDTMember(
- Type declaringType,
- String name,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutorProvider modifySharedDocumentCommandExecutorProvider,
- AnnotationEditFormatter annotationEditFormatter) {
- super();
- this.declaringType = declaringType;
- this.name = name;
- this.occurrence = occurrence;
- this.compilationUnit = compilationUnit;
- this.modifySharedDocumentCommandExecutorProvider = modifySharedDocumentCommandExecutorProvider;
- 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 headlessly, a "working copy" must be created
- * (at least as far as I can tell ~kfm)
- * - when editing via a plain text editor, make a working copy or else things are screwed
- * up the second time you edit through the XmlPersistence XmlProperties View
- */
- protected void edit_(Editor editor) throws JavaModelException, BadLocationException {
- if ( ! this.compilationUnit.isWorkingCopy()) {
- 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());
-
- CompilationUnit astRoot = this.buildASTRoot();
- astRoot.recordModifications();
-
- editor.edit(this.getModifiedDeclaration(astRoot));
-
- TextEdit edits = astRoot.rewrite(doc, this.compilationUnit.getJavaProject().getOptions(true));
- if (sharedDocument) {
- this.getModifySharedDocumentCommandExecutor().execute(new ModifySharedDocumentCommand(edits, doc));
- } else {
- this.applyEdits(edits, doc);
- }
-
- if ( ! sharedDocument) {
- 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 JDTTools.buildASTRoot(this.compilationUnit);
- }
-
- protected CommandExecutor getModifySharedDocumentCommandExecutor() {
- return this.modifySharedDocumentCommandExecutorProvider.getCommandExecutor();
- }
-
-
- // ********** 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 08aed99185..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTMethodAttribute.java
+++ /dev/null
@@ -1,188 +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 java.beans.Introspector;
-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.CommandExecutorProvider;
-import org.eclipse.jpt.utility.JavaType;
-import org.eclipse.jpt.utility.MethodSignature;
-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,
- CommandExecutorProvider modifySharedDocumentCommandExecutorProvider) {
- return newInstance(declaringType, signature, occurrence, compilationUnit, modifySharedDocumentCommandExecutorProvider, DefaultAnnotationEditFormatter.instance());
- }
-
- public static JDTMethodAttribute newInstance(
- Type declaringType,
- MethodSignature signature,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutorProvider modifySharedDocumentCommandExecutorProvider,
- AnnotationEditFormatter annotationEditFormatter) {
- return new JDTMethodAttribute(declaringType, signature, occurrence, compilationUnit, modifySharedDocumentCommandExecutorProvider, annotationEditFormatter);
- }
-
- public JDTMethodAttribute(
- Type declaringType,
- MethodSignature methodSignature,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutorProvider modifySharedDocumentCommandExecutorProvider) {
- this(declaringType, methodSignature, occurrence, compilationUnit, modifySharedDocumentCommandExecutorProvider, DefaultAnnotationEditFormatter.instance());
- }
-
- public JDTMethodAttribute(
- Type declaringType,
- MethodSignature methodSignature,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutorProvider modifySharedDocumentCommandExecutorProvider,
- AnnotationEditFormatter annotationEditFormatter) {
- super(declaringType, methodSignature.getName(), occurrence, compilationUnit, modifySharedDocumentCommandExecutorProvider, 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, CommandExecutorProvider.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(JDTTools.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(org.eclipse.jdt.core.dom.MethodDeclaration, 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() {
- String name = this.getName_();
- int beginIndex = 0;
- if (name.startsWith("get")) { //$NON-NLS-1$
- beginIndex = 3;
- } else if (name.startsWith("is")) { //$NON-NLS-1$
- beginIndex = 2;
- }
- return Introspector.decapitalize(name.substring(beginIndex));
- }
-
- public ITypeBinding getTypeBinding(CompilationUnit astRoot) {
- IMethodBinding methodBinding = getBodyDeclaration(astRoot).resolveBinding();
- if (methodBinding != null) {
- return methodBinding.getReturnType();
- }
- return null;
- }
-
- @Override
- public boolean isMethod() {
- return true;
- }
-
- public boolean isPersistable(CompilationUnit astRoot) {
- IMethodBinding binding = this.getBinding(astRoot);
- return (binding == null) ? false : JPTTools.methodIsPersistablePropertyGetter(binding);
- }
-
-
- // ********** internal **********
-
- protected MethodDeclaration[] getDeclaringTypeMethodDeclarations(CompilationUnit astRoot) {
- return this.getDeclaringTypeDeclaration(astRoot).getMethods();
- }
-
-}
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 2f6f82dab1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTModifiedDeclaration.java
+++ /dev/null
@@ -1,532 +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 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;
-
-/**
- * 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 FilteringIterator<IExtendedModifier, Annotation>(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 cbd4c9a56e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTTools.java
+++ /dev/null
@@ -1,168 +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 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;
-
-public class JDTTools {
-
- /**
- * Build an AST 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.setResolveBindings(true);
- parser.setBindingsRecovery(true); // see bugs 196200, 222735
- return (CompilationUnit) parser.createAST(null);
- }
-
- 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 why this is null sometimes
- }
- if (binding.getKind() != IBinding.VARIABLE) {
- return null;
- }
- IVariableBinding variableBinding = (IVariableBinding) binding;
- return variableBinding.getType().getQualifiedName() + '.' + variableBinding.getName();
- }
-
- public static String resolveAnnotation(Annotation node) {
- IAnnotationBinding annotationBinding = node.resolveAnnotationBinding();
- if (annotationBinding == null) {
- return null;
- }
- ITypeBinding annotationTypeBinding = annotationBinding.getAnnotationType();
- if (annotationTypeBinding == null) {
- return null;
- }
- return annotationTypeBinding.getQualifiedName();
- }
-
- public static String resolveFullyQualifiedName(Expression expression) {
- ITypeBinding resolvedTypeBinding = resolveTypeBinding(expression);
- if (resolvedTypeBinding != null) {
- return resolvedTypeBinding.getQualifiedName();
- }
- return null;
- }
-
- 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();
- }
-
- /**
- * Given an Expression return the ITypeBinding for the fullyQualifiedTypeName if it
- * exists in the type hierarchy. The expression should be a TypeLiteral or this will
- * just return null.
- */
- public static ITypeBinding findTypeInHierarchy(Expression expression, String fullyQualifiedTypeName) {
- ITypeBinding typeBinding = resolveTypeBinding(expression);
- if (typeBinding != null) {
- return findTypeInHierarchy(typeBinding, fullyQualifiedTypeName);
- }
- return null;
- }
-
- /**
- * Finds a type binding for a given fully qualified type in the hierarchy of a type.
- * Returns <code>null</code> if no type binding is found.
- * @param hierarchyType the binding representing the hierarchy
- * @param fullyQualifiedTypeName the fully qualified name to search for
- * @return the type binding
- */
- //copied from org.eclipse.jdt.internal.corext.dom.Bindings
- public static ITypeBinding findTypeInHierarchy(ITypeBinding hierarchyType, String fullyQualifiedTypeName) {
- if (hierarchyType.isArray() || hierarchyType.isPrimitive()) {
- return null;
- }
- if (fullyQualifiedTypeName.equals(hierarchyType.getQualifiedName())) {
- return hierarchyType;
- }
- ITypeBinding superClass= hierarchyType.getSuperclass();
- if (superClass != null) {
- ITypeBinding res= findTypeInHierarchy(superClass, fullyQualifiedTypeName);
- if (res != null) {
- return res;
- }
- }
- ITypeBinding[] superInterfaces= hierarchyType.getInterfaces();
- for (int i= 0; i < superInterfaces.length; i++) {
- ITypeBinding res= findTypeInHierarchy(superInterfaces[i], fullyQualifiedTypeName);
- if (res != null) {
- return res;
- }
- }
- return null;
- }
-
-}
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 a021ef6611..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTType.java
+++ /dev/null
@@ -1,174 +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 java.util.List;
-import org.eclipse.jdt.core.ICompilationUnit;
-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.CommandExecutorProvider;
-
-/**
- * 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,
- CommandExecutorProvider modifySharedDocumentCommandExecutorProvider) {
- this(typeDeclaration, compilationUnit, modifySharedDocumentCommandExecutorProvider, DefaultAnnotationEditFormatter.instance());
- }
-
- /**
- * constructor for the compilation unit's primary type
- */
- public JDTType(
- TypeDeclaration typeDeclaration, // exclude annotations and enums
- ICompilationUnit compilationUnit,
- CommandExecutorProvider modifySharedDocumentCommandExecutorProvider,
- AnnotationEditFormatter annotationEditFormatter) {
- this(null, typeDeclaration, 1, compilationUnit, modifySharedDocumentCommandExecutorProvider, annotationEditFormatter);
- }
-
- /**
- * constructor for nested types
- */
- public JDTType(
- Type declaringType,
- TypeDeclaration typeDeclaration, // exclude annotations and enums
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutorProvider modifySharedDocumentCommandExecutorProvider) {
- this(declaringType, typeDeclaration, occurrence, compilationUnit, modifySharedDocumentCommandExecutorProvider, DefaultAnnotationEditFormatter.instance());
- }
-
- /**
- * constructor for nested types
- */
- public JDTType(
- Type declaringType,
- TypeDeclaration typeDeclaration, // exclude annotations and enums
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutorProvider modifySharedDocumentCommandExecutorProvider,
- AnnotationEditFormatter annotationEditFormatter) {
- super(declaringType, typeDeclaration.getName().getFullyQualifiedName(), occurrence, compilationUnit, modifySharedDocumentCommandExecutorProvider, annotationEditFormatter);
- }
-
- /**
- * constructor for testing
- */
- public JDTType(Type declaringType, String name, int occurrence, ICompilationUnit compilationUnit) {
- super(declaringType, name, occurrence, compilationUnit, CommandExecutorProvider.Default.instance(), DefaultAnnotationEditFormatter.instance());
- }
-
-
- // ********** Member/Type implementation **********
-
- public ITypeBinding getBinding(CompilationUnit astRoot) {
- return this.getBodyDeclaration(astRoot).resolveBinding();
- }
-
- /**
- * find the type's body declaration in the specified AST
- */
- public TypeDeclaration getBodyDeclaration(CompilationUnit astRoot) {
- Type declaringType = this.getDeclaringType();
- return (declaringType == null) ?
- this.getTopLevelTypeDeclaration(astRoot)
- :
- this.getNestedTypeDeclaration(declaringType.getBodyDeclaration(astRoot));
- }
-
- public boolean isPersistable(CompilationUnit astRoot) {
- ITypeBinding binding = this.getBinding(astRoot);
- return (binding == null) ? false : JPTTools.typeIsPersistable(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<TypeDeclaration> typeDeclarations) {
- return this.getTypeDeclaration(typeDeclarations.toArray(new TypeDeclaration[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(TypeDeclaration[] typeDeclarations) {
- String name = this.getName_();
- int occurrence = this.getOccurrence();
- int count = 0;
- for (TypeDeclaration typeDeclaration : typeDeclarations) {
- if (typeDeclaration.getName().getFullyQualifiedName().equals(name)) {
- count++;
- if (count == occurrence) {
- return typeDeclaration;
- }
- }
- }
- // 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;
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected static List<TypeDeclaration> types(CompilationUnit astRoot) {
- return astRoot.types();
- }
-
-}
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 e9df14d3d8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JPTTools.java
+++ /dev/null
@@ -1,182 +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.jdt.core.dom.IMethodBinding;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jdt.core.dom.IVariableBinding;
-import org.eclipse.jdt.core.dom.Modifier;
-
-public class JPTTools {
-
- /**
- * 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(IVariableBinding field) {
- int modifiers = field.getModifiers();
- if (Modifier.isStatic(modifiers)) {
- return false;
- }
- if (Modifier.isTransient(modifiers)) {
- return false;
- }
- return true;
- }
-
- /**
- * Return whether the specified method is a "getter" method that
- * represents a property that may be "persisted".
- */
- public static boolean methodIsPersistablePropertyGetter(IMethodBinding methodBinding) {
- if (methodHasBadModifiers(methodBinding)) {
- return false;
- }
-
- ITypeBinding returnType = methodBinding.getReturnType();
- if (returnType == null) {
- return false;
- }
- String returnTypeName = returnType.getQualifiedName();
- if (returnTypeName.equals("void")) { //$NON-NLS-1$
- return false;
- }
- if (methodBinding.getParameterTypes().length != 0) {
- return false;
- }
-
- String methodName = methodBinding.getName();
- int beginIndex = 0;
- boolean booleanGetter = false;
- if (methodName.startsWith("is")) { //$NON-NLS-1$
- if (returnTypeName.equals("boolean")) { //$NON-NLS-1$
- beginIndex = 2;
- } else {
- return false;
- }
- } else {
- if (methodName.startsWith("get")) { //$NON-NLS-1$
- beginIndex = 3;
- if (returnTypeName.equals("boolean")) { //$NON-NLS-1$
- booleanGetter = true;
- }
- } else {
- return false;
- }
- }
-
- String capitalizedAttributeName = methodName.substring(beginIndex);
- // if the type has both methods:
- // boolean isProperty()
- // boolean getProperty()
- // then #isProperty() takes precedence and we ignore #getProperty()
- // (see the JavaBeans spec 1.01)
- if (booleanGetter) {
- IMethodBinding isMethod = methodBindingNoParameters(methodBinding.getDeclaringClass(), "is" + capitalizedAttributeName); //$NON-NLS-1$
- if (isMethod == null) {
- return false;
- }
- if (isMethod.getReturnType().getName().equals("boolean")) { //$NON-NLS-1$
- return false;
- }
- }
- IMethodBinding setMethod = methodBindingOneParameter(methodBinding.getDeclaringClass(), "set" + capitalizedAttributeName, returnTypeName); //$NON-NLS-1$
- if (setMethod == null) {
- return false;
- }
- if (methodHasBadModifiers(setMethod)) {
- return false;
- }
- if ( ! setMethod.getReturnType().getName().equals("void")) { //$NON-NLS-1$
- return false;
- }
- return true;
- }
-
- private static IMethodBinding methodBindingNoParameters(ITypeBinding typeBinding, String methodName) {
- for (IMethodBinding method : typeBinding.getDeclaredMethods()) {
- if (method.getName().equals(methodName)) {
- if (method.getParameterTypes().length == 0) {
- return method;
- }
- }
- }
- return null;
- }
-
- private static IMethodBinding methodBindingOneParameter(ITypeBinding typeBinding, String methodName, String parameterTypeName) {
- for (IMethodBinding method : typeBinding.getDeclaredMethods()) {
- if (method.getName().equals(methodName)) {
- if (method.getParameterTypes().length == 1) {
- if (method.getParameterTypes()[0].getQualifiedName().equals(parameterTypeName)) {
- return method;
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Return whether the specified method's modifiers prevent it
- * from being a getter or setter for a "persistent" property.
- */
- private static boolean methodHasBadModifiers(IMethodBinding methodBinding) {
- if (methodBinding.isConstructor()) {
- return true;
- }
- int modifiers = methodBinding.getModifiers();
- if (Modifier.isStatic(modifiers)) {
- return true;
- }
- if (Modifier.isFinal(modifiers)) {
- return true;
- }
- if ( ! (Modifier.isPublic(modifiers) || Modifier.isProtected(modifiers))) {
- return true;
- }
- return false;
- }
-
- /**
- * Return whether the type may be "persisted", ie marked as Entity, MappedSuperclass, Embeddable
- */
- //TODO should persistability be dependent on having a no-arg constructor or should that just be validation?
- //seems like final, or a member type being static could be dealt with through validation instead of filtering them out.
- public static boolean typeIsPersistable(ITypeBinding typeBinding) {
- if (typeBinding.isInterface()) {
- return false;
- }
- if (typeBinding.isAnnotation()) {
- return false;
- }
- if (typeBinding.isEnum()) {
- return false;
- }
- if (typeBinding.isLocal()) {
- return false;
- }
- if (typeBinding.isAnonymous()) {
- return false;
- }
- int modifiers = typeBinding.getModifiers();
- if (Modifier.isFinal(modifiers)) {
- return false;
- }
- if (typeBinding.isMember()) {
- if (!Modifier.isStatic(modifiers)) {
- return false;
- }
- }
- return true;
- }
-
-}
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 968658eea3..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * 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(newValue);
- } 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/validation/DefaultJpaValidationMessages.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/DefaultJpaValidationMessages.java
deleted file mode 100644
index ae30b69460..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/DefaultJpaValidationMessages.java
+++ /dev/null
@@ -1,60 +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.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 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 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/JpaValidationMessages.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationMessages.java
deleted file mode 100644
index 29e83d4a12..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationMessages.java
+++ /dev/null
@@ -1,82 +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.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 PERSISTENCE_XML_INVALID_CONTENT = "PERSISTENCE_XML_INVALID_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_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 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_UNSPECIFIED_CONTEXT = "PERSISTENT_TYPE_UNSPECIFIED_CONTEXT";
- 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 ENTITY_NO_ID = "ENTITY_NO_ID";
- 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_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_WITH_JOIN_TABLE = "MAPPING_MAPPED_BY_WITH_JOIN_TABLE";
- 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 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_CANNOT_BE_DETERMINED = "JOIN_TABLE_CANNOT_BE_DETERMINED";
- 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 VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_TABLE = "VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_TABLE";
- public static final String VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_TABLE = "VIRTUAL_ATTRIBUTE_OVERRIDE_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 JOIN_COLUMN_UNRESOLVED_TABLE = "JOIN_COLUMN_UNRESOLVED_TABLE";
- public static final String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_TABLE = "VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_TABLE";
- public static final String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_TABLE = "VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_TABLE";
- public static final String JOIN_COLUMN_UNRESOLVED_NAME = "JOIN_COLUMN_UNRESOLVED_NAME";
- public static final String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_NAME";
- public static final String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME";
- public static final String JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME = "JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME";
- public static final String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME";
- public static final String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME";
- 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_UNRESOLVED_REFERENCED_COLUMN_NAME = "PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME";
-
-}
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 508c1d2615..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidator.java
+++ /dev/null
@@ -1,154 +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 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.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jpt.core.JpaModel;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.wst.validation.internal.core.ValidationException;
-import org.eclipse.wst.validation.internal.operations.IWorkbenchContext;
-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.IValidatorJob;
-
-/**
- * This class is referenced in the JPA extension for the
- * WTP validator extension point.
- */
-public class JpaValidator implements IValidatorJob {
-
-
- // ********** IValidator implementation **********
-
- public void validate(IValidationContext context, IReporter reporter) throws ValidationException {
- reporter.removeAllMessages(this);
-
- for (Iterator<IMessage> stream = this.validationMessages(context); stream.hasNext(); ) {
- reporter.addMessage(this, stream.next());
- }
- }
-
- private Iterator<IMessage> validationMessages(IValidationContext context) {
- IProject project = ((IProjectValidationContext) context).getProject();
- return JptCorePlugin.getJpaProject(project).validationMessages();
- }
-
- public void cleanup(IReporter reporter) {
- // nothing to do
- }
-
-
- // ********** IValidatorJob implementation **********
-
- public ISchedulingRule getSchedulingRule(IValidationContext context) {
- // don't know what to return here. my guess is that we want to return
- // the resource that is possibly being changed during our validation,
- // and since many resources in the project may be changed during this
- // validation, returning the project makes the most sense.
- return ((IWorkbenchContext) context).getProject();
- }
-
- public IStatus validateInJob(IValidationContext context, IReporter reporter) throws ValidationException {
- if (reporter.isCancelled()) {
- return Status.CANCEL_STATUS;
- }
- this.validate(context, reporter);
- return OK_STATUS;
- }
-
-
- // ********** marker clean-up **********
-
- private static final CollectionChangeListener JPA_MODEL_LISTENER = new LocalCollectionChangeListener();
-
- static {
- JptCorePlugin.getJpaModel().addCollectionChangeListener(JpaModel.JPA_PROJECTS_COLLECTION, JPA_MODEL_LISTENER);
- }
-
- /**
- * When a JPA project is removed this listener will schedule a job to
- * remove all the markers associated with the JPA project.
- */
- private static class LocalCollectionChangeListener implements CollectionChangeListener {
-
- LocalCollectionChangeListener() {
- super();
- }
-
- public void itemsAdded(CollectionChangeEvent event) {
- // ignore
- }
-
- /**
- * For now, we expect JPA projects to be removed one at a time.
- */
- public void itemsRemoved(CollectionChangeEvent event) {
- @SuppressWarnings("unchecked")
- Iterator<JpaProject> items = (Iterator<JpaProject>) event.items();
- Job j = new DeleteMarkersJob(items.next());
- j.schedule();
- if (items.hasNext()) {
- throw new UnsupportedOperationException("unexpected event");
- }
- }
-
- public void collectionCleared(CollectionChangeEvent event) {
- throw new UnsupportedOperationException("unexpected event");
- }
-
- public void collectionChanged(CollectionChangeEvent event) {
- throw new UnsupportedOperationException("unexpected event");
- }
-
- }
-
- /**
- * Delete all the markers associated with the specified JPA project.
- */
- private static class DeleteMarkersJob extends Job {
- private final JpaProject jpaProject;
-
- DeleteMarkersJob(JpaProject jpaProject) {
- super("Delete Markers");
- this.jpaProject = jpaProject;
- }
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- IProject project = this.jpaProject.getProject();
- if (project.isOpen()) {//no need to remove markers if project has been closed
- try {
- IMarker[] markers = project.findMarkers(JptCorePlugin.VALIDATION_MARKER_ID, true, IResource.DEPTH_INFINITE);
- ResourcesPlugin.getWorkspace().deleteMarkers(markers);
- } catch (CoreException ex) {
- JptCorePlugin.log(ex); // not much else we can do
- }
- }
- return Status.OK_STATUS;
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/AbstractResourceModelProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/AbstractResourceModelProvider.java
deleted file mode 100644
index da88edbc93..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/AbstractResourceModelProvider.java
+++ /dev/null
@@ -1,372 +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.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.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentDescription;
-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.common.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.
- */
-public abstract class AbstractResourceModelProvider<R extends JpaXmlResource>
- implements JpaResourceModelProvider, ResourceStateInputProvider, ResourceStateValidator
-{
- protected IProject project;
-
- protected URI fileUri;
-
- protected R resource;
-
- protected final ResourceAdapter resourceAdapter = new ResourceAdapter();
-
- protected final ListenerList<JpaResourceModelProviderListener> listenerList = new ListenerList<JpaResourceModelProviderListener>(JpaResourceModelProviderListener.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 AbstractResourceModelProvider(IProject project, IPath resourcePath) {
- super();
- this.project = project;
- this.fileUri = buildFileUri(resourcePath);
- }
-
-
- 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 R getResource() {
- if (this.resource == null) {
- try {
- this.resource = ensureCorrectType(WorkbenchResourceHelper.getOrCreateResource(this.fileUri, getResourceSet()));
- }
- catch (ClassCastException cce) {
- Resource.Factory resourceFactory =
- WTPResourceFactoryRegistry.INSTANCE.getFactory(fileUri, getContentType(getContentTypeDescriber()));
- this.resource =
- (R)((FlexibleProjectResourceSet) getResourceSet()).createResource(fileUri, resourceFactory);
- }
- }
- return this.resource;
- }
-
- /**
- * Ensure that the given resource is of the expected type for this resource
- * model provider.
- * Return it if so, throw a ClassCastException otherwise.
- */
- protected abstract R ensureCorrectType(Resource resource) throws ClassCastException;
-
- public R createResource() throws CoreException {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- JpaXmlResource aResource = getResource();
- if (! aResource.exists() && aResource.getContents().isEmpty()) {
- populateRoot(aResource);
- try {
- aResource.saveIfNecessary();
- }
- catch (Exception e) {
- JptCorePlugin.log(e);
- }
- }
- }
- };
- workspace.run(runnable, workspace.getRoot(), IWorkspace.AVOID_UPDATE, new NullProgressMonitor());
- return this.resource;
- }
-
- protected URI getModuleURI(URI uri) {
- URI moduleuri = ModuleURIUtil.fullyQualifyURI(project);
- IPath requestPath = new Path(moduleuri.path()).append(new Path(uri.path()));
- URI resourceURI = URI.createURI(PlatformURLModuleConnection.MODULE_PROTOCOL + requestPath.toString());
- return resourceURI;
- }
-
- protected IContentDescription getContentType(String contentTypeDescriber) {
- if (contentTypeDescriber != null) {
- return Platform.getContentTypeManager().getContentType(contentTypeDescriber).getDefaultDescription();
- } else {
- return null;
- }
- }
-
- /**
- * Used to optionally define an associated content type for XML file creation
- * @return
- */
- protected String getContentTypeDescriber() {
- return null;
- }
-
- /**
- * Used to optionally fill in the root information of a resource if it does not
- * exist as a file
- */
- protected void populateRoot(JpaXmlResource resource) {}
-
-
- /**
- * minimize the scope of the suppressed warnings
- */
- @SuppressWarnings("unchecked")
- protected EList<EObject> getResourceContents(JpaXmlResource resource) {
- return resource.getContents();
- }
-
- public void addListener(JpaResourceModelProviderListener listener) {
- if (this.listenerList.isEmpty()) {
- engageResource();
- }
- this.listenerList.add(listener);
- }
-
- public void removeListener(JpaResourceModelProviderListener listener) {
- 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 ? JpaResourceModelProviderEvent.RESOURCE_LOADED : JpaResourceModelProviderEvent.RESOURCE_UNLOADED;
- JpaResourceModelProviderEvent evt = new JpaResourceModelProviderEvent(this, eventType);
- notifyListeners(evt);
- }
- }
-
- protected void notifyListeners(JpaResourceModelProviderEvent event) {
- NotifyRunner notifier = new NotifyRunner(event);
- for (JpaResourceModelProviderListener 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);
- }
- else {
- return Status.OK_STATUS;
- }
- }
-
- public void modify(Runnable runnable) {
- try {
- runnable.run();
- try {
- if (resource != null) {
- resource.save(Collections.EMPTY_MAP);
- }
- } catch (IOException ioe) {
- JptCorePlugin.log(ioe);
- }
- } catch (Exception e) {
- JptCorePlugin.log(e);
- }
- }
-
-
- // **************** ResourceStateValidator impl ****************************
-
- public ResourceStateValidator getStateValidator() {
- if (stateValidator == null) {
- stateValidator = createStateValidator();
- }
- return 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 resource.isModified();
- }
-
- public List getNonResourceFiles() {
- return Collections.emptyList();
- }
-
- public List getNonResourceInconsistentFiles() {
- return Collections.emptyList();
- }
-
- public List getResources() {
- return Collections.singletonList(getResource());
- }
-
- 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 class NotifyRunner implements ISafeRunnable
- {
- private final JpaResourceModelProviderEvent event;
-
- private JpaResourceModelProviderListener listener;
-
-
- public NotifyRunner(JpaResourceModelProviderEvent event) {
- Assert.isNotNull(event);
- this.event = event;
- }
-
-
- public void setListener(JpaResourceModelProviderListener 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/JpaResourceModelProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaResourceModelProvider.java
deleted file mode 100644
index 04e518e432..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaResourceModelProvider.java
+++ /dev/null
@@ -1,30 +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.resource;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jpt.core.resource.common.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.
- */
-public interface JpaResourceModelProvider
-{
- JpaXmlResource getResource();
-
- IStatus validateEdit(Object context);
-
- void modify(Runnable runnable);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaResourceModelProviderEvent.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaResourceModelProviderEvent.java
deleted file mode 100644
index 09d3acd689..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaResourceModelProviderEvent.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.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.
- */
-public class JpaResourceModelProviderEvent
-{
- public final static int RESOURCE_LOADED = 0x1;
-
- public final static int RESOURCE_UNLOADED = 0x2;
-
-
- private JpaResourceModelProvider modelProvider;
-
- private int type;
-
-
- public JpaResourceModelProviderEvent(JpaResourceModelProvider modelProvider, int eventType) {
- super();
- this.modelProvider = modelProvider;
- this.type = eventType;
- }
-
-
- public JpaResourceModelProvider getModelProvider() {
- return modelProvider;
- }
-
- public int getType() {
- return type;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaResourceModelProviderFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaResourceModelProviderFactory.java
deleted file mode 100644
index eb6ea26481..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaResourceModelProviderFactory.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.core.resource;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JpaResourceModelProviderFactory
-{
- JpaResourceModelProvider create(IProject project, IPath filePath);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaResourceModelProviderListener.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaResourceModelProviderListener.java
deleted file mode 100644
index 6755df9a4f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaResourceModelProviderListener.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.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.
- */
-public interface JpaResourceModelProviderListener
- extends EventListener
-{
- public void modelChanged(JpaResourceModelProviderEvent event);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/AbstractJpaEObject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/AbstractJpaEObject.java
deleted file mode 100644
index 5620c834ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/AbstractJpaEObject.java
+++ /dev/null
@@ -1,293 +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.resource.common;
-
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Set;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-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;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml 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.common.CommonPackage#getXmlEObject()
- * @model kind="class" abstract="true"
- * @generated
- */
-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 JpaXmlResource getResource() {
- return (JpaXmlResource) this.eResource();
- }
-
- public IResource getPlatformResource() {
- return this.getResource().getFile();
- }
-
- /*
- * Must be overridden by actual root object to return itself.
- */
- public JpaEObject getRoot() {
- return ((JpaEObject) this.eContainer()).getRoot();
- }
-
- public boolean isAllFeaturesUnset() {
- 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.getResource().resourceModelChanged();
- }
- }
-
- protected boolean featureIsSignificant(int featureId) {
- return ! this.featureIsInsignificant(featureId);
- }
-
- protected boolean featureIsInsignificant(int featureId) {
- return this.insignificantFeatureIds().contains(new Integer(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 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 (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) {
- for (int i = 0; i < this.node.getChildNodes().getLength(); i ++) {
- IDOMNode node = (IDOMNode) this.node.getChildNodes().item(i);
- if (node.getNodeType() == IDOMNode.ELEMENT_NODE && elementName.equals(node.getNodeName())) {
- return node;
- }
- }
- 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 class XmlEAdapterList<E extends Object & Adapter>
- extends EAdapterList<E>
- {
- public XmlEAdapterList(Notifier notifier) {
- super(notifier);
- }
-
- @Override
- protected void didAdd(int index, E newObject) {
- super.didAdd(index, newObject);
- if (newObject instanceof EMF2DOMAdapter) {
- Object node = ((EMF2DOMAdapter) newObject).getNode();
- if (node instanceof IDOMNode) {
- AbstractJpaEObject.this.node = (IDOMNode) node;
- }
- }
- }
-
- @Override
- protected void didRemove(int index, E oldObject) {
- if ((oldObject instanceof EMF2DOMAdapter) &&
- (((EMF2DOMAdapter) oldObject).getNode() == AbstractJpaEObject.this.node)) {
- AbstractJpaEObject.this.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/common/JpaArtifactEdit.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaArtifactEdit.java
deleted file mode 100644
index f021d99116..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaArtifactEdit.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.core.resource.common;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.wst.common.componentcore.ArtifactEdit;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 JpaArtifactEdit extends ArtifactEdit
-{
- public JpaArtifactEdit(IProject aProject, boolean toAccessAsReadOnly)
- throws IllegalArgumentException {
- super(aProject, toAccessAsReadOnly);
- }
-
-
- /**
- * @return a resource for the given file
- */
- public abstract JpaXmlResource getResource(IFile file);
-
- /**
- * @param deployURI - this must be in a deployment relevant form
- * (e.g "META-INF/persistence.xml" instead of "src/META-INF/persistence.xml")
- * @return a resource for the given deployment file URI
- */
- public abstract JpaXmlResource getResource(String deployURI);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaEObject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaEObject.java
deleted file mode 100644
index b65523dc82..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaEObject.java
+++ /dev/null
@@ -1,61 +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.common;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.emf.ecore.EObject;
-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.
- */
-public interface JpaEObject extends EObject
-{
- /**
- * Return the resource that most directly contains this object
- */
- IResource getPlatformResource();
-
- /**
- * Return the JpaXmlResource containing this object.
- */
- JpaXmlResource getResource();
-
- /**
- * Return the root object of the model
- */
- JpaEObject getRoot();
-
- /**
- * 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();
-
-
- boolean isAllFeaturesUnset();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaXmlResource.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaXmlResource.java
deleted file mode 100644
index 9934c2c0e2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaXmlResource.java
+++ /dev/null
@@ -1,166 +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.common;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jem.util.emf.workbench.WorkbenchResourceHelperBase;
-import org.eclipse.jem.util.plugin.JEMUtilPlugin;
-import org.eclipse.jpt.core.ResourceModelListener;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.wst.common.internal.emf.resource.Renderer;
-import org.eclipse.wst.common.internal.emf.resource.TranslatorResourceImpl;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 JpaXmlResource
- extends TranslatorResourceImpl
-{
- private ResourceModelListener resourceModelListener;
-
-
- // ********** constructor **********
-
- protected JpaXmlResource(URI uri, Renderer renderer) {
- super(uri, renderer);
- }
-
-
- // ********** BasicNotifierImpl override **********
-
- /**
- * override to prevent notification when the resource's state is unchanged
- * or the resource is not loaded
- */
- @Override
- public void eNotify(Notification notification) {
- if ( ! notification.isTouch() && this.isLoaded()) {
- super.eNotify(notification);
- this.resourceModelChanged();
- }
- }
-
-
- // ********** 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;
- }
-
-
- // ********** TranslatorResource implementation **********
-
- /**
- * only applicable for DTD-based files
- */
- public String getDoctype() {
- return null;
- }
-
-
- // ********** convenience methods **********
-
- public boolean exists() {
- return this.getFile().exists();
- }
-
- public IFile getFile() {
- IFile file = 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 : getFile(convertedURI);
- }
-
- /**
- * Return the Eclipse file for the specified URI.
- * This URI is assumed to be absolute in the following format:
- * platform:/resource/....
- */
- protected static IFile getFile(URI uri) {
- if ( ! WorkbenchResourceHelperBase.isPlatformResourceURI(uri)) {
- return null;
- }
- String fileName = URI.decode(uri.path()).substring(JEMUtilPlugin.PLATFORM_RESOURCE.length() + 1);
- return ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(fileName));
- }
-
- public abstract String getType();
-
- @Override
- public String toString() {
- // implementation in TranslatorResourceImpl is a bit off...
- return StringTools.buildToStringFor(this, this.getURI());
- }
-
-
- // ********** resource model changes **********
-
- public void setResourceModelListener(ResourceModelListener resourceModelListener) {
- this.resourceModelListener = resourceModelListener;
- }
-
- public void resourceModelChanged() {
- if (this.resourceModelListener != null) {
- this.resourceModelListener.resourceModelChanged();
- }
- }
-
-
- // ********** compiler warning fixes **********
-
- @SuppressWarnings("unchecked")
- @Override
- public EList eAdapters() {
- return super.eAdapters();
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public EList getContents() {
- return super.getContents();
- }
-
-}
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 b37146038a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AccessType.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public enum AccessType {
-
- PROPERTY,
- FIELD;
-
-}
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 7e115e6bac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Annotation.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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 Annotation extends JavaResourceNode
-{
- /**
- * Return the fully qualified annotation name.
- * @see JPA
- */
- String getAnnotationName();
-
- org.eclipse.jdt.core.dom.Annotation getJdtAnnotation(CompilationUnit astRoot);
-
- /**
- * Removing the underyling Java annotation
- */
- void removeAnnotation();
-
- /**
- * Create and add Java annotation
- */
- void newAnnotation();
-
-}
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 27ab383aa2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AnnotationDefinition.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.resource.java;
-
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * Used for building new Annotations.
- * These should be used to define non-mapping annotations. If you
- * want to provide new AnnotationDefinitions you will need
- * to create a new JpaPlatform by extending GenericJpaPlatform.
- *
- * @see MappingAnnotation
- * @see org.eclipse.jpt.core.internal.platform.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.
- */
-public interface AnnotationDefinition
-{
- /**
- * Return the fully qualified annotation name
- */
- String getAnnotationName();
-
- /**
- * Build and return an Annotation given the Member
- */
- Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member);
-
- Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member);
-}
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 ac978cd63c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverrideAnnotation.java
+++ /dev/null
@@ -1,47 +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.java;
-
-import java.util.ListIterator;
-
-/**
- * Corresponds to the javax.persistence.AssociationOverride 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.
- */
-public interface AssociationOverrideAnnotation extends OverrideAnnotation
-{
- String ANNOTATION_NAME = JPA.ASSOCIATION_OVERRIDE;
-
-
- /**
- * Corresponds to the joinColumns element of the AssociationOverride annotation.
- * Returns an empty iterator if the joinColumns element does not exist in java.
- */
- ListIterator<JoinColumnAnnotation> joinColumns();
-
- JoinColumnAnnotation joinColumnAt(int index);
-
- int indexOfJoinColumn(JoinColumnAnnotation joinColumn);
-
- int joinColumnsSize();
-
- JoinColumnAnnotation addJoinColumn(int index);
-
- void removeJoinColumn(int index);
-
- void moveJoinColumn(int targetIndex, int sourceIndex);
-
- String JOIN_COLUMNS_LIST = "joinColumnsList";
-}
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 654987c5aa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverridesAnnotation.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface AssociationOverridesAnnotation extends ContainerAnnotation<NestableAssociationOverride>
-{
- String ANNOTATION_NAME = JPA.ASSOCIATION_OVERRIDES;
-
- String ASSOCIATION_OVERRIDES_LIST = "associationOveridesList";
-}
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 c9eaa5bd35..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverrideAnnotation.java
+++ /dev/null
@@ -1,45 +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.java;
-
-/**
- * Corresponds to the javax.persistence.AttributeOverride 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.
- */
-public interface AttributeOverrideAnnotation extends OverrideAnnotation
-{
- String ANNOTATION_NAME = JPA.ATTRIBUTE_OVERRIDE;
-
- /**
- * Corresponds to the column element of the AttributeOverride annotation.
- * Returns null if the column element does not exist in java.
- */
- ColumnAnnotation getColumn();
-
- /**
- * Add the column element to the AttributeOverride annotation.
- */
- ColumnAnnotation addColumn();
-
- /**
- * Remove the column element from the AttributeOverride annotation.
- */
- void removeColumn();
-
- ColumnAnnotation getNonNullColumn();
-
- String COLUMN_PROPERTY = "columnProperty";
-
-}
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 a5903652cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverridesAnnotation.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface AttributeOverridesAnnotation extends ContainerAnnotation<NestableAttributeOverride>
-{
- String ANNOTATION_NAME = JPA.ATTRIBUTE_OVERRIDES;
-
- String ATTRIBUTE_OVERRIDES_LIST = "attributeOverridesList";
-}
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 fc4466bac8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseColumnAnnotation.java
+++ /dev/null
@@ -1,129 +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.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.
- */
-public interface BaseColumnAnnotation extends NamedColumnAnnotation
-{
-
- /**
- * Corresponds to the unique element of the *Column annotation.
- * Returns null if the unique valuePair does not exist in the annotation
- */
- Boolean getUnique();
-
- /**
- * Corresponds to the unique element of the *Column annotation.
- * Set to null to remove the unique valuePair from the annotation
- */
- void setUnique(Boolean unique);
- String UNIQUE_PROPERTY = "uniqueProperty";
-
- /**
- * Corresponds to the nullable element of the *Column annotation.
- * Returns null if the nullable valuePair does not exist in the annotation
- */
- Boolean getNullable();
-
- /**
- * Corresponds to the nullable element of the *Column annotation.
- * Set to null to remove the nullable valuePair from the annotation
- */
- void setNullable(Boolean nullable);
- String NULLABLE_PROPERTY = "nullableProperty";
-
- /**
- * Corresponds to the insertable element of the *Column annotation.
- * Returns null if the insertable valuePair does not exist in the annotation
- */
- Boolean getInsertable();
-
- /**
- * Corresponds to the insertable element of the *Column annotation.
- * Set to null to remove the insertable valuePair from the annotation
- */
- void setInsertable(Boolean insertable);
- String INSERTABLE_PROPERTY = "insertableProperty";
-
- /**
- * Corresponds to the updatable element of the *Column annotation.
- * Returns null if the updatable valuePair does not exist in the annotation
- */
- Boolean getUpdatable();
-
- /**
- * Corresponds to the updatable element of the *Column annotation.
- * Set to null to remove the updatable valuePair from the annotation
- */
- void setUpdatable(Boolean updatable);
- String UPDATABLE_PROPERTY = "updatableProperty";
-
- /**
- * Corresponds to the table element of the *Column annotation.
- * Returns null if the table valuePair does not exist in the annotation
- */
- String getTable();
-
- /**
- * Corresponds to the table element of the *Column annotation.
- * Set to null to remove the table valuePair from the annotation
- */
- void setTable(String table);
- String TABLE_PROPERTY = "tableProperty";
-
-
- /**
- * Return the {@link TextRange} for the unique element. If the unique element
- * does not exist return the {@link TextRange} for the *Column annotation.
- */
- TextRange getUniqueTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the nullable element. If the nullable element
- * does not exist return the {@link TextRange} for the *Column annotation.
- */
- TextRange getNullableTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the insertable element. If the insertable element
- * does not exist return the {@link TextRange} for the *Column annotation.
- */
- TextRange getInsertableTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the updatable element. If the updatable element
- * does not exist return the {@link TextRange} for the *Column annotation.
- */
- TextRange getUpdatableTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the table element. If the table element
- * does not exist return the {@link TextRange} for the *Column annotation.
- */
- TextRange getTableTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified postition touches the table element.
- * Return false if the table 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/BasicAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BasicAnnotation.java
deleted file mode 100644
index f8529b481d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BasicAnnotation.java
+++ /dev/null
@@ -1,67 +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.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.
- */
-public interface BasicAnnotation extends JavaResourceNode
-{
-
- String ANNOTATION_NAME = JPA.BASIC;
-
- /**
- * Corresponds to the fetch element of the Basic annotation.
- * Returns null if the fetch element does not exist in java.
- */
- FetchType getFetch();
-
- /**
- * Corresponds to the fetch element of the Basic annotation.
- * Set to null to remove the fetch element.
- */
- void setFetch(FetchType fetch);
- String FETCH_PROPERTY = "fetchProperty";
-
- /**
- * Corresponds to the optional element of the Basic annotation.
- * Returns null if the optional element does not exist in java.
- */
- Boolean getOptional();
-
- /**
- * Corresponds to the optional element of the Basic annotation.
- * Set to null to remove the optional element.
- */
- void setOptional(Boolean optional);
- String OPTIONAL_PROPERTY = "optionalProperty";
-
- /**
- * Return the {@link TextRange} for the fetch element. If the fetch element
- * does not exist return the {@link TextRange} for the Basic annotation.
- */
- TextRange getFetchTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the optional element. If the optional 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 a54aa2393d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/CascadeType.java
+++ /dev/null
@@ -1,81 +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.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-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);
-
- private String javaAnnotationValue;
-
- CascadeType(String javaAnnotationValue) {
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
- public static CascadeType[] fromJavaAnnotationValue(String[] javaAnnotationValues) {
- if (javaAnnotationValues == null) {
- return new CascadeType[0];
- }
- CascadeType[] cascadeTypes = new CascadeType[javaAnnotationValues.length];
- for (int i = 0; i < javaAnnotationValues.length; i++) {
- String javaAnnotationValue = javaAnnotationValues[i];
- if (javaAnnotationValue != null) {
- cascadeTypes[i] = cascadeType(javaAnnotationValue);
- }
- }
- return cascadeTypes;
- }
-
- private static CascadeType cascadeType(String javaAnnotationValue) {
- if (javaAnnotationValue.equals(ALL.getJavaAnnotationValue())) {
- return ALL;
- }
- else if (javaAnnotationValue.equals(PERSIST.getJavaAnnotationValue())) {
- return PERSIST;
- }
- else if (javaAnnotationValue.equals(MERGE.getJavaAnnotationValue())) {
- return MERGE;
- }
- else if (javaAnnotationValue.equals(REMOVE.getJavaAnnotationValue())) {
- return REMOVE;
- }
- else if (javaAnnotationValue.equals(REFRESH.getJavaAnnotationValue())) {
- return REFRESH;
- }
- throw new IllegalArgumentException("Unknown cascade type: " + javaAnnotationValue);
- }
-
- public static String[] toJavaAnnotationValue(CascadeType[] cascadeTypes) {
- String[] javaAnnotationValues = new String[cascadeTypes.length];
- for (int i = 0; i < cascadeTypes.length; i++) {
- CascadeType cascadeType = cascadeTypes[i];
- javaAnnotationValues[i] = cascadeType.javaAnnotationValue;
- }
- return javaAnnotationValues;
- }
-
-}
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 dc17be4c81..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ColumnAnnotation.java
+++ /dev/null
@@ -1,85 +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.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.
- */
-public interface ColumnAnnotation extends BaseColumnAnnotation
-{
- String ANNOTATION_NAME = JPA.COLUMN;
-
- /**
- * Corresponds to the length element of the javax.persistence.Column annotation.
- * Returns null if the length valuePair does not exist in the annotation
- */
- Integer getLength();
-
- /**
- * Corresponds to the length element of the javax.persistence.Column annotation.
- * Set to null to remove the length valuePair from the annotation
- */
- void setLength(Integer length);
- String LENGTH_PROPERTY = "lengthProperty";
-
- /**
- * Corresponds to the precision element of the javax.persistence.Column annotation.
- * Returns null if the precision valuePair does not exist in the annotation
- */
- Integer getPrecision();
-
- /**
- * Corresponds to the precision element of the javax.persistence.Column annotation.
- * Set to null to remove the precision valuePair from the annotation
- */
- void setPrecision(Integer precision);
- String PRECISION_PROPERTY = "precisionProperty";
-
- /**
- * Corresponds to the scale element of the javax.persistence.Column annotation.
- * Returns null if the scale valuePair does not exist in the annotation
- */
- Integer getScale();
-
- /**
- * Corresponds to the scale element of the javax.persistence.Column annotation.
- * Set to null to remove the scale valuePair from the annotation
- */
- void setScale(Integer scale);
- String SCALE_PROPERTY = "scaleProperty";
-
- /**
- * Return the {@link TextRange} for the length element. If length element
- * does not exist return the {@link TextRange} for the Column annotation.
- */
- TextRange getLengthTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the precision element. If precision element
- * does not exist return the {@link TextRange} for the Column annotation.
- */
- TextRange getPrecisionTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the scale element. If scale 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 9cd1e15aee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ContainerAnnotation.java
+++ /dev/null
@@ -1,64 +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.java;
-
-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.
- */
-public interface ContainerAnnotation<T extends NestableAnnotation> extends Annotation
-{
- /**
- * Return the fully qualified nestable annotation name.
- */
- String getNestableAnnotationName();
-
- /**
- * Return the element name of the nestable annotation when
- * it is nested within the container annotation as a member value pair
- */
- String getElementName();
-
- ListIterator<T> nestedAnnotations();
-
- int nestedAnnotationsSize();
-
- T nestedAnnotationAt(int index);
-
- T nestedAnnotationFor(org.eclipse.jdt.core.dom.Annotation jdtAnnotation);
-
- int indexOf(T nestedAnnotation);
-
- T add(int index);
-
- /**
- * Add directly to the List without firing change notification.
- */
- T addInternal(int index);
-
- void remove(T nestedAnnotation);
-
- void remove(int index);
-
- /**
- * Move in the List without firing change notification.
- */
- void moveInternal(int targetIndex, int sourceIndex);
-
- void move(int targetIndex, int sourceIndex);
-
-}
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 d86abfbeaf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorColumnAnnotation.java
+++ /dev/null
@@ -1,51 +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.java;
-
-/**
- * Corresponds to the javax.persistence.DiscriminatorColumn 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.
- */
-public interface DiscriminatorColumnAnnotation extends NamedColumnAnnotation
-{
- String ANNOTATION_NAME = JPA.DISCRIMINATOR_COLUMN;
-
- /**
- * Corresponds to the discriminatorType element of the javax.persistence.DiscriminatorColumn annotation.
- * Returns null if the discriminatorType valuePair does not exist in the annotation
- */
- DiscriminatorType getDiscriminatorType();
-
- /**
- * Corresponds to the discriminatorType element of the javax.persistence.OrderBy annotation.
- * Set the discriminatorType to null to remove the discriminatorType valuePair
- */
- void setDiscriminatorType(DiscriminatorType discriminatorType);
- String DISCRIMINATOR_TYPE_PROPERTY = "discriminatorTypeProperty";
-
- /**
- * Corresponds to the length element of the javax.persistence.DiscriminatorColumn annotation.
- * Returns null if the length valuePair does not exist in the annotation
- */
- Integer getLength();
-
- /**
- * Corresponds to the length element of the javax.persistence.OrderBy annotation.
- * Set the length to null to remove the length valuePair
- */
- void setLength(Integer length);
- String LENGTH_PROPERTY = "lengthProperty";
-
-}
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 be55e5b96a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorType.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.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public enum DiscriminatorType {
-
- STRING,
- CHAR,
- INTEGER;
-
-
- public static DiscriminatorType fromJavaAnnotationValue(Object javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- return null;
- }
- if (javaAnnotationValue.equals(JPA.DISCRIMINATOR_TYPE__STRING)) {
- return STRING;
- }
- if (javaAnnotationValue.equals(JPA.DISCRIMINATOR_TYPE__CHAR)) {
- return CHAR;
- }
- if (javaAnnotationValue.equals(JPA.DISCRIMINATOR_TYPE__INTEGER)) {
- return INTEGER;
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(DiscriminatorType discriminatorType) {
- if (discriminatorType == null) {
- return null;
- }
- switch (discriminatorType) {
- case STRING :
- return JPA.DISCRIMINATOR_TYPE__STRING;
- case CHAR :
- return JPA.DISCRIMINATOR_TYPE__CHAR;
- case INTEGER :
- return JPA.DISCRIMINATOR_TYPE__INTEGER;
- default :
- throw new IllegalArgumentException("unknown discriminator type: " + discriminatorType);
- }
- }
-}
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 2258f6a3a7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorValueAnnotation.java
+++ /dev/null
@@ -1,47 +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.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the javax.persistence.OrderBy 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.
- */
-public interface DiscriminatorValueAnnotation extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.DISCRIMINATOR_VALUE;
-
- /**
- * Corresponds to the value element of the javax.persistence.OrderBy annotation.
- * Returns null if the value valuePair does not exist in the annotation
- */
- String getValue();
-
- /**
- * Corresponds to the value element of the javax.persistence.OrderBy annotation.
- * Setting the value to null will not remove the OrderBy annotation
- */
- void setValue(String value);
- String VALUE_PROPERTY = "valueProperty";
-
- /**
- * Return the {@link TextRange} for the value element. If value element
- * does not exist return the {@link TextRange} for the DisriminatorValue 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 188e3d381f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddableAnnotation.java
+++ /dev/null
@@ -1,25 +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.java;
-
-/**
- * Corresponds to the javax.persistence.Embeddable 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.
- */
-public interface EmbeddableAnnotation extends JavaResourceNode
-{
- 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 766834a20d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddedAnnotation.java
+++ /dev/null
@@ -1,25 +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.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EmbeddedAnnotation extends JavaResourceNode
-{
- 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 d7eca844c9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddedIdAnnotation.java
+++ /dev/null
@@ -1,25 +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.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EmbeddedIdAnnotation extends JavaResourceNode
-{
- 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 f4cebb309d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EntityAnnotation.java
+++ /dev/null
@@ -1,48 +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.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the javax.persistence.Entity 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.
- */
-public interface EntityAnnotation extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.ENTITY;
-
- /**
- * Corresponds to the name element of the Entity annotation.
- * Returns null if the name element does not exist in java.
- */
- String getName();
-
- /**
- * Corresponds to the name element of the Entity annotation.
- * Set to null to remove the name element.
- */
- void setName(String name);
-
- String NAME_PROPERTY = "nameProperty";
-
- /**
- * Return the {@link TextRange} for the name element. If the name 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 f309e5f50e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EnumType.java
+++ /dev/null
@@ -1,53 +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.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public enum EnumType {
-
- ORDINAL,
- STRING;
-
-
- public static EnumType fromJavaAnnotationValue(Object javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- return null;
- }
- if (javaAnnotationValue.equals(JPA.ENUM_TYPE__ORDINAL)) {
- return ORDINAL;
- }
- if (javaAnnotationValue.equals(JPA.ENUM_TYPE__STRING)) {
- return STRING;
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(EnumType enumType) {
- if (enumType == null) {
- return null;
- }
- switch (enumType) {
- case ORDINAL :
- return JPA.ENUM_TYPE__ORDINAL;
- case STRING :
- return JPA.ENUM_TYPE__STRING;
- default :
- throw new IllegalArgumentException("unknown enum type: " + enumType);
- }
- }
-}
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 d83ddf2749..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EnumeratedAnnotation.java
+++ /dev/null
@@ -1,47 +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.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the javax.persistence.Enumerated 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.
- */
-public interface EnumeratedAnnotation extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.ENUMERATED;
-
- /**
- * Corresponds to the value element of the Enumerated annotation.
- * Returns null if the value element does not exist in java.
- */
- EnumType getValue();
-
- /**
- * Corresponds to the value element of the Enumerated annotation.
- * Set to null to remove the value element.
- */
- void setValue(EnumType value);
- String VALUE_PROPERTY = "valueProperty";
-
- /**
- * Return the {@link TextRange} for the value element. If the value 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 ca4f7e1b25..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/FetchType.java
+++ /dev/null
@@ -1,53 +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.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public enum FetchType {
-
- EAGER,
- LAZY;
-
-
- public static FetchType fromJavaAnnotationValue(Object javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- return null;
- }
- if (javaAnnotationValue.equals(JPA.FETCH_TYPE__EAGER)) {
- return EAGER;
- }
- if (javaAnnotationValue.equals(JPA.FETCH_TYPE__LAZY)) {
- return LAZY;
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(FetchType fetchType) {
- if (fetchType == null) {
- return null;
- }
- switch (fetchType) {
- case EAGER :
- return JPA.FETCH_TYPE__EAGER;
- case LAZY :
- return JPA.FETCH_TYPE__LAZY;
- default :
- throw new IllegalArgumentException("unknown fetch type: " + fetchType);
- }
- }
-}
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 ad93fe6472..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratedValueAnnotation.java
+++ /dev/null
@@ -1,67 +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.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the javax.persistence.GeneratedValue 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.
- */
-public interface GeneratedValueAnnotation extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.GENERATED_VALUE;
-
- /**
- * Corresponds to the strategy element of the GeneratedValue annotation.
- * Returns null if the strategy element does not exist in java.
- */
- GenerationType getStrategy();
-
- /**
- * Corresponds to the strategy element of the GeneratedValue annotation.
- * Set to null to remove the strategy element.
- */
- void setStrategy(GenerationType strategy);
- String STRATEGY_PROPERTY = "strategyProperty";
-
- /**
- * Corresponds to the generator element of the GeneratedValue annotation.
- * Returns null if the generator element does not exist in java.
- */
- String getGenerator();
-
- /**
- * Corresponds to the generator element of the GeneratedValue annotation.
- * Set to null to remove the generator element.
- */
- void setGenerator(String generator);
- String GENERATOR_PROPERTY = "generatorProperty";
-
-
- /**
- * Return the {@link TextRange} for the generator element. If the generator element
- * does not exist return the {@link TextRange} for the GeneratedValue annotation.
- */
- TextRange getGeneratorTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the strategy element. If the strategy element
- * does not exist return the {@link TextRange} for the GeneratedValue annotation.
- */
- TextRange getStrategyTextRange(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 6557614932..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GenerationType.java
+++ /dev/null
@@ -1,65 +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.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public enum GenerationType {
-
- TABLE,
- SEQUENCE,
- IDENTITY,
- AUTO;
-
-
- public static GenerationType fromJavaAnnotationValue(Object javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- return null;
- }
- if (javaAnnotationValue.equals(JPA.GENERATION_TYPE__TABLE)) {
- return TABLE;
- }
- if (javaAnnotationValue.equals(JPA.GENERATION_TYPE__SEQUENCE)) {
- return SEQUENCE;
- }
- if (javaAnnotationValue.equals(JPA.GENERATION_TYPE__IDENTITY)) {
- return IDENTITY;
- }
- if (javaAnnotationValue.equals(JPA.GENERATION_TYPE__AUTO)) {
- return AUTO;
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(GenerationType generationType) {
- if (generationType == null) {
- return null;
- }
- switch (generationType) {
- case TABLE :
- return JPA.GENERATION_TYPE__TABLE;
- case SEQUENCE :
- return JPA.GENERATION_TYPE__SEQUENCE;
- case IDENTITY :
- return JPA.GENERATION_TYPE__IDENTITY;
- case AUTO :
- return JPA.GENERATION_TYPE__AUTO;
- default :
- throw new IllegalArgumentException("unknown generation type: " + generationType);
- }
- }
-}
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 808281e829..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratorAnnotation.java
+++ /dev/null
@@ -1,91 +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.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.
- */
-public interface GeneratorAnnotation
- extends JavaResourceNode
-{
- /**
- * Corresponds to the name element of the TableGenerator or SequenceGenerator annotation.
- * Returns null if the name element does not exist in java. If no other memberValuePairs exist
- * the *Generator annotation will be removed as well.
- */
- String getName();
-
- /**
- * Corresponds to the name element of the TableGenerator or SequenceGenerator annotation.
- * Set to null to remove the name element. If no other memberValuePairs exist
- * the *Generator annotation will be removed as well.
- */
- void setName(String name);
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Corresponds to the initialValue element of the TableGenerator or SequenceGenerator annotation.
- * Returns null if the initialValue element does not exist in java. If no other memberValuePairs exist
- * the *Generator annotation will be removed as well.
- */
- Integer getInitialValue();
-
- /**
- * Corresponds to the initialValue element of the TableGenerator or SequenceGenerator annotation.
- * Set to null to remove the initialValue element. If no other memberValuePairs exist
- * the *Generator annotation will be removed as well.
- */
- void setInitialValue(Integer initialValue);
- String INITIAL_VALUE_PROPERTY = "initialValue"; //$NON-NLS-1$
-
- /**
- * Corresponds to the allocationSize element of the TableGenerator or SequenceGenerator annotation.
- * Returns null if the allocationSize element does not exist in java. If no other memberValuePairs exist
- * the *Generator annotation will be removed as well.
- */
- Integer getAllocationSize();
-
- /**
- * Corresponds to the allocationSize element of the TableGenerator or SequenceGenerator annotation.
- * Set to null to remove the allocationSize element. If no other memberValuePairs exist
- * the *Generator annotation will be removed as well.
- */
- void setAllocationSize(Integer allocationSize);
- String ALLOCATION_SIZE_PROPERTY = "allocationSize"; //$NON-NLS-1$
-
- /**
- * Return the {@link TextRange} for the name element. If the name element
- * does not exist return the {@link TextRange} for the *Generator annotation.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the initialValue element. If the initialValue element
- * does not exist return the {@link TextRange} for the *Generator annotation.
- */
- TextRange getInitialValueTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the allocationSize element. If the allocationSize 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 ade5e76a84..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/IdAnnotation.java
+++ /dev/null
@@ -1,25 +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.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface IdAnnotation extends JavaResourceNode
-{
- 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 283aefe3cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/IdClassAnnotation.java
+++ /dev/null
@@ -1,64 +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.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * This interface corresponds to the javax.persistence.IdClass 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.
- */
-public interface IdClassAnnotation extends JavaResourceNode
-{
- final String ANNOTATION_NAME = JPA.ID_CLASS;
-
- /**
- * Corresponds to the value element of the IdClass annotation.
- * Returns null if the value element does not exist in java.
- * Returns the portion of the value preceding the .class.
- * <p>
- * &#64;IdClass(value=Employee.class)
- * </p>
- * will return "Employee"
- **/
- String getValue();
-
- /**
- * Corresponds to the value element of the IdClass annotation.
- * Set to null to remove the value element. This will also remove the IdClass
- * annotation itself.
- */
- void setValue(String value);
- String VALUE_PROPERTY = "valueProperty";
-
- /**
- * Returns the qualified value name as it is resolved in the AST
- * <p>
- * &#64;IdClass(Employee.class)
- * </p>
- * will return "model.Employee" if there is an import for model.Employee
- * @return
- */
- String getFullyQualifiedClass();
- String FULLY_QUALIFIED_CLASS_PROPERTY = "fullyQualifiedClassProperty";
-
- /**
- * Return the {@link TextRange} for the value element. If the value element
- * does not exist return the {@link TextRange} for the IdClass annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
-}
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 89435d2c5b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/InheritanceAnnotation.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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the javax.persistence.Inheritance 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.
- */
-public interface InheritanceAnnotation extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.INHERITANCE;
-
- InheritanceType getStrategy();
-
- void setStrategy(InheritanceType strategy);
- String STRATEGY_PROPERTY = "strategyProperty";
-
- /**
- * Return the {@link TextRange} for the strategy element. If the strategy 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 b25eaa40ee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/InheritanceType.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.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public enum InheritanceType {
-
- SINGLE_TABLE,
- JOINED,
- TABLE_PER_CLASS;
-
-
- public static InheritanceType fromJavaAnnotationValue(Object javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- return null;
- }
- if (javaAnnotationValue.equals(JPA.INHERITANCE_TYPE__SINGLE_TABLE)) {
- return SINGLE_TABLE;
- }
- if (javaAnnotationValue.equals(JPA.INHERITANCE_TYPE__JOINED)) {
- return JOINED;
- }
- if (javaAnnotationValue.equals(JPA.INHERITANCE_TYPE__TABLE_PER_CLASS)) {
- return TABLE_PER_CLASS;
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(InheritanceType inheritanceType) {
- if (inheritanceType == null) {
- return null;
- }
- switch (inheritanceType) {
- case SINGLE_TABLE :
- return JPA.INHERITANCE_TYPE__SINGLE_TABLE;
- case JOINED :
- return JPA.INHERITANCE_TYPE__JOINED;
- case TABLE_PER_CLASS :
- return JPA.INHERITANCE_TYPE__TABLE_PER_CLASS;
- default :
- throw new IllegalArgumentException("unknown inheritance type: " + inheritanceType);
- }
- }
-}
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 25328896bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JPA.java
+++ /dev/null
@@ -1,302 +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.resource.java;
-
-
-/**
- * JPA 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.
- */
-// TODO move to utility?
-@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 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 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 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/JavaResourceNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceNode.java
deleted file mode 100644
index 310fb22ce0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceNode.java
+++ /dev/null
@@ -1,38 +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.java;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-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.
- */
-public interface JavaResourceNode extends Model {
-
- void initialize(CompilationUnit astRoot);
-
- JpaCompilationUnit getJpaCompilationUnit();
-
- IFile getFile();
-
- void update(CompilationUnit astRoot);
-
- TextRange getTextRange(CompilationUnit astRoot);
-
-}
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 a4e37e00b7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentAttribute.java
+++ /dev/null
@@ -1,84 +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.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-//TODO determine how we handle:
-// @Basic
-// private String foo, bar;
-public interface JavaResourcePersistentAttribute
- extends JavaResourcePersistentMember
-{
- String getName();
-
- boolean isForField();
-
- boolean isForProperty();
-
- boolean typeIsBasic();
- String TYPE_IS_BASIC_PROPERTY = "typeIsBasic"; //$NON-NLS-1$
-
- boolean isFinal();
- String FINAL_PROPERTY = "final"; //$NON-NLS-1$
-
- boolean isPublic();
- String PUBLIC_PROPERTY = "public"; //$NON-NLS-1$
-
- boolean typeIsSerializable();
- String TYPE_IS_SERIALIZABLE_PROPERTY = "typeIsSerializable"; //$NON-NLS-1$
-
- boolean typeIsDateOrCalendar();
- String TYPE_IS_DATE_OR_CALENDAR_PROPERTY = "typeIsDateOrCalendar"; //$NON-NLS-1$
-
- /**
- * Return whether the attribute type is a container:
- * java.util.Collection
- * java.util.Set
- * java.util.List
- * java.util.Map
- */
- boolean typeIsContainer();
- String TYPE_IS_CONTAINER_PROPERTY = "typeIsContainer"; //$NON-NLS-1$
-
- /**
- * Return the resolved qualified type name for the attribute.
- */
- String getQualifiedTypeName();
- String QUALIFIED_TYPE_NAME_PROPERTY = "qualifiedTypeName"; //$NON-NLS-1$
-
- /**
- * Return the resolved qualified type name for the attribute
- * if it as valid as a target entity type; i.e. not an array.
- * @see #typeIsContainer()
- */
- String getQualifiedReferenceEntityTypeName();
- String QUALIFIED_REFERENCE_ENTITY_TYPE_NAME_PROPERTY = "qualifiedReferenceEntityTypeName"; //$NON-NLS-1$
-
- /**
- * Return the fully qualified type parameter for use as a target entity.
- */
- String getQualifiedReferenceEntityElementTypeName();
- String QUALIFIED_REFERENCE_ENTITY_ELEMENT_TYPE_NAME_PROPERTY = "qualifiedReferenceEntityElementTypeName"; //$NON-NLS-1$
-
- /**
- * Return whether the attribute has any mapping or non-mapping annotations
- * (of course only persistence-related annotations).
- */
- boolean hasAnyAnnotations();
-
-}
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 4957431d89..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentMember.java
+++ /dev/null
@@ -1,191 +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.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.MethodSignature;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 JavaResourcePersistentMember
- extends JavaResourceNode
-{
-
- // ********** mapping annotations **********
-
- /**
- * Return the member's mapping annotations.
- * Do not return duplicate annotations as this error is handled by the java
- * compiler.
- * @see #supportingAnnotations()
- */
- Iterator<Annotation> mappingAnnotations();
- String MAPPING_ANNOTATIONS_COLLECTION = "mappingAnnotations"; //$NON-NLS-1$
-
- /**
- * Return the number of mapping annotations.
- */
- int mappingAnnotationsSize();
-
- /**
- * Return the member's mapping annotation.
- */
- JavaResourceNode getMappingAnnotation();
-
- /**
- * Return the mapping annotation with the specified name.
- * Return the first if there are duplicates in the source code
- */
- JavaResourceNode getMappingAnnotation(String annotationName);
-
- /**
- * Change the mapping annotation. Remove any existing mapping annotations.
- * Do not remove any non-mapping annotations.
- */
- void setMappingAnnotation(String annotationName);
-
- /**
- * Return a null mapping annotation with the specified name.
- * The corresponding AnnotationDefinition must implement #buildNullAnnotation()
- * {@link AnnotationDefinition#buildNullAnnotation(JavaResourcePersistentMember,
- * org.eclipse.jpt.core.utility.jdt.Member)}
- */
- JavaResourceNode getNullMappingAnnotation(String annotationName);
-
-
- // ********** supporting annotations **********
-
- /**
- * Return the member's supporting annotations.
- * Do not return duplicate annotations as this error is handled by the java
- * compiler. Do not return any mapping annotations.
- * @see #mappingAnnotations()
- */
- Iterator<Annotation> supportingAnnotations();
- String SUPPORTING_ANNOTATIONS_COLLECTION = "supportingAnnotations"; //$NON-NLS-1$
-
- /**
- * Return the number of supporting annotations.
- */
- int supportingAnnotationsSize();
-
- /**
- * Return the specified supporting nested annotations.
- * If both the nestable and container annotations are 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
- ListIterator<NestableAnnotation> supportingAnnotations(String nestableAnnotationName, String containerAnnotationName);
-
- /**
- * Return the specified supporting annotation.
- * Return the first if there are duplicates in the source code.
- */
- JavaResourceNode getSupportingAnnotation(String annotationName);
-
- /**
- * Return the specified supporting 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.
- */
- JavaResourceNode getNonNullSupportingAnnotation(String annotationName);
-
- /**
- * Add a supporting annotation with the specified name.
- */
- JavaResourceNode addSupportingAnnotation(String annotationName);
-
- /**
- * Remove the specified supporting annotation.
- */
- void removeSupportingAnnotation(String annotationName);
-
- /**
- * Add a new supporting 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 annotaion 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.
- */
- JavaResourceNode addSupportingAnnotation(int index, String nestableAnnotationName, String containerAnnotationName);
-
- /**
- * Remove the specified supporting nestable annotation.
- */
- void removeSupportingAnnotation(int index, String nestableAnnotationName, String containerAnnotationName);
-
- /**
- * Move the supporting nestable annotation found in the specified container
- * annotation at the specified source index to the specified target index.
- */
- void moveSupportingAnnotation(int targetIndex, int sourceIndex, String containerAnnotationName);
-
-
- // ********** 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 as being
- * persistent (equivalent to "is mapped").
- */
- boolean isPersisted();
-
- /**
- * Return whether the Java resource persistent member is for the specified
- * member.
- */
- boolean isFor(String memberName, int occurrence);
-
- /**
- * Return whether the Java resource persistent member is for the specified
- * method.
- */
- boolean isFor(MethodSignature methodSignature, int occurrence);
-
- /**
- * Return the text range for the member's name.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
-
- // ********** behavior **********
-
- /**
- * Resolve type information that could be dependent on other files being
- * added or removed.
- */
- 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 6e3b0a814b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentType.java
+++ /dev/null
@@ -1,124 +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.java;
-
-import java.util.Iterator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 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 super class.
- */
- String getSuperClassQualifiedName();
- String SUPER_CLASS_QUALIFIED_NAME_PROPERTY = "superClassQualifiedName"; //$NON-NLS-1$
-
- /**
- * Return whether the type is abstract.
- */
- boolean isAbstract();
- String ABSTRACT_PROPERTY = "abstract"; //$NON-NLS-1$
-
- /**
- * Return tye type's access type ("field" or "property").
- */
- AccessType getAccess();
- String ACCESS_PROPERTY = "access"; //$NON-NLS-1$
-
- /**
- * Return whether the type has any attributes that have
- * JPA annotations on them.
- */
- boolean hasAnyAttributeAnnotations();
-
-
- // ********** 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();
-
- /**
- * Return all the persistable types; the type itself, its children, its
- * grandchildren, etc.
- */
- Iterator<JavaResourcePersistentType> allPersistableTypes();
-
-
- // ********** 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();
-
-
- // ********** methods **********
-
- /**
- * Return the type's methods.
- */
- Iterator<JavaResourcePersistentAttribute> methods();
- String METHODS_COLLECTION = "methods"; //$NON-NLS-1$
-
- /**
- * Return the type's persistable properties.
- */
- Iterator<JavaResourcePersistentAttribute> persistableProperties();
-
-
- // ********** attributes **********
-
- /**
- * Return the type's persistable fields and properties.
- */
- Iterator<JavaResourcePersistentAttribute> persistableAttributes();
-
-}
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 f15a54f458..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnAnnotation.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.core.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.
- */
-public interface JoinColumnAnnotation extends BaseColumnAnnotation
-{
- String ANNOTATION_NAME = JPA.JOIN_COLUMN;
-
- /**
- * Corresponds to the referencedColumnName element of the javax.persistence.JoinColumn annotation.
- * Returns null if the referencedColumnName valuePair does not exist in the annotation
- */
- String getReferencedColumnName();
-
- /**
- * Corresponds to the referencedColumnName element of the javax.persistence.JoinColumn annotation.
- * Set to null to remove the referencedColumnName valuePait from the Annotation
- */
- void setReferencedColumnName(String referencedColumnName);
- String REFERENCED_COLUMN_NAME_PROPERTY = "referencedColumnNameProperty";
-
- /**
- * Return the {@link TextRange} for the referencedColumnName element. If the
- * referencedColumnName element does not exist return the {@link TextRange}
- * for the JoinColumn annotation.
- */
- TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified postition touches the referencedColumnName element.
- * Return false if the referencedColumnName 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/JoinColumnsAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnsAnnotation.java
deleted file mode 100644
index 8be6bced7a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnsAnnotation.java
+++ /dev/null
@@ -1,27 +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.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JoinColumnsAnnotation extends ContainerAnnotation<NestableJoinColumn>
-{
- String ANNOTATION_NAME = JPA.JOIN_COLUMNS;
-
- String JOIN_COLUMNS_LIST = "joinColumnsList";
-
-}
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 38d8df3505..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinTableAnnotation.java
+++ /dev/null
@@ -1,57 +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.java;
-
-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.
- */
-public interface JoinTableAnnotation extends TableAnnotation
-{
- String ANNOTATION_NAME = JPA.JOIN_TABLE;
-
- ListIterator<JoinColumnAnnotation> joinColumns();
-
- JoinColumnAnnotation joinColumnAt(int index);
-
- int indexOfJoinColumn(JoinColumnAnnotation joinColumn);
-
- int joinColumnsSize();
-
- JoinColumnAnnotation addJoinColumn(int index);
-
- void removeJoinColumn(int index);
-
- void moveJoinColumn(int targetIndex, int sourceIndex);
- String JOIN_COLUMNS_LIST = "joinColumnsList";
-
- ListIterator<JoinColumnAnnotation> inverseJoinColumns();
-
- JoinColumnAnnotation inverseJoinColumnAt(int index);
-
- int indexOfInverseJoinColumn(JoinColumnAnnotation joinColumn);
-
- int inverseJoinColumnsSize();
-
- JoinColumnAnnotation addInverseJoinColumn(int index);
-
- void removeInverseJoinColumn(int index);
-
- void moveInverseJoinColumn(int targetIndex, int sourceIndex);
- String INVERSE_JOIN_COLUMNS_LIST = "inverseJoinColumnsList";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JpaCompilationUnit.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JpaCompilationUnit.java
deleted file mode 100644
index ee4988c589..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JpaCompilationUnit.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.utility.CommandExecutorProvider;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 JpaCompilationUnit extends JavaResourceNode {
-
- ICompilationUnit getCompilationUnit();
-
- Iterator<JavaResourcePersistentType> persistableTypes();
-
- JpaAnnotationProvider getAnnotationProvider();
-
- CommandExecutorProvider getModifySharedDocumentCommandExecutorProvider();
-
- AnnotationEditFormatter getAnnotationEditFormatter();
-
- /**
- * Called (via a hook in change notification) whenever anything in the JPA
- * compilation unit changes. Forwarded to the JPA file and on to
- * various listeners (namely the JPA project).
- */
- void resourceModelChanged();
-
- /**
- * Resolve type information that could be dependent on other files being
- * added/removed.
- */
- void resolveTypes();
-
- /**
- * JDT has fired an event indicating a Java element has changed.
- * If it is related to the compilation unit, update it with the changed
- * Java source code.
- */
- void javaElementChanged(ElementChangedEvent event);
-
-}
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 9caedd50f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/LobAnnotation.java
+++ /dev/null
@@ -1,25 +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.java;
-
-/**
- * Corresponds to the javax.persistence.Lob 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.
- */
-public interface LobAnnotation extends JavaResourceNode
-{
- 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 6e5b86205f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToManyAnnotation.java
+++ /dev/null
@@ -1,53 +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.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.
- */
-public interface ManyToManyAnnotation extends RelationshipMappingAnnotation
-{
- String ANNOTATION_NAME = JPA.MANY_TO_MANY;
-
- /**
- * Corresponds to the mappedBy element of the ManyToMany annotation.
- * Returns null if the mappedBy element does not exist in java.
- */
- String getMappedBy();
-
- /**
- * Corresponds to the mappedBy element of the ManyToMany annotation.
- * Set to null to remove the mappedBy element.
- */
- void setMappedBy(String mappedBy);
- String MAPPED_BY_PROPERTY = "mappedByProperty";
-
- /**
- * Return the {@link TextRange} for the mappedBy element. If the mappedBy element
- * does not exist return the {@link TextRange} for the ManyToMany annotation.
- */
- TextRange getMappedByTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified postition touches the mappedBy element.
- * Return false if the mappedBy 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/ManyToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToOneAnnotation.java
deleted file mode 100644
index 4f0d6893e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToOneAnnotation.java
+++ /dev/null
@@ -1,47 +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.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.
- */
-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 = "optionalProperty";
-
- /**
- * 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 0402d37c40..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MapKeyAnnotation.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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the javax.persistence.MapKey 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.
- */
-public interface MapKeyAnnotation extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.MAP_KEY;
-
- String getName();
- void setName(String name);
- String NAME_PROPERTY = "nameProperty";
-
- /**
- * Return the {@link TextRange} for the name element. If the name element
- * does not exist return the {@link TextRange} for the MapKey annotation.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified postition touches the name element.
- * Return false if the name element does not exist.
- */
- public 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 2d1acafaeb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MappedSuperclassAnnotation.java
+++ /dev/null
@@ -1,25 +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.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface MappedSuperclassAnnotation extends JavaResourceNode
-{
- 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 ae9d56c765..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedColumnAnnotation.java
+++ /dev/null
@@ -1,70 +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.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.
- */
-public interface NamedColumnAnnotation extends JavaResourceNode
-{
- /**
- * Corresponds to the name element of the *Column annotation.
- * Returns null if the name valuePair does not exist in the annotation
- */
- String getName();
-
- /**
- * Corresponds to the name element of the *Column annotation.
- * Set to null to remove the name valuePair from the annotation
- */
- void setName(String name);
- String NAME_PROPERTY = "nameProperty";
-
- /**
- * Corresponds to the columnDefinition element of the *Column annotation.
- * Returns null if the columnDefinition valuePair does not exist in the annotation
- */
- String getColumnDefinition();
-
- /**
- * Corresponds to the columnDefinition element of the *Column annotation.
- * Set to null to remove the columnDefinition valuePair from the annotation
- */
- void setColumnDefinition(String columnDefinition);
- String COLUMN_DEFINITION_PROPERTY = "columnDefinitionPropety";
-
- /**
- * Return the {@link TextRange} for the name element. If the name element
- * does not exist return the {@link TextRange} for the *Column annotation.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the columnDefinition element. If the columnDefinition
- * element does not exist return the {@link TextRange} for the *Column annotation.
- */
- TextRange getColumnDefinitionTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified postition touches the name element.
- * Return false if the name 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/NamedNativeQueriesAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueriesAnnotation.java
deleted file mode 100644
index 32916ba956..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueriesAnnotation.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NamedNativeQueriesAnnotation extends ContainerAnnotation<NestableNamedNativeQuery>
-{
- String ANNOTATION_NAME = JPA.NAMED_NATIVE_QUERIES;
-
- String NAMED_NATIVE_QUERIES_LIST = "namedNativeQueriesList";
-}
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 295bd9480d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueryAnnotation.java
+++ /dev/null
@@ -1,71 +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.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-/**
- * Corresponds to the javax.persistence.NamedNativeQuery 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.
- */
-public interface NamedNativeQueryAnnotation extends QueryAnnotation
-{
- String ANNOTATION_NAME = JPA.NAMED_NATIVE_QUERY;
-
- /**
- * Corresponds to the resultClass element of the NamedNativeQuery annotation.
- * Returns null if the resultClass element does not exist in java.
- */
- String getResultClass();
-
- /**
- * Corresponds to the resultClass element of the NamedNativeQuery annotation.
- * Set to null to remove the resultClass element.
- */
- void setResultClass(String resultClass);
- String RESULT_CLASS_PROPERTY = "resultClassProperty";
-
- /**
- * Corresponds to the resultSetMapping element of the NamedNativeQuery annotation.
- * Returns null if the resultSetMapping element does not exist in java.
- */
- String getResultSetMapping();
-
- /**
- * Corresponds to the resultSetMapping element of the NamedNativeQuery annotation.
- * Set to null to remove the resultSetMapping element.
- */
- void setResultSetMapping(String resultSetMapping);
- String RESULT_SET_MAPPING_PROPERTY = "resultSetMappingProperty";
-
- String getFullyQualifiedResultClass();
- String FULLY_QUALIFIED_RESULT_CLASS_PROPERTY = "fullyQualifiedResultClassProperty";
-
- /**
- * Return the {@link TextRange} for the resultClass element. If resultClass element
- * does not exist return the {@link TextRange} for the NamedNativeQuery annotation.
- */
- TextRange getResultClassTextRange(CompilationUnit astRoot);
-
-
- /**
- * Return the {@link TextRange} for the resultSetMapping element. If resultSetMapping 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 c3ddcb2000..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueriesAnnotation.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NamedQueriesAnnotation extends ContainerAnnotation<NestableNamedQuery>
-{
- String ANNOTATION_NAME = JPA.NAMED_QUERIES;
-
- String NAMED_QUERIES_LIST = "namedQueriesList";
-}
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 6da7aabe69..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueryAnnotation.java
+++ /dev/null
@@ -1,25 +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.java;
-
-/**
- * Corresponds to the javax.persistence.NamedQuery 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.
- */
-public interface NamedQueryAnnotation extends QueryAnnotation
-{
- 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 49502da0d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAnnotation.java
+++ /dev/null
@@ -1,33 +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.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NestableAnnotation extends Annotation
-{
- //currently using this when the NestableAnnotation is moved from
- //standalone to nested or from nested to standalone.
- //not the greatest since you have to make sure to call all setter methods
- void initializeFrom(NestableAnnotation oldAnnotation);
-
- /**
- * Should only be called when the NestableAnnotation is actually nested
- * @param newIndex
- */
- void moveAnnotation(int newIndex);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAssociationOverride.java
deleted file mode 100644
index c6c51173b6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAssociationOverride.java
+++ /dev/null
@@ -1,25 +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.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NestableAssociationOverride
- extends AssociationOverrideAnnotation, NestableAnnotation
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAttributeOverride.java
deleted file mode 100644
index e36c20e35c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAttributeOverride.java
+++ /dev/null
@@ -1,25 +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.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NestableAttributeOverride
- extends AttributeOverrideAnnotation, NestableAnnotation
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableJoinColumn.java
deleted file mode 100644
index e3dd4c60d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableJoinColumn.java
+++ /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
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NestableJoinColumn extends JoinColumnAnnotation, NestableAnnotation
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedNativeQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedNativeQuery.java
deleted file mode 100644
index fcd8d07cf9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedNativeQuery.java
+++ /dev/null
@@ -1,25 +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.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NestableNamedNativeQuery
- extends NamedNativeQueryAnnotation, NestableAnnotation
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedQuery.java
deleted file mode 100644
index 1754fe5248..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedQuery.java
+++ /dev/null
@@ -1,25 +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.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NestableNamedQuery
- extends NamedQueryAnnotation, NestableAnnotation
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestablePrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestablePrimaryKeyJoinColumn.java
deleted file mode 100644
index eddbe970d2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestablePrimaryKeyJoinColumn.java
+++ /dev/null
@@ -1,25 +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.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NestablePrimaryKeyJoinColumn
- extends PrimaryKeyJoinColumnAnnotation, NestableAnnotation
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableQueryHint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableQueryHint.java
deleted file mode 100644
index c5f2735638..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableQueryHint.java
+++ /dev/null
@@ -1,25 +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.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NestableQueryHint
- extends QueryHintAnnotation, NestableAnnotation
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableSecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableSecondaryTable.java
deleted file mode 100644
index 633653c430..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableSecondaryTable.java
+++ /dev/null
@@ -1,25 +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.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NestableSecondaryTable
- extends SecondaryTableAnnotation, NestableAnnotation
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableUniqueConstraint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableUniqueConstraint.java
deleted file mode 100644
index 3beccbc357..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableUniqueConstraint.java
+++ /dev/null
@@ -1,25 +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.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NestableUniqueConstraint
- extends UniqueConstraintAnnotation, NestableAnnotation
-{
- // nothing yet
-}
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 3cdea3b24f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToManyAnnotation.java
+++ /dev/null
@@ -1,52 +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.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.
- */
-public interface OneToManyAnnotation extends RelationshipMappingAnnotation
-{
- String ANNOTATION_NAME = JPA.ONE_TO_MANY;
-
- /**
- * Corresponds to the mappedBy element of the OneToMany annotation.
- * Returns null if the mappedBy element does not exist in java.
- */
- String getMappedBy();
-
- /**
- * Corresponds to the mappedBy element of the OneToMany annotation.
- * Set to null to remove the mappedBy element.
- */
- void setMappedBy(String mappedBy);
- String MAPPED_BY_PROPERTY = "mappedByProperty";
-
- /**
- * Return the {@link TextRange} for the mappedBy element. If the mappedBy element
- * does not exist return the {@link TextRange} for the OneToMany annotation.
- */
- TextRange getMappedByTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified postition touches the mappedBy element.
- * Return false if the mappedBy 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/OneToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToOneAnnotation.java
deleted file mode 100644
index aef332057c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToOneAnnotation.java
+++ /dev/null
@@ -1,72 +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.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.
- */
-public interface OneToOneAnnotation extends RelationshipMappingAnnotation
-{
- String ANNOTATION_NAME = JPA.ONE_TO_ONE;
-
- /**
- * Corresponds to the optional element of the OneToOne annotation.
- * Returns null if the optional element does not exist in java.
- */
- Boolean getOptional();
-
- /**
- * Corresponds to the optional element of the OneToOne annotation.
- * Set to null to remove the optional element.
- */
- void setOptional(Boolean optional);
- String OPTIONAL_PROPERTY = "optionalProperty";
-
- /**
- * Corresponds to the mappedBy element of the OneToOne annotation.
- * Returns null if the mappedBy element does not exist in java.
- */
- String getMappedBy();
-
- /**
- * Corresponds to the mappedBy element of the OneToOne annotation.
- * Set to null to remove the mappedBy element.
- */
- void setMappedBy(String mappedBy);
- String MAPPED_BY_PROPERTY = "mappedByProperty";
-
- /**
- * Return the {@link TextRange} for the mappedBy element. If the mappedBy element
- * does not exist return the {@link TextRange} for the OneToOne annotation.
- */
- TextRange getMappedByTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the optional element. If the optional element
- * does not exist return the {@link TextRange} for the OneToOne annotation.
- */
- TextRange getOptionalTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified postition touches the mappedBy element.
- * Return false if the mappedBy 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/OrderByAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OrderByAnnotation.java
deleted file mode 100644
index d72ad6e065..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OrderByAnnotation.java
+++ /dev/null
@@ -1,47 +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.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the javax.persistence.OrderBy 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.
- */
-public interface OrderByAnnotation extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.ORDER_BY;
-
- /**
- * Corresponds to the value element of the javax.persistence.OrderBy annotation.
- * Returns null if the value valuePair does not exist in the annotation
- */
- String getValue();
-
- /**
- * Corresponds to the value element of the javax.persistence.OrderBy annotation.
- * Setting the value to null will not remove the OrderBy annotation
- */
- void setValue(String value);
- String VALUE_PROPERTY = "valueProperty";
-
- /**
- * Return the {@link TextRange} for the value element. If the value 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 eb95480972..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OverrideAnnotation.java
+++ /dev/null
@@ -1,52 +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.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the javax.persistence.AttributeOverride 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.
- */
-public interface OverrideAnnotation extends JavaResourceNode
-{
-
- /**
- * Corresponds to the name element of the AttributeOverride annotation.
- * Returns null if the name element does not exist in java.
- */
- String getName();
-
- /**
- * Corresponds to the name element of the AttributeOverride annotation.
- * Set to null to remove the name element.
- */
- void setName(String name);
- String NAME_PROPERTY = "nameProperty";
-
- /**
- * Return the {@link TextRange} for the name element. If name element
- * does not exist return the {@link TextRange} for the AttributeOverride annotation.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified postition touches the table element.
- * Return false if the table 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/PrimaryKeyJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnAnnotation.java
deleted file mode 100644
index 02a74a1251..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnAnnotation.java
+++ /dev/null
@@ -1,45 +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.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.
- */
-public interface PrimaryKeyJoinColumnAnnotation extends NamedColumnAnnotation
-{
- String ANNOTATION_NAME = JPA.PRIMARY_KEY_JOIN_COLUMN;
-
- String getReferencedColumnName();
-
- void setReferencedColumnName(String referencedColumnName);
- String REFERENCED_COLUMN_NAME_PROPERTY = "referencedColumnNameProperty";
-
- /**
- * Return whether the specified postition touches the referencedColumnName element.
- * Return false if the referencedColumnName element does not exist.
- */
- boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the referencedColumnName element. If the referencedColumnName
- * element does not exist return the {@link TextRange} for the PrimaryKeyJoinColumn annotation.
- */
- TextRange getReferencedColumnNameTextRange(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 3216650ab2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnsAnnotation.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface PrimaryKeyJoinColumnsAnnotation extends ContainerAnnotation<NestablePrimaryKeyJoinColumn>
-{
- String ANNOTATION_NAME = JPA.PRIMARY_KEY_JOIN_COLUMNS;
-
- String PK_JOIN_COLUMNS_LIST = "pkJoinColumnsList";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/QueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/QueryAnnotation.java
deleted file mode 100644
index 3a4defbdc0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/QueryAnnotation.java
+++ /dev/null
@@ -1,62 +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.java;
-
-import java.util.ListIterator;
-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.
- */
-public interface QueryAnnotation extends JavaResourceNode
-{
- String getName();
- void setName(String name);
- String NAME_PROPERTY = "nameProperty";
-
- String getQuery();
- void setQuery(String query);
- String QUERY_PROPERTY = "queryProperty";
-
- ListIterator<QueryHintAnnotation> hints();
-
- QueryHintAnnotation hintAt(int index);
-
- int indexOfHint(QueryHintAnnotation hint);
-
- int hintsSize();
-
- QueryHintAnnotation addHint(int index);
-
- void removeHint(int index);
-
- void moveHint(int targetIndex, int sourceIndex);
- String HINTS_LIST = "hintsList";
-
- /**
- * Return the {@link TextRange} for the name element. If name element
- * does not exist return the {@link TextRange} for the *Query annotation.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the query element. If query element
- * does not exist return the {@link TextRange} for the *Query annotation.
- */
- TextRange getQueryTextRange(CompilationUnit astRoot);
-
-}
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 e948cf1b70..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/QueryHintAnnotation.java
+++ /dev/null
@@ -1,66 +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.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the javax.persistence.QueryHint 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.
- */
-public interface QueryHintAnnotation extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.QUERY_HINT;
-
- /**
- * Corresponds to the name element of the QueryHint annotation.
- * Returns null if the name valuePair does not exist in the annotation
- */
- String getName();
-
- /**
- * Corresponds to the name element of the QueryHint annotation.
- * Setting to null will remove the name valuePair
- */
- void setName(String name);
- String NAME_PROPERTY = "nameProperty";
-
- /**
- * Corresponds to the value element of the QueryHint annotation.
- * Returns null if the value valuePair does not exist in the annotation
- */
- String getValue();
-
- /**
- * Corresponds to the value element of the QueryHint annotation.
- * Setting to null will remove the value valuePair
- */
- void setValue(String value);
- String VALUE_PROPERTY = "valueProperty";
-
- /**
- * Return the {@link TextRange} for the name element. If the name element
- * does not exist return the {@link TextRange} for the QueryHint annotation.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the value element. If the value 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/RelationshipMappingAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/RelationshipMappingAnnotation.java
deleted file mode 100644
index 54b3aeeda8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/RelationshipMappingAnnotation.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.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.
- */
-public interface RelationshipMappingAnnotation extends JavaResourceNode
-{
- /**
- * Corresponds to the targetEntity element of the relationship
- * annotations (ManyToMany, OneToMany, ManyToOne, OneToOne).
- * Returns null if the targetEntity element does not exist in java.
- * Returns the portion of the targetEntity preceding the .class.
- * <p>
- * &#64;ManyToMany(targetEntity=Employee.class)
- * </p>
- * will return "Employee"
- **/
- String getTargetEntity();
-
- /**
- * Corresponds to the targetEntity of the relationship
- * annotations (ManyToMany, OneToMany, ManyToOne, OneToOne).
- * Set to null to remove the targetEntity element.
- */
- void setTargetEntity(String targetEntity);
- String TARGET_ENTITY_PROPERTY = "targetEntityProperty";
-
- /**
- * Returns the qualified targetEntity name as it is resolved in the AST
- * <p>
- * &#64;ManyToMany(targetEntity=Employee.class)
- * </p>
- * will return "model.Employee" if there is an import for model.Employee
- * @return
- */
- String getFullyQualifiedTargetEntity();
- String FULLY_QUALFIEID_TARGET_ENTITY_PROPERTY = "fullyQualifiedTargetEntityProperty";
-
- /**
- * Corresponds to the fetch element of the relationship
- * annotations (ManyToMany, OneToMany, ManyToOne, OneToOne).
- * Returns null if the fetch element does not exist in java.
- */
- FetchType getFetch();
-
- /**
- * Corresponds to the fetch element of the relationship
- * annotations (ManyToMany, OneToMany, ManyToOne, OneToOne).
- * Set to null to remove the fetch element.
- */
- void setFetch(FetchType fetch);
- String FETCH_PROPERTY = "fetchProperty";
-
- boolean isCascadeAll();
- void setCascadeAll(boolean all);
- String CASCADE_ALL_PROPERTY = "cascadeAllProperty";
-
- boolean isCascadeMerge();
- void setCascadeMerge(boolean merge);
- String CASCADE_MERGE_PROPERTY = "cascadeMergeProperty";
-
- boolean isCascadePersist();
- void setCascadePersist(boolean persist);
- String CASCADE_PERSIST_PROPERTY = "cascadePersistProperty";
-
- boolean isCascadeRefresh();
- void setCascadeRefresh(boolean refresh);
- String CASCADE_REFRESH_PROPERTY = "cascadeRefreshProperty";
-
- boolean isCascadeRemove();
- void setCascadeRemove(boolean remove);
- String CASCADE_REMOVE_PROPERTY = "cascadeRemoveProperty";
-
-
- /**
- * Return the {@link TextRange} for the targetEntity element. If the targetEntity element
- * does not exist return the {@link TextRange} for the mapping annotation.
- */
- TextRange getTargetEntityTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the fetch element. If the fetch element
- * does not exist return the {@link TextRange} for the mapping annotation.
- */
- TextRange getFetchTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the cascade element. If the cascade element
- * does not exist return the {@link TextRange} for the 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 99ff95b8ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTableAnnotation.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.resource.java;
-
-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.
- */
-public interface SecondaryTableAnnotation extends TableAnnotation
-{
- String ANNOTATION_NAME = JPA.SECONDARY_TABLE;
-
- ListIterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumns();
-
- PrimaryKeyJoinColumnAnnotation pkJoinColumnAt(int index);
-
- int indexOfPkJoinColumn(PrimaryKeyJoinColumnAnnotation pkJoinColumn);
-
- int pkJoinColumnsSize();
-
- PrimaryKeyJoinColumnAnnotation addPkJoinColumn(int index);
-
- void removePkJoinColumn(int index);
-
- void movePkJoinColumn(int targetIndex, int sourceIndex);
-
- String PK_JOIN_COLUMNS_LIST = "pkJoinColumnsList";
-}
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 39f9c12f0d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTablesAnnotation.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface SecondaryTablesAnnotation extends ContainerAnnotation<NestableSecondaryTable>
-{
- String ANNOTATION_NAME = JPA.SECONDARY_TABLES;
-
- String SECONDARY_TABLES_LIST = "secondaryTablesList";
-}
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 cc7156f515..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SequenceGeneratorAnnotation.java
+++ /dev/null
@@ -1,56 +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.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the javax.persistence.SequenceGenerator 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.
- */
-public interface SequenceGeneratorAnnotation
- extends GeneratorAnnotation
-{
- String ANNOTATION_NAME = JPA.SEQUENCE_GENERATOR;
-
- /**
- * Corresponds to the sequenceName element of the SequenceGenerator annotation.
- * Returns null if the sequenceName element does not exist in java. If no other memberValuePairs exist
- * the SequenceGenerator annotation will be removed as well.
- */
- String getSequenceName();
-
- /**
- * Corresponds to the sequenceName element of the SequenceGenerator annotation.
- * Set to null to remove the sequenceName element. If no other memberValuePairs exist
- * the SequenceGenerator annotation will be removed as well.
- */
- void setSequenceName(String sequenceName);
- String SEQUENCE_NAME_PROPERTY = "sequenceName"; //$NON-NLS-1$
-
- /**
- * Return the {@link TextRange} for the sequenceName element. If the sequenceName 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 sequenceName 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 272c955bc1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableAnnotation.java
+++ /dev/null
@@ -1,93 +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.java;
-
-import java.util.ListIterator;
-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.
- */
-public interface TableAnnotation
- extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.TABLE;
-
- String getName();
- void setName(String name);
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- String getCatalog();
- void setCatalog(String catalog);
- String CATALOG_PROPERTY = "catalog"; //$NON-NLS-1$
-
- String getSchema();
- void setSchema(String schema);
- String SCHEMA_PROPERTY = "schema"; //$NON-NLS-1$
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints();
-
- UniqueConstraintAnnotation uniqueConstraintAt(int index);
-
- int indexOfUniqueConstraint(UniqueConstraintAnnotation uniqueConstraint);
-
- int uniqueConstraintsSize();
-
- UniqueConstraintAnnotation addUniqueConstraint(int index);
-
- void removeUniqueConstraint(int index);
-
- void moveUniqueConstraint(int targetIndex, int sourceIndex);
- String UNIQUE_CONSTRAINTS_LIST = "uniqueConstraints"; //$NON-NLS-1$
-
- /**
- * Return the {@link TextRange} for the name element. If the name element
- * does not exist return the {@link TextRange} for the *Table annotation.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the catalog element. If the catalog element
- * does not exist return the {@link TextRange} for the *Table annotation.
- */
- TextRange getCatalogTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the schema element. If the schema element
- * does not exist return the {@link TextRange} for the *Table annotation.
- */
- TextRange getSchemaTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified postition touches the name element.
- * Return false if the name element does not exist.
- */
- boolean nameTouches(int pos, CompilationUnit astRoot);
-
- /**
- * Return whether the specified postition touches the schema element.
- * Return false if the name element does not exist.
- */
- boolean schemaTouches(int pos, CompilationUnit astRoot);
-
- /**
- * Return whether the specified postition touches the catalog element.
- * Return false if the name element does not exist.
- */
- boolean catalogTouches(int pos, CompilationUnit astRoot);
-
-}
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 da69071bca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableGeneratorAnnotation.java
+++ /dev/null
@@ -1,208 +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.java;
-
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the javax.persistence.TableGenerator 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.
- */
-public interface TableGeneratorAnnotation
- extends GeneratorAnnotation
-{
-
- String ANNOTATION_NAME = JPA.TABLE_GENERATOR;
-
- /**
- * Corresponds to the table element of the TableGenerator annotation.
- * Returns null if the table element does not exist in java. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
- */
- String getTable();
-
- /**
- * Corresponds to the table element of the TableGenerator annotation.
- * Set to null to remove the table element. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
- */
- void setTable(String table);
- String TABLE_PROPERTY = "table"; //$NON-NLS-1$
-
- /**
- * Corresponds to the catalog element of the TableGenerator annotation.
- * Returns null if the catalog element does not exist in java. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
- */
- String getCatalog();
-
- /**
- * Corresponds to the catalog element of the TableGenerator annotation.
- * Set to null to remove the catalog element. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
- */
- void setCatalog(String catalog);
- String CATALOG_PROPERTY = "catalog"; //$NON-NLS-1$
-
- /**
- * Corresponds to the schema element of the TableGenerator annotation.
- * Returns null if the schema element does not exist in java. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
- */
- String getSchema();
-
- /**
- * Corresponds to the schema element of the TableGenerator annotation.
- * Set to null to remove the schema element. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
- */
- void setSchema(String schema);
- String SCHEMA_PROPERTY = "schema"; //$NON-NLS-1$
-
- /**
- * Corresponds to the pkColumnName element of the TableGenerator annotation.
- * Returns null if the pkColumnName element does not exist in java. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
- */
- String getPkColumnName();
-
- /**
- * Corresponds to the pkColumnName element of the TableGenerator annotation.
- * Set to null to remove the pkColumnName element. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
- */
- void setPkColumnName(String pkColumnName);
- String PK_COLUMN_NAME_PROPERTY = "pkColumnName"; //$NON-NLS-1$
-
- /**
- * Corresponds to the valueColumnName element of the TableGenerator annotation.
- * Returns null if the valueColumnName element does not exist in java. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
- */
- String getValueColumnName();
-
- /**
- * Corresponds to the valueColumnName element of the TableGenerator annotation.
- * Set to null to remove the valueColumnName element. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
- */
- void setValueColumnName(String valueColumnName);
- String VALUE_COLUMN_NAME_PROPERTY = "valueColumnName"; //$NON-NLS-1$
-
- /**
- * Corresponds to the pkColumnValue element of the TableGenerator annotation.
- * Returns null if the pkColumnValue element does not exist in java. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
- */
- String getPkColumnValue();
-
- /**
- * Corresponds to the pkColumnValue element of the TableGenerator annotation.
- * Set to null to remove the pkColumnValue element. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
- */
- void setPkColumnValue(String pkColumnValue);
- String PK_COLUMN_VALUE_PROPERTY = "pkColumnValue"; //$NON-NLS-1$
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints();
-
- UniqueConstraintAnnotation uniqueConstraintAt(int index);
-
- int indexOfUniqueConstraint(UniqueConstraintAnnotation uniqueConstraint);
-
- int uniqueConstraintsSize();
-
- UniqueConstraintAnnotation addUniqueConstraint(int index);
-
- void removeUniqueConstraint(int index);
-
- void moveUniqueConstraint(int targetIndex, int sourceIndex);
- String UNIQUE_CONSTRAINTS_LIST = "uniqueConstraints"; //$NON-NLS-1$
-
- /**
- * Return the {@link TextRange} for the table element. If the table 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 table element does not exist.
- */
- boolean tableTouches(int pos, CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the catalog element. If the catalog 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 catalog element does not exist.
- */
- boolean catalogTouches(int pos, CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the schema element. If the schema 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 schema element does not exist.
- */
- boolean schemaTouches(int pos, CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the pkColumnName element. If the pkColumnName 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 pkColumnName element does not exist.
- */
- boolean pkColumnNameTouches(int pos, CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the valueColumnName element. If the valueColumnName 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 valueColumnName element does not exist.
- */
- boolean valueColumnNameTouches(int pos, CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the pkColumnValue element. If the pkColumnValue 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 pkColumnValue element does not exist.
- */
- boolean pkColumnValueTouches(int pos, CompilationUnit astRoot);
-
-}
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 3f9edbb174..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TemporalAnnotation.java
+++ /dev/null
@@ -1,47 +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.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the javax.persistence.Temporal 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.
- */
-public interface TemporalAnnotation extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.TEMPORAL;
-
- /**
- * Corresponds to the value element of the Temporal annotation.
- * Returns null if the value element does not exist in java.
- */
- TemporalType getValue();
-
- /**
- * Corresponds to the value element of the Temporal annotation.
- * Set to null to remove the value element.
- */
- void setValue(TemporalType value);
- String VALUE_PROPERTY = "valueProperty";
-
- /**
- * Return the {@link TextRange} for the value element. If the value 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 d658f4389c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TemporalType.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.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public enum TemporalType {
-
- DATE,
- TIME,
- TIMESTAMP;
-
-
- public static TemporalType fromJavaAnnotationValue(Object javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- return null;
- }
- if (javaAnnotationValue.equals(JPA.TEMPORAL_TYPE__DATE)) {
- return DATE;
- }
- if (javaAnnotationValue.equals(JPA.TEMPORAL_TYPE__TIME)) {
- return TIME;
- }
- if (javaAnnotationValue.equals(JPA.TEMPORAL_TYPE__TIMESTAMP)) {
- return TIMESTAMP;
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(TemporalType temporalType) {
- if (temporalType == null) {
- return null;
- }
- switch (temporalType) {
- case DATE :
- return JPA.TEMPORAL_TYPE__DATE;
- case TIME :
- return JPA.TEMPORAL_TYPE__TIME;
- case TIMESTAMP :
- return JPA.TEMPORAL_TYPE__TIMESTAMP;
- default :
- throw new IllegalArgumentException("unknown temporal type: " + temporalType);
- }
- }
-}
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 5b83a4a4df..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TransientAnnotation.java
+++ /dev/null
@@ -1,25 +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.java;
-
-/**
- * Corresponds to the javax.persistence.Transient 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.
- */
-public interface TransientAnnotation extends JavaResourceNode
-{
- 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 83f19e0f93..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/UniqueConstraintAnnotation.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.core.resource.java;
-
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-
-/**
- * Corresponds to the javax.persistence.UniqueConstraint 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.
- */
-public interface UniqueConstraintAnnotation extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.UNIQUE_CONSTRAINT;
-
- ListIterator<String> columnNames();
-
- int columnNamesSize();
-
- void addColumnName(String columnName);
-
- void addColumnName(int index, String columnName);
-
- void removeColumnName(String columnName);
-
- void removeColumnName(int index);
-
- void moveColumnName(int targetIndex, int sourceIndex);
- String COLUMN_NAMES_LIST = "columnNames"; //$NON-NLS-1$
-
- /**
- * Return whether the specified postition touches the columnNames element.
- * Return false if the columnNames 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 03583a5cf3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/VersionAnnotation.java
+++ /dev/null
@@ -1,25 +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.java;
-
-/**
- * Corresponds to the javax.persistence.Version 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.
- */
-public interface VersionAnnotation extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.VERSION;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAbstractColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAbstractColumn.java
deleted file mode 100644
index 96a1fef117..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAbstractColumn.java
+++ /dev/null
@@ -1,512 +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.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.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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 -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlAbstractColumn()
- * @model kind="class" abstract="true"
- * @generated
- */
-public abstract class AbstractXmlAbstractColumn extends AbstractXmlNamedColumn implements XmlAbstractColumn
-{
- /**
- * 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 AbstractXmlAbstractColumn()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ABSTRACT_XML_ABSTRACT_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#getXmlAbstractColumn_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.AbstractXmlAbstractColumn#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_ABSTRACT_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#getXmlAbstractColumn_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.AbstractXmlAbstractColumn#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_ABSTRACT_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#getXmlAbstractColumn_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.AbstractXmlAbstractColumn#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_ABSTRACT_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#getXmlAbstractColumn_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.AbstractXmlAbstractColumn#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_ABSTRACT_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#getXmlAbstractColumn_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.AbstractXmlAbstractColumn#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_ABSTRACT_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_ABSTRACT_COLUMN__INSERTABLE:
- return getInsertable();
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__NULLABLE:
- return getNullable();
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__TABLE:
- return getTable();
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__UNIQUE:
- return getUnique();
- case OrmPackage.ABSTRACT_XML_ABSTRACT_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_ABSTRACT_COLUMN__INSERTABLE:
- setInsertable((Boolean)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__NULLABLE:
- setNullable((Boolean)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__TABLE:
- setTable((String)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__UNIQUE:
- setUnique((Boolean)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_ABSTRACT_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_ABSTRACT_COLUMN__INSERTABLE:
- setInsertable(INSERTABLE_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__NULLABLE:
- setNullable(NULLABLE_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__TABLE:
- setTable(TABLE_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__UNIQUE:
- setUnique(UNIQUE_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_ABSTRACT_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_ABSTRACT_COLUMN__INSERTABLE:
- return INSERTABLE_EDEFAULT == null ? insertable != null : !INSERTABLE_EDEFAULT.equals(insertable);
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__NULLABLE:
- return NULLABLE_EDEFAULT == null ? nullable != null : !NULLABLE_EDEFAULT.equals(nullable);
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__TABLE:
- return TABLE_EDEFAULT == null ? table != null : !TABLE_EDEFAULT.equals(table);
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__UNIQUE:
- return UNIQUE_EDEFAULT == null ? unique != null : !UNIQUE_EDEFAULT.equals(unique);
- case OrmPackage.ABSTRACT_XML_ABSTRACT_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 == XmlAbstractColumn.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__INSERTABLE: return OrmPackage.XML_ABSTRACT_COLUMN__INSERTABLE;
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__NULLABLE: return OrmPackage.XML_ABSTRACT_COLUMN__NULLABLE;
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__TABLE: return OrmPackage.XML_ABSTRACT_COLUMN__TABLE;
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__UNIQUE: return OrmPackage.XML_ABSTRACT_COLUMN__UNIQUE;
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__UPDATABLE: return OrmPackage.XML_ABSTRACT_COLUMN__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 == XmlAbstractColumn.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ABSTRACT_COLUMN__INSERTABLE: return OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__INSERTABLE;
- case OrmPackage.XML_ABSTRACT_COLUMN__NULLABLE: return OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__NULLABLE;
- case OrmPackage.XML_ABSTRACT_COLUMN__TABLE: return OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__TABLE;
- case OrmPackage.XML_ABSTRACT_COLUMN__UNIQUE: return OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__UNIQUE;
- case OrmPackage.XML_ABSTRACT_COLUMN__UPDATABLE: return OrmPackage.ABSTRACT_XML_ABSTRACT_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(" (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(OrmXmlMapper.TABLE);
- }
-} // AbstractXmlAbstractColumn
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 6795010bbe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAttributeMapping.java
+++ /dev/null
@@ -1,200 +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.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.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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
-{
- /**
- * 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>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__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__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__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__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getNameTextRange() {
- return getAttributeTextRange(OrmXmlMapper.NAME);
- }
-
-} // AbstractXmlAttributeMapping
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlBaseTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlBaseTable.java
deleted file mode 100644
index 564aef08fa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlBaseTable.java
+++ /dev/null
@@ -1,410 +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.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.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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 -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlBaseTable()
- * @model kind="class" abstract="true"
- * @generated
- */
-public abstract class AbstractXmlBaseTable extends AbstractJpaEObject implements XmlBaseTable
-{
- /**
- * 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 AbstractXmlBaseTable()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ABSTRACT_XML_BASE_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#getXmlBaseTable_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.AbstractXmlBaseTable#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_BASE_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#getXmlBaseTable_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.AbstractXmlBaseTable#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_BASE_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#getXmlBaseTable_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.AbstractXmlBaseTable#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_BASE_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#getXmlBaseTable_UniqueConstraints()
- * @model containment="true"
- * @generated
- */
- public EList<XmlUniqueConstraint> getUniqueConstraints()
- {
- if (uniqueConstraints == null)
- {
- uniqueConstraints = new EObjectContainmentEList<XmlUniqueConstraint>(XmlUniqueConstraint.class, this, OrmPackage.ABSTRACT_XML_BASE_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_BASE_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_BASE_TABLE__NAME:
- return getName();
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__CATALOG:
- return getCatalog();
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__SCHEMA:
- return getSchema();
- case OrmPackage.ABSTRACT_XML_BASE_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_BASE_TABLE__NAME:
- setName((String)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__CATALOG:
- setCatalog((String)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__SCHEMA:
- setSchema((String)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_BASE_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_BASE_TABLE__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__CATALOG:
- setCatalog(CATALOG_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__SCHEMA:
- setSchema(SCHEMA_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_BASE_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_BASE_TABLE__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__CATALOG:
- return CATALOG_EDEFAULT == null ? catalog != null : !CATALOG_EDEFAULT.equals(catalog);
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__SCHEMA:
- return SCHEMA_EDEFAULT == null ? schema != null : !SCHEMA_EDEFAULT.equals(schema);
- case OrmPackage.ABSTRACT_XML_BASE_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(OrmXmlMapper.NAME);
- }
-
- public TextRange getCatalogTextRange() {
- return getAttributeTextRange(OrmXmlMapper.CATALOG);
- }
-
- public TextRange getSchemaTextRange() {
- return getAttributeTextRange(OrmXmlMapper.SCHEMA);
- }
-
-} // AbstractXmlBaseTable
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 665e82277e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlNamedColumn.java
+++ /dev/null
@@ -1,267 +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.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.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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 -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlNamedColumn()
- * @model kind="class" abstract="true"
- * @generated
- */
-public abstract class AbstractXmlNamedColumn extends AbstractJpaEObject implements XmlNamedColumn
-{
- /**
- * 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#getXmlNamedColumn_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#getXmlNamedColumn_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(OrmXmlMapper.NAME);
- }
-
-} // AbstractXmlNamedColumn
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 42f0ded60f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlTypeMapping.java
+++ /dev/null
@@ -1,516 +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 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.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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 -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getClassName <em>Class Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getAccess <em>Access</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getMetadataComplete <em>Metadata Complete</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getDescription <em>Description</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getAttributes <em>Attributes</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlTypeMapping()
- * @model kind="class" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public abstract class AbstractXmlTypeMapping 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;
-
- /**
- * 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 #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#getAbstractXmlTypeMapping_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 default value is <code>"PROPERTY"</code>.
- * 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#getAbstractXmlTypeMapping_Access()
- * @model default="PROPERTY"
- * @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#getAbstractXmlTypeMapping_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#getAbstractXmlTypeMapping_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#getAbstractXmlTypeMapping_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__CLASS_NAME:
- return getClassName();
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ACCESS:
- return getAccess();
- 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__CLASS_NAME:
- setClassName((String)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ACCESS:
- setAccess((AccessType)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__CLASS_NAME:
- setClassName(CLASS_NAME_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ACCESS:
- setAccess(ACCESS_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__CLASS_NAME:
- return CLASS_NAME_EDEFAULT == null ? className != null : !CLASS_NAME_EDEFAULT.equals(className);
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ACCESS:
- return access != ACCESS_EDEFAULT;
- 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(" (className: ");
- result.append(className);
- result.append(", access: ");
- result.append(access);
- result.append(", metadataComplete: ");
- result.append(metadataComplete);
- result.append(", description: ");
- result.append(description);
- result.append(')');
- return result.toString();
- }
-
-
- public TextRange getClassTextRange() {
- return getAttributeTextRange(OrmXmlMapper.CLASS);
- }
-
- public TextRange getAttributesTextRange() {
- return getAttributeTextRange(OrmXmlMapper.ATTRIBUTES);
- }
-
-} // 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 1652866cbe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Attributes.java
+++ /dev/null
@@ -1,658 +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.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.ListIterator;
-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.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * <!-- 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"
- * @extends JpaEObject
- * @generated
- */
-public class Attributes extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * 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>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__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__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__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__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__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);
- }
-
- public List<XmlAttributeMapping> getAttributeMappings() {
- List<XmlAttributeMapping> attributeMappings = new ArrayList<XmlAttributeMapping>();
- ListIterator<XmlId> ids = new CloneListIterator<XmlId>(this.getIds());//prevent ConcurrentModificiationException
- for (XmlId mapping : CollectionTools.iterable(ids)) {
- attributeMappings.add(mapping);
- }
- ListIterator<XmlEmbeddedId> embeddedIds = new CloneListIterator<XmlEmbeddedId>(this.getEmbeddedIds());//prevent ConcurrentModificiationException
- for (XmlEmbeddedId mapping : CollectionTools.iterable(embeddedIds)) {
- attributeMappings.add(mapping);
- }
- ListIterator<XmlBasic> basics = new CloneListIterator<XmlBasic>(this.getBasics());//prevent ConcurrentModificiationException
- for (XmlBasic mapping : CollectionTools.iterable(basics)) {
- attributeMappings.add(mapping);
- }
- ListIterator<XmlVersion> versions = new CloneListIterator<XmlVersion>(this.getVersions());//prevent ConcurrentModificiationException
- for (XmlVersion mapping : CollectionTools.iterable(versions)) {
- attributeMappings.add(mapping);
- }
- ListIterator<XmlManyToOne> manyToOnes = new CloneListIterator<XmlManyToOne>(this.getManyToOnes());//prevent ConcurrentModificiationException
- for (XmlManyToOne mapping : CollectionTools.iterable(manyToOnes)) {
- attributeMappings.add(mapping);
- }
- ListIterator<XmlOneToMany> oneToManys = new CloneListIterator<XmlOneToMany>(this.getOneToManys());//prevent ConcurrentModificiationException
- for (XmlOneToMany mapping : CollectionTools.iterable(oneToManys)) {
- attributeMappings.add(mapping);
- }
- ListIterator<XmlOneToOne> oneToOnes = new CloneListIterator<XmlOneToOne>(this.getOneToOnes());//prevent ConcurrentModificiationException
- for (XmlOneToOne mapping : CollectionTools.iterable(oneToOnes)) {
- attributeMappings.add(mapping);
- }
- ListIterator<XmlManyToMany> manyToManys = new CloneListIterator<XmlManyToMany>(this.getManyToManys());//prevent ConcurrentModificiationException
- for (XmlManyToMany mapping : CollectionTools.iterable(manyToManys)) {
- attributeMappings.add(mapping);
- }
- ListIterator<XmlEmbedded> embeddeds = new CloneListIterator<XmlEmbedded>(this.getEmbeddeds());//prevent ConcurrentModificiationException
- for (XmlEmbedded mapping : CollectionTools.iterable(embeddeds)) {
- attributeMappings.add(mapping);
- }
- ListIterator<XmlTransient> transients = new CloneListIterator<XmlTransient>(this.getTransients());//prevent ConcurrentModificiationException
- for (XmlTransient mapping : CollectionTools.iterable(transients)) {
- attributeMappings.add(mapping);
- }
- return attributeMappings;
- }
-
-} // Attributes
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/BaseXmlEmbedded.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/BaseXmlEmbedded.java
deleted file mode 100644
index f8beba9e1f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/BaseXmlEmbedded.java
+++ /dev/null
@@ -1,54 +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.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-
-/**
- * <!-- 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 -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.BaseXmlEmbedded#getAttributeOverrides <em>Attribute Overrides</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getBaseXmlEmbedded()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface BaseXmlEmbedded extends XmlAttributeMapping
-{
- /**
- * 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#getBaseXmlEmbedded_AttributeOverrides()
- * @model containment="true"
- * @generated
- */
- EList<XmlAttributeOverride> getAttributeOverrides();
-
-} // BaseXmlEmbedded
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 3de53f776c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/CascadeType.java
+++ /dev/null
@@ -1,173 +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 org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface CascadeType extends JpaEObject
-{
- /**
- * 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
- */
- boolean isCascadeAll();
-
- /**
- * 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
- */
- void setCascadeAll(boolean value);
-
- /**
- * 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
- */
- boolean isCascadePersist();
-
- /**
- * 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
- */
- void setCascadePersist(boolean value);
-
- /**
- * 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
- */
- boolean isCascadeMerge();
-
- /**
- * 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
- */
- void setCascadeMerge(boolean value);
-
- /**
- * 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
- */
- boolean isCascadeRemove();
-
- /**
- * 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
- */
- void setCascadeRemove(boolean value);
-
- /**
- * 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
- */
- boolean isCascadeRefresh();
-
- /**
- * 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
- */
- void setCascadeRefresh(boolean value);
-
-} // CascadeType
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/CascadeTypeImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/CascadeTypeImpl.java
deleted file mode 100644
index e016287be0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/CascadeTypeImpl.java
+++ /dev/null
@@ -1,462 +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 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.common.AbstractJpaEObject;
-
-/**
- * <!-- 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 -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeTypeImpl()
- * @model kind="class"
- * @generated
- */
-public class CascadeTypeImpl extends AbstractJpaEObject implements CascadeType
-{
- /**
- * 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 CascadeTypeImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.CASCADE_TYPE_IMPL;
- }
-
- /**
- * 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.CascadeTypeImpl#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_IMPL__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.CascadeTypeImpl#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_IMPL__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.CascadeTypeImpl#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_IMPL__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.CascadeTypeImpl#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_IMPL__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.CascadeTypeImpl#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_IMPL__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_IMPL__CASCADE_ALL:
- return isCascadeAll() ? Boolean.TRUE : Boolean.FALSE;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_PERSIST:
- return isCascadePersist() ? Boolean.TRUE : Boolean.FALSE;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_MERGE:
- return isCascadeMerge() ? Boolean.TRUE : Boolean.FALSE;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_REMOVE:
- return isCascadeRemove() ? Boolean.TRUE : Boolean.FALSE;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_REFRESH:
- return isCascadeRefresh() ? Boolean.TRUE : Boolean.FALSE;
- }
- 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_IMPL__CASCADE_ALL:
- setCascadeAll(((Boolean)newValue).booleanValue());
- return;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_PERSIST:
- setCascadePersist(((Boolean)newValue).booleanValue());
- return;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_MERGE:
- setCascadeMerge(((Boolean)newValue).booleanValue());
- return;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_REMOVE:
- setCascadeRemove(((Boolean)newValue).booleanValue());
- return;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_REFRESH:
- setCascadeRefresh(((Boolean)newValue).booleanValue());
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_ALL:
- setCascadeAll(CASCADE_ALL_EDEFAULT);
- return;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_PERSIST:
- setCascadePersist(CASCADE_PERSIST_EDEFAULT);
- return;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_MERGE:
- setCascadeMerge(CASCADE_MERGE_EDEFAULT);
- return;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_REMOVE:
- setCascadeRemove(CASCADE_REMOVE_EDEFAULT);
- return;
- case OrmPackage.CASCADE_TYPE_IMPL__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_IMPL__CASCADE_ALL:
- return cascadeAll != CASCADE_ALL_EDEFAULT;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_PERSIST:
- return cascadePersist != CASCADE_PERSIST_EDEFAULT;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_MERGE:
- return cascadeMerge != CASCADE_MERGE_EDEFAULT;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_REMOVE:
- return cascadeRemove != CASCADE_REMOVE_EDEFAULT;
- case OrmPackage.CASCADE_TYPE_IMPL__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(" (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();
- }
-
-} // CascadeType
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 814febfcf4..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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.common.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 3650410064..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/ColumnResult.java
+++ /dev/null
@@ -1,202 +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 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.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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();
- }
-
-} // 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 b1c58f2959..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityListener.java
+++ /dev/null
@@ -1,799 +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 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.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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>
- * <li>{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPrePersist <em>Pre Persist</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPostPersist <em>Post Persist</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPreRemove <em>Pre Remove</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPostRemove <em>Post Remove</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPreUpdate <em>Pre Update</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPostUpdate <em>Post Update</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPostLoad <em>Post Load</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityListener()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class EntityListener 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;
-
- /**
- * 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;
-
- /**
- * <!-- 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#getEntityListener_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#getEntityListener_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#getEntityListener_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#getEntityListener_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#getEntityListener_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#getEntityListener_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#getEntityListener_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));
- }
-
- /**
- * <!-- 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__CLASS_NAME:
- return getClassName();
- 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();
- }
- 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__CLASS_NAME:
- setClassName((String)newValue);
- return;
- 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;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ENTITY_LISTENER__CLASS_NAME:
- setClassName(CLASS_NAME_EDEFAULT);
- return;
- 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;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ENTITY_LISTENER__CLASS_NAME:
- return CLASS_NAME_EDEFAULT == null ? className != null : !CLASS_NAME_EDEFAULT.equals(className);
- 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;
- }
- 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();
- }
-
-} // EntityListener
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 5fd96f844a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityListeners.java
+++ /dev/null
@@ -1,185 +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.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.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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);
- }
-
-} // 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 8f7e2cb8d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityResult.java
+++ /dev/null
@@ -1,338 +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.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.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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();
- }
-
-} // 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 5c664a8aff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EventMethod.java
+++ /dev/null
@@ -1,202 +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 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.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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"
- * @extends JpaEObject
- * @generated
- */
-public class EventMethod extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * 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>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__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__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__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__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(" (methodName: ");
- result.append(methodName);
- result.append(')');
- return result.toString();
- }
-
-} // EventMethod
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 9cca71e590..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/FieldResult.java
+++ /dev/null
@@ -1,270 +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 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.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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();
- }
-
-} // 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 a57e43cbfb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Inheritance.java
+++ /dev/null
@@ -1,202 +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 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.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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();
- }
-
-} // 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/Lob.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Lob.java
deleted file mode 100644
index 2426020bef..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.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 8c45c94d91..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/MapKey.java
+++ /dev/null
@@ -1,65 +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 org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface MapKey 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#getMapKey_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.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
- */
- void setName(String value);
-
-} // MapKey
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/MapKeyImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/MapKeyImpl.java
deleted file mode 100644
index 824ab2a552..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/MapKeyImpl.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.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.common.AbstractJpaEObject;
-
-/**
- * <!-- 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 -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getMapKeyImpl()
- * @model kind="class"
- * @generated
- */
-public class MapKeyImpl extends AbstractJpaEObject implements MapKey
-{
- /**
- * 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 MapKeyImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.MAP_KEY_IMPL;
- }
-
- /**
- * 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.MapKeyImpl#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_IMPL__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_IMPL__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_IMPL__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_IMPL__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_IMPL__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();
- }
-
-} // 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 a23597aba0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmFactory.java
+++ /dev/null
@@ -1,1047 +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 org.eclipse.emf.common.util.Enumerator;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.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_ENTITY_MAPPINGS: return (EObject)createXmlEntityMappings();
- case OrmPackage.XML_PERSISTENCE_UNIT_METADATA: return (EObject)createXmlPersistenceUnitMetadata();
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS: return (EObject)createXmlPersistenceUnitDefaults();
- case OrmPackage.XML_MAPPED_SUPERCLASS: return (EObject)createXmlMappedSuperclass();
- case OrmPackage.XML_ENTITY: return (EObject)createXmlEntity();
- case OrmPackage.XML_EMBEDDABLE: return (EObject)createXmlEmbeddable();
- case OrmPackage.ATTRIBUTES: return (EObject)createAttributes();
- case OrmPackage.XML_ID_IMPL: return (EObject)createXmlIdImpl();
- case OrmPackage.XML_EMBEDDED_ID_IMPL: return (EObject)createXmlEmbeddedIdImpl();
- case OrmPackage.XML_EMBEDDED_IMPL: return (EObject)createXmlEmbeddedImpl();
- case OrmPackage.XML_BASIC_IMPL: return (EObject)createXmlBasicImpl();
- case OrmPackage.XML_VERSION_IMPL: return (EObject)createXmlVersionImpl();
- case OrmPackage.XML_MANY_TO_ONE_IMPL: return (EObject)createXmlManyToOneImpl();
- case OrmPackage.XML_ONE_TO_MANY_IMPL: return (EObject)createXmlOneToManyImpl();
- case OrmPackage.XML_ONE_TO_ONE_IMPL: return (EObject)createXmlOneToOneImpl();
- case OrmPackage.XML_MANY_TO_MANY_IMPL: return (EObject)createXmlManyToManyImpl();
- case OrmPackage.XML_TRANSIENT_IMPL: return (EObject)createXmlTransientImpl();
- case OrmPackage.XML_ASSOCIATION_OVERRIDE_IMPL: return (EObject)createXmlAssociationOverrideImpl();
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE_IMPL: return (EObject)createXmlAttributeOverrideImpl();
- case OrmPackage.CASCADE_TYPE_IMPL: return (EObject)createCascadeTypeImpl();
- case OrmPackage.XML_COLUMN_IMPL: return (EObject)createXmlColumnImpl();
- case OrmPackage.COLUMN_RESULT: return (EObject)createColumnResult();
- case OrmPackage.XML_DISCRIMINATOR_COLUMN: return (EObject)createXmlDiscriminatorColumn();
- case OrmPackage.ENTITY_LISTENERS: return (EObject)createEntityListeners();
- case OrmPackage.ENTITY_LISTENER: return (EObject)createEntityListener();
- case OrmPackage.ENTITY_RESULT: return (EObject)createEntityResult();
- case OrmPackage.EVENT_METHOD: return (EObject)createEventMethod();
- case OrmPackage.FIELD_RESULT: return (EObject)createFieldResult();
- case OrmPackage.XML_GENERATED_VALUE_IMPL: return (EObject)createXmlGeneratedValueImpl();
- case OrmPackage.XML_ID_CLASS: return (EObject)createXmlIdClass();
- case OrmPackage.INHERITANCE: return (EObject)createInheritance();
- case OrmPackage.XML_JOIN_COLUMN_IMPL: return (EObject)createXmlJoinColumnImpl();
- case OrmPackage.XML_JOIN_TABLE_IMPL: return (EObject)createXmlJoinTableImpl();
- case OrmPackage.LOB: return (EObject)createLob();
- case OrmPackage.MAP_KEY_IMPL: return (EObject)createMapKeyImpl();
- case OrmPackage.XML_NAMED_NATIVE_QUERY: return (EObject)createXmlNamedNativeQuery();
- case OrmPackage.XML_NAMED_QUERY: return (EObject)createXmlNamedQuery();
- 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_IMPL: return (EObject)createXmlPrimaryKeyJoinColumnImpl();
- case OrmPackage.XML_QUERY_HINT: return (EObject)createXmlQueryHint();
- case OrmPackage.XML_TABLE: return (EObject)createXmlTable();
- case OrmPackage.XML_SECONDARY_TABLE_IMPL: return (EObject)createXmlSecondaryTableImpl();
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL: return (EObject)createXmlSequenceGeneratorImpl();
- case OrmPackage.SQL_RESULT_SET_MAPPING: return (EObject)createSqlResultSetMapping();
- case OrmPackage.XML_TABLE_GENERATOR_IMPL: return (EObject)createXmlTableGeneratorImpl();
- case OrmPackage.XML_UNIQUE_CONSTRAINT_IMPL: return (EObject)createXmlUniqueConstraintImpl();
- 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);
- case OrmPackage.DISCRIMINATOR_VALUE:
- return createDiscriminatorValueFromString(eDataType, initialValue);
- case OrmPackage.ENUMERATED:
- return createEnumeratedFromString(eDataType, initialValue);
- case OrmPackage.ORDER_BY:
- return createOrderByFromString(eDataType, initialValue);
- case OrmPackage.VERSION_TYPE:
- return createVersionTypeFromString(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);
- case OrmPackage.DISCRIMINATOR_VALUE:
- return convertDiscriminatorValueToString(eDataType, instanceValue);
- case OrmPackage.ENUMERATED:
- return convertEnumeratedToString(eDataType, instanceValue);
- case OrmPackage.ORDER_BY:
- return convertOrderByToString(eDataType, instanceValue);
- case OrmPackage.VERSION_TYPE:
- return convertVersionTypeToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlEntityMappings createXmlEntityMappings()
- {
- XmlEntityMappings xmlEntityMappings = new XmlEntityMappings();
- return xmlEntityMappings;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPersistenceUnitMetadata createXmlPersistenceUnitMetadata()
- {
- XmlPersistenceUnitMetadata xmlPersistenceUnitMetadata = new XmlPersistenceUnitMetadata();
- return xmlPersistenceUnitMetadata;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPersistenceUnitDefaults createXmlPersistenceUnitDefaults()
- {
- XmlPersistenceUnitDefaults xmlPersistenceUnitDefaults = new XmlPersistenceUnitDefaults();
- return xmlPersistenceUnitDefaults;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlMappedSuperclass createXmlMappedSuperclass()
- {
- XmlMappedSuperclass xmlMappedSuperclass = new XmlMappedSuperclass();
- return xmlMappedSuperclass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlEntity createXmlEntity()
- {
- XmlEntity xmlEntity = new XmlEntity();
- return xmlEntity;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlEmbeddable createXmlEmbeddable()
- {
- XmlEmbeddable xmlEmbeddable = new XmlEmbeddable();
- return xmlEmbeddable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Attributes createAttributes()
- {
- Attributes attributes = new Attributes();
- return attributes;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlIdImpl createXmlIdImpl()
- {
- XmlIdImpl xmlIdImpl = new XmlIdImpl();
- return xmlIdImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlEmbeddedIdImpl createXmlEmbeddedIdImpl()
- {
- XmlEmbeddedIdImpl xmlEmbeddedIdImpl = new XmlEmbeddedIdImpl();
- return xmlEmbeddedIdImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlBasicImpl createXmlBasicImpl()
- {
- XmlBasicImpl xmlBasicImpl = new XmlBasicImpl();
- return xmlBasicImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlVersionImpl createXmlVersionImpl()
- {
- XmlVersionImpl xmlVersionImpl = new XmlVersionImpl();
- return xmlVersionImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlManyToOneImpl createXmlManyToOneImpl()
- {
- XmlManyToOneImpl xmlManyToOneImpl = new XmlManyToOneImpl();
- return xmlManyToOneImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlOneToManyImpl createXmlOneToManyImpl()
- {
- XmlOneToManyImpl xmlOneToManyImpl = new XmlOneToManyImpl();
- return xmlOneToManyImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlOneToOneImpl createXmlOneToOneImpl()
- {
- XmlOneToOneImpl xmlOneToOneImpl = new XmlOneToOneImpl();
- return xmlOneToOneImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlManyToManyImpl createXmlManyToManyImpl()
- {
- XmlManyToManyImpl xmlManyToManyImpl = new XmlManyToManyImpl();
- return xmlManyToManyImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlEmbeddedImpl createXmlEmbeddedImpl()
- {
- XmlEmbeddedImpl xmlEmbeddedImpl = new XmlEmbeddedImpl();
- return xmlEmbeddedImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlTransientImpl createXmlTransientImpl()
- {
- XmlTransientImpl xmlTransientImpl = new XmlTransientImpl();
- return xmlTransientImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlAssociationOverrideImpl createXmlAssociationOverrideImpl()
- {
- XmlAssociationOverrideImpl xmlAssociationOverrideImpl = new XmlAssociationOverrideImpl();
- return xmlAssociationOverrideImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlAttributeOverrideImpl createXmlAttributeOverrideImpl()
- {
- XmlAttributeOverrideImpl xmlAttributeOverrideImpl = new XmlAttributeOverrideImpl();
- return xmlAttributeOverrideImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public CascadeTypeImpl createCascadeTypeImpl()
- {
- CascadeTypeImpl cascadeTypeImpl = new CascadeTypeImpl();
- return cascadeTypeImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlColumnImpl createXmlColumnImpl()
- {
- XmlColumnImpl xmlColumnImpl = new XmlColumnImpl();
- return xmlColumnImpl;
- }
-
- /**
- * <!-- 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 EntityListeners createEntityListeners()
- {
- EntityListeners entityListeners = new EntityListeners();
- return entityListeners;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EntityListener createEntityListener()
- {
- EntityListener entityListener = new EntityListener();
- return entityListener;
- }
-
- /**
- * <!-- 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 XmlGeneratedValueImpl createXmlGeneratedValueImpl()
- {
- XmlGeneratedValueImpl xmlGeneratedValueImpl = new XmlGeneratedValueImpl();
- return xmlGeneratedValueImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlIdClass createXmlIdClass()
- {
- XmlIdClass xmlIdClass = new XmlIdClass();
- return xmlIdClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Inheritance createInheritance()
- {
- Inheritance inheritance = new Inheritance();
- return inheritance;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlJoinColumnImpl createXmlJoinColumnImpl()
- {
- XmlJoinColumnImpl xmlJoinColumnImpl = new XmlJoinColumnImpl();
- return xmlJoinColumnImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlJoinTableImpl createXmlJoinTableImpl()
- {
- XmlJoinTableImpl xmlJoinTableImpl = new XmlJoinTableImpl();
- return xmlJoinTableImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Lob createLob()
- {
- Lob lob = new Lob();
- return lob;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public MapKeyImpl createMapKeyImpl()
- {
- MapKeyImpl mapKeyImpl = new MapKeyImpl();
- return mapKeyImpl;
- }
-
- /**
- * <!-- 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 EventMethod createEventMethod()
- {
- EventMethod eventMethod = new EventMethod();
- return eventMethod;
- }
-
- /**
- * <!-- 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 XmlPrimaryKeyJoinColumnImpl createXmlPrimaryKeyJoinColumnImpl()
- {
- XmlPrimaryKeyJoinColumnImpl xmlPrimaryKeyJoinColumnImpl = new XmlPrimaryKeyJoinColumnImpl();
- return xmlPrimaryKeyJoinColumnImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlQueryHint createXmlQueryHint()
- {
- XmlQueryHint xmlQueryHint = new XmlQueryHint();
- return xmlQueryHint;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlTable createXmlTable()
- {
- XmlTable xmlTable = new XmlTable();
- return xmlTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlSecondaryTableImpl createXmlSecondaryTableImpl()
- {
- XmlSecondaryTableImpl xmlSecondaryTableImpl = new XmlSecondaryTableImpl();
- return xmlSecondaryTableImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlSequenceGeneratorImpl createXmlSequenceGeneratorImpl()
- {
- XmlSequenceGeneratorImpl xmlSequenceGeneratorImpl = new XmlSequenceGeneratorImpl();
- return xmlSequenceGeneratorImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public SqlResultSetMapping createSqlResultSetMapping()
- {
- SqlResultSetMapping sqlResultSetMapping = new SqlResultSetMapping();
- return sqlResultSetMapping;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlTableGeneratorImpl createXmlTableGeneratorImpl()
- {
- XmlTableGeneratorImpl xmlTableGeneratorImpl = new XmlTableGeneratorImpl();
- return xmlTableGeneratorImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlUniqueConstraintImpl createXmlUniqueConstraintImpl()
- {
- XmlUniqueConstraintImpl xmlUniqueConstraintImpl = new XmlUniqueConstraintImpl();
- return xmlUniqueConstraintImpl;
- }
-
- /**
- * <!-- 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 String createDiscriminatorValueFromString(EDataType eDataType, String initialValue)
- {
- return (String)super.createFromString(eDataType, initialValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertDiscriminatorValueToString(EDataType eDataType, Object instanceValue)
- {
- return super.convertToString(eDataType, instanceValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Enumerator createEnumeratedFromString(EDataType eDataType, String initialValue)
- {
- return (Enumerator)super.createFromString(eDataType, initialValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertEnumeratedToString(EDataType eDataType, Object instanceValue)
- {
- return super.convertToString(eDataType, instanceValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String createOrderByFromString(EDataType eDataType, String initialValue)
- {
- return (String)super.createFromString(eDataType, initialValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertOrderByToString(EDataType eDataType, Object instanceValue)
- {
- return super.convertToString(eDataType, instanceValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String createVersionTypeFromString(EDataType eDataType, String initialValue)
- {
- return (String)super.createFromString(eDataType, initialValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertVersionTypeToString(EDataType eDataType, Object instanceValue)
- {
- return super.convertToString(eDataType, instanceValue);
- }
-
- /**
- * <!-- 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 d0c5cbed90..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmPackage.java
+++ /dev/null
@@ -1,13890 +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 org.eclipse.emf.common.util.Enumerator;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-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.persistence.PersistencePackage;
-
-/**
- * <!-- 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.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.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 = 0;
-
- /**
- * 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 = 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_ENTITY_MAPPINGS__DESCRIPTION = 1;
-
- /**
- * 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 = 2;
-
- /**
- * 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 = 3;
-
- /**
- * 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 = 4;
-
- /**
- * 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 = 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_ENTITY_MAPPINGS__ACCESS = 6;
-
- /**
- * 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 = 7;
-
- /**
- * 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 = 8;
-
- /**
- * 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 = 9;
-
- /**
- * 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 = 10;
-
- /**
- * 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 = 11;
-
- /**
- * 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 = 12;
-
- /**
- * 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 = 13;
-
- /**
- * 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 = 14;
-
- /**
- * 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 = 15;
-
- /**
- * 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 = 1;
-
- /**
- * 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 = 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 = 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 = 2;
-
- /**
- * 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 = 2;
-
- /**
- * 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 = 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_PERSISTENCE_UNIT_DEFAULTS__CATALOG = 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_PERSISTENCE_UNIT_DEFAULTS__ACCESS = 2;
-
- /**
- * 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 = 3;
-
- /**
- * 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 = 4;
-
- /**
- * 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 = 5;
-
- /**
- * 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 = 3;
-
- /**
- * 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 = 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_TYPE_MAPPING__ACCESS = 1;
-
- /**
- * 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 = 2;
-
- /**
- * 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 = 3;
-
- /**
- * 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 = 4;
-
- /**
- * 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 = 5;
-
- /**
- * 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 = 4;
-
- /**
- * 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>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>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 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_MAPPED_SUPERCLASS__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_MAPPED_SUPERCLASS__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_MAPPED_SUPERCLASS__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_MAPPED_SUPERCLASS__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_MAPPED_SUPERCLASS__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_MAPPED_SUPERCLASS__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_MAPPED_SUPERCLASS__POST_LOAD = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 10;
-
- /**
- * 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 + 11;
-
- /**
- * 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 = 5;
-
- /**
- * 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>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>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>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 + 0;
-
- /**
- * 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 + 1;
-
- /**
- * 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 + 2;
-
- /**
- * 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 + 3;
-
- /**
- * 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 + 4;
-
- /**
- * 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 + 5;
-
- /**
- * 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 + 6;
-
- /**
- * 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 + 7;
-
- /**
- * 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 + 8;
-
- /**
- * 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 + 9;
-
- /**
- * 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 + 10;
-
- /**
- * 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 + 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_ENTITY__SQL_RESULT_SET_MAPPINGS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 12;
-
- /**
- * 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 + 13;
-
- /**
- * 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 + 14;
-
- /**
- * 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 + 15;
-
- /**
- * 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 + 16;
-
- /**
- * 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 + 17;
-
- /**
- * 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 + 18;
-
- /**
- * 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 + 19;
-
- /**
- * 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 + 20;
-
- /**
- * 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 + 21;
-
- /**
- * 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 + 22;
-
- /**
- * 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 + 23;
-
- /**
- * 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 + 24;
-
- /**
- * 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 + 25;
-
- /**
- * 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 = 6;
-
- /**
- * 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>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>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.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 = 7;
-
- /**
- * 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 10;
-
- /**
- * 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 = 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_ATTRIBUTE_MAPPING__NAME = 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 = 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 = 9;
-
- /**
- * 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.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 = 10;
-
- /**
- * 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 = 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 = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * 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 = 11;
-
- /**
- * 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.XmlRelationshipMapping <em>Xml Relationship Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping()
- * @generated
- */
- public static final int XML_RELATIONSHIP_MAPPING = 12;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_RELATIONSHIP_MAPPING__NAME = 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 XML_RELATIONSHIP_MAPPING__TARGET_ENTITY = 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 XML_RELATIONSHIP_MAPPING__FETCH = XML_ATTRIBUTE_MAPPING_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_RELATIONSHIP_MAPPING__JOIN_TABLE = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * 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_RELATIONSHIP_MAPPING__CASCADE = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * The number of structural features of the '<em>Xml Relationship Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_RELATIONSHIP_MAPPING_FEATURE_COUNT = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping <em>Xml Multi Relationship Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMultiRelationshipMapping()
- * @generated
- */
- public static final int XML_MULTI_RELATIONSHIP_MAPPING = 13;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTI_RELATIONSHIP_MAPPING__NAME = 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 XML_MULTI_RELATIONSHIP_MAPPING__TARGET_ENTITY = 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 XML_MULTI_RELATIONSHIP_MAPPING__FETCH = XML_RELATIONSHIP_MAPPING__FETCH;
-
- /**
- * 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_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE = XML_RELATIONSHIP_MAPPING__JOIN_TABLE;
-
- /**
- * 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_MULTI_RELATIONSHIP_MAPPING__CASCADE = 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 XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY = XML_RELATIONSHIP_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_MULTI_RELATIONSHIP_MAPPING__ORDER_BY = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * 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_MULTI_RELATIONSHIP_MAPPING__MAP_KEY = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * The number of structural features of the '<em>Xml Multi Relationship Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTI_RELATIONSHIP_MAPPING_FEATURE_COUNT = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping <em>Xml Single Relationship Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSingleRelationshipMapping()
- * @generated
- */
- public static final int XML_SINGLE_RELATIONSHIP_MAPPING = 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_SINGLE_RELATIONSHIP_MAPPING__NAME = 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 XML_SINGLE_RELATIONSHIP_MAPPING__TARGET_ENTITY = 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 XML_SINGLE_RELATIONSHIP_MAPPING__FETCH = XML_RELATIONSHIP_MAPPING__FETCH;
-
- /**
- * 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_SINGLE_RELATIONSHIP_MAPPING__JOIN_TABLE = XML_RELATIONSHIP_MAPPING__JOIN_TABLE;
-
- /**
- * 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_SINGLE_RELATIONSHIP_MAPPING__CASCADE = XML_RELATIONSHIP_MAPPING__CASCADE;
-
- /**
- * The feature id for the '<em><b>Optional</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL = 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 XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml Single Relationship Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * 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 = 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_ID__NAME = 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 = 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 = 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 = 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 = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * 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 = 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 = XML_ATTRIBUTE_MAPPING_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_ID__SEQUENCE_GENERATOR = 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 = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 7;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlIdImpl <em>Xml Id Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlIdImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlIdImpl()
- * @generated
- */
- public static final int XML_ID_IMPL = 16;
-
- /**
- * 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_IMPL__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_IMPL__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_IMPL__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_IMPL__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_IMPL__ENUMERATED = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * 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_IMPL__GENERATED_VALUE = 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_IMPL__TABLE_GENERATOR = ABSTRACT_XML_ATTRIBUTE_MAPPING_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_ID_IMPL__SEQUENCE_GENERATOR = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 6;
-
- /**
- * The number of structural features of the '<em>Xml Id Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID_IMPL_FEATURE_COUNT = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 7;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.BaseXmlEmbedded <em>Base Xml Embedded</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.BaseXmlEmbedded
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getBaseXmlEmbedded()
- * @generated
- */
- public static final int BASE_XML_EMBEDDED = 17;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int BASE_XML_EMBEDDED__NAME = 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 BASE_XML_EMBEDDED__ATTRIBUTE_OVERRIDES = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Base Xml Embedded</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int BASE_XML_EMBEDDED_FEATURE_COUNT = XML_ATTRIBUTE_MAPPING_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 = 18;
-
- /**
- * 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 = 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 XML_EMBEDDED_ID__ATTRIBUTE_OVERRIDES = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * 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 = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlEmbeddedIdImpl <em>Xml Embedded Id Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbeddedIdImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbeddedIdImpl()
- * @generated
- */
- public static final int XML_EMBEDDED_ID_IMPL = 19;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_ID_IMPL__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 XML_EMBEDDED_ID_IMPL__ATTRIBUTE_OVERRIDES = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Embedded Id Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_ID_IMPL_FEATURE_COUNT = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * 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 = 23;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlBasicImpl <em>Xml Basic Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlBasicImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBasicImpl()
- * @generated
- */
- public static final int XML_BASIC_IMPL = 24;
-
- /**
- * 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 = 25;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlVersionImpl <em>Xml Version Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlVersionImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlVersionImpl()
- * @generated
- */
- public static final int XML_VERSION_IMPL = 26;
-
- /**
- * 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 = 27;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToOneImpl <em>Xml Many To One Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlManyToOneImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlManyToOneImpl()
- * @generated
- */
- public static final int XML_MANY_TO_ONE_IMPL = 28;
-
- /**
- * 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 = 29;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToManyImpl <em>Xml One To Many Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToManyImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToManyImpl()
- * @generated
- */
- public static final int XML_ONE_TO_MANY_IMPL = 30;
-
- /**
- * 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 = 31;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToOneImpl <em>Xml One To One Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToOneImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToOneImpl()
- * @generated
- */
- public static final int XML_ONE_TO_ONE_IMPL = 32;
-
- /**
- * 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 = 33;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToManyImpl <em>Xml Many To Many Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlManyToManyImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlManyToManyImpl()
- * @generated
- */
- public static final int XML_MANY_TO_MANY_IMPL = 34;
-
- /**
- * 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 = 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_EMBEDDED__NAME = BASE_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 = BASE_XML_EMBEDDED__ATTRIBUTE_OVERRIDES;
-
- /**
- * 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 = BASE_XML_EMBEDDED_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlEmbeddedImpl <em>Xml Embedded Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbeddedImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbeddedImpl()
- * @generated
- */
- public static final int XML_EMBEDDED_IMPL = 21;
-
- /**
- * 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_IMPL__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 XML_EMBEDDED_IMPL__ATTRIBUTE_OVERRIDES = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Embedded Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_IMPL_FEATURE_COUNT = ABSTRACT_XML_ATTRIBUTE_MAPPING_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 = 22;
-
- /**
- * The feature id for the '<em><b>Lob</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTIBLE_MAPPING__LOB = 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 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 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_BASIC_IMPL__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_IMPL__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_IMPL__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_IMPL__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_IMPL__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_IMPL__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_IMPL__OPTIONAL = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5;
-
- /**
- * The number of structural features of the '<em>Xml Basic Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_IMPL_FEATURE_COUNT = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 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_VERSION__NAME = 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 = 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 = 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 = 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 = 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 = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * 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_IMPL__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_IMPL__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_IMPL__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_IMPL__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_IMPL__ENUMERATED = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * The number of structural features of the '<em>Xml Version Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION_IMPL_FEATURE_COUNT = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * 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 = 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 = 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 = XML_SINGLE_RELATIONSHIP_MAPPING__FETCH;
-
- /**
- * 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 = XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_TABLE;
-
- /**
- * 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 = XML_SINGLE_RELATIONSHIP_MAPPING__CASCADE;
-
- /**
- * 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 = XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL;
-
- /**
- * 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 = XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS;
-
- /**
- * 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 = 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 XML_MANY_TO_ONE_IMPL__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 XML_MANY_TO_ONE_IMPL__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 XML_MANY_TO_ONE_IMPL__FETCH = ABSTRACT_XML_ATTRIBUTE_MAPPING_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_MANY_TO_ONE_IMPL__JOIN_TABLE = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * 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_IMPL__CASCADE = ABSTRACT_XML_ATTRIBUTE_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 XML_MANY_TO_ONE_IMPL__OPTIONAL = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * 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_IMPL__JOIN_COLUMNS = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5;
-
- /**
- * The number of structural features of the '<em>Xml Many To One Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_IMPL_FEATURE_COUNT = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 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_ONE_TO_MANY__NAME = 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 = 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 = XML_MULTI_RELATIONSHIP_MAPPING__FETCH;
-
- /**
- * 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 = XML_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE;
-
- /**
- * 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 = 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 = XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY;
-
- /**
- * 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 = XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY;
-
- /**
- * 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 = 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 = XML_MULTI_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * 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 = XML_MULTI_RELATIONSHIP_MAPPING_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_ONE_TO_MANY_IMPL__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 XML_ONE_TO_MANY_IMPL__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 XML_ONE_TO_MANY_IMPL__FETCH = ABSTRACT_XML_ATTRIBUTE_MAPPING_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_ONE_TO_MANY_IMPL__JOIN_TABLE = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * 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_IMPL__CASCADE = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * 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_IMPL__MAPPED_BY = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * 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_IMPL__ORDER_BY = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5;
-
- /**
- * 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_IMPL__MAP_KEY = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 6;
-
- /**
- * 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_IMPL__JOIN_COLUMNS = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 7;
-
- /**
- * The number of structural features of the '<em>Xml One To Many Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_IMPL_FEATURE_COUNT = ABSTRACT_XML_ATTRIBUTE_MAPPING_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_ONE_TO_ONE__NAME = 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 = 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 = XML_SINGLE_RELATIONSHIP_MAPPING__FETCH;
-
- /**
- * 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 = XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_TABLE;
-
- /**
- * 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 = XML_SINGLE_RELATIONSHIP_MAPPING__CASCADE;
-
- /**
- * 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 = XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL;
-
- /**
- * 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 = XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS;
-
- /**
- * 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 = XML_SINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * 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 = XML_SINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * 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 = XML_SINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_IMPL__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 XML_ONE_TO_ONE_IMPL__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 XML_ONE_TO_ONE_IMPL__FETCH = ABSTRACT_XML_ATTRIBUTE_MAPPING_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_ONE_TO_ONE_IMPL__JOIN_TABLE = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * 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_IMPL__CASCADE = ABSTRACT_XML_ATTRIBUTE_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 XML_ONE_TO_ONE_IMPL__OPTIONAL = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * 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_IMPL__JOIN_COLUMNS = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5;
-
- /**
- * 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_IMPL__MAPPED_BY = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 6;
-
- /**
- * 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_IMPL__PRIMARY_KEY_JOIN_COLUMNS = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 7;
-
- /**
- * The number of structural features of the '<em>Xml One To One Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_IMPL_FEATURE_COUNT = ABSTRACT_XML_ATTRIBUTE_MAPPING_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_MANY_TO_MANY__NAME = 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 = 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 = XML_MULTI_RELATIONSHIP_MAPPING__FETCH;
-
- /**
- * 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 = XML_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE;
-
- /**
- * 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 = 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 = XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY;
-
- /**
- * 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 = XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY;
-
- /**
- * 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 = 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 = XML_MULTI_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 XML_MANY_TO_MANY_IMPL__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 XML_MANY_TO_MANY_IMPL__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 XML_MANY_TO_MANY_IMPL__FETCH = ABSTRACT_XML_ATTRIBUTE_MAPPING_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_MANY_TO_MANY_IMPL__JOIN_TABLE = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * 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_IMPL__CASCADE = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * 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_IMPL__MAPPED_BY = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * 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_IMPL__ORDER_BY = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5;
-
- /**
- * 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_IMPL__MAP_KEY = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 6;
-
- /**
- * The number of structural features of the '<em>Xml Many To Many Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_IMPL_FEATURE_COUNT = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 7;
-
- /**
- * 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 = 35;
-
- /**
- * 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 = 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 = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlTransientImpl <em>Xml Transient Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlTransientImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTransientImpl()
- * @generated
- */
- public static final int XML_TRANSIENT_IMPL = 36;
-
- /**
- * 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_IMPL__NAME = ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The number of structural features of the '<em>Xml Transient Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSIENT_IMPL_FEATURE_COUNT = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * 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 = 37;
-
- /**
- * 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 = 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_ASSOCIATION_OVERRIDE__NAME = 1;
-
- /**
- * 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 = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverrideImpl <em>Xml Association Override Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAssociationOverrideImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAssociationOverrideImpl()
- * @generated
- */
- public static final int XML_ASSOCIATION_OVERRIDE_IMPL = 38;
-
- /**
- * 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_IMPL__JOIN_COLUMNS = XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS;
-
- /**
- * 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_IMPL__NAME = XML_ASSOCIATION_OVERRIDE__NAME;
-
- /**
- * The number of structural features of the '<em>Xml Association Override Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ASSOCIATION_OVERRIDE_IMPL_FEATURE_COUNT = XML_ASSOCIATION_OVERRIDE_FEATURE_COUNT + 0;
-
- /**
- * 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 = 39;
-
- /**
- * 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 = 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_ATTRIBUTE_OVERRIDE__NAME = 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 = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideImpl <em>Xml Attribute Override Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeOverrideImpl()
- * @generated
- */
- public static final int XML_ATTRIBUTE_OVERRIDE_IMPL = 40;
-
- /**
- * 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_IMPL__COLUMN = XML_ATTRIBUTE_OVERRIDE__COLUMN;
-
- /**
- * 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_IMPL__NAME = XML_ATTRIBUTE_OVERRIDE__NAME;
-
- /**
- * The number of structural features of the '<em>Xml Attribute Override Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_OVERRIDE_IMPL_FEATURE_COUNT = XML_ATTRIBUTE_OVERRIDE_FEATURE_COUNT + 0;
-
- /**
- * 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 = 41;
-
- /**
- * 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 = 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 = 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 = 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 = 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 = 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 = 5;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.CascadeTypeImpl <em>Cascade Type Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.CascadeTypeImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeTypeImpl()
- * @generated
- */
- public static final int CASCADE_TYPE_IMPL = 42;
-
- /**
- * 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_IMPL__CASCADE_ALL = CASCADE_TYPE__CASCADE_ALL;
-
- /**
- * 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_IMPL__CASCADE_PERSIST = CASCADE_TYPE__CASCADE_PERSIST;
-
- /**
- * 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_IMPL__CASCADE_MERGE = CASCADE_TYPE__CASCADE_MERGE;
-
- /**
- * 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_IMPL__CASCADE_REMOVE = CASCADE_TYPE__CASCADE_REMOVE;
-
- /**
- * 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_IMPL__CASCADE_REFRESH = CASCADE_TYPE__CASCADE_REFRESH;
-
- /**
- * The number of structural features of the '<em>Cascade Type Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int CASCADE_TYPE_IMPL_FEATURE_COUNT = CASCADE_TYPE_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedColumn <em>Xml Named Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlNamedColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedColumn()
- * @generated
- */
- public static final int XML_NAMED_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_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 XML_NAMED_COLUMN__NAME = 1;
-
- /**
- * The number of structural features of the '<em>Xml Named Column</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_COLUMN_FEATURE_COUNT = 2;
-
- /**
- * 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 = 44;
-
- /**
- * 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 = 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_NAMED_COLUMN__NAME = XML_NAMED_COLUMN__NAME;
-
- /**
- * 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 = XML_NAMED_COLUMN_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn <em>Xml Abstract Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAbstractColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAbstractColumn()
- * @generated
- */
- public static final int XML_ABSTRACT_COLUMN = 45;
-
- /**
- * 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_ABSTRACT_COLUMN__COLUMN_DEFINITION = 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_ABSTRACT_COLUMN__NAME = 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 XML_ABSTRACT_COLUMN__INSERTABLE = 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 XML_ABSTRACT_COLUMN__NULLABLE = 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 XML_ABSTRACT_COLUMN__TABLE = 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 XML_ABSTRACT_COLUMN__UNIQUE = 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 XML_ABSTRACT_COLUMN__UPDATABLE = XML_NAMED_COLUMN_FEATURE_COUNT + 4;
-
- /**
- * The number of structural features of the '<em>Xml Abstract Column</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ABSTRACT_COLUMN_FEATURE_COUNT = XML_NAMED_COLUMN_FEATURE_COUNT + 5;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlAbstractColumn <em>Abstract Xml Abstract Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlAbstractColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlAbstractColumn()
- * @generated
- */
- public static final int ABSTRACT_XML_ABSTRACT_COLUMN = 46;
-
- /**
- * 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_ABSTRACT_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_ABSTRACT_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_ABSTRACT_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_ABSTRACT_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_ABSTRACT_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_ABSTRACT_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_ABSTRACT_COLUMN__UPDATABLE = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 4;
-
- /**
- * The number of structural features of the '<em>Abstract Xml Abstract Column</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_ABSTRACT_COLUMN_FEATURE_COUNT = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 5;
-
- /**
- * 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 = 47;
-
- /**
- * 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 = XML_ABSTRACT_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 = XML_ABSTRACT_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 = XML_ABSTRACT_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 = XML_ABSTRACT_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 = XML_ABSTRACT_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 = XML_ABSTRACT_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 = XML_ABSTRACT_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 = XML_ABSTRACT_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 = XML_ABSTRACT_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 = XML_ABSTRACT_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 = XML_ABSTRACT_COLUMN_FEATURE_COUNT + 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlColumnImpl <em>Xml Column Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlColumnImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlColumnImpl()
- * @generated
- */
- public static final int XML_COLUMN_IMPL = 48;
-
- /**
- * 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_IMPL__COLUMN_DEFINITION = ABSTRACT_XML_ABSTRACT_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_IMPL__NAME = ABSTRACT_XML_ABSTRACT_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_IMPL__INSERTABLE = ABSTRACT_XML_ABSTRACT_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_IMPL__NULLABLE = ABSTRACT_XML_ABSTRACT_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_IMPL__TABLE = ABSTRACT_XML_ABSTRACT_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_IMPL__UNIQUE = ABSTRACT_XML_ABSTRACT_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_IMPL__UPDATABLE = ABSTRACT_XML_ABSTRACT_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_IMPL__LENGTH = ABSTRACT_XML_ABSTRACT_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_IMPL__PRECISION = ABSTRACT_XML_ABSTRACT_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_IMPL__SCALE = ABSTRACT_XML_ABSTRACT_COLUMN_FEATURE_COUNT + 2;
-
- /**
- * The number of structural features of the '<em>Xml Column Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN_IMPL_FEATURE_COUNT = ABSTRACT_XML_ABSTRACT_COLUMN_FEATURE_COUNT + 3;
-
- /**
- * 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 = 49;
-
- /**
- * 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.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 = 50;
-
- /**
- * 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.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 = 51;
-
- /**
- * 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.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 = 52;
-
- /**
- * 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 = 0;
-
- /**
- * 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 = 1;
-
- /**
- * 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 = 2;
-
- /**
- * 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 = 3;
-
- /**
- * 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 = 4;
-
- /**
- * 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 = 5;
-
- /**
- * 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 = 6;
-
- /**
- * 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 = 7;
-
- /**
- * 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 = 8;
-
- /**
- * 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 = 53;
-
- /**
- * 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 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 = 55;
-
- /**
- * 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 = 59;
-
- /**
- * 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 = 64;
-
- /**
- * 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 = 65;
-
- /**
- * 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 = 54;
-
- /**
- * 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 = 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 = 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 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 = 56;
-
- /**
- * 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 meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratedValueImpl <em>Xml Generated Value Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlGeneratedValueImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGeneratedValueImpl()
- * @generated
- */
- public static final int XML_GENERATED_VALUE_IMPL = 57;
-
- /**
- * 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_IMPL__GENERATOR = XML_GENERATED_VALUE__GENERATOR;
-
- /**
- * 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_IMPL__STRATEGY = XML_GENERATED_VALUE__STRATEGY;
-
- /**
- * The number of structural features of the '<em>Xml Generated Value Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_GENERATED_VALUE_IMPL_FEATURE_COUNT = XML_GENERATED_VALUE_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlIdClass <em>Xml Id Class</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlIdClass
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlIdClass()
- * @generated
- */
- public static final int XML_ID_CLASS = 58;
-
- /**
- * 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_ID_CLASS__CLASS_NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Id Class</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID_CLASS_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 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 = 60;
-
- /**
- * 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 = XML_ABSTRACT_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 = XML_ABSTRACT_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 = XML_ABSTRACT_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 = XML_ABSTRACT_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 = XML_ABSTRACT_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 = XML_ABSTRACT_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 = XML_ABSTRACT_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 = XML_ABSTRACT_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 = XML_ABSTRACT_COLUMN_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlJoinColumnImpl <em>Xml Join Column Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinColumnImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinColumnImpl()
- * @generated
- */
- public static final int XML_JOIN_COLUMN_IMPL = 61;
-
- /**
- * 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_IMPL__COLUMN_DEFINITION = ABSTRACT_XML_ABSTRACT_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_IMPL__NAME = ABSTRACT_XML_ABSTRACT_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_IMPL__INSERTABLE = ABSTRACT_XML_ABSTRACT_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_IMPL__NULLABLE = ABSTRACT_XML_ABSTRACT_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_IMPL__TABLE = ABSTRACT_XML_ABSTRACT_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_IMPL__UNIQUE = ABSTRACT_XML_ABSTRACT_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_IMPL__UPDATABLE = ABSTRACT_XML_ABSTRACT_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_IMPL__REFERENCED_COLUMN_NAME = ABSTRACT_XML_ABSTRACT_COLUMN_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Join Column Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN_IMPL_FEATURE_COUNT = ABSTRACT_XML_ABSTRACT_COLUMN_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlBaseTable <em>Xml Base Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlBaseTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBaseTable()
- * @generated
- */
- public static final int XML_BASE_TABLE = 81;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASE_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 XML_BASE_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 XML_BASE_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 XML_BASE_TABLE__UNIQUE_CONSTRAINTS = 3;
-
- /**
- * The number of structural features of the '<em>Xml Base Table</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASE_TABLE_FEATURE_COUNT = 4;
-
- /**
- * 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 = 62;
-
- /**
- * 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 = XML_BASE_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 = XML_BASE_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 = XML_BASE_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 = XML_BASE_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 = XML_BASE_TABLE_FEATURE_COUNT + 0;
-
- /**
- * 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 = XML_BASE_TABLE_FEATURE_COUNT + 1;
-
- /**
- * 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 = XML_BASE_TABLE_FEATURE_COUNT + 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlBaseTable <em>Abstract Xml Base Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlBaseTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlBaseTable()
- * @generated
- */
- public static final int ABSTRACT_XML_BASE_TABLE = 80;
-
- /**
- * 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_BASE_TABLE__NAME = XML_BASE_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_BASE_TABLE__CATALOG = XML_BASE_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_BASE_TABLE__SCHEMA = XML_BASE_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_BASE_TABLE__UNIQUE_CONSTRAINTS = XML_BASE_TABLE__UNIQUE_CONSTRAINTS;
-
- /**
- * The number of structural features of the '<em>Abstract Xml Base Table</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_BASE_TABLE_FEATURE_COUNT = XML_BASE_TABLE_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlJoinTableImpl <em>Xml Join Table Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinTableImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinTableImpl()
- * @generated
- */
- public static final int XML_JOIN_TABLE_IMPL = 63;
-
- /**
- * 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_IMPL__NAME = ABSTRACT_XML_BASE_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_IMPL__CATALOG = ABSTRACT_XML_BASE_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_IMPL__SCHEMA = ABSTRACT_XML_BASE_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_IMPL__UNIQUE_CONSTRAINTS = ABSTRACT_XML_BASE_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_IMPL__JOIN_COLUMNS = ABSTRACT_XML_BASE_TABLE_FEATURE_COUNT + 0;
-
- /**
- * 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_IMPL__INVERSE_JOIN_COLUMNS = ABSTRACT_XML_BASE_TABLE_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml Join Table Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE_IMPL_FEATURE_COUNT = ABSTRACT_XML_BASE_TABLE_FEATURE_COUNT + 2;
-
- /**
- * 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>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 meta object id for the '{@link org.eclipse.jpt.core.resource.orm.MapKeyImpl <em>Map Key Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.MapKeyImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getMapKeyImpl()
- * @generated
- */
- public static final int MAP_KEY_IMPL = 66;
-
- /**
- * 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_IMPL__NAME = MAP_KEY__NAME;
-
- /**
- * The number of structural features of the '<em>Map Key Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int MAP_KEY_IMPL_FEATURE_COUNT = MAP_KEY_FEATURE_COUNT + 0;
-
- /**
- * 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 = 67;
-
- /**
- * 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 = 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 = 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 = 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 = 3;
-
- /**
- * 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 = 68;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_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 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 = 69;
-
- /**
- * 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 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 + 0;
-
- /**
- * 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 = 70;
-
- /**
- * 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 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 = 71;
-
- /**
- * 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 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 = 72;
-
- /**
- * 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 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 = 73;
-
- /**
- * 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 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 = 74;
-
- /**
- * 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 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 = 75;
-
- /**
- * 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 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 = 76;
-
- /**
- * 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 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 = 77;
-
- /**
- * 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 = 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 = 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 = 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 = XML_NAMED_COLUMN_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumnImpl <em>Xml Primary Key Join Column Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumnImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPrimaryKeyJoinColumnImpl()
- * @generated
- */
- public static final int XML_PRIMARY_KEY_JOIN_COLUMN_IMPL = 78;
-
- /**
- * 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_IMPL__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_IMPL__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_IMPL__REFERENCED_COLUMN_NAME = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Primary Key Join Column Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY_JOIN_COLUMN_IMPL_FEATURE_COUNT = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 1;
-
- /**
- * 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 = 79;
-
- /**
- * 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 = 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 = 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 = 2;
-
- /**
- * 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 = 82;
-
- /**
- * 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_BASE_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_BASE_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_BASE_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_BASE_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_BASE_TABLE_FEATURE_COUNT + 0;
-
- /**
- * 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 = 83;
-
- /**
- * 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 = XML_BASE_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 = XML_BASE_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 = XML_BASE_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 = XML_BASE_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 = XML_BASE_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 = XML_BASE_TABLE_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlSecondaryTableImpl <em>Xml Secondary Table Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlSecondaryTableImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSecondaryTableImpl()
- * @generated
- */
- public static final int XML_SECONDARY_TABLE_IMPL = 84;
-
- /**
- * 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_IMPL__NAME = ABSTRACT_XML_BASE_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_IMPL__CATALOG = ABSTRACT_XML_BASE_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_IMPL__SCHEMA = ABSTRACT_XML_BASE_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_IMPL__UNIQUE_CONSTRAINTS = ABSTRACT_XML_BASE_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_IMPL__PRIMARY_KEY_JOIN_COLUMNS = ABSTRACT_XML_BASE_TABLE_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Secondary Table Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE_IMPL_FEATURE_COUNT = ABSTRACT_XML_BASE_TABLE_FEATURE_COUNT + 1;
-
- /**
- * 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 = 85;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_GENERATOR__NAME = 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 = 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 = 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 = 3;
-
- /**
- * 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 = 86;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_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>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 + 0;
-
- /**
- * 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 + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlSequenceGeneratorImpl <em>Xml Sequence Generator Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlSequenceGeneratorImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSequenceGeneratorImpl()
- * @generated
- */
- public static final int XML_SEQUENCE_GENERATOR_IMPL = 87;
-
- /**
- * 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_IMPL__NAME = XML_SEQUENCE_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_IMPL__INITIAL_VALUE = XML_SEQUENCE_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_IMPL__ALLOCATION_SIZE = XML_SEQUENCE_GENERATOR__ALLOCATION_SIZE;
-
- /**
- * 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_IMPL__SEQUENCE_NAME = XML_SEQUENCE_GENERATOR__SEQUENCE_NAME;
-
- /**
- * The number of structural features of the '<em>Xml Sequence Generator Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SEQUENCE_GENERATOR_IMPL_FEATURE_COUNT = XML_SEQUENCE_GENERATOR_FEATURE_COUNT + 0;
-
- /**
- * 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 = 88;
-
- /**
- * 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 = 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 = 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 = 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 = 3;
-
- /**
- * 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 = 89;
-
- /**
- * 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 meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGeneratorImpl <em>Xml Table Generator Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGeneratorImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGeneratorImpl()
- * @generated
- */
- public static final int XML_TABLE_GENERATOR_IMPL = 90;
-
- /**
- * 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_IMPL__NAME = XML_TABLE_GENERATOR__NAME;
-
- /**
- * The feature id for the '<em><b>Initial Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_IMPL__INITIAL_VALUE = XML_TABLE_GENERATOR__INITIAL_VALUE;
-
- /**
- * The feature id for the '<em><b>Allocation Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_IMPL__ALLOCATION_SIZE = XML_TABLE_GENERATOR__ALLOCATION_SIZE;
-
- /**
- * The feature id for the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_IMPL__TABLE = XML_TABLE_GENERATOR__TABLE;
-
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_IMPL__CATALOG = XML_TABLE_GENERATOR__CATALOG;
-
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_IMPL__SCHEMA = XML_TABLE_GENERATOR__SCHEMA;
-
- /**
- * The feature id for the '<em><b>Pk Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_IMPL__PK_COLUMN_NAME = XML_TABLE_GENERATOR__PK_COLUMN_NAME;
-
- /**
- * The feature id for the '<em><b>Value Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_IMPL__VALUE_COLUMN_NAME = XML_TABLE_GENERATOR__VALUE_COLUMN_NAME;
-
- /**
- * The feature id for the '<em><b>Pk Column Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_IMPL__PK_COLUMN_VALUE = XML_TABLE_GENERATOR__PK_COLUMN_VALUE;
-
- /**
- * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_IMPL__UNIQUE_CONSTRAINTS = XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS;
-
- /**
- * The number of structural features of the '<em>Xml Table Generator Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_IMPL_FEATURE_COUNT = XML_TABLE_GENERATOR_FEATURE_COUNT + 0;
-
- /**
- * 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 = 91;
-
- /**
- * 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 = 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 = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlUniqueConstraintImpl <em>Xml Unique Constraint Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlUniqueConstraintImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlUniqueConstraintImpl()
- * @generated
- */
- public static final int XML_UNIQUE_CONSTRAINT_IMPL = 92;
-
- /**
- * 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_IMPL__COLUMN_NAMES = XML_UNIQUE_CONSTRAINT__COLUMN_NAMES;
-
- /**
- * The number of structural features of the '<em>Xml Unique Constraint Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_UNIQUE_CONSTRAINT_IMPL_FEATURE_COUNT = XML_UNIQUE_CONSTRAINT_FEATURE_COUNT + 0;
-
- /**
- * 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 = 93;
-
- /**
- * 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 = 94;
-
- /**
- * 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 = 95;
-
- /**
- * 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 = 96;
-
- /**
- * 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 = 97;
-
- /**
- * 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 = 98;
-
- /**
- * 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 = 99;
-
- /**
- * The meta object id for the '<em>Discriminator Value</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see java.lang.String
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getDiscriminatorValue()
- * @generated
- */
- public static final int DISCRIMINATOR_VALUE = 100;
-
- /**
- * The meta object id for the '<em>Enumerated</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.common.util.Enumerator
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEnumerated()
- * @generated
- */
- public static final int ENUMERATED = 101;
-
- /**
- * The meta object id for the '<em>Order By</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see java.lang.String
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getOrderBy()
- * @generated
- */
- public static final int ORDER_BY = 102;
-
- /**
- * The meta object id for the '<em>Version Type</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see java.lang.String
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getVersionType()
- * @generated
- */
- public static final int VERSION_TYPE = 103;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntityMappingsEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPersistenceUnitMetadataEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPersistenceUnitDefaultsEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass abstractXmlTypeMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMappedSuperclassEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntityEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEmbeddableEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass attributesEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAttributeMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass abstractXmlAttributeMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNullAttributeMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass columnMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlRelationshipMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMultiRelationshipMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlSingleRelationshipMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlIdEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlIdImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass baseXmlEmbeddedEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEmbeddedIdEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEmbeddedIdImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasicEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasicImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlVersionEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlVersionImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToOneEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToOneImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToManyEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToManyImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToOneEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToOneImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToManyEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToManyImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEmbeddedEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEmbeddedImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlConvertibleMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTransientEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTransientImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAssociationOverrideEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAssociationOverrideImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAttributeOverrideEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAttributeOverrideImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass cascadeTypeEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass cascadeTypeImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedColumnEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass abstractXmlNamedColumnEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAbstractColumnEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass abstractXmlAbstractColumnEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlColumnEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlColumnImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass columnResultEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlDiscriminatorColumnEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass entityListenersEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass entityListenerEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass entityResultEClass = 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 xmlGeneratedValueImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlIdClassEClass = 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 xmlJoinColumnImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlJoinTableEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlJoinTableImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass lobEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass mapKeyEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass mapKeyImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlQueryEClass = 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 eventMethodEClass = 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 xmlPrimaryKeyJoinColumnImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlQueryHintEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass abstractXmlBaseTableEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBaseTableEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTableEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlSecondaryTableEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlSecondaryTableImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlGeneratorEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlSequenceGeneratorEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlSequenceGeneratorImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass sqlResultSetMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTableGeneratorEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTableGeneratorImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlUniqueConstraintEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlUniqueConstraintImplEClass = 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;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EDataType discriminatorValueEDataType = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EDataType enumeratedEDataType = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EDataType orderByEDataType = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EDataType versionTypeEDataType = 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. Simple
- * dependencies are satisfied by calling this method on all
- * dependent packages before doing anything else. This method drives
- * initialization for interdependent packages directly, in parallel
- * with this package, itself.
- * <p>Of this package and its interdependencies, all packages which
- * have not yet been registered by their URI values are first created
- * and registered. The packages are then initialized in two steps:
- * meta-model objects for all of the packages are created before any
- * are initialized, since one package's meta-model objects may refer to
- * those of another.
- * <p>Invocation of this method will not affect any packages that have
- * already been initialized.
- * <!-- 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.getEPackage(eNS_URI) instanceof OrmPackage ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new OrmPackage());
-
- isInited = true;
-
- // Initialize simple dependencies
- EcorePackage.eINSTANCE.eClass();
- XMLTypePackage.eINSTANCE.eClass();
-
- // Obtain or create and register interdependencies
- 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
- theOrmPackage.createPackageContents();
- thePersistencePackage.createPackageContents();
-
- // Initialize created meta-data
- theOrmPackage.initializePackageContents();
- thePersistencePackage.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theOrmPackage.freeze();
-
- return theOrmPackage;
- }
-
-
- /**
- * 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#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.orm.XmlEntityMappings#getVersion()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EAttribute getXmlEntityMappings_Version()
- {
- return (EAttribute)xmlEntityMappingsEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * 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(1);
- }
-
-
- /**
- * 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(2);
- }
-
-
- /**
- * 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(3);
- }
-
-
- /**
- * 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(4);
- }
-
-
- /**
- * 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(5);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#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.XmlEntityMappings#getAccess()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EAttribute getXmlEntityMappings_Access()
- {
- return (EAttribute)xmlEntityMappingsEClass.getEStructuralFeatures().get(6);
- }
-
-
- /**
- * 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(7);
- }
-
-
- /**
- * 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(8);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#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.XmlEntityMappings#getNamedQueries()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EReference getXmlEntityMappings_NamedQueries()
- {
- return (EReference)xmlEntityMappingsEClass.getEStructuralFeatures().get(9);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#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.XmlEntityMappings#getNamedNativeQueries()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EReference getXmlEntityMappings_NamedNativeQueries()
- {
- return (EReference)xmlEntityMappingsEClass.getEStructuralFeatures().get(10);
- }
-
-
- /**
- * 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(11);
- }
-
-
- /**
- * 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(12);
- }
-
-
- /**
- * 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(13);
- }
-
-
- /**
- * 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(14);
- }
-
-
- /**
- * 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.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#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.XmlPersistenceUnitDefaults#getAccess()
- * @see #getXmlPersistenceUnitDefaults()
- * @generated
- */
- public EAttribute getXmlPersistenceUnitDefaults_Access()
- {
- return (EAttribute)xmlPersistenceUnitDefaultsEClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * 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(3);
- }
-
-
- /**
- * 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(4);
- }
-
-
- /**
- * 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 the attribute '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#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.AbstractXmlTypeMapping#getClassName()
- * @see #getAbstractXmlTypeMapping()
- * @generated
- */
- public EAttribute getAbstractXmlTypeMapping_ClassName()
- {
- return (EAttribute)abstractXmlTypeMappingEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#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.AbstractXmlTypeMapping#getAccess()
- * @see #getAbstractXmlTypeMapping()
- * @generated
- */
- public EAttribute getAbstractXmlTypeMapping_Access()
- {
- return (EAttribute)abstractXmlTypeMappingEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#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.AbstractXmlTypeMapping#getMetadataComplete()
- * @see #getAbstractXmlTypeMapping()
- * @generated
- */
- public EAttribute getAbstractXmlTypeMapping_MetadataComplete()
- {
- return (EAttribute)abstractXmlTypeMappingEClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#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.AbstractXmlTypeMapping#getDescription()
- * @see #getAbstractXmlTypeMapping()
- * @generated
- */
- public EAttribute getAbstractXmlTypeMapping_Description()
- {
- return (EAttribute)abstractXmlTypeMappingEClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#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.AbstractXmlTypeMapping#getAttributes()
- * @see #getAbstractXmlTypeMapping()
- * @generated
- */
- public EReference getAbstractXmlTypeMapping_Attributes()
- {
- return (EReference)abstractXmlTypeMappingEClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * 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 containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#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.XmlMappedSuperclass#getIdClass()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_IdClass()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * 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(1);
- }
-
-
- /**
- * 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(2);
- }
-
-
- /**
- * 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(3);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#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.XmlMappedSuperclass#getPrePersist()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_PrePersist()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#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.XmlMappedSuperclass#getPostPersist()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_PostPersist()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(5);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#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.XmlMappedSuperclass#getPreRemove()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_PreRemove()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(6);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#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.XmlMappedSuperclass#getPostRemove()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_PostRemove()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(7);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#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.XmlMappedSuperclass#getPreUpdate()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_PreUpdate()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(8);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#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.XmlMappedSuperclass#getPostUpdate()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_PostUpdate()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(9);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#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.XmlMappedSuperclass#getPostLoad()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_PostLoad()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(10);
- }
-
-
- /**
- * 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#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.XmlEntity#getIdClass()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_IdClass()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * 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(5);
- }
-
-
- /**
- * 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(6);
- }
-
-
- /**
- * 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(7);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#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.XmlEntity#getSequenceGenerator()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_SequenceGenerator()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(8);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#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.XmlEntity#getTableGenerator()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_TableGenerator()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(9);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#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.XmlEntity#getNamedQueries()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_NamedQueries()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(10);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#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.XmlEntity#getNamedNativeQueries()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_NamedNativeQueries()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(11);
- }
-
-
- /**
- * 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(12);
- }
-
-
- /**
- * 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(13);
- }
-
-
- /**
- * 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(14);
- }
-
-
- /**
- * 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(15);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#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.XmlEntity#getPrePersist()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_PrePersist()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(16);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#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.XmlEntity#getPostPersist()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_PostPersist()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(17);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#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.XmlEntity#getPreRemove()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_PreRemove()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(18);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#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.XmlEntity#getPostRemove()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_PostRemove()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(19);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#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.XmlEntity#getPreUpdate()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_PreUpdate()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(20);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#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.XmlEntity#getPostUpdate()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_PostUpdate()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(21);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#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.XmlEntity#getPostLoad()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_PostLoad()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(22);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#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.XmlEntity#getAttributeOverrides()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_AttributeOverrides()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(23);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#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.XmlEntity#getAssociationOverrides()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_AssociationOverrides()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(24);
- }
-
-
- /**
- * 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.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.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.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.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.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.XmlRelationshipMapping <em>Xml Relationship Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Relationship Mapping</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping
- * @generated
- */
- public EClass getXmlRelationshipMapping()
- {
- return xmlRelationshipMappingEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#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.XmlRelationshipMapping#getTargetEntity()
- * @see #getXmlRelationshipMapping()
- * @generated
- */
- public EAttribute getXmlRelationshipMapping_TargetEntity()
- {
- return (EAttribute)xmlRelationshipMappingEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#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.XmlRelationshipMapping#getFetch()
- * @see #getXmlRelationshipMapping()
- * @generated
- */
- public EAttribute getXmlRelationshipMapping_Fetch()
- {
- return (EAttribute)xmlRelationshipMappingEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#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.XmlRelationshipMapping#getJoinTable()
- * @see #getXmlRelationshipMapping()
- * @generated
- */
- public EReference getXmlRelationshipMapping_JoinTable()
- {
- return (EReference)xmlRelationshipMappingEClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#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.XmlRelationshipMapping#getCascade()
- * @see #getXmlRelationshipMapping()
- * @generated
- */
- public EReference getXmlRelationshipMapping_Cascade()
- {
- return (EReference)xmlRelationshipMappingEClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping <em>Xml Multi Relationship Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Multi Relationship Mapping</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping
- * @generated
- */
- public EClass getXmlMultiRelationshipMapping()
- {
- return xmlMultiRelationshipMappingEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping#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.XmlMultiRelationshipMapping#getMappedBy()
- * @see #getXmlMultiRelationshipMapping()
- * @generated
- */
- public EAttribute getXmlMultiRelationshipMapping_MappedBy()
- {
- return (EAttribute)xmlMultiRelationshipMappingEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping#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.XmlMultiRelationshipMapping#getOrderBy()
- * @see #getXmlMultiRelationshipMapping()
- * @generated
- */
- public EAttribute getXmlMultiRelationshipMapping_OrderBy()
- {
- return (EAttribute)xmlMultiRelationshipMappingEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping#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.XmlMultiRelationshipMapping#getMapKey()
- * @see #getXmlMultiRelationshipMapping()
- * @generated
- */
- public EReference getXmlMultiRelationshipMapping_MapKey()
- {
- return (EReference)xmlMultiRelationshipMappingEClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping <em>Xml Single Relationship Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Single Relationship Mapping</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping
- * @generated
- */
- public EClass getXmlSingleRelationshipMapping()
- {
- return xmlSingleRelationshipMappingEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping#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.XmlSingleRelationshipMapping#getOptional()
- * @see #getXmlSingleRelationshipMapping()
- * @generated
- */
- public EAttribute getXmlSingleRelationshipMapping_Optional()
- {
- return (EAttribute)xmlSingleRelationshipMappingEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping#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.XmlSingleRelationshipMapping#getJoinColumns()
- * @see #getXmlSingleRelationshipMapping()
- * @generated
- */
- public EReference getXmlSingleRelationshipMapping_JoinColumns()
- {
- return (EReference)xmlSingleRelationshipMappingEClass.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 the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlId#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.XmlId#getTableGenerator()
- * @see #getXmlId()
- * @generated
- */
- public EReference getXmlId_TableGenerator()
- {
- return (EReference)xmlIdEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlId#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.XmlId#getSequenceGenerator()
- * @see #getXmlId()
- * @generated
- */
- public EReference getXmlId_SequenceGenerator()
- {
- return (EReference)xmlIdEClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlIdImpl <em>Xml Id Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Id Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlIdImpl
- * @generated
- */
- public EClass getXmlIdImpl()
- {
- return xmlIdImplEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.BaseXmlEmbedded <em>Base Xml Embedded</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Base Xml Embedded</em>'.
- * @see org.eclipse.jpt.core.resource.orm.BaseXmlEmbedded
- * @generated
- */
- public EClass getBaseXmlEmbedded()
- {
- return baseXmlEmbeddedEClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.BaseXmlEmbedded#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.BaseXmlEmbedded#getAttributeOverrides()
- * @see #getBaseXmlEmbedded()
- * @generated
- */
- public EReference getBaseXmlEmbedded_AttributeOverrides()
- {
- return (EReference)baseXmlEmbeddedEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * 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.XmlEmbeddedIdImpl <em>Xml Embedded Id Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Embedded Id Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbeddedIdImpl
- * @generated
- */
- public EClass getXmlEmbeddedIdImpl()
- {
- return xmlEmbeddedIdImplEClass;
- }
-
-
- /**
- * 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.XmlBasicImpl <em>Xml Basic Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Basic Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlBasicImpl
- * @generated
- */
- public EClass getXmlBasicImpl()
- {
- return xmlBasicImplEClass;
- }
-
-
- /**
- * 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.XmlVersionImpl <em>Xml Version Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Version Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlVersionImpl
- * @generated
- */
- public EClass getXmlVersionImpl()
- {
- return xmlVersionImplEClass;
- }
-
-
- /**
- * 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.XmlManyToOneImpl <em>Xml Many To One Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Many To One Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlManyToOneImpl
- * @generated
- */
- public EClass getXmlManyToOneImpl()
- {
- return xmlManyToOneImplEClass;
- }
-
-
- /**
- * 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 the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlOneToMany#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.XmlOneToMany#getJoinColumns()
- * @see #getXmlOneToMany()
- * @generated
- */
- public EReference getXmlOneToMany_JoinColumns()
- {
- return (EReference)xmlOneToManyEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlOneToManyImpl <em>Xml One To Many Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To Many Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToManyImpl
- * @generated
- */
- public EClass getXmlOneToManyImpl()
- {
- return xmlOneToManyImplEClass;
- }
-
-
- /**
- * 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 attribute '{@link org.eclipse.jpt.core.resource.orm.XmlOneToOne#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.XmlOneToOne#getMappedBy()
- * @see #getXmlOneToOne()
- * @generated
- */
- public EAttribute getXmlOneToOne_MappedBy()
- {
- return (EAttribute)xmlOneToOneEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * 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(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlOneToOneImpl <em>Xml One To One Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To One Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToOneImpl
- * @generated
- */
- public EClass getXmlOneToOneImpl()
- {
- return xmlOneToOneImplEClass;
- }
-
-
- /**
- * 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.XmlManyToManyImpl <em>Xml Many To Many Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Many To Many Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlManyToManyImpl
- * @generated
- */
- public EClass getXmlManyToManyImpl()
- {
- return xmlManyToManyImplEClass;
- }
-
-
- /**
- * 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.XmlEmbeddedImpl <em>Xml Embedded Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Embedded Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbeddedImpl
- * @generated
- */
- public EClass getXmlEmbeddedImpl()
- {
- return xmlEmbeddedImplEClass;
- }
-
-
- /**
- * 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.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.XmlTransientImpl <em>Xml Transient Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Transient Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTransientImpl
- * @generated
- */
- public EClass getXmlTransientImpl()
- {
- return xmlTransientImplEClass;
- }
-
-
- /**
- * 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 the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverride#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.XmlAssociationOverride#getJoinColumns()
- * @see #getXmlAssociationOverride()
- * @generated
- */
- public EReference getXmlAssociationOverride_JoinColumns()
- {
- return (EReference)xmlAssociationOverrideEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverride#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.XmlAssociationOverride#getName()
- * @see #getXmlAssociationOverride()
- * @generated
- */
- public EAttribute getXmlAssociationOverride_Name()
- {
- return (EAttribute)xmlAssociationOverrideEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverrideImpl <em>Xml Association Override Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Association Override Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAssociationOverrideImpl
- * @generated
- */
- public EClass getXmlAssociationOverrideImpl()
- {
- return xmlAssociationOverrideImplEClass;
- }
-
-
- /**
- * 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 the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride#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.XmlAttributeOverride#getName()
- * @see #getXmlAttributeOverride()
- * @generated
- */
- public EAttribute getXmlAttributeOverride_Name()
- {
- return (EAttribute)xmlAttributeOverrideEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideImpl <em>Xml Attribute Override Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Attribute Override Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideImpl
- * @generated
- */
- public EClass getXmlAttributeOverrideImpl()
- {
- return xmlAttributeOverrideImplEClass;
- }
-
-
- /**
- * 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.CascadeTypeImpl <em>Cascade Type Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Cascade Type Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.CascadeTypeImpl
- * @generated
- */
- public EClass getCascadeTypeImpl()
- {
- return cascadeTypeImplEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlNamedColumn <em>Xml Named Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Named Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlNamedColumn
- * @generated
- */
- public EClass getXmlNamedColumn()
- {
- return xmlNamedColumnEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlNamedColumn#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.XmlNamedColumn#getColumnDefinition()
- * @see #getXmlNamedColumn()
- * @generated
- */
- public EAttribute getXmlNamedColumn_ColumnDefinition()
- {
- return (EAttribute)xmlNamedColumnEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlNamedColumn#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.XmlNamedColumn#getName()
- * @see #getXmlNamedColumn()
- * @generated
- */
- public EAttribute getXmlNamedColumn_Name()
- {
- return (EAttribute)xmlNamedColumnEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * 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 class '{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn <em>Xml Abstract Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Abstract Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAbstractColumn
- * @generated
- */
- public EClass getXmlAbstractColumn()
- {
- return xmlAbstractColumnEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#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.XmlAbstractColumn#getInsertable()
- * @see #getXmlAbstractColumn()
- * @generated
- */
- public EAttribute getXmlAbstractColumn_Insertable()
- {
- return (EAttribute)xmlAbstractColumnEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#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.XmlAbstractColumn#getNullable()
- * @see #getXmlAbstractColumn()
- * @generated
- */
- public EAttribute getXmlAbstractColumn_Nullable()
- {
- return (EAttribute)xmlAbstractColumnEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#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.XmlAbstractColumn#getTable()
- * @see #getXmlAbstractColumn()
- * @generated
- */
- public EAttribute getXmlAbstractColumn_Table()
- {
- return (EAttribute)xmlAbstractColumnEClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#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.XmlAbstractColumn#getUnique()
- * @see #getXmlAbstractColumn()
- * @generated
- */
- public EAttribute getXmlAbstractColumn_Unique()
- {
- return (EAttribute)xmlAbstractColumnEClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#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.XmlAbstractColumn#getUpdatable()
- * @see #getXmlAbstractColumn()
- * @generated
- */
- public EAttribute getXmlAbstractColumn_Updatable()
- {
- return (EAttribute)xmlAbstractColumnEClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlAbstractColumn <em>Abstract Xml Abstract Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Abstract Xml Abstract Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlAbstractColumn
- * @generated
- */
- public EClass getAbstractXmlAbstractColumn()
- {
- return abstractXmlAbstractColumnEClass;
- }
-
-
- /**
- * 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.XmlColumnImpl <em>Xml Column Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Column Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlColumnImpl
- * @generated
- */
- public EClass getXmlColumnImpl()
- {
- return xmlColumnImplEClass;
- }
-
-
- /**
- * 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.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.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.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 the containment reference '{@link org.eclipse.jpt.core.resource.orm.EntityListener#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.EntityListener#getPrePersist()
- * @see #getEntityListener()
- * @generated
- */
- public EReference getEntityListener_PrePersist()
- {
- return (EReference)entityListenerEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.EntityListener#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.EntityListener#getPostPersist()
- * @see #getEntityListener()
- * @generated
- */
- public EReference getEntityListener_PostPersist()
- {
- return (EReference)entityListenerEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.EntityListener#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.EntityListener#getPreRemove()
- * @see #getEntityListener()
- * @generated
- */
- public EReference getEntityListener_PreRemove()
- {
- return (EReference)entityListenerEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.EntityListener#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.EntityListener#getPostRemove()
- * @see #getEntityListener()
- * @generated
- */
- public EReference getEntityListener_PostRemove()
- {
- return (EReference)entityListenerEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.EntityListener#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.EntityListener#getPreUpdate()
- * @see #getEntityListener()
- * @generated
- */
- public EReference getEntityListener_PreUpdate()
- {
- return (EReference)entityListenerEClass.getEStructuralFeatures().get(5);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.EntityListener#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.EntityListener#getPostUpdate()
- * @see #getEntityListener()
- * @generated
- */
- public EReference getEntityListener_PostUpdate()
- {
- return (EReference)entityListenerEClass.getEStructuralFeatures().get(6);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.EntityListener#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.EntityListener#getPostLoad()
- * @see #getEntityListener()
- * @generated
- */
- public EReference getEntityListener_PostLoad()
- {
- return (EReference)entityListenerEClass.getEStructuralFeatures().get(7);
- }
-
- /**
- * 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.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.XmlGeneratedValueImpl <em>Xml Generated Value Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Generated Value Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlGeneratedValueImpl
- * @generated
- */
- public EClass getXmlGeneratedValueImpl()
- {
- return xmlGeneratedValueImplEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlIdClass <em>Xml Id Class</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Id Class</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlIdClass
- * @generated
- */
- public EClass getXmlIdClass()
- {
- return xmlIdClassEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlIdClass#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.XmlIdClass#getClassName()
- * @see #getXmlIdClass()
- * @generated
- */
- public EAttribute getXmlIdClass_ClassName()
- {
- return (EAttribute)xmlIdClassEClass.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.XmlJoinColumnImpl <em>Xml Join Column Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Join Column Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinColumnImpl
- * @generated
- */
- public EClass getXmlJoinColumnImpl()
- {
- return xmlJoinColumnImplEClass;
- }
-
-
- /**
- * 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#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.XmlJoinTable#getJoinColumns()
- * @see #getXmlJoinTable()
- * @generated
- */
- public EReference getXmlJoinTable_JoinColumns()
- {
- return (EReference)xmlJoinTableEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * 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(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlJoinTableImpl <em>Xml Join Table Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Join Table Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinTableImpl
- * @generated
- */
- public EClass getXmlJoinTableImpl()
- {
- return xmlJoinTableImplEClass;
- }
-
-
- /**
- * 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.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.MapKeyImpl <em>Map Key Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Map Key Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.MapKeyImpl
- * @generated
- */
- public EClass getMapKeyImpl()
- {
- return mapKeyImplEClass;
- }
-
-
- /**
- * 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.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.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.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.XmlPrimaryKeyJoinColumnImpl <em>Xml Primary Key Join Column Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Primary Key Join Column Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumnImpl
- * @generated
- */
- public EClass getXmlPrimaryKeyJoinColumnImpl()
- {
- return xmlPrimaryKeyJoinColumnImplEClass;
- }
-
-
- /**
- * 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.AbstractXmlBaseTable <em>Abstract Xml Base Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Abstract Xml Base Table</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlBaseTable
- * @generated
- */
- public EClass getAbstractXmlBaseTable()
- {
- return abstractXmlBaseTableEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlBaseTable <em>Xml Base Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Base Table</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlBaseTable
- * @generated
- */
- public EClass getXmlBaseTable()
- {
- return xmlBaseTableEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlBaseTable#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.XmlBaseTable#getName()
- * @see #getXmlBaseTable()
- * @generated
- */
- public EAttribute getXmlBaseTable_Name()
- {
- return (EAttribute)xmlBaseTableEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlBaseTable#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.XmlBaseTable#getCatalog()
- * @see #getXmlBaseTable()
- * @generated
- */
- public EAttribute getXmlBaseTable_Catalog()
- {
- return (EAttribute)xmlBaseTableEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlBaseTable#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.XmlBaseTable#getSchema()
- * @see #getXmlBaseTable()
- * @generated
- */
- public EAttribute getXmlBaseTable_Schema()
- {
- return (EAttribute)xmlBaseTableEClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlBaseTable#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.XmlBaseTable#getUniqueConstraints()
- * @see #getXmlBaseTable()
- * @generated
- */
- public EReference getXmlBaseTable_UniqueConstraints()
- {
- return (EReference)xmlBaseTableEClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * 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.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.XmlSecondaryTableImpl <em>Xml Secondary Table Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Secondary Table Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlSecondaryTableImpl
- * @generated
- */
- public EClass getXmlSecondaryTableImpl()
- {
- return xmlSecondaryTableImplEClass;
- }
-
-
- /**
- * 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.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.XmlSequenceGeneratorImpl <em>Xml Sequence Generator Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Sequence Generator Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlSequenceGeneratorImpl
- * @generated
- */
- public EClass getXmlSequenceGeneratorImpl()
- {
- return xmlSequenceGeneratorImplEClass;
- }
-
-
- /**
- * 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.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.XmlTableGeneratorImpl <em>Xml Table Generator Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Table Generator Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGeneratorImpl
- * @generated
- */
- public EClass getXmlTableGeneratorImpl()
- {
- return xmlTableGeneratorImplEClass;
- }
-
-
- /**
- * 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.XmlUniqueConstraintImpl <em>Xml Unique Constraint Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Unique Constraint Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlUniqueConstraintImpl
- * @generated
- */
- public EClass getXmlUniqueConstraintImpl()
- {
- return xmlUniqueConstraintImplEClass;
- }
-
-
- /**
- * 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 meta object for data type '{@link java.lang.String <em>Discriminator Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for data type '<em>Discriminator Value</em>'.
- * @see java.lang.String
- * @model instanceClass="java.lang.String"
- * @generated
- */
- public EDataType getDiscriminatorValue()
- {
- return discriminatorValueEDataType;
- }
-
- /**
- * Returns the meta object for data type '{@link org.eclipse.emf.common.util.Enumerator <em>Enumerated</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for data type '<em>Enumerated</em>'.
- * @see org.eclipse.emf.common.util.Enumerator
- * @model instanceClass="org.eclipse.emf.common.util.Enumerator"
- * @generated
- */
- public EDataType getEnumerated()
- {
- return enumeratedEDataType;
- }
-
- /**
- * Returns the meta object for data type '{@link java.lang.String <em>Order By</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for data type '<em>Order By</em>'.
- * @see java.lang.String
- * @model instanceClass="java.lang.String"
- * @generated
- */
- public EDataType getOrderBy()
- {
- return orderByEDataType;
- }
-
- /**
- * Returns the meta object for data type '{@link java.lang.String <em>Version Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for data type '<em>Version Type</em>'.
- * @see java.lang.String
- * @model instanceClass="java.lang.String"
- * @generated
- */
- public EDataType getVersionType()
- {
- return versionTypeEDataType;
- }
-
- /**
- * 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
- xmlEntityMappingsEClass = createEClass(XML_ENTITY_MAPPINGS);
- createEAttribute(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__VERSION);
- 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);
- createEAttribute(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__ACCESS);
- createEReference(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS);
- createEReference(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__TABLE_GENERATORS);
- createEReference(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__NAMED_QUERIES);
- createEReference(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES);
- 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);
-
- 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);
-
- 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__ACCESS);
- createEAttribute(xmlPersistenceUnitDefaultsEClass, XML_PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST);
- createEReference(xmlPersistenceUnitDefaultsEClass, XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS);
-
- abstractXmlTypeMappingEClass = createEClass(ABSTRACT_XML_TYPE_MAPPING);
- createEAttribute(abstractXmlTypeMappingEClass, ABSTRACT_XML_TYPE_MAPPING__CLASS_NAME);
- createEAttribute(abstractXmlTypeMappingEClass, ABSTRACT_XML_TYPE_MAPPING__ACCESS);
- createEAttribute(abstractXmlTypeMappingEClass, ABSTRACT_XML_TYPE_MAPPING__METADATA_COMPLETE);
- createEAttribute(abstractXmlTypeMappingEClass, ABSTRACT_XML_TYPE_MAPPING__DESCRIPTION);
- createEReference(abstractXmlTypeMappingEClass, ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES);
-
- xmlMappedSuperclassEClass = createEClass(XML_MAPPED_SUPERCLASS);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__ID_CLASS);
- createEAttribute(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS);
- createEAttribute(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__PRE_PERSIST);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__POST_PERSIST);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__PRE_REMOVE);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__POST_REMOVE);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__PRE_UPDATE);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__POST_UPDATE);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__POST_LOAD);
-
- 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__ID_CLASS);
- createEReference(xmlEntityEClass, XML_ENTITY__INHERITANCE);
- createEAttribute(xmlEntityEClass, XML_ENTITY__DISCRIMINATOR_VALUE);
- createEReference(xmlEntityEClass, XML_ENTITY__DISCRIMINATOR_COLUMN);
- createEReference(xmlEntityEClass, XML_ENTITY__SEQUENCE_GENERATOR);
- createEReference(xmlEntityEClass, XML_ENTITY__TABLE_GENERATOR);
- createEReference(xmlEntityEClass, XML_ENTITY__NAMED_QUERIES);
- createEReference(xmlEntityEClass, XML_ENTITY__NAMED_NATIVE_QUERIES);
- 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);
- createEReference(xmlEntityEClass, XML_ENTITY__PRE_PERSIST);
- createEReference(xmlEntityEClass, XML_ENTITY__POST_PERSIST);
- createEReference(xmlEntityEClass, XML_ENTITY__PRE_REMOVE);
- createEReference(xmlEntityEClass, XML_ENTITY__POST_REMOVE);
- createEReference(xmlEntityEClass, XML_ENTITY__PRE_UPDATE);
- createEReference(xmlEntityEClass, XML_ENTITY__POST_UPDATE);
- createEReference(xmlEntityEClass, XML_ENTITY__POST_LOAD);
- createEReference(xmlEntityEClass, XML_ENTITY__ATTRIBUTE_OVERRIDES);
- createEReference(xmlEntityEClass, XML_ENTITY__ASSOCIATION_OVERRIDES);
-
- xmlEmbeddableEClass = createEClass(XML_EMBEDDABLE);
-
- 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);
-
- xmlAttributeMappingEClass = createEClass(XML_ATTRIBUTE_MAPPING);
- createEAttribute(xmlAttributeMappingEClass, XML_ATTRIBUTE_MAPPING__NAME);
-
- abstractXmlAttributeMappingEClass = createEClass(ABSTRACT_XML_ATTRIBUTE_MAPPING);
-
- xmlNullAttributeMappingEClass = createEClass(XML_NULL_ATTRIBUTE_MAPPING);
-
- columnMappingEClass = createEClass(COLUMN_MAPPING);
- createEReference(columnMappingEClass, COLUMN_MAPPING__COLUMN);
-
- xmlRelationshipMappingEClass = createEClass(XML_RELATIONSHIP_MAPPING);
- createEAttribute(xmlRelationshipMappingEClass, XML_RELATIONSHIP_MAPPING__TARGET_ENTITY);
- createEAttribute(xmlRelationshipMappingEClass, XML_RELATIONSHIP_MAPPING__FETCH);
- createEReference(xmlRelationshipMappingEClass, XML_RELATIONSHIP_MAPPING__JOIN_TABLE);
- createEReference(xmlRelationshipMappingEClass, XML_RELATIONSHIP_MAPPING__CASCADE);
-
- xmlMultiRelationshipMappingEClass = createEClass(XML_MULTI_RELATIONSHIP_MAPPING);
- createEAttribute(xmlMultiRelationshipMappingEClass, XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY);
- createEAttribute(xmlMultiRelationshipMappingEClass, XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY);
- createEReference(xmlMultiRelationshipMappingEClass, XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY);
-
- xmlSingleRelationshipMappingEClass = createEClass(XML_SINGLE_RELATIONSHIP_MAPPING);
- createEAttribute(xmlSingleRelationshipMappingEClass, XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL);
- createEReference(xmlSingleRelationshipMappingEClass, XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS);
-
- xmlIdEClass = createEClass(XML_ID);
- createEReference(xmlIdEClass, XML_ID__GENERATED_VALUE);
- createEReference(xmlIdEClass, XML_ID__TABLE_GENERATOR);
- createEReference(xmlIdEClass, XML_ID__SEQUENCE_GENERATOR);
-
- xmlIdImplEClass = createEClass(XML_ID_IMPL);
-
- baseXmlEmbeddedEClass = createEClass(BASE_XML_EMBEDDED);
- createEReference(baseXmlEmbeddedEClass, BASE_XML_EMBEDDED__ATTRIBUTE_OVERRIDES);
-
- xmlEmbeddedIdEClass = createEClass(XML_EMBEDDED_ID);
-
- xmlEmbeddedIdImplEClass = createEClass(XML_EMBEDDED_ID_IMPL);
-
- xmlEmbeddedEClass = createEClass(XML_EMBEDDED);
-
- xmlEmbeddedImplEClass = createEClass(XML_EMBEDDED_IMPL);
-
- xmlConvertibleMappingEClass = createEClass(XML_CONVERTIBLE_MAPPING);
- createEAttribute(xmlConvertibleMappingEClass, XML_CONVERTIBLE_MAPPING__LOB);
- createEAttribute(xmlConvertibleMappingEClass, XML_CONVERTIBLE_MAPPING__TEMPORAL);
- createEAttribute(xmlConvertibleMappingEClass, XML_CONVERTIBLE_MAPPING__ENUMERATED);
-
- xmlBasicEClass = createEClass(XML_BASIC);
- createEAttribute(xmlBasicEClass, XML_BASIC__FETCH);
- createEAttribute(xmlBasicEClass, XML_BASIC__OPTIONAL);
-
- xmlBasicImplEClass = createEClass(XML_BASIC_IMPL);
-
- xmlVersionEClass = createEClass(XML_VERSION);
-
- xmlVersionImplEClass = createEClass(XML_VERSION_IMPL);
-
- xmlManyToOneEClass = createEClass(XML_MANY_TO_ONE);
-
- xmlManyToOneImplEClass = createEClass(XML_MANY_TO_ONE_IMPL);
-
- xmlOneToManyEClass = createEClass(XML_ONE_TO_MANY);
- createEReference(xmlOneToManyEClass, XML_ONE_TO_MANY__JOIN_COLUMNS);
-
- xmlOneToManyImplEClass = createEClass(XML_ONE_TO_MANY_IMPL);
-
- xmlOneToOneEClass = createEClass(XML_ONE_TO_ONE);
- createEAttribute(xmlOneToOneEClass, XML_ONE_TO_ONE__MAPPED_BY);
- createEReference(xmlOneToOneEClass, XML_ONE_TO_ONE__PRIMARY_KEY_JOIN_COLUMNS);
-
- xmlOneToOneImplEClass = createEClass(XML_ONE_TO_ONE_IMPL);
-
- xmlManyToManyEClass = createEClass(XML_MANY_TO_MANY);
-
- xmlManyToManyImplEClass = createEClass(XML_MANY_TO_MANY_IMPL);
-
- xmlTransientEClass = createEClass(XML_TRANSIENT);
-
- xmlTransientImplEClass = createEClass(XML_TRANSIENT_IMPL);
-
- xmlAssociationOverrideEClass = createEClass(XML_ASSOCIATION_OVERRIDE);
- createEReference(xmlAssociationOverrideEClass, XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS);
- createEAttribute(xmlAssociationOverrideEClass, XML_ASSOCIATION_OVERRIDE__NAME);
-
- xmlAssociationOverrideImplEClass = createEClass(XML_ASSOCIATION_OVERRIDE_IMPL);
-
- xmlAttributeOverrideEClass = createEClass(XML_ATTRIBUTE_OVERRIDE);
- createEReference(xmlAttributeOverrideEClass, XML_ATTRIBUTE_OVERRIDE__COLUMN);
- createEAttribute(xmlAttributeOverrideEClass, XML_ATTRIBUTE_OVERRIDE__NAME);
-
- xmlAttributeOverrideImplEClass = createEClass(XML_ATTRIBUTE_OVERRIDE_IMPL);
-
- 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);
-
- cascadeTypeImplEClass = createEClass(CASCADE_TYPE_IMPL);
-
- xmlNamedColumnEClass = createEClass(XML_NAMED_COLUMN);
- createEAttribute(xmlNamedColumnEClass, XML_NAMED_COLUMN__COLUMN_DEFINITION);
- createEAttribute(xmlNamedColumnEClass, XML_NAMED_COLUMN__NAME);
-
- abstractXmlNamedColumnEClass = createEClass(ABSTRACT_XML_NAMED_COLUMN);
-
- xmlAbstractColumnEClass = createEClass(XML_ABSTRACT_COLUMN);
- createEAttribute(xmlAbstractColumnEClass, XML_ABSTRACT_COLUMN__INSERTABLE);
- createEAttribute(xmlAbstractColumnEClass, XML_ABSTRACT_COLUMN__NULLABLE);
- createEAttribute(xmlAbstractColumnEClass, XML_ABSTRACT_COLUMN__TABLE);
- createEAttribute(xmlAbstractColumnEClass, XML_ABSTRACT_COLUMN__UNIQUE);
- createEAttribute(xmlAbstractColumnEClass, XML_ABSTRACT_COLUMN__UPDATABLE);
-
- abstractXmlAbstractColumnEClass = createEClass(ABSTRACT_XML_ABSTRACT_COLUMN);
-
- xmlColumnEClass = createEClass(XML_COLUMN);
- createEAttribute(xmlColumnEClass, XML_COLUMN__LENGTH);
- createEAttribute(xmlColumnEClass, XML_COLUMN__PRECISION);
- createEAttribute(xmlColumnEClass, XML_COLUMN__SCALE);
-
- xmlColumnImplEClass = createEClass(XML_COLUMN_IMPL);
-
- columnResultEClass = createEClass(COLUMN_RESULT);
- createEAttribute(columnResultEClass, COLUMN_RESULT__NAME);
-
- xmlDiscriminatorColumnEClass = createEClass(XML_DISCRIMINATOR_COLUMN);
- createEAttribute(xmlDiscriminatorColumnEClass, XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE);
- createEAttribute(xmlDiscriminatorColumnEClass, XML_DISCRIMINATOR_COLUMN__LENGTH);
-
- entityListenersEClass = createEClass(ENTITY_LISTENERS);
- createEReference(entityListenersEClass, ENTITY_LISTENERS__ENTITY_LISTENERS);
-
- entityListenerEClass = createEClass(ENTITY_LISTENER);
- createEAttribute(entityListenerEClass, ENTITY_LISTENER__CLASS_NAME);
- createEReference(entityListenerEClass, ENTITY_LISTENER__PRE_PERSIST);
- createEReference(entityListenerEClass, ENTITY_LISTENER__POST_PERSIST);
- createEReference(entityListenerEClass, ENTITY_LISTENER__PRE_REMOVE);
- createEReference(entityListenerEClass, ENTITY_LISTENER__POST_REMOVE);
- createEReference(entityListenerEClass, ENTITY_LISTENER__PRE_UPDATE);
- createEReference(entityListenerEClass, ENTITY_LISTENER__POST_UPDATE);
- createEReference(entityListenerEClass, ENTITY_LISTENER__POST_LOAD);
-
- 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);
-
- 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);
-
- xmlGeneratedValueImplEClass = createEClass(XML_GENERATED_VALUE_IMPL);
-
- xmlIdClassEClass = createEClass(XML_ID_CLASS);
- createEAttribute(xmlIdClassEClass, XML_ID_CLASS__CLASS_NAME);
-
- inheritanceEClass = createEClass(INHERITANCE);
- createEAttribute(inheritanceEClass, INHERITANCE__STRATEGY);
-
- xmlJoinColumnEClass = createEClass(XML_JOIN_COLUMN);
- createEAttribute(xmlJoinColumnEClass, XML_JOIN_COLUMN__REFERENCED_COLUMN_NAME);
-
- xmlJoinColumnImplEClass = createEClass(XML_JOIN_COLUMN_IMPL);
-
- xmlJoinTableEClass = createEClass(XML_JOIN_TABLE);
- createEReference(xmlJoinTableEClass, XML_JOIN_TABLE__JOIN_COLUMNS);
- createEReference(xmlJoinTableEClass, XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS);
-
- xmlJoinTableImplEClass = createEClass(XML_JOIN_TABLE_IMPL);
-
- lobEClass = createEClass(LOB);
-
- mapKeyEClass = createEClass(MAP_KEY);
- createEAttribute(mapKeyEClass, MAP_KEY__NAME);
-
- mapKeyImplEClass = createEClass(MAP_KEY_IMPL);
-
- xmlQueryEClass = createEClass(XML_QUERY);
- createEAttribute(xmlQueryEClass, XML_QUERY__NAME);
- createEAttribute(xmlQueryEClass, XML_QUERY__QUERY);
- createEReference(xmlQueryEClass, XML_QUERY__HINTS);
-
- 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);
-
- 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);
-
- xmlPrimaryKeyJoinColumnImplEClass = createEClass(XML_PRIMARY_KEY_JOIN_COLUMN_IMPL);
-
- xmlQueryHintEClass = createEClass(XML_QUERY_HINT);
- createEAttribute(xmlQueryHintEClass, XML_QUERY_HINT__NAME);
- createEAttribute(xmlQueryHintEClass, XML_QUERY_HINT__VALUE);
-
- abstractXmlBaseTableEClass = createEClass(ABSTRACT_XML_BASE_TABLE);
-
- xmlBaseTableEClass = createEClass(XML_BASE_TABLE);
- createEAttribute(xmlBaseTableEClass, XML_BASE_TABLE__NAME);
- createEAttribute(xmlBaseTableEClass, XML_BASE_TABLE__CATALOG);
- createEAttribute(xmlBaseTableEClass, XML_BASE_TABLE__SCHEMA);
- createEReference(xmlBaseTableEClass, XML_BASE_TABLE__UNIQUE_CONSTRAINTS);
-
- xmlTableEClass = createEClass(XML_TABLE);
-
- xmlSecondaryTableEClass = createEClass(XML_SECONDARY_TABLE);
- createEReference(xmlSecondaryTableEClass, XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS);
-
- xmlSecondaryTableImplEClass = createEClass(XML_SECONDARY_TABLE_IMPL);
-
- xmlGeneratorEClass = createEClass(XML_GENERATOR);
- createEAttribute(xmlGeneratorEClass, XML_GENERATOR__NAME);
- createEAttribute(xmlGeneratorEClass, XML_GENERATOR__INITIAL_VALUE);
- createEAttribute(xmlGeneratorEClass, XML_GENERATOR__ALLOCATION_SIZE);
-
- xmlSequenceGeneratorEClass = createEClass(XML_SEQUENCE_GENERATOR);
- createEAttribute(xmlSequenceGeneratorEClass, XML_SEQUENCE_GENERATOR__SEQUENCE_NAME);
-
- xmlSequenceGeneratorImplEClass = createEClass(XML_SEQUENCE_GENERATOR_IMPL);
-
- 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);
-
- 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);
-
- xmlTableGeneratorImplEClass = createEClass(XML_TABLE_GENERATOR_IMPL);
-
- xmlUniqueConstraintEClass = createEClass(XML_UNIQUE_CONSTRAINT);
- createEAttribute(xmlUniqueConstraintEClass, XML_UNIQUE_CONSTRAINT__COLUMN_NAMES);
-
- xmlUniqueConstraintImplEClass = createEClass(XML_UNIQUE_CONSTRAINT_IMPL);
-
- // 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);
-
- // Create data types
- discriminatorValueEDataType = createEDataType(DISCRIMINATOR_VALUE);
- enumeratedEDataType = createEDataType(ENUMERATED);
- orderByEDataType = createEDataType(ORDER_BY);
- versionTypeEDataType = createEDataType(VERSION_TYPE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents()
- {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- xmlMappedSuperclassEClass.getESuperTypes().add(this.getAbstractXmlTypeMapping());
- xmlEntityEClass.getESuperTypes().add(this.getAbstractXmlTypeMapping());
- xmlEmbeddableEClass.getESuperTypes().add(this.getAbstractXmlTypeMapping());
- abstractXmlAttributeMappingEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlNullAttributeMappingEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlRelationshipMappingEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlMultiRelationshipMappingEClass.getESuperTypes().add(this.getXmlRelationshipMapping());
- xmlSingleRelationshipMappingEClass.getESuperTypes().add(this.getXmlRelationshipMapping());
- xmlIdEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlIdEClass.getESuperTypes().add(this.getColumnMapping());
- xmlIdEClass.getESuperTypes().add(this.getXmlConvertibleMapping());
- xmlIdImplEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlIdImplEClass.getESuperTypes().add(this.getXmlId());
- baseXmlEmbeddedEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlEmbeddedIdEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlEmbeddedIdEClass.getESuperTypes().add(this.getBaseXmlEmbedded());
- xmlEmbeddedIdImplEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlEmbeddedIdImplEClass.getESuperTypes().add(this.getXmlEmbeddedId());
- xmlEmbeddedEClass.getESuperTypes().add(this.getBaseXmlEmbedded());
- xmlEmbeddedImplEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlEmbeddedImplEClass.getESuperTypes().add(this.getXmlEmbedded());
- xmlBasicEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlBasicEClass.getESuperTypes().add(this.getColumnMapping());
- xmlBasicEClass.getESuperTypes().add(this.getXmlConvertibleMapping());
- xmlBasicImplEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlBasicImplEClass.getESuperTypes().add(this.getXmlBasic());
- xmlVersionEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlVersionEClass.getESuperTypes().add(this.getColumnMapping());
- xmlVersionEClass.getESuperTypes().add(this.getXmlConvertibleMapping());
- xmlVersionImplEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlVersionImplEClass.getESuperTypes().add(this.getXmlVersion());
- xmlManyToOneEClass.getESuperTypes().add(this.getXmlSingleRelationshipMapping());
- xmlManyToOneImplEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlManyToOneImplEClass.getESuperTypes().add(this.getXmlManyToOne());
- xmlOneToManyEClass.getESuperTypes().add(this.getXmlMultiRelationshipMapping());
- xmlOneToManyImplEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlOneToManyImplEClass.getESuperTypes().add(this.getXmlOneToMany());
- xmlOneToOneEClass.getESuperTypes().add(this.getXmlSingleRelationshipMapping());
- xmlOneToOneImplEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlOneToOneImplEClass.getESuperTypes().add(this.getXmlOneToOne());
- xmlManyToManyEClass.getESuperTypes().add(this.getXmlMultiRelationshipMapping());
- xmlManyToManyImplEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlManyToManyImplEClass.getESuperTypes().add(this.getXmlManyToMany());
- xmlTransientEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlTransientImplEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlTransientImplEClass.getESuperTypes().add(this.getXmlTransient());
- xmlAssociationOverrideImplEClass.getESuperTypes().add(this.getXmlAssociationOverride());
- xmlAttributeOverrideImplEClass.getESuperTypes().add(this.getXmlAttributeOverride());
- cascadeTypeImplEClass.getESuperTypes().add(this.getCascadeType());
- abstractXmlNamedColumnEClass.getESuperTypes().add(this.getXmlNamedColumn());
- xmlAbstractColumnEClass.getESuperTypes().add(this.getXmlNamedColumn());
- abstractXmlAbstractColumnEClass.getESuperTypes().add(this.getAbstractXmlNamedColumn());
- abstractXmlAbstractColumnEClass.getESuperTypes().add(this.getXmlAbstractColumn());
- xmlColumnEClass.getESuperTypes().add(this.getXmlAbstractColumn());
- xmlColumnImplEClass.getESuperTypes().add(this.getAbstractXmlAbstractColumn());
- xmlColumnImplEClass.getESuperTypes().add(this.getXmlColumn());
- xmlDiscriminatorColumnEClass.getESuperTypes().add(this.getAbstractXmlNamedColumn());
- xmlGeneratedValueImplEClass.getESuperTypes().add(this.getXmlGeneratedValue());
- xmlJoinColumnEClass.getESuperTypes().add(this.getXmlAbstractColumn());
- xmlJoinColumnImplEClass.getESuperTypes().add(this.getAbstractXmlAbstractColumn());
- xmlJoinColumnImplEClass.getESuperTypes().add(this.getXmlJoinColumn());
- xmlJoinTableEClass.getESuperTypes().add(this.getXmlBaseTable());
- xmlJoinTableImplEClass.getESuperTypes().add(this.getAbstractXmlBaseTable());
- xmlJoinTableImplEClass.getESuperTypes().add(this.getXmlJoinTable());
- mapKeyImplEClass.getESuperTypes().add(this.getMapKey());
- xmlNamedNativeQueryEClass.getESuperTypes().add(this.getXmlQuery());
- xmlNamedQueryEClass.getESuperTypes().add(this.getXmlQuery());
- 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.getXmlNamedColumn());
- xmlPrimaryKeyJoinColumnImplEClass.getESuperTypes().add(this.getAbstractXmlNamedColumn());
- xmlPrimaryKeyJoinColumnImplEClass.getESuperTypes().add(this.getXmlPrimaryKeyJoinColumn());
- abstractXmlBaseTableEClass.getESuperTypes().add(this.getXmlBaseTable());
- xmlTableEClass.getESuperTypes().add(this.getAbstractXmlBaseTable());
- xmlSecondaryTableEClass.getESuperTypes().add(this.getXmlBaseTable());
- xmlSecondaryTableImplEClass.getESuperTypes().add(this.getAbstractXmlBaseTable());
- xmlSecondaryTableImplEClass.getESuperTypes().add(this.getXmlSecondaryTable());
- xmlSequenceGeneratorEClass.getESuperTypes().add(this.getXmlGenerator());
- xmlSequenceGeneratorImplEClass.getESuperTypes().add(this.getXmlSequenceGenerator());
- xmlTableGeneratorEClass.getESuperTypes().add(this.getXmlGenerator());
- xmlTableGeneratorImplEClass.getESuperTypes().add(this.getXmlTableGenerator());
- xmlUniqueConstraintImplEClass.getESuperTypes().add(this.getXmlUniqueConstraint());
-
- // Initialize classes and features; add operations and parameters
- initEClass(xmlEntityMappingsEClass, XmlEntityMappings.class, "XmlEntityMappings", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlEntityMappings_Version(), this.getVersionType(), "version", "1.0", 1, 1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- 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);
- initEAttribute(getXmlEntityMappings_Access(), this.getAccessType(), "access", "PROPERTY", 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_NamedQueries(), this.getXmlNamedQuery(), null, "namedQueries", 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_NamedNativeQueries(), this.getXmlNamedNativeQuery(), null, "namedNativeQueries", 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(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(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_Access(), this.getAccessType(), "access", "PROPERTY", 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(abstractXmlTypeMappingEClass, AbstractXmlTypeMapping.class, "AbstractXmlTypeMapping", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getAbstractXmlTypeMapping_ClassName(), theXMLTypePackage.getString(), "className", null, 1, 1, AbstractXmlTypeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getAbstractXmlTypeMapping_Access(), this.getAccessType(), "access", "PROPERTY", 0, 1, AbstractXmlTypeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getAbstractXmlTypeMapping_MetadataComplete(), theXMLTypePackage.getBooleanObject(), "metadataComplete", null, 0, 1, AbstractXmlTypeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getAbstractXmlTypeMapping_Description(), theXMLTypePackage.getString(), "description", null, 0, 1, AbstractXmlTypeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getAbstractXmlTypeMapping_Attributes(), this.getAttributes(), null, "attributes", null, 0, 1, AbstractXmlTypeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMappedSuperclassEClass, XmlMappedSuperclass.class, "XmlMappedSuperclass", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlMappedSuperclass_IdClass(), this.getXmlIdClass(), null, "idClass", 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_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);
- initEReference(getXmlMappedSuperclass_PrePersist(), this.getPrePersist(), null, "prePersist", 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_PostPersist(), this.getPostPersist(), null, "postPersist", 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_PreRemove(), this.getPreRemove(), null, "preRemove", 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_PostRemove(), this.getPostRemove(), null, "postRemove", 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_PreUpdate(), this.getPreUpdate(), null, "preUpdate", 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_PostUpdate(), this.getPostUpdate(), null, "postUpdate", 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_PostLoad(), this.getPostLoad(), null, "postLoad", 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(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_IdClass(), this.getXmlIdClass(), null, "idClass", 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(), this.getDiscriminatorValue(), "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_SequenceGenerator(), this.getXmlSequenceGenerator(), null, "sequenceGenerator", 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_TableGenerator(), this.getXmlTableGenerator(), null, "tableGenerator", 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_NamedQueries(), this.getXmlNamedQuery(), null, "namedQueries", 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_NamedNativeQueries(), this.getXmlNamedNativeQuery(), null, "namedNativeQueries", 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);
- initEReference(getXmlEntity_PrePersist(), this.getPrePersist(), null, "prePersist", 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_PostPersist(), this.getPostPersist(), null, "postPersist", 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_PreRemove(), this.getPreRemove(), null, "preRemove", 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_PostRemove(), this.getPostRemove(), null, "postRemove", 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_PreUpdate(), this.getPreUpdate(), null, "preUpdate", 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_PostUpdate(), this.getPostUpdate(), null, "postUpdate", 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_PostLoad(), this.getPostLoad(), null, "postLoad", 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_AttributeOverrides(), this.getXmlAttributeOverride(), null, "attributeOverrides", 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_AssociationOverrides(), this.getXmlAssociationOverride(), null, "associationOverrides", 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(xmlEmbeddableEClass, XmlEmbeddable.class, "XmlEmbeddable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- 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(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(abstractXmlAttributeMappingEClass, AbstractXmlAttributeMapping.class, "AbstractXmlAttributeMapping", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlNullAttributeMappingEClass, XmlNullAttributeMapping.class, "XmlNullAttributeMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- 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(xmlRelationshipMappingEClass, XmlRelationshipMapping.class, "XmlRelationshipMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlRelationshipMapping_TargetEntity(), theXMLTypePackage.getString(), "targetEntity", null, 0, 1, XmlRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlRelationshipMapping_Fetch(), this.getFetchType(), "fetch", "LAZY", 0, 1, XmlRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlRelationshipMapping_JoinTable(), this.getXmlJoinTable(), null, "joinTable", null, 0, 1, XmlRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlRelationshipMapping_Cascade(), this.getCascadeType(), null, "cascade", null, 0, 1, XmlRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMultiRelationshipMappingEClass, XmlMultiRelationshipMapping.class, "XmlMultiRelationshipMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlMultiRelationshipMapping_MappedBy(), theXMLTypePackage.getString(), "mappedBy", null, 0, 1, XmlMultiRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlMultiRelationshipMapping_OrderBy(), this.getOrderBy(), "orderBy", null, 0, 1, XmlMultiRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMultiRelationshipMapping_MapKey(), this.getMapKey(), null, "mapKey", null, 0, 1, XmlMultiRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlSingleRelationshipMappingEClass, XmlSingleRelationshipMapping.class, "XmlSingleRelationshipMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlSingleRelationshipMapping_Optional(), theXMLTypePackage.getBooleanObject(), "optional", null, 0, 1, XmlSingleRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlSingleRelationshipMapping_JoinColumns(), this.getXmlJoinColumn(), null, "joinColumns", null, 0, -1, XmlSingleRelationshipMapping.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);
- initEReference(getXmlId_TableGenerator(), this.getXmlTableGenerator(), null, "tableGenerator", null, 0, 1, XmlId.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlId_SequenceGenerator(), this.getXmlSequenceGenerator(), null, "sequenceGenerator", 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(xmlIdImplEClass, XmlIdImpl.class, "XmlIdImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(baseXmlEmbeddedEClass, BaseXmlEmbedded.class, "BaseXmlEmbedded", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getBaseXmlEmbedded_AttributeOverrides(), this.getXmlAttributeOverride(), null, "attributeOverrides", null, 0, -1, BaseXmlEmbedded.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEmbeddedIdEClass, XmlEmbeddedId.class, "XmlEmbeddedId", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlEmbeddedIdImplEClass, XmlEmbeddedIdImpl.class, "XmlEmbeddedIdImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlEmbeddedEClass, XmlEmbedded.class, "XmlEmbedded", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlEmbeddedImplEClass, XmlEmbeddedImpl.class, "XmlEmbeddedImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- 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(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(xmlBasicImplEClass, XmlBasicImpl.class, "XmlBasicImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlVersionEClass, XmlVersion.class, "XmlVersion", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlVersionImplEClass, XmlVersionImpl.class, "XmlVersionImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlManyToOneEClass, XmlManyToOne.class, "XmlManyToOne", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlManyToOneImplEClass, XmlManyToOneImpl.class, "XmlManyToOneImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlOneToManyEClass, XmlOneToMany.class, "XmlOneToMany", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlOneToMany_JoinColumns(), this.getXmlJoinColumn(), null, "joinColumns", null, 0, -1, XmlOneToMany.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlOneToManyImplEClass, XmlOneToManyImpl.class, "XmlOneToManyImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlOneToOneEClass, XmlOneToOne.class, "XmlOneToOne", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlOneToOne_MappedBy(), theXMLTypePackage.getString(), "mappedBy", null, 0, 1, XmlOneToOne.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- 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(xmlOneToOneImplEClass, XmlOneToOneImpl.class, "XmlOneToOneImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlManyToManyEClass, XmlManyToMany.class, "XmlManyToMany", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlManyToManyImplEClass, XmlManyToManyImpl.class, "XmlManyToManyImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlTransientEClass, XmlTransient.class, "XmlTransient", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlTransientImplEClass, XmlTransientImpl.class, "XmlTransientImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlAssociationOverrideEClass, XmlAssociationOverride.class, "XmlAssociationOverride", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlAssociationOverride_JoinColumns(), this.getXmlJoinColumn(), null, "joinColumns", null, 1, -1, XmlAssociationOverride.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlAssociationOverride_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, XmlAssociationOverride.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlAssociationOverrideImplEClass, XmlAssociationOverrideImpl.class, "XmlAssociationOverrideImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- 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);
- initEAttribute(getXmlAttributeOverride_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, XmlAttributeOverride.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlAttributeOverrideImplEClass, XmlAttributeOverrideImpl.class, "XmlAttributeOverrideImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- 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(cascadeTypeImplEClass, CascadeTypeImpl.class, "CascadeTypeImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlNamedColumnEClass, XmlNamedColumn.class, "XmlNamedColumn", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlNamedColumn_ColumnDefinition(), theXMLTypePackage.getString(), "columnDefinition", null, 0, 1, XmlNamedColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlNamedColumn_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlNamedColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(abstractXmlNamedColumnEClass, AbstractXmlNamedColumn.class, "AbstractXmlNamedColumn", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlAbstractColumnEClass, XmlAbstractColumn.class, "XmlAbstractColumn", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlAbstractColumn_Insertable(), theXMLTypePackage.getBooleanObject(), "insertable", null, 0, 1, XmlAbstractColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlAbstractColumn_Nullable(), theXMLTypePackage.getBooleanObject(), "nullable", null, 0, 1, XmlAbstractColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlAbstractColumn_Table(), theXMLTypePackage.getString(), "table", null, 0, 1, XmlAbstractColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlAbstractColumn_Unique(), theXMLTypePackage.getBooleanObject(), "unique", null, 0, 1, XmlAbstractColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlAbstractColumn_Updatable(), theXMLTypePackage.getBooleanObject(), "updatable", null, 0, 1, XmlAbstractColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(abstractXmlAbstractColumnEClass, AbstractXmlAbstractColumn.class, "AbstractXmlAbstractColumn", 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(xmlColumnImplEClass, XmlColumnImpl.class, "XmlColumnImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- 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(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(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(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);
- initEReference(getEntityListener_PrePersist(), this.getPrePersist(), null, "prePersist", null, 0, 1, EntityListener.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getEntityListener_PostPersist(), this.getPostPersist(), null, "postPersist", null, 0, 1, EntityListener.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getEntityListener_PreRemove(), this.getPreRemove(), null, "preRemove", null, 0, 1, EntityListener.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getEntityListener_PostRemove(), this.getPostRemove(), null, "postRemove", null, 0, 1, EntityListener.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getEntityListener_PreUpdate(), this.getPreUpdate(), null, "preUpdate", null, 0, 1, EntityListener.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getEntityListener_PostUpdate(), this.getPostUpdate(), null, "postUpdate", null, 0, 1, EntityListener.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getEntityListener_PostLoad(), this.getPostLoad(), null, "postLoad", null, 0, 1, EntityListener.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(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(xmlGeneratedValueImplEClass, XmlGeneratedValueImpl.class, "XmlGeneratedValueImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlIdClassEClass, XmlIdClass.class, "XmlIdClass", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlIdClass_ClassName(), theXMLTypePackage.getString(), "className", null, 1, 1, XmlIdClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, 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(xmlJoinColumnImplEClass, XmlJoinColumnImpl.class, "XmlJoinColumnImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlJoinTableEClass, XmlJoinTable.class, "XmlJoinTable", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlJoinTable_JoinColumns(), this.getXmlJoinColumn(), null, "joinColumns", null, 0, -1, XmlJoinTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- 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(xmlJoinTableImplEClass, XmlJoinTableImpl.class, "XmlJoinTableImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(lobEClass, Lob.class, "Lob", !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(mapKeyImplEClass, MapKeyImpl.class, "MapKeyImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- 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(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(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(xmlPrimaryKeyJoinColumnImplEClass, XmlPrimaryKeyJoinColumnImpl.class, "XmlPrimaryKeyJoinColumnImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- 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(abstractXmlBaseTableEClass, AbstractXmlBaseTable.class, "AbstractXmlBaseTable", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlBaseTableEClass, XmlBaseTable.class, "XmlBaseTable", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlBaseTable_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlBaseTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlBaseTable_Catalog(), theXMLTypePackage.getString(), "catalog", null, 0, 1, XmlBaseTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlBaseTable_Schema(), theXMLTypePackage.getString(), "schema", null, 0, 1, XmlBaseTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlBaseTable_UniqueConstraints(), this.getXmlUniqueConstraint(), null, "uniqueConstraints", null, 0, -1, XmlBaseTable.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(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(xmlSecondaryTableImplEClass, XmlSecondaryTableImpl.class, "XmlSecondaryTableImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- 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(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(xmlSequenceGeneratorImplEClass, XmlSequenceGeneratorImpl.class, "XmlSequenceGeneratorImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- 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(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(xmlTableGeneratorImplEClass, XmlTableGeneratorImpl.class, "XmlTableGeneratorImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- 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(xmlUniqueConstraintImplEClass, XmlUniqueConstraintImpl.class, "XmlUniqueConstraintImpl", !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);
-
- // Initialize data types
- initEDataType(discriminatorValueEDataType, String.class, "DiscriminatorValue", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
- initEDataType(enumeratedEDataType, Enumerator.class, "Enumerated", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
- initEDataType(orderByEDataType, String.class, "OrderBy", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
- initEDataType(versionTypeEDataType, String.class, "VersionType", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
-
- // 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.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>Version</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY_MAPPINGS__VERSION = eINSTANCE.getXmlEntityMappings_Version();
-
- /**
- * 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>Access</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY_MAPPINGS__ACCESS = eINSTANCE.getXmlEntityMappings_Access();
-
- /**
- * 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>Named Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS__NAMED_QUERIES = eINSTANCE.getXmlEntityMappings_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_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES = eINSTANCE.getXmlEntityMappings_NamedNativeQueries();
-
- /**
- * 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.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.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>Access</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS = eINSTANCE.getXmlPersistenceUnitDefaults_Access();
-
- /**
- * 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.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 '<em><b>Class Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute ABSTRACT_XML_TYPE_MAPPING__CLASS_NAME = eINSTANCE.getAbstractXmlTypeMapping_ClassName();
-
- /**
- * The meta object literal for the '<em><b>Access</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute ABSTRACT_XML_TYPE_MAPPING__ACCESS = eINSTANCE.getAbstractXmlTypeMapping_Access();
-
- /**
- * 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 ABSTRACT_XML_TYPE_MAPPING__METADATA_COMPLETE = eINSTANCE.getAbstractXmlTypeMapping_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 ABSTRACT_XML_TYPE_MAPPING__DESCRIPTION = eINSTANCE.getAbstractXmlTypeMapping_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 ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES = eINSTANCE.getAbstractXmlTypeMapping_Attributes();
-
- /**
- * 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>Id Class</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS__ID_CLASS = eINSTANCE.getXmlMappedSuperclass_IdClass();
-
- /**
- * 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 '<em><b>Pre Persist</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS__PRE_PERSIST = eINSTANCE.getXmlMappedSuperclass_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_MAPPED_SUPERCLASS__POST_PERSIST = eINSTANCE.getXmlMappedSuperclass_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_MAPPED_SUPERCLASS__PRE_REMOVE = eINSTANCE.getXmlMappedSuperclass_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_MAPPED_SUPERCLASS__POST_REMOVE = eINSTANCE.getXmlMappedSuperclass_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_MAPPED_SUPERCLASS__PRE_UPDATE = eINSTANCE.getXmlMappedSuperclass_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_MAPPED_SUPERCLASS__POST_UPDATE = eINSTANCE.getXmlMappedSuperclass_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_MAPPED_SUPERCLASS__POST_LOAD = eINSTANCE.getXmlMappedSuperclass_PostLoad();
-
- /**
- * 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>Id Class</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__ID_CLASS = eINSTANCE.getXmlEntity_IdClass();
-
- /**
- * 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>Sequence Generator</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__SEQUENCE_GENERATOR = eINSTANCE.getXmlEntity_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_ENTITY__TABLE_GENERATOR = eINSTANCE.getXmlEntity_TableGenerator();
-
- /**
- * 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_ENTITY__NAMED_QUERIES = eINSTANCE.getXmlEntity_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_ENTITY__NAMED_NATIVE_QUERIES = eINSTANCE.getXmlEntity_NamedNativeQueries();
-
- /**
- * 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 '<em><b>Pre Persist</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__PRE_PERSIST = eINSTANCE.getXmlEntity_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_ENTITY__POST_PERSIST = eINSTANCE.getXmlEntity_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_ENTITY__PRE_REMOVE = eINSTANCE.getXmlEntity_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_ENTITY__POST_REMOVE = eINSTANCE.getXmlEntity_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_ENTITY__PRE_UPDATE = eINSTANCE.getXmlEntity_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_ENTITY__POST_UPDATE = eINSTANCE.getXmlEntity_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_ENTITY__POST_LOAD = eINSTANCE.getXmlEntity_PostLoad();
-
- /**
- * 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_ENTITY__ATTRIBUTE_OVERRIDES = eINSTANCE.getXmlEntity_AttributeOverrides();
-
- /**
- * 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_ENTITY__ASSOCIATION_OVERRIDES = eINSTANCE.getXmlEntity_AssociationOverrides();
-
- /**
- * 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.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.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.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.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.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.XmlRelationshipMapping <em>Xml Relationship Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping()
- * @generated
- */
- public static final EClass XML_RELATIONSHIP_MAPPING = eINSTANCE.getXmlRelationshipMapping();
-
- /**
- * 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 XML_RELATIONSHIP_MAPPING__TARGET_ENTITY = eINSTANCE.getXmlRelationshipMapping_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 XML_RELATIONSHIP_MAPPING__FETCH = eINSTANCE.getXmlRelationshipMapping_Fetch();
-
- /**
- * 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_RELATIONSHIP_MAPPING__JOIN_TABLE = eINSTANCE.getXmlRelationshipMapping_JoinTable();
-
- /**
- * 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 XML_RELATIONSHIP_MAPPING__CASCADE = eINSTANCE.getXmlRelationshipMapping_Cascade();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping <em>Xml Multi Relationship Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMultiRelationshipMapping()
- * @generated
- */
- public static final EClass XML_MULTI_RELATIONSHIP_MAPPING = eINSTANCE.getXmlMultiRelationshipMapping();
-
- /**
- * 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_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY = eINSTANCE.getXmlMultiRelationshipMapping_MappedBy();
-
- /**
- * 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_MULTI_RELATIONSHIP_MAPPING__ORDER_BY = eINSTANCE.getXmlMultiRelationshipMapping_OrderBy();
-
- /**
- * 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_MULTI_RELATIONSHIP_MAPPING__MAP_KEY = eINSTANCE.getXmlMultiRelationshipMapping_MapKey();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping <em>Xml Single Relationship Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSingleRelationshipMapping()
- * @generated
- */
- public static final EClass XML_SINGLE_RELATIONSHIP_MAPPING = eINSTANCE.getXmlSingleRelationshipMapping();
-
- /**
- * 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_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL = eINSTANCE.getXmlSingleRelationshipMapping_Optional();
-
- /**
- * 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_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS = eINSTANCE.getXmlSingleRelationshipMapping_JoinColumns();
-
- /**
- * 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 '<em><b>Table Generator</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ID__TABLE_GENERATOR = eINSTANCE.getXmlId_TableGenerator();
-
- /**
- * 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_ID__SEQUENCE_GENERATOR = eINSTANCE.getXmlId_SequenceGenerator();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlIdImpl <em>Xml Id Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlIdImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlIdImpl()
- * @generated
- */
- public static final EClass XML_ID_IMPL = eINSTANCE.getXmlIdImpl();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.BaseXmlEmbedded <em>Base Xml Embedded</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.BaseXmlEmbedded
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getBaseXmlEmbedded()
- * @generated
- */
- public static final EClass BASE_XML_EMBEDDED = eINSTANCE.getBaseXmlEmbedded();
-
- /**
- * 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 BASE_XML_EMBEDDED__ATTRIBUTE_OVERRIDES = eINSTANCE.getBaseXmlEmbedded_AttributeOverrides();
-
- /**
- * 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.XmlEmbeddedIdImpl <em>Xml Embedded Id Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbeddedIdImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbeddedIdImpl()
- * @generated
- */
- public static final EClass XML_EMBEDDED_ID_IMPL = eINSTANCE.getXmlEmbeddedIdImpl();
-
- /**
- * 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.XmlBasicImpl <em>Xml Basic Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlBasicImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBasicImpl()
- * @generated
- */
- public static final EClass XML_BASIC_IMPL = eINSTANCE.getXmlBasicImpl();
-
- /**
- * 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.XmlVersionImpl <em>Xml Version Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlVersionImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlVersionImpl()
- * @generated
- */
- public static final EClass XML_VERSION_IMPL = eINSTANCE.getXmlVersionImpl();
-
- /**
- * 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.XmlManyToOneImpl <em>Xml Many To One Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlManyToOneImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlManyToOneImpl()
- * @generated
- */
- public static final EClass XML_MANY_TO_ONE_IMPL = eINSTANCE.getXmlManyToOneImpl();
-
- /**
- * 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 '<em><b>Join Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ONE_TO_MANY__JOIN_COLUMNS = eINSTANCE.getXmlOneToMany_JoinColumns();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToManyImpl <em>Xml One To Many Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToManyImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToManyImpl()
- * @generated
- */
- public static final EClass XML_ONE_TO_MANY_IMPL = eINSTANCE.getXmlOneToManyImpl();
-
- /**
- * 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>Mapped By</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ONE_TO_ONE__MAPPED_BY = eINSTANCE.getXmlOneToOne_MappedBy();
-
- /**
- * 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.XmlOneToOneImpl <em>Xml One To One Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToOneImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToOneImpl()
- * @generated
- */
- public static final EClass XML_ONE_TO_ONE_IMPL = eINSTANCE.getXmlOneToOneImpl();
-
- /**
- * 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.XmlManyToManyImpl <em>Xml Many To Many Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlManyToManyImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlManyToManyImpl()
- * @generated
- */
- public static final EClass XML_MANY_TO_MANY_IMPL = eINSTANCE.getXmlManyToManyImpl();
-
- /**
- * 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.XmlEmbeddedImpl <em>Xml Embedded Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbeddedImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbeddedImpl()
- * @generated
- */
- public static final EClass XML_EMBEDDED_IMPL = eINSTANCE.getXmlEmbeddedImpl();
-
- /**
- * 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.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.XmlTransientImpl <em>Xml Transient Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlTransientImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTransientImpl()
- * @generated
- */
- public static final EClass XML_TRANSIENT_IMPL = eINSTANCE.getXmlTransientImpl();
-
- /**
- * 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 '<em><b>Join Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS = eINSTANCE.getXmlAssociationOverride_JoinColumns();
-
- /**
- * 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_ASSOCIATION_OVERRIDE__NAME = eINSTANCE.getXmlAssociationOverride_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverrideImpl <em>Xml Association Override Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAssociationOverrideImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAssociationOverrideImpl()
- * @generated
- */
- public static final EClass XML_ASSOCIATION_OVERRIDE_IMPL = eINSTANCE.getXmlAssociationOverrideImpl();
-
- /**
- * 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 '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ATTRIBUTE_OVERRIDE__NAME = eINSTANCE.getXmlAttributeOverride_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideImpl <em>Xml Attribute Override Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeOverrideImpl()
- * @generated
- */
- public static final EClass XML_ATTRIBUTE_OVERRIDE_IMPL = eINSTANCE.getXmlAttributeOverrideImpl();
-
- /**
- * 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.CascadeTypeImpl <em>Cascade Type Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.CascadeTypeImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeTypeImpl()
- * @generated
- */
- public static final EClass CASCADE_TYPE_IMPL = eINSTANCE.getCascadeTypeImpl();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedColumn <em>Xml Named Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlNamedColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedColumn()
- * @generated
- */
- public static final EClass XML_NAMED_COLUMN = eINSTANCE.getXmlNamedColumn();
-
- /**
- * 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 XML_NAMED_COLUMN__COLUMN_DEFINITION = eINSTANCE.getXmlNamedColumn_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 XML_NAMED_COLUMN__NAME = eINSTANCE.getXmlNamedColumn_Name();
-
- /**
- * 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 '{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn <em>Xml Abstract Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAbstractColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAbstractColumn()
- * @generated
- */
- public static final EClass XML_ABSTRACT_COLUMN = eINSTANCE.getXmlAbstractColumn();
-
- /**
- * 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_ABSTRACT_COLUMN__INSERTABLE = eINSTANCE.getXmlAbstractColumn_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 XML_ABSTRACT_COLUMN__NULLABLE = eINSTANCE.getXmlAbstractColumn_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 XML_ABSTRACT_COLUMN__TABLE = eINSTANCE.getXmlAbstractColumn_Table();
-
- /**
- * The meta object literal for the '<em><b>Unique</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ABSTRACT_COLUMN__UNIQUE = eINSTANCE.getXmlAbstractColumn_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 XML_ABSTRACT_COLUMN__UPDATABLE = eINSTANCE.getXmlAbstractColumn_Updatable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlAbstractColumn <em>Abstract Xml Abstract Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlAbstractColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlAbstractColumn()
- * @generated
- */
- public static final EClass ABSTRACT_XML_ABSTRACT_COLUMN = eINSTANCE.getAbstractXmlAbstractColumn();
-
- /**
- * 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.XmlColumnImpl <em>Xml Column Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlColumnImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlColumnImpl()
- * @generated
- */
- public static final EClass XML_COLUMN_IMPL = eINSTANCE.getXmlColumnImpl();
-
- /**
- * 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.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.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.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 '<em><b>Pre Persist</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ENTITY_LISTENER__PRE_PERSIST = eINSTANCE.getEntityListener_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 ENTITY_LISTENER__POST_PERSIST = eINSTANCE.getEntityListener_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 ENTITY_LISTENER__PRE_REMOVE = eINSTANCE.getEntityListener_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 ENTITY_LISTENER__POST_REMOVE = eINSTANCE.getEntityListener_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 ENTITY_LISTENER__PRE_UPDATE = eINSTANCE.getEntityListener_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 ENTITY_LISTENER__POST_UPDATE = eINSTANCE.getEntityListener_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 ENTITY_LISTENER__POST_LOAD = eINSTANCE.getEntityListener_PostLoad();
-
- /**
- * 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.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.XmlGeneratedValueImpl <em>Xml Generated Value Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlGeneratedValueImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGeneratedValueImpl()
- * @generated
- */
- public static final EClass XML_GENERATED_VALUE_IMPL = eINSTANCE.getXmlGeneratedValueImpl();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlIdClass <em>Xml Id Class</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlIdClass
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlIdClass()
- * @generated
- */
- public static final EClass XML_ID_CLASS = eINSTANCE.getXmlIdClass();
-
- /**
- * 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_ID_CLASS__CLASS_NAME = eINSTANCE.getXmlIdClass_ClassName();
-
- /**
- * 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.XmlJoinColumnImpl <em>Xml Join Column Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinColumnImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinColumnImpl()
- * @generated
- */
- public static final EClass XML_JOIN_COLUMN_IMPL = eINSTANCE.getXmlJoinColumnImpl();
-
- /**
- * 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>Join Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_JOIN_TABLE__JOIN_COLUMNS = eINSTANCE.getXmlJoinTable_JoinColumns();
-
- /**
- * 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.XmlJoinTableImpl <em>Xml Join Table Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinTableImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinTableImpl()
- * @generated
- */
- public static final EClass XML_JOIN_TABLE_IMPL = eINSTANCE.getXmlJoinTableImpl();
-
- /**
- * 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.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.MapKeyImpl <em>Map Key Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.MapKeyImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getMapKeyImpl()
- * @generated
- */
- public static final EClass MAP_KEY_IMPL = eINSTANCE.getMapKeyImpl();
-
- /**
- * 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.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.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.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.XmlPrimaryKeyJoinColumnImpl <em>Xml Primary Key Join Column Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumnImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPrimaryKeyJoinColumnImpl()
- * @generated
- */
- public static final EClass XML_PRIMARY_KEY_JOIN_COLUMN_IMPL = eINSTANCE.getXmlPrimaryKeyJoinColumnImpl();
-
- /**
- * 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.AbstractXmlBaseTable <em>Abstract Xml Base Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlBaseTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlBaseTable()
- * @generated
- */
- public static final EClass ABSTRACT_XML_BASE_TABLE = eINSTANCE.getAbstractXmlBaseTable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlBaseTable <em>Xml Base Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlBaseTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBaseTable()
- * @generated
- */
- public static final EClass XML_BASE_TABLE = eINSTANCE.getXmlBaseTable();
-
- /**
- * 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_BASE_TABLE__NAME = eINSTANCE.getXmlBaseTable_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 XML_BASE_TABLE__CATALOG = eINSTANCE.getXmlBaseTable_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_BASE_TABLE__SCHEMA = eINSTANCE.getXmlBaseTable_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 XML_BASE_TABLE__UNIQUE_CONSTRAINTS = eINSTANCE.getXmlBaseTable_UniqueConstraints();
-
- /**
- * 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.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.XmlSecondaryTableImpl <em>Xml Secondary Table Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlSecondaryTableImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSecondaryTableImpl()
- * @generated
- */
- public static final EClass XML_SECONDARY_TABLE_IMPL = eINSTANCE.getXmlSecondaryTableImpl();
-
- /**
- * 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.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.XmlSequenceGeneratorImpl <em>Xml Sequence Generator Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlSequenceGeneratorImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSequenceGeneratorImpl()
- * @generated
- */
- public static final EClass XML_SEQUENCE_GENERATOR_IMPL = eINSTANCE.getXmlSequenceGeneratorImpl();
-
- /**
- * 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.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.XmlTableGeneratorImpl <em>Xml Table Generator Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGeneratorImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGeneratorImpl()
- * @generated
- */
- public static final EClass XML_TABLE_GENERATOR_IMPL = eINSTANCE.getXmlTableGeneratorImpl();
-
- /**
- * 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.XmlUniqueConstraintImpl <em>Xml Unique Constraint Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlUniqueConstraintImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlUniqueConstraintImpl()
- * @generated
- */
- public static final EClass XML_UNIQUE_CONSTRAINT_IMPL = eINSTANCE.getXmlUniqueConstraintImpl();
-
- /**
- * 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();
-
- /**
- * The meta object literal for the '<em>Discriminator Value</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see java.lang.String
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getDiscriminatorValue()
- * @generated
- */
- public static final EDataType DISCRIMINATOR_VALUE = eINSTANCE.getDiscriminatorValue();
-
- /**
- * The meta object literal for the '<em>Enumerated</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.common.util.Enumerator
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEnumerated()
- * @generated
- */
- public static final EDataType ENUMERATED = eINSTANCE.getEnumerated();
-
- /**
- * The meta object literal for the '<em>Order By</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see java.lang.String
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getOrderBy()
- * @generated
- */
- public static final EDataType ORDER_BY = eINSTANCE.getOrderBy();
-
- /**
- * The meta object literal for the '<em>Version Type</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see java.lang.String
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getVersionType()
- * @generated
- */
- public static final EDataType VERSION_TYPE = eINSTANCE.getVersionType();
-
- }
-
-} //OrmPackage
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmResource.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmResource.java
deleted file mode 100644
index 0680167b3d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmResource.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.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.internal.resource.orm.translators.EntityMappingsTranslator;
-import org.eclipse.jpt.core.resource.common.JpaXmlResource;
-import org.eclipse.wst.common.internal.emf.resource.Renderer;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 OrmResource
- extends JpaXmlResource
-{
- public OrmResource(URI uri, Renderer renderer) {
- super(uri, renderer);
- }
-
-
- public Translator getRootTranslator() {
- return EntityMappingsTranslator.INSTANCE;
- }
-
- @Override
- public String getType() {
- return JpaFile.ORM_RESOURCE_TYPE;
- }
-
- public XmlEntityMappings getEntityMappings() {
- return (XmlEntityMappings) this.getRootObject();
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public EList eAdapters() {
- return super.eAdapters();
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public EList getContents() {
- return super.getContents();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmResourceFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmResourceFactory.java
deleted file mode 100644
index a392d98629..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmResourceFactory.java
+++ /dev/null
@@ -1,47 +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 org.eclipse.emf.common.util.URI;
-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 OrmResourceFactory
- extends TranslatorResourceFactory
-{
- public OrmResourceFactory() {
- this(RendererFactory.getDefaultRendererFactory());
- }
-
- public OrmResourceFactory(RendererFactory aRendererFactory) {
- super(aRendererFactory);
- }
-
- public OrmResourceFactory(RendererFactory aRendererFactory, boolean listeningForUpdates) {
- super(aRendererFactory, listeningForUpdates);
- }
-
- @Override
- protected TranslatorResource createResource(URI uri, Renderer renderer) {
- return new OrmResource(uri, renderer);
- }
-
-}
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 98419a3518..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostLoad.java
+++ /dev/null
@@ -1,53 +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 org.eclipse.emf.ecore.EClass;
-
-/**
- * <!-- 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;
- }
-
-} // 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 55ac8f00bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostPersist.java
+++ /dev/null
@@ -1,53 +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 org.eclipse.emf.ecore.EClass;
-
-/**
- * <!-- 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;
- }
-
-} // 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 d9a68a060d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostRemove.java
+++ /dev/null
@@ -1,53 +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 org.eclipse.emf.ecore.EClass;
-
-/**
- * <!-- 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;
- }
-
-} // 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 cbd617e8cc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostUpdate.java
+++ /dev/null
@@ -1,53 +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 org.eclipse.emf.ecore.EClass;
-
-/**
- * <!-- 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;
- }
-
-} // 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 461caecf78..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PrePersist.java
+++ /dev/null
@@ -1,53 +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 org.eclipse.emf.ecore.EClass;
-
-/**
- * <!-- 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;
- }
-
-} // 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 810358352b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PreRemove.java
+++ /dev/null
@@ -1,53 +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 org.eclipse.emf.ecore.EClass;
-
-/**
- * <!-- 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;
- }
-
-} // 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 01cdff5a0d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PreUpdate.java
+++ /dev/null
@@ -1,53 +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 org.eclipse.emf.ecore.EClass;
-
-/**
- * <!-- 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;
- }
-
-} // 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 33bc163750..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/SqlResultSetMapping.java
+++ /dev/null
@@ -1,317 +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.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.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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"
- * @extends JpaEObject
- * @generated
- */
-public class SqlResultSetMapping 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 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>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__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__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__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__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(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
-} // SqlResultSetMapping
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/XmlAbstractColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAbstractColumn.java
deleted file mode 100644
index c4b269ea22..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAbstractColumn.java
+++ /dev/null
@@ -1,179 +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 org.eclipse.jpt.core.utility.TextRange;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>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.XmlAbstractColumn#getInsertable <em>Insertable</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getNullable <em>Nullable</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getTable <em>Table</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getUnique <em>Unique</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getUpdatable <em>Updatable</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAbstractColumn()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlAbstractColumn extends XmlNamedColumn
-{
- /**
- * 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#getXmlAbstractColumn_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.XmlAbstractColumn#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>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#getXmlAbstractColumn_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.XmlAbstractColumn#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>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#getXmlAbstractColumn_Table()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getTable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getTable <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Table</em>' attribute.
- * @see #getTable()
- * @generated
- */
- void setTable(String value);
-
- /**
- * Returns the value of the '<em><b>Unique</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Unique</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Unique</em>' attribute.
- * @see #setUnique(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAbstractColumn_Unique()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getUnique();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getUnique <em>Unique</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Unique</em>' attribute.
- * @see #getUnique()
- * @generated
- */
- void setUnique(Boolean value);
-
- /**
- * Returns the value of the '<em><b>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#getXmlAbstractColumn_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.XmlAbstractColumn#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);
-
- /**
- * Return the {@link TextRange} for the table attibute. If the table attibute
- * does not exist return the {@link TextRange} for the *table element.
- */
- TextRange getTableTextRange();
-
-} // AbstractColumn
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 b82e5566de..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAssociationOverride.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.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Association 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.XmlAssociationOverride#getJoinColumns <em>Join Columns</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverride#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAssociationOverride()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlAssociationOverride 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#getXmlAssociationOverride_JoinColumns()
- * @model containment="true" required="true"
- * @generated
- */
- EList<XmlJoinColumn> getJoinColumns();
-
- /**
- * 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#getXmlAssociationOverride_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.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
- */
- void setName(String value);
-} // AssociationOverride
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAssociationOverrideImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAssociationOverrideImpl.java
deleted file mode 100644
index 97c57582cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAssociationOverrideImpl.java
+++ /dev/null
@@ -1,261 +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.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.common.AbstractJpaEObject;
-
-/**
- * <!-- 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#getXmlAssociationOverrideImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlAssociationOverrideImpl extends AbstractJpaEObject implements XmlAssociationOverride
-{
- /**
- * 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 #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 XmlAssociationOverrideImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_ASSOCIATION_OVERRIDE_IMPL;
- }
-
- /**
- * 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#getXmlAssociationOverride_JoinColumns()
- * @model containment="true" required="true"
- * @generated
- */
- public EList<XmlJoinColumn> getJoinColumns()
- {
- if (joinColumns == null)
- {
- joinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_ASSOCIATION_OVERRIDE_IMPL__JOIN_COLUMNS);
- }
- return joinColumns;
- }
-
- /**
- * 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#getXmlAssociationOverride_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.XmlAssociationOverrideImpl#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_IMPL__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_IMPL__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_ASSOCIATION_OVERRIDE_IMPL__JOIN_COLUMNS:
- return getJoinColumns();
- case OrmPackage.XML_ASSOCIATION_OVERRIDE_IMPL__NAME:
- return getName();
- }
- 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_IMPL__JOIN_COLUMNS:
- getJoinColumns().clear();
- getJoinColumns().addAll((Collection<? extends XmlJoinColumn>)newValue);
- return;
- case OrmPackage.XML_ASSOCIATION_OVERRIDE_IMPL__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.XML_ASSOCIATION_OVERRIDE_IMPL__JOIN_COLUMNS:
- getJoinColumns().clear();
- return;
- case OrmPackage.XML_ASSOCIATION_OVERRIDE_IMPL__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.XML_ASSOCIATION_OVERRIDE_IMPL__JOIN_COLUMNS:
- return joinColumns != null && !joinColumns.isEmpty();
- case OrmPackage.XML_ASSOCIATION_OVERRIDE_IMPL__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();
- }
-
-} // XmlAssociationOverrideImpl
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 0325a83e79..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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.common.JpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>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"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlAttributeMapping 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#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();
-} // AttributeMapping
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 de3a886f30..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverride.java
+++ /dev/null
@@ -1,92 +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 org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeOverride()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlAttributeOverride 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#getXmlAttributeOverride_Column()
- * @model containment="true" required="true"
- * @generated
- */
- XmlColumn getColumn();
-
- /**
- * 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
- */
- void setColumn(XmlColumn value);
-
- /**
- * 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#getXmlAttributeOverride_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.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
- */
- void setName(String value);
-
-} // AttributeOverride
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverrideImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverrideImpl.java
deleted file mode 100644
index 38a8354284..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverrideImpl.java
+++ /dev/null
@@ -1,292 +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 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.common.AbstractJpaEObject;
-
-/**
- * <!-- 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 -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeOverrideImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlAttributeOverrideImpl extends AbstractJpaEObject implements XmlAttributeOverride
-{
- /**
- * 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 #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 XmlAttributeOverrideImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_ATTRIBUTE_OVERRIDE_IMPL;
- }
-
- /**
- * 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_IMPL__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.XmlAttributeOverrideImpl#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_IMPL__COLUMN, null, msgs);
- if (newColumn != null)
- msgs = ((InternalEObject)newColumn).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ATTRIBUTE_OVERRIDE_IMPL__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_IMPL__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#getXmlAttributeOverride_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.XmlAttributeOverrideImpl#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_IMPL__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_IMPL__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_IMPL__COLUMN:
- return getColumn();
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE_IMPL__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.XML_ATTRIBUTE_OVERRIDE_IMPL__COLUMN:
- setColumn((XmlColumn)newValue);
- return;
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE_IMPL__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.XML_ATTRIBUTE_OVERRIDE_IMPL__COLUMN:
- setColumn((XmlColumn)null);
- return;
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE_IMPL__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.XML_ATTRIBUTE_OVERRIDE_IMPL__COLUMN:
- return column != null;
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE_IMPL__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();
- }
-
-} // AttributeOverride
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBaseTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBaseTable.java
deleted file mode 100644
index 8db7a67dab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBaseTable.java
+++ /dev/null
@@ -1,155 +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.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>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.XmlBaseTable#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlBaseTable#getCatalog <em>Catalog</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlBaseTable#getSchema <em>Schema</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlBaseTable#getUniqueConstraints <em>Unique Constraints</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBaseTable()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlBaseTable 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#getXmlBaseTable_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.XmlBaseTable#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>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#getXmlBaseTable_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.XmlBaseTable#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.OrmPackage#getXmlBaseTable_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.XmlBaseTable#getSchema <em>Schema</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Schema</em>' attribute.
- * @see #getSchema()
- * @generated
- */
- void setSchema(String value);
-
- /**
- * Returns the value of the '<em><b>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#getXmlBaseTable_UniqueConstraints()
- * @model containment="true"
- * @generated
- */
- EList<XmlUniqueConstraint> getUniqueConstraints();
-
- /**
- * Return the {@link TextRange} for the name attibute. If the name attibute
- * does not exist return the {@link TextRange} for the *table element.
- */
- TextRange getNameTextRange();
-
- /**
- * Return the {@link TextRange} for the schema attibute. If the schema attibute
- * does not exist return the {@link TextRange} for the *table element.
- */
- TextRange getSchemaTextRange();
-
- /**
- * Return the {@link TextRange} for the catalog attibute. If the catalog attibute
- * does not exist return the {@link TextRange} for the *table element.
- */
- TextRange getCatalogTextRange();
-} // XmlBaseTable
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 9548b73181..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBasic.java
+++ /dev/null
@@ -1,94 +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;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>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.
- * <!-- 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" interface="true" abstract="true"
- * @generated
- */
-public interface XmlBasic extends XmlAttributeMapping, ColumnMapping, XmlConvertibleMapping
-{
- /**
- * 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
- */
- FetchType getFetch();
-
- /**
- * 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
- */
- void setFetch(FetchType value);
-
- /**
- * 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
- */
- Boolean getOptional();
-
- /**
- * 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
- */
- void setOptional(Boolean value);
-
-} // Basic
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBasicImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBasicImpl.java
deleted file mode 100644
index fe86b0ff2b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBasicImpl.java
+++ /dev/null
@@ -1,651 +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 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.MappingKeys;
-import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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 -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBasicImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlBasicImpl extends AbstractXmlAttributeMapping implements XmlBasic
-{
- /**
- * 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 XmlBasicImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_BASIC_IMPL;
- }
-
- /**
- * 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_IMPL__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.XmlBasicImpl#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_IMPL__COLUMN, null, msgs);
- if (newColumn != null)
- msgs = ((InternalEObject)newColumn).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_BASIC_IMPL__COLUMN, null, msgs);
- msgs = basicSetColumn(newColumn, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_BASIC_IMPL__COLUMN, newColumn, newColumn));
- }
-
- /**
- * 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.XmlBasicImpl#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_IMPL__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.XmlBasicImpl#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_IMPL__OPTIONAL, oldOptional, optional));
- }
-
- /**
- * 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.XmlBasicImpl#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_IMPL__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.XmlBasicImpl#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_IMPL__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.XmlBasicImpl#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_IMPL__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_BASIC_IMPL__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_IMPL__COLUMN:
- return getColumn();
- case OrmPackage.XML_BASIC_IMPL__LOB:
- return isLob() ? Boolean.TRUE : Boolean.FALSE;
- case OrmPackage.XML_BASIC_IMPL__TEMPORAL:
- return getTemporal();
- case OrmPackage.XML_BASIC_IMPL__ENUMERATED:
- return getEnumerated();
- case OrmPackage.XML_BASIC_IMPL__FETCH:
- return getFetch();
- case OrmPackage.XML_BASIC_IMPL__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_IMPL__COLUMN:
- setColumn((XmlColumn)newValue);
- return;
- case OrmPackage.XML_BASIC_IMPL__LOB:
- setLob(((Boolean)newValue).booleanValue());
- return;
- case OrmPackage.XML_BASIC_IMPL__TEMPORAL:
- setTemporal((TemporalType)newValue);
- return;
- case OrmPackage.XML_BASIC_IMPL__ENUMERATED:
- setEnumerated((EnumType)newValue);
- return;
- case OrmPackage.XML_BASIC_IMPL__FETCH:
- setFetch((FetchType)newValue);
- return;
- case OrmPackage.XML_BASIC_IMPL__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_IMPL__COLUMN:
- setColumn((XmlColumn)null);
- return;
- case OrmPackage.XML_BASIC_IMPL__LOB:
- setLob(LOB_EDEFAULT);
- return;
- case OrmPackage.XML_BASIC_IMPL__TEMPORAL:
- setTemporal(TEMPORAL_EDEFAULT);
- return;
- case OrmPackage.XML_BASIC_IMPL__ENUMERATED:
- setEnumerated(ENUMERATED_EDEFAULT);
- return;
- case OrmPackage.XML_BASIC_IMPL__FETCH:
- setFetch(FETCH_EDEFAULT);
- return;
- case OrmPackage.XML_BASIC_IMPL__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_IMPL__COLUMN:
- return column != null;
- case OrmPackage.XML_BASIC_IMPL__LOB:
- return lob != LOB_EDEFAULT;
- case OrmPackage.XML_BASIC_IMPL__TEMPORAL:
- return temporal != TEMPORAL_EDEFAULT;
- case OrmPackage.XML_BASIC_IMPL__ENUMERATED:
- return enumerated != ENUMERATED_EDEFAULT;
- case OrmPackage.XML_BASIC_IMPL__FETCH:
- return fetch != FETCH_EDEFAULT;
- case OrmPackage.XML_BASIC_IMPL__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_IMPL__COLUMN: return OrmPackage.COLUMN_MAPPING__COLUMN;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_BASIC_IMPL__LOB: return OrmPackage.XML_CONVERTIBLE_MAPPING__LOB;
- case OrmPackage.XML_BASIC_IMPL__TEMPORAL: return OrmPackage.XML_CONVERTIBLE_MAPPING__TEMPORAL;
- case OrmPackage.XML_BASIC_IMPL__ENUMERATED: return OrmPackage.XML_CONVERTIBLE_MAPPING__ENUMERATED;
- default: return -1;
- }
- }
- if (baseClass == XmlBasic.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_BASIC_IMPL__FETCH: return OrmPackage.XML_BASIC__FETCH;
- case OrmPackage.XML_BASIC_IMPL__OPTIONAL: return OrmPackage.XML_BASIC__OPTIONAL;
- 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_IMPL__COLUMN;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_CONVERTIBLE_MAPPING__LOB: return OrmPackage.XML_BASIC_IMPL__LOB;
- case OrmPackage.XML_CONVERTIBLE_MAPPING__TEMPORAL: return OrmPackage.XML_BASIC_IMPL__TEMPORAL;
- case OrmPackage.XML_CONVERTIBLE_MAPPING__ENUMERATED: return OrmPackage.XML_BASIC_IMPL__ENUMERATED;
- default: return -1;
- }
- }
- if (baseClass == XmlBasic.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_BASIC__FETCH: return OrmPackage.XML_BASIC_IMPL__FETCH;
- case OrmPackage.XML_BASIC__OPTIONAL: return OrmPackage.XML_BASIC_IMPL__OPTIONAL;
- 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(OrmXmlMapper.ENUMERATED);
- }
-
- public TextRange getLobTextRange() {
- return getAttributeTextRange(OrmXmlMapper.LOB);
- }
-
- public TextRange getTemporalTextRange() {
- return getAttributeTextRange(OrmXmlMapper.TEMPORAL);
- }
-
- public String getMappingKey() {
- return MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY;
- }
-} // BasicImpl
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 282f383c48..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlColumn.java
+++ /dev/null
@@ -1,117 +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;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>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.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" interface="true" abstract="true"
- * @generated
- */
-public interface XmlColumn extends XmlAbstractColumn
-{
- /**
- * 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
- */
- Integer getLength();
-
- /**
- * 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
- */
- void setLength(Integer value);
-
- /**
- * 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
- */
- Integer getPrecision();
-
- /**
- * 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
- */
- void setPrecision(Integer value);
-
- /**
- * 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
- */
- Integer getScale();
-
- /**
- * 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
- */
- void setScale(Integer value);
-
-} // Column
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlColumnImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlColumnImpl.java
deleted file mode 100644
index ad096bf380..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlColumnImpl.java
+++ /dev/null
@@ -1,369 +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 org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-/**
- * <!-- 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 -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlColumnImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlColumnImpl extends AbstractXmlAbstractColumn implements XmlColumn
-{
- /**
- * 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 XmlColumnImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_COLUMN_IMPL;
- }
-
- /**
- * 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.XmlColumnImpl#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_IMPL__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.XmlColumnImpl#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_IMPL__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.XmlColumnImpl#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_IMPL__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_IMPL__LENGTH:
- return getLength();
- case OrmPackage.XML_COLUMN_IMPL__PRECISION:
- return getPrecision();
- case OrmPackage.XML_COLUMN_IMPL__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_IMPL__LENGTH:
- setLength((Integer)newValue);
- return;
- case OrmPackage.XML_COLUMN_IMPL__PRECISION:
- setPrecision((Integer)newValue);
- return;
- case OrmPackage.XML_COLUMN_IMPL__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_IMPL__LENGTH:
- setLength(LENGTH_EDEFAULT);
- return;
- case OrmPackage.XML_COLUMN_IMPL__PRECISION:
- setPrecision(PRECISION_EDEFAULT);
- return;
- case OrmPackage.XML_COLUMN_IMPL__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_IMPL__LENGTH:
- return LENGTH_EDEFAULT == null ? length != null : !LENGTH_EDEFAULT.equals(length);
- case OrmPackage.XML_COLUMN_IMPL__PRECISION:
- return PRECISION_EDEFAULT == null ? precision != null : !PRECISION_EDEFAULT.equals(precision);
- case OrmPackage.XML_COLUMN_IMPL__SCALE:
- return SCALE_EDEFAULT == null ? scale != null : !SCALE_EDEFAULT.equals(scale);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlColumn.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_COLUMN_IMPL__LENGTH: return OrmPackage.XML_COLUMN__LENGTH;
- case OrmPackage.XML_COLUMN_IMPL__PRECISION: return OrmPackage.XML_COLUMN__PRECISION;
- case OrmPackage.XML_COLUMN_IMPL__SCALE: return OrmPackage.XML_COLUMN__SCALE;
- 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 == XmlColumn.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_COLUMN__LENGTH: return OrmPackage.XML_COLUMN_IMPL__LENGTH;
- case OrmPackage.XML_COLUMN__PRECISION: return OrmPackage.XML_COLUMN_IMPL__PRECISION;
- case OrmPackage.XML_COLUMN__SCALE: return OrmPackage.XML_COLUMN_IMPL__SCALE;
- 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(" (length: ");
- result.append(length);
- result.append(", precision: ");
- result.append(precision);
- result.append(", scale: ");
- result.append(scale);
- result.append(')');
- return result.toString();
- }
-
-} // 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 a2e27fb7a1..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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.common.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 3f4cd01ea6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlDiscriminatorColumn.java
+++ /dev/null
@@ -1,267 +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 org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-/**
- * <!-- 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();
- }
-
-} // DiscriminatorColumn
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 6fc3e212ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddable.java
+++ /dev/null
@@ -1,63 +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 org.eclipse.emf.ecore.EClass;
-
-/**
- * <!-- 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
-{
- /**
- * 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;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlEmbeddable()
- {
- super();
- }
-
- public XmlEntityMappings getEntityMappings() {
- return (XmlEntityMappings) eContainer();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_EMBEDDABLE;
- }
-
-} // Embeddable
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 fe1584ca2f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbedded.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.resource.orm;
-
-
-/**
- * <!-- 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" interface="true" abstract="true"
- * @generated
- */
-public interface XmlEmbedded extends BaseXmlEmbedded
-{
-
-} // Embedded
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 45f6723c36..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedId.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.resource.orm;
-
-
-/**
- * <!-- 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" interface="true" abstract="true"
- * @generated
- */
-public interface XmlEmbeddedId extends XmlAttributeMapping, BaseXmlEmbedded
-{
-
-} // EmbeddedId
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedIdImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedIdImpl.java
deleted file mode 100644
index 478cbead0c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedIdImpl.java
+++ /dev/null
@@ -1,232 +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.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.jpt.core.MappingKeys;
-
-/**
- * <!-- 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#getXmlEmbeddedIdImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlEmbeddedIdImpl extends AbstractXmlAttributeMapping implements XmlEmbeddedId
-{
- /**
- * 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 XmlEmbeddedIdImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_EMBEDDED_ID_IMPL;
- }
-
- /**
- * 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#getBaseXmlEmbedded_AttributeOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAttributeOverride> getAttributeOverrides()
- {
- if (attributeOverrides == null)
- {
- attributeOverrides = new EObjectContainmentEList<XmlAttributeOverride>(XmlAttributeOverride.class, this, OrmPackage.XML_EMBEDDED_ID_IMPL__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.XML_EMBEDDED_ID_IMPL__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.XML_EMBEDDED_ID_IMPL__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.XML_EMBEDDED_ID_IMPL__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.XML_EMBEDDED_ID_IMPL__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.XML_EMBEDDED_ID_IMPL__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 == BaseXmlEmbedded.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_EMBEDDED_ID_IMPL__ATTRIBUTE_OVERRIDES: return OrmPackage.BASE_XML_EMBEDDED__ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlEmbeddedId.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 == BaseXmlEmbedded.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.BASE_XML_EMBEDDED__ATTRIBUTE_OVERRIDES: return OrmPackage.XML_EMBEDDED_ID_IMPL__ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlEmbeddedId.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- public String getMappingKey() {
- return MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY;
- }
-} // EmbeddedId
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedImpl.java
deleted file mode 100644
index 892ef0e3f9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedImpl.java
+++ /dev/null
@@ -1,232 +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.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.jpt.core.MappingKeys;
-
-/**
- * <!-- 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#getXmlEmbeddedImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlEmbeddedImpl extends AbstractXmlAttributeMapping implements XmlEmbedded
-{
- /**
- * 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 XmlEmbeddedImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_EMBEDDED_IMPL;
- }
-
- /**
- * 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#getBaseXmlEmbedded_AttributeOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAttributeOverride> getAttributeOverrides()
- {
- if (attributeOverrides == null)
- {
- attributeOverrides = new EObjectContainmentEList<XmlAttributeOverride>(XmlAttributeOverride.class, this, OrmPackage.XML_EMBEDDED_IMPL__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.XML_EMBEDDED_IMPL__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.XML_EMBEDDED_IMPL__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.XML_EMBEDDED_IMPL__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.XML_EMBEDDED_IMPL__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.XML_EMBEDDED_IMPL__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 == BaseXmlEmbedded.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_EMBEDDED_IMPL__ATTRIBUTE_OVERRIDES: return OrmPackage.BASE_XML_EMBEDDED__ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlEmbedded.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 == BaseXmlEmbedded.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.BASE_XML_EMBEDDED__ATTRIBUTE_OVERRIDES: return OrmPackage.XML_EMBEDDED_IMPL__ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlEmbedded.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- public String getMappingKey() {
- return MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY;
- }
-} // Embedded
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 6018cb23f3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEntity.java
+++ /dev/null
@@ -1,1925 +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.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;
-
-/**
- * <!-- 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#getIdClass <em>Id Class</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#getSequenceGenerator <em>Sequence Generator</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getTableGenerator <em>Table Generator</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getNamedQueries <em>Named Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getNamedNativeQueries <em>Named Native Queries</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>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPrePersist <em>Pre Persist</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPostPersist <em>Post Persist</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPreRemove <em>Pre Remove</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPostRemove <em>Post Remove</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPreUpdate <em>Pre Update</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPostUpdate <em>Post Update</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPostLoad <em>Post Load</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getAttributeOverrides <em>Attribute Overrides</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getAssociationOverrides <em>Association Overrides</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity()
- * @model kind="class"
- * @generated
- */
-public class XmlEntity extends AbstractXmlTypeMapping
-{
- /**
- * 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 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 #getIdClass() <em>Id Class</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIdClass()
- * @generated
- * @ordered
- */
- protected XmlIdClass idClass;
-
- /**
- * 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 #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 #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;
-
- /**
- * 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;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlEntity()
- {
- super();
- }
-
- 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(XmlIdClass)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_IdClass()
- * @model containment="true"
- * @generated
- */
- public XmlIdClass getIdClass()
- {
- return idClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetIdClass(XmlIdClass newIdClass, NotificationChain msgs)
- {
- XmlIdClass 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(XmlIdClass 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.jpt.core.resource.orm.DiscriminatorValue"
- * @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#getXmlEntity_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#getXmlEntity_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#getXmlEntity_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#getXmlEntity_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#getXmlEntity_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#getXmlEntity_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#getXmlEntity_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#getXmlEntity_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#getXmlEntity_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#getXmlEntity_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#getXmlEntity_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#getXmlEntity_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#getXmlEntity_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;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- 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__ID_CLASS:
- return basicSetIdClass(null, msgs);
- case OrmPackage.XML_ENTITY__INHERITANCE:
- return basicSetInheritance(null, msgs);
- case OrmPackage.XML_ENTITY__DISCRIMINATOR_COLUMN:
- return basicSetDiscriminatorColumn(null, 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__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__SQL_RESULT_SET_MAPPINGS:
- return ((InternalEList<?>)getSqlResultSetMappings()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY__ENTITY_LISTENERS:
- return basicSetEntityListeners(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);
- }
- 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__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__ID_CLASS:
- return getIdClass();
- 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__SEQUENCE_GENERATOR:
- return getSequenceGenerator();
- case OrmPackage.XML_ENTITY__TABLE_GENERATOR:
- return getTableGenerator();
- case OrmPackage.XML_ENTITY__NAMED_QUERIES:
- return getNamedQueries();
- case OrmPackage.XML_ENTITY__NAMED_NATIVE_QUERIES:
- return getNamedNativeQueries();
- case OrmPackage.XML_ENTITY__SQL_RESULT_SET_MAPPINGS:
- return getSqlResultSetMappings();
- case OrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS:
- return isExcludeDefaultListeners() ? Boolean.TRUE : Boolean.FALSE;
- case OrmPackage.XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS:
- return isExcludeSuperclassListeners() ? Boolean.TRUE : Boolean.FALSE;
- case OrmPackage.XML_ENTITY__ENTITY_LISTENERS:
- return getEntityListeners();
- 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();
- }
- 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__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__ID_CLASS:
- setIdClass((XmlIdClass)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__SEQUENCE_GENERATOR:
- setSequenceGenerator((XmlSequenceGenerator)newValue);
- return;
- case OrmPackage.XML_ENTITY__TABLE_GENERATOR:
- setTableGenerator((XmlTableGenerator)newValue);
- return;
- 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__SQL_RESULT_SET_MAPPINGS:
- getSqlResultSetMappings().clear();
- getSqlResultSetMappings().addAll((Collection<? extends SqlResultSetMapping>)newValue);
- return;
- case OrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS:
- setExcludeDefaultListeners(((Boolean)newValue).booleanValue());
- return;
- case OrmPackage.XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS:
- setExcludeSuperclassListeners(((Boolean)newValue).booleanValue());
- return;
- case OrmPackage.XML_ENTITY__ENTITY_LISTENERS:
- setEntityListeners((EntityListeners)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;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- 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__ID_CLASS:
- setIdClass((XmlIdClass)null);
- 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__SEQUENCE_GENERATOR:
- setSequenceGenerator((XmlSequenceGenerator)null);
- return;
- case OrmPackage.XML_ENTITY__TABLE_GENERATOR:
- setTableGenerator((XmlTableGenerator)null);
- return;
- case OrmPackage.XML_ENTITY__NAMED_QUERIES:
- getNamedQueries().clear();
- return;
- case OrmPackage.XML_ENTITY__NAMED_NATIVE_QUERIES:
- getNamedNativeQueries().clear();
- 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;
- 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;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- 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__ID_CLASS:
- return idClass != null;
- 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__SEQUENCE_GENERATOR:
- return sequenceGenerator != null;
- case OrmPackage.XML_ENTITY__TABLE_GENERATOR:
- return tableGenerator != null;
- 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__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;
- 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();
- }
- 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(", discriminatorValue: ");
- result.append(discriminatorValue);
- result.append(", excludeDefaultListeners: ");
- result.append(excludeDefaultListeners);
- result.append(", excludeSuperclassListeners: ");
- result.append(excludeSuperclassListeners);
- result.append(')');
- return result.toString();
- }
-
-} // Entity
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 a722bf490c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEntityMappings.java
+++ /dev/null
@@ -1,1079 +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.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.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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#getVersion <em>Version</em>}</li>
- * <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#getAccess <em>Access</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#getNamedQueries <em>Named Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getNamedNativeQueries <em>Named Native Queries</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"
- * @extends JpaEObject
- * @generated
- */
-public class XmlEntityMappings extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * 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 = "1.0";
-
- /**
- * 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;
-
- /**
- * This is true if the Version attribute has been set.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- protected boolean versionESet;
-
- /**
- * 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;
-
- /**
- * 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 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 #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 #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>Version</b></em>' attribute.
- * The default value is <code>"1.0"</code>.
- * <!-- 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 #isSetVersion()
- * @see #unsetVersion()
- * @see #setVersion(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_Version()
- * @model default="1.0" unsettable="true" dataType="org.eclipse.jpt.core.resource.orm.VersionType" required="true"
- * @generated
- */
- public String getVersion()
- {
- return version;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getVersion <em>Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Version</em>' attribute.
- * @see #isSetVersion()
- * @see #unsetVersion()
- * @see #getVersion()
- * @generated
- */
- public void setVersion(String newVersion)
- {
- String oldVersion = version;
- version = newVersion;
- boolean oldVersionESet = versionESet;
- versionESet = true;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_MAPPINGS__VERSION, oldVersion, version, !oldVersionESet));
- }
-
- /**
- * Unsets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getVersion <em>Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isSetVersion()
- * @see #getVersion()
- * @see #setVersion(String)
- * @generated
- */
- public void unsetVersion()
- {
- String oldVersion = version;
- boolean oldVersionESet = versionESet;
- version = VERSION_EDEFAULT;
- versionESet = false;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.UNSET, OrmPackage.XML_ENTITY_MAPPINGS__VERSION, oldVersion, VERSION_EDEFAULT, oldVersionESet));
- }
-
- /**
- * Returns whether the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getVersion <em>Version</em>}' attribute is set.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return whether the value of the '<em>Version</em>' attribute is set.
- * @see #unsetVersion()
- * @see #getVersion()
- * @see #setVersion(String)
- * @generated
- */
- public boolean isSetVersion()
- {
- return versionESet;
- }
-
- /**
- * 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 default value is <code>"PROPERTY"</code>.
- * 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#getXmlEntityMappings_Access()
- * @model default="PROPERTY"
- * @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>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#getXmlEntityMappings_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#getXmlEntityMappings_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>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__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__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__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__VERSION:
- return getVersion();
- 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__ACCESS:
- return getAccess();
- case OrmPackage.XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS:
- return getSequenceGenerators();
- case OrmPackage.XML_ENTITY_MAPPINGS__TABLE_GENERATORS:
- return getTableGenerators();
- case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_QUERIES:
- return getNamedQueries();
- case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES:
- return getNamedNativeQueries();
- 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__VERSION:
- setVersion((String)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__ACCESS:
- setAccess((AccessType)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__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__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__VERSION:
- unsetVersion();
- 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__ACCESS:
- setAccess(ACCESS_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__NAMED_QUERIES:
- getNamedQueries().clear();
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES:
- getNamedNativeQueries().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__VERSION:
- return isSetVersion();
- 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__ACCESS:
- return access != ACCESS_EDEFAULT;
- 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__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__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);
- }
-
-
- // **************** 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(" (version: ");
- if (versionESet) result.append(version); else result.append("<unset>");
- 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(", access: ");
- result.append(access);
- result.append(')');
- return result.toString();
- }
-
- @Override
- public JpaEObject getRoot() {
- return this;
- }
-} \ No newline at end of file
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 26eef8a2fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratedValue.java
+++ /dev/null
@@ -1,102 +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 org.eclipse.jpt.core.resource.common.JpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlGeneratedValue extends JpaEObject
-{
- /**
- * 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
- */
- String getGenerator();
-
- /**
- * 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
- */
- void setGenerator(String value);
-
- /**
- * 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
- */
- GenerationType getStrategy();
-
- /**
- * 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
- */
- void setStrategy(GenerationType value);
-
- /**
- * Return the {@link TextRange} for the generator attibute. If the generator attibute
- * does not exist return the {@link TextRange} for the generated-value element.
- */
- TextRange getGeneratorTextRange();
-} // GeneratedValue
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratedValueImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratedValueImpl.java
deleted file mode 100644
index 4d30fa1669..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratedValueImpl.java
+++ /dev/null
@@ -1,266 +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 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.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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 -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGeneratedValueImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlGeneratedValueImpl extends AbstractJpaEObject implements XmlGeneratedValue
-{
- /**
- * 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 XmlGeneratedValueImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_GENERATED_VALUE_IMPL;
- }
-
- /**
- * 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.XmlGeneratedValueImpl#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_IMPL__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.XmlGeneratedValueImpl#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_IMPL__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_IMPL__GENERATOR:
- return getGenerator();
- case OrmPackage.XML_GENERATED_VALUE_IMPL__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_IMPL__GENERATOR:
- setGenerator((String)newValue);
- return;
- case OrmPackage.XML_GENERATED_VALUE_IMPL__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_IMPL__GENERATOR:
- setGenerator(GENERATOR_EDEFAULT);
- return;
- case OrmPackage.XML_GENERATED_VALUE_IMPL__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_IMPL__GENERATOR:
- return GENERATOR_EDEFAULT == null ? generator != null : !GENERATOR_EDEFAULT.equals(generator);
- case OrmPackage.XML_GENERATED_VALUE_IMPL__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(OrmXmlMapper.GENERATOR);
- }
-} // 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 51b4174e8d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGenerator.java
+++ /dev/null
@@ -1,123 +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 org.eclipse.jpt.core.resource.common.JpaEObject;
-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"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlGenerator 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#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/XmlId.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlId.java
deleted file mode 100644
index f9e0c3ad51..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlId.java
+++ /dev/null
@@ -1,117 +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;
-
-
-/**
- * <!-- 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>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlId#getTableGenerator <em>Table Generator</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlId#getSequenceGenerator <em>Sequence Generator</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlId()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlId extends XmlAttributeMapping, ColumnMapping, XmlConvertibleMapping
-{
- /**
- * 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
- */
- XmlGeneratedValue getGeneratedValue();
-
- /**
- * 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
- */
- void setGeneratedValue(XmlGeneratedValue 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#getXmlId_TableGenerator()
- * @model containment="true"
- * @generated
- */
- XmlTableGenerator getTableGenerator();
-
- /**
- * 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
- */
- void setTableGenerator(XmlTableGenerator value);
-
- /**
- * 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#getXmlId_SequenceGenerator()
- * @model containment="true"
- * @generated
- */
- XmlSequenceGenerator getSequenceGenerator();
-
- /**
- * 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
- */
- void setSequenceGenerator(XmlSequenceGenerator value);
-
-} // Id
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlIdClass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlIdClass.java
deleted file mode 100644
index 1bb0e3dd92..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlIdClass.java
+++ /dev/null
@@ -1,202 +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 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.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Id Class</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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.XmlIdClass#getClassName <em>Class Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlIdClass()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlIdClass 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 XmlIdClass()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_ID_CLASS;
- }
-
- /**
- * 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#getXmlIdClass_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.XmlIdClass#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_ID_CLASS__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_ID_CLASS__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_ID_CLASS__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_ID_CLASS__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_ID_CLASS__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();
- }
-
-} // IdClass
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlIdImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlIdImpl.java
deleted file mode 100644
index 7d68d9eb62..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlIdImpl.java
+++ /dev/null
@@ -1,769 +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 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.MappingKeys;
-import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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 -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlIdImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlIdImpl extends AbstractXmlAttributeMapping implements XmlId
-{
- /**
- * 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 #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 #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 #getSequenceGenerator() <em>Sequence Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSequenceGenerator()
- * @generated
- * @ordered
- */
- protected XmlSequenceGenerator sequenceGenerator;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlIdImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_ID_IMPL;
- }
-
- /**
- * 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_IMPL__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.XmlIdImpl#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_IMPL__COLUMN, null, msgs);
- if (newColumn != null)
- msgs = ((InternalEObject)newColumn).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID_IMPL__COLUMN, null, msgs);
- msgs = basicSetColumn(newColumn, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID_IMPL__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.XmlIdImpl#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_IMPL__LOB, oldLob, lob));
- }
-
- /**
- * 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_IMPL__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.XmlIdImpl#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_IMPL__GENERATED_VALUE, null, msgs);
- if (newGeneratedValue != null)
- msgs = ((InternalEObject)newGeneratedValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID_IMPL__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_IMPL__GENERATED_VALUE, newGeneratedValue, newGeneratedValue));
- }
-
- /**
- * 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.XmlIdImpl#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_IMPL__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.XmlIdImpl#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_IMPL__ENUMERATED, oldEnumerated, enumerated));
- }
-
- /**
- * 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#getXmlId_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_IMPL__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.XmlIdImpl#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_IMPL__TABLE_GENERATOR, null, msgs);
- if (newTableGenerator != null)
- msgs = ((InternalEObject)newTableGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID_IMPL__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_IMPL__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#getXmlId_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_IMPL__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.XmlIdImpl#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_IMPL__SEQUENCE_GENERATOR, null, msgs);
- if (newSequenceGenerator != null)
- msgs = ((InternalEObject)newSequenceGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID_IMPL__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_IMPL__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_IMPL__COLUMN:
- return basicSetColumn(null, msgs);
- case OrmPackage.XML_ID_IMPL__GENERATED_VALUE:
- return basicSetGeneratedValue(null, msgs);
- case OrmPackage.XML_ID_IMPL__TABLE_GENERATOR:
- return basicSetTableGenerator(null, msgs);
- case OrmPackage.XML_ID_IMPL__SEQUENCE_GENERATOR:
- return basicSetSequenceGenerator(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_IMPL__COLUMN:
- return getColumn();
- case OrmPackage.XML_ID_IMPL__LOB:
- return isLob() ? Boolean.TRUE : Boolean.FALSE;
- case OrmPackage.XML_ID_IMPL__TEMPORAL:
- return getTemporal();
- case OrmPackage.XML_ID_IMPL__ENUMERATED:
- return getEnumerated();
- case OrmPackage.XML_ID_IMPL__GENERATED_VALUE:
- return getGeneratedValue();
- case OrmPackage.XML_ID_IMPL__TABLE_GENERATOR:
- return getTableGenerator();
- case OrmPackage.XML_ID_IMPL__SEQUENCE_GENERATOR:
- return getSequenceGenerator();
- }
- 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_IMPL__COLUMN:
- setColumn((XmlColumn)newValue);
- return;
- case OrmPackage.XML_ID_IMPL__LOB:
- setLob(((Boolean)newValue).booleanValue());
- return;
- case OrmPackage.XML_ID_IMPL__TEMPORAL:
- setTemporal((TemporalType)newValue);
- return;
- case OrmPackage.XML_ID_IMPL__ENUMERATED:
- setEnumerated((EnumType)newValue);
- return;
- case OrmPackage.XML_ID_IMPL__GENERATED_VALUE:
- setGeneratedValue((XmlGeneratedValue)newValue);
- return;
- case OrmPackage.XML_ID_IMPL__TABLE_GENERATOR:
- setTableGenerator((XmlTableGenerator)newValue);
- return;
- case OrmPackage.XML_ID_IMPL__SEQUENCE_GENERATOR:
- setSequenceGenerator((XmlSequenceGenerator)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_IMPL__COLUMN:
- setColumn((XmlColumn)null);
- return;
- case OrmPackage.XML_ID_IMPL__LOB:
- setLob(LOB_EDEFAULT);
- return;
- case OrmPackage.XML_ID_IMPL__TEMPORAL:
- setTemporal(TEMPORAL_EDEFAULT);
- return;
- case OrmPackage.XML_ID_IMPL__ENUMERATED:
- setEnumerated(ENUMERATED_EDEFAULT);
- return;
- case OrmPackage.XML_ID_IMPL__GENERATED_VALUE:
- setGeneratedValue((XmlGeneratedValue)null);
- return;
- case OrmPackage.XML_ID_IMPL__TABLE_GENERATOR:
- setTableGenerator((XmlTableGenerator)null);
- return;
- case OrmPackage.XML_ID_IMPL__SEQUENCE_GENERATOR:
- setSequenceGenerator((XmlSequenceGenerator)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ID_IMPL__COLUMN:
- return column != null;
- case OrmPackage.XML_ID_IMPL__LOB:
- return lob != LOB_EDEFAULT;
- case OrmPackage.XML_ID_IMPL__TEMPORAL:
- return temporal != TEMPORAL_EDEFAULT;
- case OrmPackage.XML_ID_IMPL__ENUMERATED:
- return enumerated != ENUMERATED_EDEFAULT;
- case OrmPackage.XML_ID_IMPL__GENERATED_VALUE:
- return generatedValue != null;
- case OrmPackage.XML_ID_IMPL__TABLE_GENERATOR:
- return tableGenerator != null;
- case OrmPackage.XML_ID_IMPL__SEQUENCE_GENERATOR:
- return sequenceGenerator != 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_IMPL__COLUMN: return OrmPackage.COLUMN_MAPPING__COLUMN;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ID_IMPL__LOB: return OrmPackage.XML_CONVERTIBLE_MAPPING__LOB;
- case OrmPackage.XML_ID_IMPL__TEMPORAL: return OrmPackage.XML_CONVERTIBLE_MAPPING__TEMPORAL;
- case OrmPackage.XML_ID_IMPL__ENUMERATED: return OrmPackage.XML_CONVERTIBLE_MAPPING__ENUMERATED;
- default: return -1;
- }
- }
- if (baseClass == XmlId.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ID_IMPL__GENERATED_VALUE: return OrmPackage.XML_ID__GENERATED_VALUE;
- case OrmPackage.XML_ID_IMPL__TABLE_GENERATOR: return OrmPackage.XML_ID__TABLE_GENERATOR;
- case OrmPackage.XML_ID_IMPL__SEQUENCE_GENERATOR: return OrmPackage.XML_ID__SEQUENCE_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_IMPL__COLUMN;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_CONVERTIBLE_MAPPING__LOB: return OrmPackage.XML_ID_IMPL__LOB;
- case OrmPackage.XML_CONVERTIBLE_MAPPING__TEMPORAL: return OrmPackage.XML_ID_IMPL__TEMPORAL;
- case OrmPackage.XML_CONVERTIBLE_MAPPING__ENUMERATED: return OrmPackage.XML_ID_IMPL__ENUMERATED;
- default: return -1;
- }
- }
- if (baseClass == XmlId.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ID__GENERATED_VALUE: return OrmPackage.XML_ID_IMPL__GENERATED_VALUE;
- case OrmPackage.XML_ID__TABLE_GENERATOR: return OrmPackage.XML_ID_IMPL__TABLE_GENERATOR;
- case OrmPackage.XML_ID__SEQUENCE_GENERATOR: return OrmPackage.XML_ID_IMPL__SEQUENCE_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(OrmXmlMapper.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;
- }
-} // Id
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 b2e260a3a4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumn.java
+++ /dev/null
@@ -1,67 +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 org.eclipse.jpt.core.utility.TextRange;
-
-
-/**
- * <!-- 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" interface="true" abstract="true"
- * @generated
- */
-public interface XmlJoinColumn extends XmlAbstractColumn
-{
- /**
- * 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
- */
- String getReferencedColumnName();
-
- /**
- * 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
- */
- void setReferencedColumnName(String value);
-
- TextRange getReferencedColumnNameTextRange();
-
-} // JoinColumn
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumnImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumnImpl.java
deleted file mode 100644
index bf46b1b4a1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumnImpl.java
+++ /dev/null
@@ -1,236 +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 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.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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 -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinColumnImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlJoinColumnImpl extends AbstractXmlAbstractColumn implements XmlJoinColumn
-{
- /**
- * 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 XmlJoinColumnImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_JOIN_COLUMN_IMPL;
- }
-
- /**
- * 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.XmlJoinColumnImpl#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_IMPL__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_IMPL__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_IMPL__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_IMPL__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_IMPL__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 int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlJoinColumn.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_JOIN_COLUMN_IMPL__REFERENCED_COLUMN_NAME: return OrmPackage.XML_JOIN_COLUMN__REFERENCED_COLUMN_NAME;
- 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 == XmlJoinColumn.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_JOIN_COLUMN__REFERENCED_COLUMN_NAME: return OrmPackage.XML_JOIN_COLUMN_IMPL__REFERENCED_COLUMN_NAME;
- 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(" (referencedColumnName: ");
- result.append(referencedColumnName);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getReferencedColumnNameTextRange() {
- return getAttributeTextRange(OrmXmlMapper.REFERENCED_COLUMN_NAME);
- }
-} // JoinColumn
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 dd393c3079..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinTable.java
+++ /dev/null
@@ -1,72 +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 org.eclipse.emf.common.util.EList;
-
-/**
- * <!-- 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#getJoinColumns <em>Join Columns</em>}</li>
- * <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" interface="true" abstract="true"
- * @generated
- */
-public interface XmlJoinTable extends XmlBaseTable
-{
- /**
- * 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#getXmlJoinTable_JoinColumns()
- * @model containment="true"
- * @generated
- */
- EList<XmlJoinColumn> getJoinColumns();
-
- /**
- * 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
- */
- EList<XmlJoinColumn> getInverseJoinColumns();
-
- boolean isSpecified();
-} // JoinTable
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinTableImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinTableImpl.java
deleted file mode 100644
index 499fb4e1a8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinTableImpl.java
+++ /dev/null
@@ -1,264 +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.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;
-
-/**
- * <!-- 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 -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinTableImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlJoinTableImpl extends AbstractXmlBaseTable implements XmlJoinTable
-{
- /**
- * 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 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 XmlJoinTableImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_JOIN_TABLE_IMPL;
- }
-
- /**
- * 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#getXmlJoinTable_JoinColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlJoinColumn> getJoinColumns()
- {
- if (joinColumns == null)
- {
- joinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_JOIN_TABLE_IMPL__JOIN_COLUMNS);
- }
- return joinColumns;
- }
-
- /**
- * 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_IMPL__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_IMPL__JOIN_COLUMNS:
- return ((InternalEList<?>)getJoinColumns()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_JOIN_TABLE_IMPL__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_IMPL__JOIN_COLUMNS:
- return getJoinColumns();
- case OrmPackage.XML_JOIN_TABLE_IMPL__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_IMPL__JOIN_COLUMNS:
- getJoinColumns().clear();
- getJoinColumns().addAll((Collection<? extends XmlJoinColumn>)newValue);
- return;
- case OrmPackage.XML_JOIN_TABLE_IMPL__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_IMPL__JOIN_COLUMNS:
- getJoinColumns().clear();
- return;
- case OrmPackage.XML_JOIN_TABLE_IMPL__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_IMPL__JOIN_COLUMNS:
- return joinColumns != null && !joinColumns.isEmpty();
- case OrmPackage.XML_JOIN_TABLE_IMPL__INVERSE_JOIN_COLUMNS:
- return inverseJoinColumns != null && !inverseJoinColumns.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlJoinTable.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_JOIN_TABLE_IMPL__JOIN_COLUMNS: return OrmPackage.XML_JOIN_TABLE__JOIN_COLUMNS;
- case OrmPackage.XML_JOIN_TABLE_IMPL__INVERSE_JOIN_COLUMNS: return OrmPackage.XML_JOIN_TABLE__INVERSE_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 == XmlJoinTable.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_JOIN_TABLE__JOIN_COLUMNS: return OrmPackage.XML_JOIN_TABLE_IMPL__JOIN_COLUMNS;
- case OrmPackage.XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS: return OrmPackage.XML_JOIN_TABLE_IMPL__INVERSE_JOIN_COLUMNS;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- public boolean isSpecified() {
- return true;
- }
-} // JoinTable
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 8745efe5f4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToMany.java
+++ /dev/null
@@ -1,31 +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;
-
-
-/**
- * <!-- 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" interface="true" abstract="true"
- * @generated
- */
-public interface XmlManyToMany extends XmlMultiRelationshipMapping
-{
-} // ManyToMany
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToManyImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToManyImpl.java
deleted file mode 100644
index 50435a3aca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToManyImpl.java
+++ /dev/null
@@ -1,744 +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 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.MappingKeys;
-import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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#getXmlManyToManyImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlManyToManyImpl extends AbstractXmlAttributeMapping implements XmlManyToMany
-{
- /**
- * 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 #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 #getCascade() <em>Cascade</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascade()
- * @generated
- * @ordered
- */
- protected CascadeType cascade;
-
- /**
- * 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 #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 #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 XmlManyToManyImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_MANY_TO_MANY_IMPL;
- }
-
- /**
- * 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#getXmlRelationshipMapping_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.XmlManyToManyImpl#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.XML_MANY_TO_MANY_IMPL__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#getXmlRelationshipMapping_Fetch()
- * @model default="LAZY"
- * @generated
- */
- public FetchType getFetch()
- {
- return fetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToManyImpl#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_MANY_TO_MANY_IMPL__FETCH, oldFetch, fetch));
- }
-
- /**
- * 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#getXmlMultiRelationshipMapping_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.XmlManyToManyImpl#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_MANY_TO_MANY_IMPL__MAPPED_BY, oldMappedBy, mappedBy));
- }
-
- /**
- * 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#getXmlMultiRelationshipMapping_OrderBy()
- * @model dataType="org.eclipse.jpt.core.resource.orm.OrderBy"
- * @generated
- */
- public String getOrderBy()
- {
- return orderBy;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToManyImpl#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_MANY_TO_MANY_IMPL__ORDER_BY, oldOrderBy, orderBy));
- }
-
- /**
- * 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#getXmlMultiRelationshipMapping_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_MANY_TO_MANY_IMPL__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.XmlManyToManyImpl#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_MANY_TO_MANY_IMPL__MAP_KEY, null, msgs);
- if (newMapKey != null)
- msgs = ((InternalEObject)newMapKey).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MANY_TO_MANY_IMPL__MAP_KEY, null, msgs);
- msgs = basicSetMapKey(newMapKey, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MANY_TO_MANY_IMPL__MAP_KEY, newMapKey, newMapKey));
- }
-
- /**
- * 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#getXmlRelationshipMapping_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_MANY_TO_MANY_IMPL__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.XmlManyToManyImpl#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_MANY_TO_MANY_IMPL__JOIN_TABLE, null, msgs);
- if (newJoinTable != null)
- msgs = ((InternalEObject)newJoinTable).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MANY_TO_MANY_IMPL__JOIN_TABLE, null, msgs);
- msgs = basicSetJoinTable(newJoinTable, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MANY_TO_MANY_IMPL__JOIN_TABLE, newJoinTable, newJoinTable));
- }
-
- /**
- * 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#getXmlRelationshipMapping_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.XML_MANY_TO_MANY_IMPL__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.XmlManyToManyImpl#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.XML_MANY_TO_MANY_IMPL__CASCADE, null, msgs);
- if (newCascade != null)
- msgs = ((InternalEObject)newCascade).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MANY_TO_MANY_IMPL__CASCADE, null, msgs);
- msgs = basicSetCascade(newCascade, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MANY_TO_MANY_IMPL__CASCADE, newCascade, newCascade));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_MANY_TO_MANY_IMPL__JOIN_TABLE:
- return basicSetJoinTable(null, msgs);
- case OrmPackage.XML_MANY_TO_MANY_IMPL__CASCADE:
- return basicSetCascade(null, msgs);
- case OrmPackage.XML_MANY_TO_MANY_IMPL__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.XML_MANY_TO_MANY_IMPL__TARGET_ENTITY:
- return getTargetEntity();
- case OrmPackage.XML_MANY_TO_MANY_IMPL__FETCH:
- return getFetch();
- case OrmPackage.XML_MANY_TO_MANY_IMPL__JOIN_TABLE:
- return getJoinTable();
- case OrmPackage.XML_MANY_TO_MANY_IMPL__CASCADE:
- return getCascade();
- case OrmPackage.XML_MANY_TO_MANY_IMPL__MAPPED_BY:
- return getMappedBy();
- case OrmPackage.XML_MANY_TO_MANY_IMPL__ORDER_BY:
- return getOrderBy();
- case OrmPackage.XML_MANY_TO_MANY_IMPL__MAP_KEY:
- return getMapKey();
- }
- 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_MANY_TO_MANY_IMPL__TARGET_ENTITY:
- setTargetEntity((String)newValue);
- return;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__FETCH:
- setFetch((FetchType)newValue);
- return;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__JOIN_TABLE:
- setJoinTable((XmlJoinTable)newValue);
- return;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__CASCADE:
- setCascade((CascadeType)newValue);
- return;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__MAPPED_BY:
- setMappedBy((String)newValue);
- return;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__ORDER_BY:
- setOrderBy((String)newValue);
- return;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__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.XML_MANY_TO_MANY_IMPL__TARGET_ENTITY:
- setTargetEntity(TARGET_ENTITY_EDEFAULT);
- return;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__FETCH:
- setFetch(FETCH_EDEFAULT);
- return;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__JOIN_TABLE:
- setJoinTable((XmlJoinTable)null);
- return;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__CASCADE:
- setCascade((CascadeType)null);
- return;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__MAPPED_BY:
- setMappedBy(MAPPED_BY_EDEFAULT);
- return;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__ORDER_BY:
- setOrderBy(ORDER_BY_EDEFAULT);
- return;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__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.XML_MANY_TO_MANY_IMPL__TARGET_ENTITY:
- return TARGET_ENTITY_EDEFAULT == null ? targetEntity != null : !TARGET_ENTITY_EDEFAULT.equals(targetEntity);
- case OrmPackage.XML_MANY_TO_MANY_IMPL__FETCH:
- return fetch != FETCH_EDEFAULT;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__JOIN_TABLE:
- return joinTable != null;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__CASCADE:
- return cascade != null;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__MAPPED_BY:
- return MAPPED_BY_EDEFAULT == null ? mappedBy != null : !MAPPED_BY_EDEFAULT.equals(mappedBy);
- case OrmPackage.XML_MANY_TO_MANY_IMPL__ORDER_BY:
- return ORDER_BY_EDEFAULT == null ? orderBy != null : !ORDER_BY_EDEFAULT.equals(orderBy);
- case OrmPackage.XML_MANY_TO_MANY_IMPL__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 == XmlRelationshipMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_MANY_TO_MANY_IMPL__TARGET_ENTITY: return OrmPackage.XML_RELATIONSHIP_MAPPING__TARGET_ENTITY;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__FETCH: return OrmPackage.XML_RELATIONSHIP_MAPPING__FETCH;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__JOIN_TABLE: return OrmPackage.XML_RELATIONSHIP_MAPPING__JOIN_TABLE;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__CASCADE: return OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE;
- default: return -1;
- }
- }
- if (baseClass == XmlMultiRelationshipMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_MANY_TO_MANY_IMPL__MAPPED_BY: return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__ORDER_BY: return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__MAP_KEY: return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToMany.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 == XmlRelationshipMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_RELATIONSHIP_MAPPING__TARGET_ENTITY: return OrmPackage.XML_MANY_TO_MANY_IMPL__TARGET_ENTITY;
- case OrmPackage.XML_RELATIONSHIP_MAPPING__FETCH: return OrmPackage.XML_MANY_TO_MANY_IMPL__FETCH;
- case OrmPackage.XML_RELATIONSHIP_MAPPING__JOIN_TABLE: return OrmPackage.XML_MANY_TO_MANY_IMPL__JOIN_TABLE;
- case OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE: return OrmPackage.XML_MANY_TO_MANY_IMPL__CASCADE;
- default: return -1;
- }
- }
- if (baseClass == XmlMultiRelationshipMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY: return OrmPackage.XML_MANY_TO_MANY_IMPL__MAPPED_BY;
- case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY: return OrmPackage.XML_MANY_TO_MANY_IMPL__ORDER_BY;
- case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY: return OrmPackage.XML_MANY_TO_MANY_IMPL__MAP_KEY;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToMany.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(" (targetEntity: ");
- result.append(targetEntity);
- result.append(", fetch: ");
- result.append(fetch);
- result.append(", mappedBy: ");
- result.append(mappedBy);
- result.append(", orderBy: ");
- result.append(orderBy);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getMappedByTextRange() {
- return getAttributeTextRange(OrmXmlMapper.MAPPED_BY);
- }
-
- public String getMappingKey() {
- return MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-} \ No newline at end of file
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 10c32ac72f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToOne.java
+++ /dev/null
@@ -1,31 +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;
-
-
-/**
- * <!-- 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" interface="true" abstract="true"
- * @generated
- */
-public interface XmlManyToOne extends XmlSingleRelationshipMapping
-{
-} // ManyToOne
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToOneImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToOneImpl.java
deleted file mode 100644
index bfe2bde187..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToOneImpl.java
+++ /dev/null
@@ -1,638 +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.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.MappingKeys;
-
-/**
- * <!-- 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#getXmlManyToOneImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlManyToOneImpl extends AbstractXmlAttributeMapping implements XmlManyToOne
-{
- /**
- * 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 #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 #getCascade() <em>Cascade</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascade()
- * @generated
- * @ordered
- */
- protected CascadeType cascade;
-
- /**
- * 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;
-
- /**
- * 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 XmlManyToOneImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_MANY_TO_ONE_IMPL;
- }
-
- /**
- * 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#getXmlRelationshipMapping_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.XmlManyToOneImpl#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.XML_MANY_TO_ONE_IMPL__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#getXmlRelationshipMapping_Fetch()
- * @model default="LAZY"
- * @generated
- */
- public FetchType getFetch()
- {
- return fetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToOneImpl#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_MANY_TO_ONE_IMPL__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#getXmlSingleRelationshipMapping_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.XmlManyToOneImpl#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_MANY_TO_ONE_IMPL__OPTIONAL, oldOptional, optional));
- }
-
- /**
- * 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#getXmlSingleRelationshipMapping_JoinColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlJoinColumn> getJoinColumns()
- {
- if (joinColumns == null)
- {
- joinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_COLUMNS);
- }
- return joinColumns;
- }
-
- /**
- * 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#getXmlRelationshipMapping_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_MANY_TO_ONE_IMPL__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.XmlManyToOneImpl#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_MANY_TO_ONE_IMPL__JOIN_TABLE, null, msgs);
- if (newJoinTable != null)
- msgs = ((InternalEObject)newJoinTable).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_TABLE, null, msgs);
- msgs = basicSetJoinTable(newJoinTable, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_TABLE, newJoinTable, newJoinTable));
- }
-
- /**
- * 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#getXmlRelationshipMapping_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.XML_MANY_TO_ONE_IMPL__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.XmlManyToOneImpl#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.XML_MANY_TO_ONE_IMPL__CASCADE, null, msgs);
- if (newCascade != null)
- msgs = ((InternalEObject)newCascade).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MANY_TO_ONE_IMPL__CASCADE, null, msgs);
- msgs = basicSetCascade(newCascade, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MANY_TO_ONE_IMPL__CASCADE, newCascade, newCascade));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_TABLE:
- return basicSetJoinTable(null, msgs);
- case OrmPackage.XML_MANY_TO_ONE_IMPL__CASCADE:
- return basicSetCascade(null, msgs);
- case OrmPackage.XML_MANY_TO_ONE_IMPL__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_MANY_TO_ONE_IMPL__TARGET_ENTITY:
- return getTargetEntity();
- case OrmPackage.XML_MANY_TO_ONE_IMPL__FETCH:
- return getFetch();
- case OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_TABLE:
- return getJoinTable();
- case OrmPackage.XML_MANY_TO_ONE_IMPL__CASCADE:
- return getCascade();
- case OrmPackage.XML_MANY_TO_ONE_IMPL__OPTIONAL:
- return getOptional();
- case OrmPackage.XML_MANY_TO_ONE_IMPL__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.XML_MANY_TO_ONE_IMPL__TARGET_ENTITY:
- setTargetEntity((String)newValue);
- return;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__FETCH:
- setFetch((FetchType)newValue);
- return;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_TABLE:
- setJoinTable((XmlJoinTable)newValue);
- return;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__CASCADE:
- setCascade((CascadeType)newValue);
- return;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__OPTIONAL:
- setOptional((Boolean)newValue);
- return;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__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.XML_MANY_TO_ONE_IMPL__TARGET_ENTITY:
- setTargetEntity(TARGET_ENTITY_EDEFAULT);
- return;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__FETCH:
- setFetch(FETCH_EDEFAULT);
- return;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_TABLE:
- setJoinTable((XmlJoinTable)null);
- return;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__CASCADE:
- setCascade((CascadeType)null);
- return;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__OPTIONAL:
- setOptional(OPTIONAL_EDEFAULT);
- return;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__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.XML_MANY_TO_ONE_IMPL__TARGET_ENTITY:
- return TARGET_ENTITY_EDEFAULT == null ? targetEntity != null : !TARGET_ENTITY_EDEFAULT.equals(targetEntity);
- case OrmPackage.XML_MANY_TO_ONE_IMPL__FETCH:
- return fetch != FETCH_EDEFAULT;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_TABLE:
- return joinTable != null;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__CASCADE:
- return cascade != null;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__OPTIONAL:
- return OPTIONAL_EDEFAULT == null ? optional != null : !OPTIONAL_EDEFAULT.equals(optional);
- case OrmPackage.XML_MANY_TO_ONE_IMPL__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 == XmlRelationshipMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_MANY_TO_ONE_IMPL__TARGET_ENTITY: return OrmPackage.XML_RELATIONSHIP_MAPPING__TARGET_ENTITY;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__FETCH: return OrmPackage.XML_RELATIONSHIP_MAPPING__FETCH;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_TABLE: return OrmPackage.XML_RELATIONSHIP_MAPPING__JOIN_TABLE;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__CASCADE: return OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE;
- default: return -1;
- }
- }
- if (baseClass == XmlSingleRelationshipMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_MANY_TO_ONE_IMPL__OPTIONAL: return OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_COLUMNS: return OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToOne.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 == XmlRelationshipMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_RELATIONSHIP_MAPPING__TARGET_ENTITY: return OrmPackage.XML_MANY_TO_ONE_IMPL__TARGET_ENTITY;
- case OrmPackage.XML_RELATIONSHIP_MAPPING__FETCH: return OrmPackage.XML_MANY_TO_ONE_IMPL__FETCH;
- case OrmPackage.XML_RELATIONSHIP_MAPPING__JOIN_TABLE: return OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_TABLE;
- case OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE: return OrmPackage.XML_MANY_TO_ONE_IMPL__CASCADE;
- default: return -1;
- }
- }
- if (baseClass == XmlSingleRelationshipMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL: return OrmPackage.XML_MANY_TO_ONE_IMPL__OPTIONAL;
- case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS: return OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_COLUMNS;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToOne.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(" (targetEntity: ");
- result.append(targetEntity);
- result.append(", fetch: ");
- result.append(fetch);
- result.append(", optional: ");
- result.append(optional);
- result.append(')');
- return result.toString();
- }
-
- public String getMappingKey() {
- return MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-} // ManyToOne
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 483d429b7d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlMappedSuperclass.java
+++ /dev/null
@@ -1,1040 +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 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;
-
-/**
- * <!-- 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#getIdClass <em>Id Class</em>}</li>
- * <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>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPrePersist <em>Pre Persist</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPostPersist <em>Post Persist</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPreRemove <em>Pre Remove</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPostRemove <em>Post Remove</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPreUpdate <em>Pre Update</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPostUpdate <em>Post Update</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPostLoad <em>Post Load</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedSuperclass()
- * @model kind="class"
- * @generated
- */
-public class XmlMappedSuperclass extends AbstractXmlTypeMapping
-{
- /**
- * 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 #getIdClass() <em>Id Class</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIdClass()
- * @generated
- * @ordered
- */
- protected XmlIdClass 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;
-
- /**
- * 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;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlMappedSuperclass()
- {
- super();
- }
-
- 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(XmlIdClass)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedSuperclass_IdClass()
- * @model containment="true"
- * @generated
- */
- public XmlIdClass getIdClass()
- {
- return idClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetIdClass(XmlIdClass newIdClass, NotificationChain msgs)
- {
- XmlIdClass 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(XmlIdClass 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));
- }
-
- /**
- * 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#getXmlMappedSuperclass_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_MAPPED_SUPERCLASS__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.XmlMappedSuperclass#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_MAPPED_SUPERCLASS__PRE_PERSIST, null, msgs);
- if (newPrePersist != null)
- msgs = ((InternalEObject)newPrePersist).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__PRE_PERSIST, null, msgs);
- msgs = basicSetPrePersist(newPrePersist, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__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#getXmlMappedSuperclass_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_MAPPED_SUPERCLASS__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.XmlMappedSuperclass#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_MAPPED_SUPERCLASS__POST_PERSIST, null, msgs);
- if (newPostPersist != null)
- msgs = ((InternalEObject)newPostPersist).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__POST_PERSIST, null, msgs);
- msgs = basicSetPostPersist(newPostPersist, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__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#getXmlMappedSuperclass_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_MAPPED_SUPERCLASS__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.XmlMappedSuperclass#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_MAPPED_SUPERCLASS__PRE_REMOVE, null, msgs);
- if (newPreRemove != null)
- msgs = ((InternalEObject)newPreRemove).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__PRE_REMOVE, null, msgs);
- msgs = basicSetPreRemove(newPreRemove, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__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#getXmlMappedSuperclass_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_MAPPED_SUPERCLASS__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.XmlMappedSuperclass#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_MAPPED_SUPERCLASS__POST_REMOVE, null, msgs);
- if (newPostRemove != null)
- msgs = ((InternalEObject)newPostRemove).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__POST_REMOVE, null, msgs);
- msgs = basicSetPostRemove(newPostRemove, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__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#getXmlMappedSuperclass_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_MAPPED_SUPERCLASS__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.XmlMappedSuperclass#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_MAPPED_SUPERCLASS__PRE_UPDATE, null, msgs);
- if (newPreUpdate != null)
- msgs = ((InternalEObject)newPreUpdate).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__PRE_UPDATE, null, msgs);
- msgs = basicSetPreUpdate(newPreUpdate, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__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#getXmlMappedSuperclass_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_MAPPED_SUPERCLASS__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.XmlMappedSuperclass#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_MAPPED_SUPERCLASS__POST_UPDATE, null, msgs);
- if (newPostUpdate != null)
- msgs = ((InternalEObject)newPostUpdate).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__POST_UPDATE, null, msgs);
- msgs = basicSetPostUpdate(newPostUpdate, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__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#getXmlMappedSuperclass_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_MAPPED_SUPERCLASS__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.XmlMappedSuperclass#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_MAPPED_SUPERCLASS__POST_LOAD, null, msgs);
- if (newPostLoad != null)
- msgs = ((InternalEObject)newPostLoad).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__POST_LOAD, null, msgs);
- msgs = basicSetPostLoad(newPostLoad, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__POST_LOAD, newPostLoad, newPostLoad));
- }
-
- /**
- * <!-- 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);
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_PERSIST:
- return basicSetPrePersist(null, msgs);
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_PERSIST:
- return basicSetPostPersist(null, msgs);
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_REMOVE:
- return basicSetPreRemove(null, msgs);
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_REMOVE:
- return basicSetPostRemove(null, msgs);
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_UPDATE:
- return basicSetPreUpdate(null, msgs);
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_UPDATE:
- return basicSetPostUpdate(null, msgs);
- case OrmPackage.XML_MAPPED_SUPERCLASS__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.XML_MAPPED_SUPERCLASS__ID_CLASS:
- return getIdClass();
- case OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS:
- return isExcludeDefaultListeners() ? Boolean.TRUE : Boolean.FALSE;
- case OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS:
- return isExcludeSuperclassListeners() ? Boolean.TRUE : Boolean.FALSE;
- case OrmPackage.XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS:
- return getEntityListeners();
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_PERSIST:
- return getPrePersist();
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_PERSIST:
- return getPostPersist();
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_REMOVE:
- return getPreRemove();
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_REMOVE:
- return getPostRemove();
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_UPDATE:
- return getPreUpdate();
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_UPDATE:
- return getPostUpdate();
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_LOAD:
- return getPostLoad();
- }
- 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((XmlIdClass)newValue);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS:
- setExcludeDefaultListeners(((Boolean)newValue).booleanValue());
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS:
- setExcludeSuperclassListeners(((Boolean)newValue).booleanValue());
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS:
- setEntityListeners((EntityListeners)newValue);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_PERSIST:
- setPrePersist((PrePersist)newValue);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_PERSIST:
- setPostPersist((PostPersist)newValue);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_REMOVE:
- setPreRemove((PreRemove)newValue);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_REMOVE:
- setPostRemove((PostRemove)newValue);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_UPDATE:
- setPreUpdate((PreUpdate)newValue);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_UPDATE:
- setPostUpdate((PostUpdate)newValue);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_LOAD:
- setPostLoad((PostLoad)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((XmlIdClass)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;
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_PERSIST:
- setPrePersist((PrePersist)null);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_PERSIST:
- setPostPersist((PostPersist)null);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_REMOVE:
- setPreRemove((PreRemove)null);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_REMOVE:
- setPostRemove((PostRemove)null);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_UPDATE:
- setPreUpdate((PreUpdate)null);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_UPDATE:
- setPostUpdate((PostUpdate)null);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_LOAD:
- setPostLoad((PostLoad)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;
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_PERSIST:
- return prePersist != null;
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_PERSIST:
- return postPersist != null;
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_REMOVE:
- return preRemove != null;
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_REMOVE:
- return postRemove != null;
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_UPDATE:
- return preUpdate != null;
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_UPDATE:
- return postUpdate != null;
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_LOAD:
- return postLoad != 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(" (excludeDefaultListeners: ");
- result.append(excludeDefaultListeners);
- result.append(", excludeSuperclassListeners: ");
- result.append(excludeSuperclassListeners);
- result.append(')');
- return result.toString();
- }
-
-} // MappedSuperclass
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlMultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlMultiRelationshipMapping.java
deleted file mode 100644
index 8bc2997a6e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlMultiRelationshipMapping.java
+++ /dev/null
@@ -1,120 +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 org.eclipse.jpt.core.utility.TextRange;
-
-
-/**
- * <!-- 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.XmlMultiRelationshipMapping#getMappedBy <em>Mapped By</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping#getOrderBy <em>Order By</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping#getMapKey <em>Map Key</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMultiRelationshipMapping()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlMultiRelationshipMapping extends XmlRelationshipMapping
-{
- /**
- * 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#getXmlMultiRelationshipMapping_OrderBy()
- * @model dataType="org.eclipse.jpt.core.resource.orm.OrderBy"
- * @generated
- */
- String getOrderBy();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping#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);
-
- /**
- * 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#getXmlMultiRelationshipMapping_MapKey()
- * @model containment="true"
- * @generated
- */
- MapKey getMapKey();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping#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>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#getXmlMultiRelationshipMapping_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.XmlMultiRelationshipMapping#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();
-} // MultiRelationshipMapping
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedColumn.java
deleted file mode 100644
index 688f19bdc7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedColumn.java
+++ /dev/null
@@ -1,99 +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 org.eclipse.jpt.core.resource.common.JpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>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.XmlNamedColumn#getColumnDefinition <em>Column Definition</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlNamedColumn#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedColumn()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlNamedColumn extends JpaEObject
-{
- /**
- * 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#getXmlNamedColumn_ColumnDefinition()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getColumnDefinition();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedColumn#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
- */
- void setColumnDefinition(String value);
-
- /**
- * 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#getXmlNamedColumn_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.XmlNamedColumn#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);
-
- /**
- * Return the {@link TextRange} for the name attibute. If the name attibute
- * does not exist return the {@link TextRange} for the *table element.
- */
- TextRange getNameTextRange();
-
-} // NamedColumn
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 3bc2fcfa89..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedNativeQuery.java
+++ /dev/null
@@ -1,474 +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.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.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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 #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>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__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__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__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__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(" (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(OrmXmlMapper.NAME);
- }
-} \ 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 8388735029..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedQuery.java
+++ /dev/null
@@ -1,333 +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.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.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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
-{
- /**
- * 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;
-
- /**
- * <!-- 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>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;
- }
-
- /**
- * <!-- 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__NAME:
- return getName();
- case OrmPackage.XML_NAMED_QUERY__QUERY:
- return getQuery();
- case OrmPackage.XML_NAMED_QUERY__HINTS:
- return getHints();
- }
- 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__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;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- 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;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- 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();
- }
- 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(", query: ");
- result.append(query);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getNameTextRange() {
- return getAttributeTextRange(OrmXmlMapper.NAME);
- }
-} \ No newline at end of file
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 d37a53078b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNullAttributeMapping.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-
-/**
- * <!-- 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" interface="true" abstract="true"
- * @generated
- */
-public interface XmlNullAttributeMapping extends XmlAttributeMapping
-{
-} // XmlNullAttributeMapping
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 4502f8fc94..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToMany.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.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-
-/**
- * <!-- 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 -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlOneToMany#getJoinColumns <em>Join Columns</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToMany()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlOneToMany extends XmlMultiRelationshipMapping
-{
- /**
- * 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#getXmlOneToMany_JoinColumns()
- * @model containment="true"
- * @generated
- */
- EList<XmlJoinColumn> getJoinColumns();
-
-} // OneToMany
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToManyImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToManyImpl.java
deleted file mode 100644
index 51632202bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToManyImpl.java
+++ /dev/null
@@ -1,797 +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.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.MappingKeys;
-import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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#getXmlOneToManyImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlOneToManyImpl extends AbstractXmlAttributeMapping implements XmlOneToMany
-{
- /**
- * 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 #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 #getCascade() <em>Cascade</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascade()
- * @generated
- * @ordered
- */
- protected CascadeType cascade;
-
- /**
- * 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 #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 #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 #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 XmlOneToManyImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_ONE_TO_MANY_IMPL;
- }
-
- /**
- * 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#getXmlRelationshipMapping_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.XmlOneToManyImpl#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.XML_ONE_TO_MANY_IMPL__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#getXmlRelationshipMapping_Fetch()
- * @model default="LAZY"
- * @generated
- */
- public FetchType getFetch()
- {
- return fetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToManyImpl#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_ONE_TO_MANY_IMPL__FETCH, oldFetch, fetch));
- }
-
- /**
- * 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#getXmlMultiRelationshipMapping_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.XmlOneToManyImpl#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_MANY_IMPL__MAPPED_BY, oldMappedBy, mappedBy));
- }
-
- /**
- * 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#getXmlMultiRelationshipMapping_OrderBy()
- * @model dataType="org.eclipse.jpt.core.resource.orm.OrderBy"
- * @generated
- */
- public String getOrderBy()
- {
- return orderBy;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToManyImpl#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_ONE_TO_MANY_IMPL__ORDER_BY, oldOrderBy, orderBy));
- }
-
- /**
- * 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#getXmlMultiRelationshipMapping_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_ONE_TO_MANY_IMPL__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.XmlOneToManyImpl#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_ONE_TO_MANY_IMPL__MAP_KEY, null, msgs);
- if (newMapKey != null)
- msgs = ((InternalEObject)newMapKey).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ONE_TO_MANY_IMPL__MAP_KEY, null, msgs);
- msgs = basicSetMapKey(newMapKey, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_MANY_IMPL__MAP_KEY, newMapKey, newMapKey));
- }
-
- /**
- * 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#getXmlRelationshipMapping_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_ONE_TO_MANY_IMPL__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.XmlOneToManyImpl#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_ONE_TO_MANY_IMPL__JOIN_TABLE, null, msgs);
- if (newJoinTable != null)
- msgs = ((InternalEObject)newJoinTable).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_TABLE, null, msgs);
- msgs = basicSetJoinTable(newJoinTable, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_MANY_IMPL__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#getXmlOneToMany_JoinColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlJoinColumn> getJoinColumns()
- {
- if (joinColumns == null)
- {
- joinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_COLUMNS);
- }
- return joinColumns;
- }
-
- /**
- * 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#getXmlRelationshipMapping_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.XML_ONE_TO_MANY_IMPL__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.XmlOneToManyImpl#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.XML_ONE_TO_MANY_IMPL__CASCADE, null, msgs);
- if (newCascade != null)
- msgs = ((InternalEObject)newCascade).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ONE_TO_MANY_IMPL__CASCADE, null, msgs);
- msgs = basicSetCascade(newCascade, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_MANY_IMPL__CASCADE, newCascade, newCascade));
- }
-
- /**
- * <!-- 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_IMPL__JOIN_TABLE:
- return basicSetJoinTable(null, msgs);
- case OrmPackage.XML_ONE_TO_MANY_IMPL__CASCADE:
- return basicSetCascade(null, msgs);
- case OrmPackage.XML_ONE_TO_MANY_IMPL__MAP_KEY:
- return basicSetMapKey(null, msgs);
- case OrmPackage.XML_ONE_TO_MANY_IMPL__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_IMPL__TARGET_ENTITY:
- return getTargetEntity();
- case OrmPackage.XML_ONE_TO_MANY_IMPL__FETCH:
- return getFetch();
- case OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_TABLE:
- return getJoinTable();
- case OrmPackage.XML_ONE_TO_MANY_IMPL__CASCADE:
- return getCascade();
- case OrmPackage.XML_ONE_TO_MANY_IMPL__MAPPED_BY:
- return getMappedBy();
- case OrmPackage.XML_ONE_TO_MANY_IMPL__ORDER_BY:
- return getOrderBy();
- case OrmPackage.XML_ONE_TO_MANY_IMPL__MAP_KEY:
- return getMapKey();
- case OrmPackage.XML_ONE_TO_MANY_IMPL__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.XML_ONE_TO_MANY_IMPL__TARGET_ENTITY:
- setTargetEntity((String)newValue);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__FETCH:
- setFetch((FetchType)newValue);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_TABLE:
- setJoinTable((XmlJoinTable)newValue);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__CASCADE:
- setCascade((CascadeType)newValue);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__MAPPED_BY:
- setMappedBy((String)newValue);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__ORDER_BY:
- setOrderBy((String)newValue);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__MAP_KEY:
- setMapKey((MapKey)newValue);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__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.XML_ONE_TO_MANY_IMPL__TARGET_ENTITY:
- setTargetEntity(TARGET_ENTITY_EDEFAULT);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__FETCH:
- setFetch(FETCH_EDEFAULT);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_TABLE:
- setJoinTable((XmlJoinTable)null);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__CASCADE:
- setCascade((CascadeType)null);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__MAPPED_BY:
- setMappedBy(MAPPED_BY_EDEFAULT);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__ORDER_BY:
- setOrderBy(ORDER_BY_EDEFAULT);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__MAP_KEY:
- setMapKey((MapKey)null);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__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.XML_ONE_TO_MANY_IMPL__TARGET_ENTITY:
- return TARGET_ENTITY_EDEFAULT == null ? targetEntity != null : !TARGET_ENTITY_EDEFAULT.equals(targetEntity);
- case OrmPackage.XML_ONE_TO_MANY_IMPL__FETCH:
- return fetch != FETCH_EDEFAULT;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_TABLE:
- return joinTable != null;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__CASCADE:
- return cascade != null;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__MAPPED_BY:
- return MAPPED_BY_EDEFAULT == null ? mappedBy != null : !MAPPED_BY_EDEFAULT.equals(mappedBy);
- case OrmPackage.XML_ONE_TO_MANY_IMPL__ORDER_BY:
- return ORDER_BY_EDEFAULT == null ? orderBy != null : !ORDER_BY_EDEFAULT.equals(orderBy);
- case OrmPackage.XML_ONE_TO_MANY_IMPL__MAP_KEY:
- return mapKey != null;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__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 == XmlRelationshipMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ONE_TO_MANY_IMPL__TARGET_ENTITY: return OrmPackage.XML_RELATIONSHIP_MAPPING__TARGET_ENTITY;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__FETCH: return OrmPackage.XML_RELATIONSHIP_MAPPING__FETCH;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_TABLE: return OrmPackage.XML_RELATIONSHIP_MAPPING__JOIN_TABLE;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__CASCADE: return OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE;
- default: return -1;
- }
- }
- if (baseClass == XmlMultiRelationshipMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ONE_TO_MANY_IMPL__MAPPED_BY: return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__ORDER_BY: return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__MAP_KEY: return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToMany.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_COLUMNS: return OrmPackage.XML_ONE_TO_MANY__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 == XmlRelationshipMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_RELATIONSHIP_MAPPING__TARGET_ENTITY: return OrmPackage.XML_ONE_TO_MANY_IMPL__TARGET_ENTITY;
- case OrmPackage.XML_RELATIONSHIP_MAPPING__FETCH: return OrmPackage.XML_ONE_TO_MANY_IMPL__FETCH;
- case OrmPackage.XML_RELATIONSHIP_MAPPING__JOIN_TABLE: return OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_TABLE;
- case OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE: return OrmPackage.XML_ONE_TO_MANY_IMPL__CASCADE;
- default: return -1;
- }
- }
- if (baseClass == XmlMultiRelationshipMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY: return OrmPackage.XML_ONE_TO_MANY_IMPL__MAPPED_BY;
- case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY: return OrmPackage.XML_ONE_TO_MANY_IMPL__ORDER_BY;
- case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY: return OrmPackage.XML_ONE_TO_MANY_IMPL__MAP_KEY;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToMany.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ONE_TO_MANY__JOIN_COLUMNS: return OrmPackage.XML_ONE_TO_MANY_IMPL__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(" (targetEntity: ");
- result.append(targetEntity);
- result.append(", fetch: ");
- result.append(fetch);
- result.append(", mappedBy: ");
- result.append(mappedBy);
- result.append(", orderBy: ");
- result.append(orderBy);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getMappedByTextRange() {
- return getAttributeTextRange(OrmXmlMapper.MAPPED_BY);
- }
-
- public String getMappingKey() {
- return MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-} // OneToMany
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 de2ac0d6ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToOne.java
+++ /dev/null
@@ -1,84 +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 org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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#getMappedBy <em>Mapped By</em>}</li>
- * <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" interface="true" abstract="true"
- * @generated
- */
-public interface XmlOneToOne extends XmlSingleRelationshipMapping
-{
- /**
- * 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#getXmlOneToOne_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.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
- */
- void setMappedBy(String value);
-
- /**
- * 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
- */
- EList<XmlPrimaryKeyJoinColumn> getPrimaryKeyJoinColumns();
-
- TextRange getMappedByTextRange();
-
-} // OneToOne
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToOneImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToOneImpl.java
deleted file mode 100644
index b9ec20c005..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToOneImpl.java
+++ /dev/null
@@ -1,761 +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.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.MappingKeys;
-import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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 -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToOneImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlOneToOneImpl extends AbstractXmlAttributeMapping implements XmlOneToOne
-{
- /**
- * 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 #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 #getCascade() <em>Cascade</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascade()
- * @generated
- * @ordered
- */
- protected CascadeType cascade;
-
- /**
- * 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;
-
- /**
- * 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 #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 #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 XmlOneToOneImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_ONE_TO_ONE_IMPL;
- }
-
- /**
- * 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#getXmlRelationshipMapping_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.XmlOneToOneImpl#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.XML_ONE_TO_ONE_IMPL__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#getXmlRelationshipMapping_Fetch()
- * @model default="LAZY"
- * @generated
- */
- public FetchType getFetch()
- {
- return fetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToOneImpl#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_ONE_TO_ONE_IMPL__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#getXmlSingleRelationshipMapping_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.XmlOneToOneImpl#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_ONE_TO_ONE_IMPL__OPTIONAL, oldOptional, optional));
- }
-
- /**
- * 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#getXmlOneToOne_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.XmlOneToOneImpl#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_IMPL__MAPPED_BY, oldMappedBy, mappedBy));
- }
-
- /**
- * 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_IMPL__PRIMARY_KEY_JOIN_COLUMNS);
- }
- return primaryKeyJoinColumns;
- }
-
- /**
- * 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#getXmlSingleRelationshipMapping_JoinColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlJoinColumn> getJoinColumns()
- {
- if (joinColumns == null)
- {
- joinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_COLUMNS);
- }
- return joinColumns;
- }
-
- /**
- * 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#getXmlRelationshipMapping_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_ONE_TO_ONE_IMPL__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.XmlOneToOneImpl#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_ONE_TO_ONE_IMPL__JOIN_TABLE, null, msgs);
- if (newJoinTable != null)
- msgs = ((InternalEObject)newJoinTable).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_TABLE, null, msgs);
- msgs = basicSetJoinTable(newJoinTable, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_TABLE, newJoinTable, newJoinTable));
- }
-
- /**
- * 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#getXmlRelationshipMapping_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.XML_ONE_TO_ONE_IMPL__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.XmlOneToOneImpl#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.XML_ONE_TO_ONE_IMPL__CASCADE, null, msgs);
- if (newCascade != null)
- msgs = ((InternalEObject)newCascade).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ONE_TO_ONE_IMPL__CASCADE, null, msgs);
- msgs = basicSetCascade(newCascade, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_ONE_IMPL__CASCADE, newCascade, newCascade));
- }
-
- /**
- * <!-- 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_IMPL__JOIN_TABLE:
- return basicSetJoinTable(null, msgs);
- case OrmPackage.XML_ONE_TO_ONE_IMPL__CASCADE:
- return basicSetCascade(null, msgs);
- case OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_COLUMNS:
- return ((InternalEList<?>)getJoinColumns()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ONE_TO_ONE_IMPL__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_IMPL__TARGET_ENTITY:
- return getTargetEntity();
- case OrmPackage.XML_ONE_TO_ONE_IMPL__FETCH:
- return getFetch();
- case OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_TABLE:
- return getJoinTable();
- case OrmPackage.XML_ONE_TO_ONE_IMPL__CASCADE:
- return getCascade();
- case OrmPackage.XML_ONE_TO_ONE_IMPL__OPTIONAL:
- return getOptional();
- case OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_COLUMNS:
- return getJoinColumns();
- case OrmPackage.XML_ONE_TO_ONE_IMPL__MAPPED_BY:
- return getMappedBy();
- case OrmPackage.XML_ONE_TO_ONE_IMPL__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_IMPL__TARGET_ENTITY:
- setTargetEntity((String)newValue);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__FETCH:
- setFetch((FetchType)newValue);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_TABLE:
- setJoinTable((XmlJoinTable)newValue);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__CASCADE:
- setCascade((CascadeType)newValue);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__OPTIONAL:
- setOptional((Boolean)newValue);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_COLUMNS:
- getJoinColumns().clear();
- getJoinColumns().addAll((Collection<? extends XmlJoinColumn>)newValue);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__MAPPED_BY:
- setMappedBy((String)newValue);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__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_IMPL__TARGET_ENTITY:
- setTargetEntity(TARGET_ENTITY_EDEFAULT);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__FETCH:
- setFetch(FETCH_EDEFAULT);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_TABLE:
- setJoinTable((XmlJoinTable)null);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__CASCADE:
- setCascade((CascadeType)null);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__OPTIONAL:
- setOptional(OPTIONAL_EDEFAULT);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_COLUMNS:
- getJoinColumns().clear();
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__MAPPED_BY:
- setMappedBy(MAPPED_BY_EDEFAULT);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__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_IMPL__TARGET_ENTITY:
- return TARGET_ENTITY_EDEFAULT == null ? targetEntity != null : !TARGET_ENTITY_EDEFAULT.equals(targetEntity);
- case OrmPackage.XML_ONE_TO_ONE_IMPL__FETCH:
- return fetch != FETCH_EDEFAULT;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_TABLE:
- return joinTable != null;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__CASCADE:
- return cascade != null;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__OPTIONAL:
- return OPTIONAL_EDEFAULT == null ? optional != null : !OPTIONAL_EDEFAULT.equals(optional);
- case OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_COLUMNS:
- return joinColumns != null && !joinColumns.isEmpty();
- case OrmPackage.XML_ONE_TO_ONE_IMPL__MAPPED_BY:
- return MAPPED_BY_EDEFAULT == null ? mappedBy != null : !MAPPED_BY_EDEFAULT.equals(mappedBy);
- case OrmPackage.XML_ONE_TO_ONE_IMPL__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 == XmlRelationshipMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ONE_TO_ONE_IMPL__TARGET_ENTITY: return OrmPackage.XML_RELATIONSHIP_MAPPING__TARGET_ENTITY;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__FETCH: return OrmPackage.XML_RELATIONSHIP_MAPPING__FETCH;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_TABLE: return OrmPackage.XML_RELATIONSHIP_MAPPING__JOIN_TABLE;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__CASCADE: return OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE;
- default: return -1;
- }
- }
- if (baseClass == XmlSingleRelationshipMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ONE_TO_ONE_IMPL__OPTIONAL: return OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_COLUMNS: return OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToOne.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ONE_TO_ONE_IMPL__MAPPED_BY: return OrmPackage.XML_ONE_TO_ONE__MAPPED_BY;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__PRIMARY_KEY_JOIN_COLUMNS: return OrmPackage.XML_ONE_TO_ONE__PRIMARY_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 == XmlRelationshipMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_RELATIONSHIP_MAPPING__TARGET_ENTITY: return OrmPackage.XML_ONE_TO_ONE_IMPL__TARGET_ENTITY;
- case OrmPackage.XML_RELATIONSHIP_MAPPING__FETCH: return OrmPackage.XML_ONE_TO_ONE_IMPL__FETCH;
- case OrmPackage.XML_RELATIONSHIP_MAPPING__JOIN_TABLE: return OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_TABLE;
- case OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE: return OrmPackage.XML_ONE_TO_ONE_IMPL__CASCADE;
- default: return -1;
- }
- }
- if (baseClass == XmlSingleRelationshipMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL: return OrmPackage.XML_ONE_TO_ONE_IMPL__OPTIONAL;
- case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS: return OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_COLUMNS;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToOne.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ONE_TO_ONE__MAPPED_BY: return OrmPackage.XML_ONE_TO_ONE_IMPL__MAPPED_BY;
- case OrmPackage.XML_ONE_TO_ONE__PRIMARY_KEY_JOIN_COLUMNS: return OrmPackage.XML_ONE_TO_ONE_IMPL__PRIMARY_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(" (targetEntity: ");
- result.append(targetEntity);
- result.append(", fetch: ");
- result.append(fetch);
- result.append(", optional: ");
- result.append(optional);
- result.append(", mappedBy: ");
- result.append(mappedBy);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getMappedByTextRange() {
- return getAttributeTextRange(OrmXmlMapper.MAPPED_BY);
- }
-
- public String getMappingKey() {
- return MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-} // OneToOne
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 cdcaf867ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPersistenceUnitDefaults.java
+++ /dev/null
@@ -1,505 +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 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.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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#getAccess <em>Access</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"
- * @extends JpaEObject
- * @generated
- */
-public class XmlPersistenceUnitDefaults extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * 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;
-
- /**
- * 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 #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 default value is <code>"PROPERTY"</code>.
- * 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#getXmlPersistenceUnitDefaults_Access()
- * @model default="PROPERTY"
- * @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>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__SCHEMA:
- return getSchema();
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CATALOG:
- return getCatalog();
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS:
- return getAccess();
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST:
- return isCascadePersist() ? Boolean.TRUE : Boolean.FALSE;
- 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__SCHEMA:
- setSchema((String)newValue);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CATALOG:
- setCatalog((String)newValue);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS:
- setAccess((AccessType)newValue);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST:
- setCascadePersist(((Boolean)newValue).booleanValue());
- 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__SCHEMA:
- setSchema(SCHEMA_EDEFAULT);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CATALOG:
- setCatalog(CATALOG_EDEFAULT);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS:
- setAccess(ACCESS_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__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__ACCESS:
- return access != ACCESS_EDEFAULT;
- 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 String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (schema: ");
- result.append(schema);
- result.append(", catalog: ");
- result.append(catalog);
- result.append(", access: ");
- result.append(access);
- result.append(", cascadePersist: ");
- result.append(cascadePersist);
- result.append(')');
- return result.toString();
- }
-
-} // OrmPersistenceUnitDefaults
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 06b617dd77..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPersistenceUnitMetadata.java
+++ /dev/null
@@ -1,301 +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 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.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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"
- * @extends JpaEObject
- * @generated
- */
-public class XmlPersistenceUnitMetadata extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * 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>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__XML_MAPPING_METADATA_COMPLETE:
- return isXmlMappingMetadataComplete() ? Boolean.TRUE : Boolean.FALSE;
- 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__XML_MAPPING_METADATA_COMPLETE:
- setXmlMappingMetadataComplete(((Boolean)newValue).booleanValue());
- 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__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__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(" (xmlMappingMetadataComplete: ");
- result.append(xmlMappingMetadataComplete);
- result.append(')');
- return result.toString();
- }
-
-} // PersistenceUnitMetadata
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 1cb74716ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPrimaryKeyJoinColumn.java
+++ /dev/null
@@ -1,72 +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 org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Primary Key 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.XmlPrimaryKeyJoinColumn#getReferencedColumnName <em>Referenced Column Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPrimaryKeyJoinColumn()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlPrimaryKeyJoinColumn extends XmlNamedColumn
-{
-
- /**
- * 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
- */
- String getReferencedColumnName();
-
- /**
- * 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
- */
- void setReferencedColumnName(String value);
-
-
- /**
- * Return the {@link TextRange} for the referenced-column-name attibute. If the referenced-column-name attibute
- * does not exist return the {@link TextRange} for the *table element.
- */
- TextRange getReferencedColumnNameTextRange();
-
-} // PrimaryKeyJoinColumn
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPrimaryKeyJoinColumnImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPrimaryKeyJoinColumnImpl.java
deleted file mode 100644
index 1a0ef19f2e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPrimaryKeyJoinColumnImpl.java
+++ /dev/null
@@ -1,236 +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 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.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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 -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPrimaryKeyJoinColumnImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlPrimaryKeyJoinColumnImpl extends AbstractXmlNamedColumn implements XmlPrimaryKeyJoinColumn
-{
- /**
- * 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 XmlPrimaryKeyJoinColumnImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_PRIMARY_KEY_JOIN_COLUMN_IMPL;
- }
-
- /**
- * 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.XmlPrimaryKeyJoinColumnImpl#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_IMPL__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_IMPL__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_IMPL__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_IMPL__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_IMPL__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 int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlPrimaryKeyJoinColumn.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN_IMPL__REFERENCED_COLUMN_NAME: return OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME;
- 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 == XmlPrimaryKeyJoinColumn.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME: return OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN_IMPL__REFERENCED_COLUMN_NAME;
- 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(" (referencedColumnName: ");
- result.append(referencedColumnName);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getReferencedColumnNameTextRange() {
- return getAttributeTextRange(OrmXmlMapper.REFERENCED_COLUMN_NAME);
- }
-} // 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 b09de55800..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlQuery.java
+++ /dev/null
@@ -1,112 +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.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-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"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlQuery 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#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();
-} \ No newline at end of file
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 ed0a6c85ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlQueryHint.java
+++ /dev/null
@@ -1,270 +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 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.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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"
- * @extends JpaEObject
- * @generated
- */
-public class XmlQueryHint 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 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>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__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__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__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__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(" (name: ");
- result.append(name);
- result.append(", value: ");
- result.append(value);
- result.append(')');
- return result.toString();
- }
-
-} // QueryHint
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlRelationshipMapping.java
deleted file mode 100644
index 78ee50bc0a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlRelationshipMapping.java
+++ /dev/null
@@ -1,148 +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;
-
-
-/**
- * <!-- 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.XmlRelationshipMapping#getTargetEntity <em>Target Entity</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#getFetch <em>Fetch</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#getJoinTable <em>Join Table</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#getCascade <em>Cascade</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlRelationshipMapping extends XmlAttributeMapping
-{
- /**
- * 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#getXmlRelationshipMapping_TargetEntity()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getTargetEntity();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#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
- */
- void setTargetEntity(String value);
-
- /**
- * 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#getXmlRelationshipMapping_Fetch()
- * @model default="LAZY"
- * @generated
- */
- FetchType getFetch();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#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>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#getXmlRelationshipMapping_Cascade()
- * @model containment="true"
- * @generated
- */
- CascadeType getCascade();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#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
- */
- void setCascade(CascadeType 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.OrmPackage#getXmlRelationshipMapping_JoinTable()
- * @model containment="true"
- * @generated
- */
- XmlJoinTable getJoinTable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#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);
-
-} // RelationshipMapping
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 a6cfb7aa0a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSecondaryTable.java
+++ /dev/null
@@ -1,55 +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 org.eclipse.emf.common.util.EList;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Secondary Table</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <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" interface="true" abstract="true"
- * @generated
- */
-public interface XmlSecondaryTable extends XmlBaseTable
-{
-
- /**
- * 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
- */
- EList<XmlPrimaryKeyJoinColumn> getPrimaryKeyJoinColumns();
-
-} // SecondaryTable
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSecondaryTableImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSecondaryTableImpl.java
deleted file mode 100644
index d0d68d926c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSecondaryTableImpl.java
+++ /dev/null
@@ -1,214 +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.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;
-
-/**
- * <!-- 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 -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSecondaryTableImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlSecondaryTableImpl extends AbstractXmlBaseTable implements XmlSecondaryTable
-{
- /**
- * 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 XmlSecondaryTableImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_SECONDARY_TABLE_IMPL;
- }
-
- /**
- * 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_IMPL__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_IMPL__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_IMPL__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_IMPL__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_IMPL__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_IMPL__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 == XmlSecondaryTable.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_SECONDARY_TABLE_IMPL__PRIMARY_KEY_JOIN_COLUMNS: return OrmPackage.XML_SECONDARY_TABLE__PRIMARY_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 == XmlSecondaryTable.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS: return OrmPackage.XML_SECONDARY_TABLE_IMPL__PRIMARY_KEY_JOIN_COLUMNS;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
-} // 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 161fdc9c3d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSequenceGenerator.java
+++ /dev/null
@@ -1,63 +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;
-
-
-/**
- * <!-- 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" interface="true" abstract="true"
- * @generated
- */
-public interface XmlSequenceGenerator extends XmlGenerator
-{
- /**
- * 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
- */
- String getSequenceName();
-
- /**
- * 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
- */
- void setSequenceName(String value);
-
-} // SequenceGenerator
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSequenceGeneratorImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSequenceGeneratorImpl.java
deleted file mode 100644
index 09b30bde86..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSequenceGeneratorImpl.java
+++ /dev/null
@@ -1,404 +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 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.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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 -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSequenceGeneratorImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlSequenceGeneratorImpl extends AbstractJpaEObject implements XmlSequenceGenerator
-{
- /**
- * 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 #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 XmlSequenceGeneratorImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_SEQUENCE_GENERATOR_IMPL;
- }
-
- /**
- * 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.XmlSequenceGeneratorImpl#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_IMPL__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.XmlSequenceGeneratorImpl#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_IMPL__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.XmlSequenceGeneratorImpl#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_IMPL__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.XmlSequenceGeneratorImpl#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_IMPL__ALLOCATION_SIZE, oldAllocationSize, allocationSize));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__NAME:
- return getName();
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__INITIAL_VALUE:
- return getInitialValue();
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__ALLOCATION_SIZE:
- return getAllocationSize();
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__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_IMPL__NAME:
- setName((String)newValue);
- return;
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__INITIAL_VALUE:
- setInitialValue((Integer)newValue);
- return;
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__ALLOCATION_SIZE:
- setAllocationSize((Integer)newValue);
- return;
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__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_IMPL__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__INITIAL_VALUE:
- setInitialValue(INITIAL_VALUE_EDEFAULT);
- return;
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__ALLOCATION_SIZE:
- setAllocationSize(ALLOCATION_SIZE_EDEFAULT);
- return;
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__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_IMPL__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__INITIAL_VALUE:
- return INITIAL_VALUE_EDEFAULT == null ? initialValue != null : !INITIAL_VALUE_EDEFAULT.equals(initialValue);
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__ALLOCATION_SIZE:
- return ALLOCATION_SIZE_EDEFAULT == null ? allocationSize != null : !ALLOCATION_SIZE_EDEFAULT.equals(allocationSize);
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__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 String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(", initialValue: ");
- result.append(initialValue);
- result.append(", allocationSize: ");
- result.append(allocationSize);
- result.append(", sequenceName: ");
- result.append(sequenceName);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getNameTextRange() {
- return getAttributeTextRange(OrmXmlMapper.NAME);
- }
-
- public boolean isVirtual() {
- return false;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSingleRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSingleRelationshipMapping.java
deleted file mode 100644
index 7ffe31a8b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSingleRelationshipMapping.java
+++ /dev/null
@@ -1,81 +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 org.eclipse.emf.common.util.EList;
-
-/**
- * <!-- 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.XmlSingleRelationshipMapping#getOptional <em>Optional</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping#getJoinColumns <em>Join Columns</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSingleRelationshipMapping()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlSingleRelationshipMapping extends XmlRelationshipMapping
-{
- /**
- * 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#getXmlSingleRelationshipMapping_Optional()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getOptional();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping#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
- */
- void setOptional(Boolean value);
-
- /**
- * 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#getXmlSingleRelationshipMapping_JoinColumns()
- * @model containment="true"
- * @generated
- */
- EList<XmlJoinColumn> getJoinColumns();
-
-} // SingleRelationshipMapping
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 ddcde8ddc3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTable.java
+++ /dev/null
@@ -1,52 +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 org.eclipse.emf.ecore.EClass;
-
-/**
- * <!-- 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 AbstractXmlBaseTable
-{
- /**
- * <!-- 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;
- }
-} // 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 49bc56c5b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTableGenerator.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.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-
-/**
- * <!-- 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" interface="true" abstract="true"
- * @generated
- */
-public interface XmlTableGenerator extends XmlGenerator
-{
- /**
- * 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
- */
- String getTable();
-
- /**
- * 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
- */
- void setTable(String value);
-
- /**
- * Returns the value of the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Catalog</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Catalog</em>' attribute.
- * @see #setCatalog(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator_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.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
- */
- 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.OrmPackage#getXmlTableGenerator_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.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
- */
- void setSchema(String value);
-
- /**
- * 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
- */
- String getPkColumnName();
-
- /**
- * 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
- */
- void setPkColumnName(String value);
-
- /**
- * 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
- */
- String getValueColumnName();
-
- /**
- * 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
- */
- void setValueColumnName(String value);
-
- /**
- * 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
- */
- String getPkColumnValue();
-
- /**
- * 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
- */
- void setPkColumnValue(String value);
-
- /**
- * 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
- */
- EList<XmlUniqueConstraint> getUniqueConstraints();
-
-} // TableGenerator
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTableGeneratorImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTableGeneratorImpl.java
deleted file mode 100644
index 80c4bf0d62..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTableGeneratorImpl.java
+++ /dev/null
@@ -1,806 +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.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.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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 -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGeneratorImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlTableGeneratorImpl extends AbstractJpaEObject implements XmlTableGenerator
-{
- /**
- * 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 XmlTableGeneratorImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_TABLE_GENERATOR_IMPL;
- }
-
- /**
- * 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.XmlTableGeneratorImpl#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_IMPL__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.XmlTableGeneratorImpl#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_IMPL__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.XmlTableGeneratorImpl#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_IMPL__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.XmlTableGeneratorImpl#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_IMPL__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.XmlTableGeneratorImpl#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_IMPL__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.XmlTableGeneratorImpl#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_IMPL__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.XmlTableGeneratorImpl#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_IMPL__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.XmlTableGeneratorImpl#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_IMPL__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.XmlTableGeneratorImpl#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_IMPL__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_IMPL__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_IMPL__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_IMPL__NAME:
- return getName();
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__INITIAL_VALUE:
- return getInitialValue();
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__ALLOCATION_SIZE:
- return getAllocationSize();
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__TABLE:
- return getTable();
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__CATALOG:
- return getCatalog();
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__SCHEMA:
- return getSchema();
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__PK_COLUMN_NAME:
- return getPkColumnName();
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__VALUE_COLUMN_NAME:
- return getValueColumnName();
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__PK_COLUMN_VALUE:
- return getPkColumnValue();
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__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_IMPL__NAME:
- setName((String)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__INITIAL_VALUE:
- setInitialValue((Integer)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__ALLOCATION_SIZE:
- setAllocationSize((Integer)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__TABLE:
- setTable((String)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__CATALOG:
- setCatalog((String)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__SCHEMA:
- setSchema((String)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__PK_COLUMN_NAME:
- setPkColumnName((String)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__VALUE_COLUMN_NAME:
- setValueColumnName((String)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__PK_COLUMN_VALUE:
- setPkColumnValue((String)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__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_IMPL__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__INITIAL_VALUE:
- setInitialValue(INITIAL_VALUE_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__ALLOCATION_SIZE:
- setAllocationSize(ALLOCATION_SIZE_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__TABLE:
- setTable(TABLE_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__CATALOG:
- setCatalog(CATALOG_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__SCHEMA:
- setSchema(SCHEMA_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__PK_COLUMN_NAME:
- setPkColumnName(PK_COLUMN_NAME_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__VALUE_COLUMN_NAME:
- setValueColumnName(VALUE_COLUMN_NAME_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__PK_COLUMN_VALUE:
- setPkColumnValue(PK_COLUMN_VALUE_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__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_IMPL__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__INITIAL_VALUE:
- return INITIAL_VALUE_EDEFAULT == null ? initialValue != null : !INITIAL_VALUE_EDEFAULT.equals(initialValue);
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__ALLOCATION_SIZE:
- return ALLOCATION_SIZE_EDEFAULT == null ? allocationSize != null : !ALLOCATION_SIZE_EDEFAULT.equals(allocationSize);
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__TABLE:
- return TABLE_EDEFAULT == null ? table != null : !TABLE_EDEFAULT.equals(table);
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__CATALOG:
- return CATALOG_EDEFAULT == null ? catalog != null : !CATALOG_EDEFAULT.equals(catalog);
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__SCHEMA:
- return SCHEMA_EDEFAULT == null ? schema != null : !SCHEMA_EDEFAULT.equals(schema);
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__PK_COLUMN_NAME:
- return PK_COLUMN_NAME_EDEFAULT == null ? pkColumnName != null : !PK_COLUMN_NAME_EDEFAULT.equals(pkColumnName);
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__VALUE_COLUMN_NAME:
- return VALUE_COLUMN_NAME_EDEFAULT == null ? valueColumnName != null : !VALUE_COLUMN_NAME_EDEFAULT.equals(valueColumnName);
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__PK_COLUMN_VALUE:
- return PK_COLUMN_VALUE_EDEFAULT == null ? pkColumnValue != null : !PK_COLUMN_VALUE_EDEFAULT.equals(pkColumnValue);
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__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(", 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(OrmXmlMapper.NAME);
- }
-
- public boolean isVirtual() {
- return false;
- }
-} \ No newline at end of file
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 aeae56313b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTransient.java
+++ /dev/null
@@ -1,31 +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;
-
-
-/**
- * <!-- 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" interface="true" abstract="true"
- * @generated
- */
-public interface XmlTransient extends XmlAttributeMapping
-{
-} // Transient
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTransientImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTransientImpl.java
deleted file mode 100644
index b0dc24e7b3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTransientImpl.java
+++ /dev/null
@@ -1,57 +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 org.eclipse.emf.ecore.EClass;
-import org.eclipse.jpt.core.MappingKeys;
-
-/**
- * <!-- 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#getXmlTransientImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlTransientImpl extends AbstractXmlAttributeMapping implements XmlTransient
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlTransientImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_TRANSIENT_IMPL;
- }
-
- public String getMappingKey() {
- return MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-} // Transient
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 967f35ce07..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlUniqueConstraint.java
+++ /dev/null
@@ -1,56 +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 org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml 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" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlUniqueConstraint extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Column Names</b></em>' attribute list.
- * The list contents are of type {@link java.lang.String}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column Names</em>' attribute list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Column Names</em>' attribute list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlUniqueConstraint_ColumnNames()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- EList<String> getColumnNames();
-
-} // XmlUniqueConstraint
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlUniqueConstraintImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlUniqueConstraintImpl.java
deleted file mode 100644
index 48ea18b122..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlUniqueConstraintImpl.java
+++ /dev/null
@@ -1,175 +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.Collection;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.util.EDataTypeEList;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-
-/**
- * <!-- 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 -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlUniqueConstraintImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlUniqueConstraintImpl extends AbstractJpaEObject implements XmlUniqueConstraint
-{
- /**
- * 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 XmlUniqueConstraintImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_UNIQUE_CONSTRAINT_IMPL;
- }
-
- /**
- * 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_IMPL__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_IMPL__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_IMPL__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_IMPL__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_IMPL__COLUMN_NAMES:
- return columnNames != null && !columnNames.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (columnNames: ");
- result.append(columnNames);
- result.append(')');
- return result.toString();
- }
-
-} // UniqueConstraint
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 f3b06bb5b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlVersion.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.resource.orm;
-
-
-/**
- * <!-- 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" interface="true" abstract="true"
- * @generated
- */
-public interface XmlVersion extends XmlAttributeMapping, ColumnMapping, XmlConvertibleMapping
-{
-
-} // Version
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlVersionImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlVersionImpl.java
deleted file mode 100644
index cd37265259..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlVersionImpl.java
+++ /dev/null
@@ -1,517 +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 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.MappingKeys;
-import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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#getXmlVersionImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlVersionImpl extends AbstractXmlAttributeMapping implements XmlVersion
-{
- /**
- * 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 XmlVersionImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_VERSION_IMPL;
- }
-
- /**
- * 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_IMPL__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.XmlVersionImpl#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_IMPL__COLUMN, null, msgs);
- if (newColumn != null)
- msgs = ((InternalEObject)newColumn).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_VERSION_IMPL__COLUMN, null, msgs);
- msgs = basicSetColumn(newColumn, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_VERSION_IMPL__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.XmlVersionImpl#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_IMPL__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.XmlVersionImpl#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_IMPL__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.XmlVersionImpl#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_IMPL__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_IMPL__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_IMPL__COLUMN:
- return getColumn();
- case OrmPackage.XML_VERSION_IMPL__LOB:
- return isLob() ? Boolean.TRUE : Boolean.FALSE;
- case OrmPackage.XML_VERSION_IMPL__TEMPORAL:
- return getTemporal();
- case OrmPackage.XML_VERSION_IMPL__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_IMPL__COLUMN:
- setColumn((XmlColumn)newValue);
- return;
- case OrmPackage.XML_VERSION_IMPL__LOB:
- setLob(((Boolean)newValue).booleanValue());
- return;
- case OrmPackage.XML_VERSION_IMPL__TEMPORAL:
- setTemporal((TemporalType)newValue);
- return;
- case OrmPackage.XML_VERSION_IMPL__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_IMPL__COLUMN:
- setColumn((XmlColumn)null);
- return;
- case OrmPackage.XML_VERSION_IMPL__LOB:
- setLob(LOB_EDEFAULT);
- return;
- case OrmPackage.XML_VERSION_IMPL__TEMPORAL:
- setTemporal(TEMPORAL_EDEFAULT);
- return;
- case OrmPackage.XML_VERSION_IMPL__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_IMPL__COLUMN:
- return column != null;
- case OrmPackage.XML_VERSION_IMPL__LOB:
- return lob != LOB_EDEFAULT;
- case OrmPackage.XML_VERSION_IMPL__TEMPORAL:
- return temporal != TEMPORAL_EDEFAULT;
- case OrmPackage.XML_VERSION_IMPL__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_IMPL__COLUMN: return OrmPackage.COLUMN_MAPPING__COLUMN;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_VERSION_IMPL__LOB: return OrmPackage.XML_CONVERTIBLE_MAPPING__LOB;
- case OrmPackage.XML_VERSION_IMPL__TEMPORAL: return OrmPackage.XML_CONVERTIBLE_MAPPING__TEMPORAL;
- case OrmPackage.XML_VERSION_IMPL__ENUMERATED: return OrmPackage.XML_CONVERTIBLE_MAPPING__ENUMERATED;
- default: return -1;
- }
- }
- if (baseClass == XmlVersion.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 == ColumnMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.COLUMN_MAPPING__COLUMN: return OrmPackage.XML_VERSION_IMPL__COLUMN;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_CONVERTIBLE_MAPPING__LOB: return OrmPackage.XML_VERSION_IMPL__LOB;
- case OrmPackage.XML_CONVERTIBLE_MAPPING__TEMPORAL: return OrmPackage.XML_VERSION_IMPL__TEMPORAL;
- case OrmPackage.XML_CONVERTIBLE_MAPPING__ENUMERATED: return OrmPackage.XML_VERSION_IMPL__ENUMERATED;
- default: return -1;
- }
- }
- if (baseClass == XmlVersion.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(" (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(OrmXmlMapper.ENUMERATED);
- }
-
- public TextRange getLobTextRange() {
- throw new UnsupportedOperationException("lob not supported by version mappings");
- }
-
- public TextRange getTemporalTextRange() {
- throw new UnsupportedOperationException("temporal not supported by version mappings");
- }
-
- public String getMappingKey() {
- return MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY;
- }
-} // Version
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 4fbedaaaaa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceFactory.java
+++ /dev/null
@@ -1,291 +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.resource.persistence;
-
-import org.eclipse.emf.common.util.Enumerator;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.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_PERSISTENCE: return (EObject)createXmlPersistence();
- case PersistencePackage.XML_PERSISTENCE_UNIT: return (EObject)createXmlPersistenceUnit();
- case PersistencePackage.XML_MAPPING_FILE_REF: return (EObject)createXmlMappingFileRef();
- case PersistencePackage.XML_JAVA_CLASS_REF: return (EObject)createXmlJavaClassRef();
- 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);
- case PersistencePackage.XML_PERSISTENCE_UNIT_TRANSACTION_TYPE_OBJECT:
- return createXmlPersistenceUnitTransactionTypeObjectFromString(eDataType, initialValue);
- case PersistencePackage.XML_VERSION:
- return createXmlVersionFromString(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);
- case PersistencePackage.XML_PERSISTENCE_UNIT_TRANSACTION_TYPE_OBJECT:
- return convertXmlPersistenceUnitTransactionTypeObjectToString(eDataType, instanceValue);
- case PersistencePackage.XML_VERSION:
- return convertXmlVersionToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- 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 XmlMappingFileRef createXmlMappingFileRef()
- {
- XmlMappingFileRef xmlMappingFileRef = new XmlMappingFileRef();
- return xmlMappingFileRef;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlJavaClassRef createXmlJavaClassRef()
- {
- XmlJavaClassRef xmlJavaClassRef = new XmlJavaClassRef();
- return xmlJavaClassRef;
- }
-
- /**
- * <!-- 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 Enumerator createXmlPersistenceUnitTransactionTypeObjectFromString(EDataType eDataType, String initialValue)
- {
- return (Enumerator)super.createFromString(eDataType, initialValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertXmlPersistenceUnitTransactionTypeObjectToString(EDataType eDataType, Object instanceValue)
- {
- return super.convertToString(eDataType, instanceValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String createXmlVersionFromString(EDataType eDataType, String initialValue)
- {
- return (String)super.createFromString(eDataType, initialValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertXmlVersionToString(EDataType eDataType, Object instanceValue)
- {
- return super.convertToString(eDataType, instanceValue);
- }
-
- /**
- * <!-- 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 9cb233159f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistencePackage.java
+++ /dev/null
@@ -1,1324 +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.resource.persistence;
-
-import org.eclipse.emf.common.util.Enumerator;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-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;
-
-/**
- * <!-- 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.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.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 = 0;
-
- /**
- * 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 = 0;
-
- /**
- * 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 = 1;
-
- /**
- * 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 = 2;
-
- /**
- * 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 = 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__DESCRIPTION = 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 = 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 = 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 = 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 = 4;
-
- /**
- * The feature id for the '<em><b>Jar Files</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT__JAR_FILES = 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 = 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 = 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 = 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 = 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 = 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 = 11;
-
- /**
- * 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.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 = 3;
-
- /**
- * 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.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 = 4;
-
- /**
- * 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 = 5;
-
- /**
- * 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 = 6;
-
- /**
- * The meta object id for the '<em>Xml Persistence Unit Transaction Type Object</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.common.util.Enumerator
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnitTransactionTypeObject()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT_TRANSACTION_TYPE_OBJECT = 7;
-
- /**
- * The meta object id for the '<em>Xml Version</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see java.lang.String
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlVersion()
- * @generated
- */
- public static final int XML_VERSION = 8;
-
- /**
- * <!-- 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 xmlMappingFileRefEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlJavaClassRefEClass = 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;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EDataType xmlPersistenceUnitTransactionTypeObjectEDataType = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EDataType xmlVersionEDataType = 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. Simple
- * dependencies are satisfied by calling this method on all
- * dependent packages before doing anything else. This method drives
- * initialization for interdependent packages directly, in parallel
- * with this package, itself.
- * <p>Of this package and its interdependencies, all packages which
- * have not yet been registered by their URI values are first created
- * and registered. The packages are then initialized in two steps:
- * meta-model objects for all of the packages are created before any
- * are initialized, since one package's meta-model objects may refer to
- * those of another.
- * <p>Invocation of this method will not affect any packages that have
- * already been initialized.
- * <!-- 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.getEPackage(eNS_URI) instanceof PersistencePackage ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new PersistencePackage());
-
- isInited = true;
-
- // Initialize simple dependencies
- EcorePackage.eINSTANCE.eClass();
- XMLTypePackage.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);
-
- // Create package meta-data objects
- thePersistencePackage.createPackageContents();
- theOrmPackage.createPackageContents();
-
- // Initialize created meta-data
- thePersistencePackage.initializePackageContents();
- theOrmPackage.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- thePersistencePackage.freeze();
-
- return thePersistencePackage;
- }
-
-
- /**
- * 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 the attribute '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistence#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.persistence.XmlPersistence#getVersion()
- * @see #getXmlPersistence()
- * @generated
- */
- public EAttribute getXmlPersistence_Version()
- {
- return (EAttribute)xmlPersistenceEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * 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 attribute 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 attribute list '<em>Jar Files</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getJarFiles()
- * @see #getXmlPersistenceUnit()
- * @generated
- */
- public EAttribute getXmlPersistenceUnit_JarFiles()
- {
- return (EAttribute)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.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.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.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 meta object for data type '{@link org.eclipse.emf.common.util.Enumerator <em>Xml Persistence Unit Transaction Type Object</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for data type '<em>Xml Persistence Unit Transaction Type Object</em>'.
- * @see org.eclipse.emf.common.util.Enumerator
- * @model instanceClass="org.eclipse.emf.common.util.Enumerator"
- * @generated
- */
- public EDataType getXmlPersistenceUnitTransactionTypeObject()
- {
- return xmlPersistenceUnitTransactionTypeObjectEDataType;
- }
-
-
- /**
- * Returns the meta object for data type '{@link java.lang.String <em>Xml Version</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for data type '<em>Xml Version</em>'.
- * @see java.lang.String
- * @model instanceClass="java.lang.String"
- * @generated
- */
- public EDataType getXmlVersion()
- {
- return xmlVersionEDataType;
- }
-
-
- /**
- * 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
- xmlPersistenceEClass = createEClass(XML_PERSISTENCE);
- createEReference(xmlPersistenceEClass, XML_PERSISTENCE__PERSISTENCE_UNITS);
- createEAttribute(xmlPersistenceEClass, XML_PERSISTENCE__VERSION);
-
- 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);
- createEAttribute(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);
-
- xmlMappingFileRefEClass = createEClass(XML_MAPPING_FILE_REF);
- createEAttribute(xmlMappingFileRefEClass, XML_MAPPING_FILE_REF__FILE_NAME);
-
- xmlJavaClassRefEClass = createEClass(XML_JAVA_CLASS_REF);
- createEAttribute(xmlJavaClassRefEClass, XML_JAVA_CLASS_REF__JAVA_CLASS);
-
- 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);
-
- // Create data types
- xmlPersistenceUnitTransactionTypeObjectEDataType = createEDataType(XML_PERSISTENCE_UNIT_TRANSACTION_TYPE_OBJECT);
- xmlVersionEDataType = createEDataType(XML_VERSION);
- }
-
- /**
- * <!-- 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);
- EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
-
- // Initialize classes and features; add operations and parameters
- 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);
- initEAttribute(getXmlPersistence_Version(), this.getXmlVersion(), "version", null, 1, 1, XmlPersistence.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !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);
- initEAttribute(getXmlPersistenceUnit_JarFiles(), theXMLTypePackage.getString(), "jarFiles", null, 0, -1, XmlPersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !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(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(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(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);
-
- // Initialize data types
- initEDataType(xmlPersistenceUnitTransactionTypeObjectEDataType, Enumerator.class, "XmlPersistenceUnitTransactionTypeObject", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
- initEDataType(xmlVersionEDataType, String.class, "XmlVersion", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
-
- // 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.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 '<em><b>Version</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE__VERSION = eINSTANCE.getXmlPersistence_Version();
-
- /**
- * 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>' attribute list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute 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.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.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.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();
-
- /**
- * The meta object literal for the '<em>Xml Persistence Unit Transaction Type Object</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.common.util.Enumerator
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnitTransactionTypeObject()
- * @generated
- */
- public static final EDataType XML_PERSISTENCE_UNIT_TRANSACTION_TYPE_OBJECT = eINSTANCE.getXmlPersistenceUnitTransactionTypeObject();
-
- /**
- * The meta object literal for the '<em>Xml Version</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see java.lang.String
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlVersion()
- * @generated
- */
- public static final EDataType XML_VERSION = eINSTANCE.getXmlVersion();
-
- }
-
-} //PersistencePackage
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceResource.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceResource.java
deleted file mode 100644
index 3b3fa25fd5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceResource.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.resource.persistence;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.internal.resource.persistence.translators.PersistenceTranslator;
-import org.eclipse.jpt.core.resource.common.JpaXmlResource;
-import org.eclipse.wst.common.internal.emf.resource.Renderer;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 PersistenceResource
- extends JpaXmlResource
-{
- public PersistenceResource(URI uri, Renderer renderer) {
- super(uri, renderer);
- }
-
- public Translator getRootTranslator() {
- return PersistenceTranslator.INSTANCE;
- }
-
- @Override
- public String getType() {
- return JpaFile.PERSISTENCE_RESOURCE_TYPE;
- }
-
- public XmlPersistence getPersistence() {
- return (XmlPersistence) this.getRootObject();
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public EList eAdapters() {
- return super.eAdapters();
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public EList getContents() {
- return super.getContents();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceResourceFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceResourceFactory.java
deleted file mode 100644
index 58b34972d6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceResourceFactory.java
+++ /dev/null
@@ -1,48 +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.resource.persistence;
-
-import org.eclipse.emf.common.util.URI;
-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 PersistenceResourceFactory extends TranslatorResourceFactory
-{
- public PersistenceResourceFactory() {
- this(RendererFactory.getDefaultRendererFactory());
- }
-
- public PersistenceResourceFactory(RendererFactory aRendererFactory) {
- super(aRendererFactory);
- }
-
- public PersistenceResourceFactory(RendererFactory aRendererFactory, boolean listeningForUpdates) {
- super(aRendererFactory, listeningForUpdates);
- }
-
-
- /**
- * @see TranslatorResourceFactory#createResource(URI, Renderer)
- */
- protected TranslatorResource createResource(URI uri, Renderer renderer) {
- return new PersistenceResource(uri, renderer);
- }
-}
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 4792c501ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlJavaClassRef.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.resource.persistence;
-
-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.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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();
- }
-
-} // XmlJavaClassRef
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 557b9b76ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlMappingFileRef.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.resource.persistence;
-
-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.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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));
- }
-
- /**
- * <!-- 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();
- }
-
-} // XmlMappingFileRef
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 d8c25400d8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistence.java
+++ /dev/null
@@ -1,288 +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.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.EObject;
-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.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlPersistence#getVersion <em>Version</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistence()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlPersistence extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * 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;
-
- /**
- * 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;
-
- /**
- * <!-- 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>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.persistence.PersistencePackage#getXmlPersistence_Version()
- * @model unique="false" dataType="org.eclipse.jpt.core.resource.persistence.XmlVersion" required="true"
- * @generated
- */
- public String getVersion()
- {
- return version;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistence#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
- */
- public void setVersion(String newVersion)
- {
- String oldVersion = version;
- version = newVersion;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_PERSISTENCE__VERSION, oldVersion, version));
- }
-
- /**
- * 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();
- case PersistencePackage.XML_PERSISTENCE__VERSION:
- return getVersion();
- }
- 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;
- case PersistencePackage.XML_PERSISTENCE__VERSION:
- setVersion((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_PERSISTENCE__PERSISTENCE_UNITS:
- getPersistenceUnits().clear();
- return;
- case PersistencePackage.XML_PERSISTENCE__VERSION:
- setVersion(VERSION_EDEFAULT);
- 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();
- case PersistencePackage.XML_PERSISTENCE__VERSION:
- return VERSION_EDEFAULT == null ? version != null : !VERSION_EDEFAULT.equals(version);
- }
- return super.eIsSet(featureID);
- }
-
-
- // **************** 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(" (version: ");
- result.append(version);
- result.append(')');
- return result.toString();
- }
-
- @Override
- public JpaEObject getRoot() {
- return this;
- }
-} \ No newline at end of file
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 d31a80a1e8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistenceUnit.java
+++ /dev/null
@@ -1,856 +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.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.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EDataTypeEList;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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"
- * @extends JpaEObject
- * @generated
- */
-public class XmlPersistenceUnit extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * 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>}' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJarFiles()
- * @generated
- * @ordered
- */
- protected EList<String> 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>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>' attribute list.
- * The list contents are of type {@link java.lang.String}.
- * <!-- 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>' attribute list.
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_JarFiles()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public EList<String> getJarFiles()
- {
- if (jarFiles == null)
- {
- jarFiles = new EDataTypeEList<String>(String.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__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__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__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 String>)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__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__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(" (description: ");
- result.append(description);
- result.append(", provider: ");
- result.append(provider);
- result.append(", jtaDataSource: ");
- result.append(jtaDataSource);
- result.append(", nonJtaDataSource: ");
- result.append(nonJtaDataSource);
- result.append(", jarFiles: ");
- result.append(jarFiles);
- result.append(", excludeUnlistedClasses: ");
- result.append(excludeUnlistedClasses);
- result.append(", name: ");
- result.append(name);
- result.append(", transactionType: ");
- result.append(transactionType);
- result.append(')');
- return result.toString();
- }
-
-} // XmlPersistenceUnit
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 bbebb80f44..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistenceUnitTransactionType.java
+++ /dev/null
@@ -1,235 +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.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 e0906944e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlProperties.java
+++ /dev/null
@@ -1,185 +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.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.InternalEObject;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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);
- }
-
-} // XmlProperties
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 89ea3f4ebb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlProperty.java
+++ /dev/null
@@ -1,266 +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.resource.persistence;
-
-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.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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();
- }
-
-} // XmlProperty
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 8b8c5ef547..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/AbstractTextRange.java
+++ /dev/null
@@ -1,68 +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;
-
-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.
- */
-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);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/PlatformUtilities.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/PlatformUtilities.java
deleted file mode 100644
index 47dfe71349..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/PlatformUtilities.java
+++ /dev/null
@@ -1,58 +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;
-
-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.jpt.core.JptCorePlugin;
-
-/**
- * A collection of utilities for dealing with eclipse platform API
- */
-public class PlatformUtilities
-{
- /**
- * Retrieves the content type for the IFile referenced.
- * (Makes sure to close the input stream)
- */
- public static IContentType getContentType(IFile file) {
- InputStream inputStream = null;
- try {
- inputStream = file.getContents();
- } catch (CoreException ex) {
- JptCorePlugin.log(ex);
- return null;
- }
-
- IContentType contentType = null;
- try {
- contentType = Platform.getContentTypeManager().findContentTypeFor(inputStream, file.getName());
- } catch (IOException ex) {
- JptCorePlugin.log(ex);
- } finally {
- try {
- inputStream.close();
- } catch (IOException ex) {
- JptCorePlugin.log(ex);
- }
- }
- return contentType;
- }
-
- private PlatformUtilities() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
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 0c6505572b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/TextRange.java
+++ /dev/null
@@ -1,114 +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.utility;
-
-/**
- * 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.
- */
-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 getOffset() {
- return 0;
- }
- public int getLength() {
- return 0;
- }
- public boolean includes(int index) {
- return false;
- }
- public boolean touches(int index) {
- return index == 0; // ???
- }
- public int getLineNumber() {
- return 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";
- }
- }
-
-}
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 c4e917a82c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/Attribute.java
+++ /dev/null
@@ -1,53 +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.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();
-
- /**
- * Return whether the attribute is a property/method pair.
- */
- // TODO rename to isProperty()?
- boolean isMethod();
-
-}
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 f51bab64a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/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.db.ui
-Bundle-Version: 1.1.0.qualifier
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Export-Package: org.eclipse.jpt.db.ui.internal; x-friends:="org.eclipse.jpt.ui"
-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,1.2.0)",
- org.eclipse.datatools.sqltools.editor.core;bundle-version="[1.0.0,2.0.0)"
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
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 0d56981f21..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/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
-###############################################################################
-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 bf648aaa4f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.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.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 2b0e5835b1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/plugin.properties
+++ /dev/null
@@ -1,25 +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
-###############################################################################
-# ====================================================================
-# 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 Tools - DB UI
-providerName = Eclipse.org
-
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 ae67ad1cf6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/src/org/eclipse/jpt/db/ui/internal/DTPUiTools.java
+++ /dev/null
@@ -1,115 +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.ui.internal;
-
-import org.eclipse.datatools.connectivity.ICategory;
-import org.eclipse.datatools.connectivity.IConnectionProfile;
-import org.eclipse.datatools.connectivity.IProfileListener;
-import org.eclipse.datatools.connectivity.ProfileManager;
-import org.eclipse.datatools.connectivity.internal.ConnectionProfileManager;
-import org.eclipse.datatools.connectivity.internal.ui.wizards.CPWizardNode;
-import org.eclipse.datatools.connectivity.internal.ui.wizards.NewCPWizard;
-import org.eclipse.datatools.connectivity.internal.ui.wizards.ProfileWizardProvider;
-import org.eclipse.datatools.connectivity.ui.wizards.IProfileWizardProvider;
-import org.eclipse.datatools.connectivity.ui.wizards.IWizardCategoryProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-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
- NewCPWizard wizard = new NewCPWizard(new LocalViewerFilter(), null);
- 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 17e145857a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,16 +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.0.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.sqltools.editor.core;bundle-version="[1.0.0,2.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
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 974eadac6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/build.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2007 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-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 644c396149..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/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.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 e87a2d3972..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/plugin.properties
+++ /dev/null
@@ -1,25 +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
-###############################################################################
-# ====================================================================
-# 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 Tools - DB
-providerName = Eclipse.org
-
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 5c6da7058d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Catalog.java
+++ /dev/null
@@ -1,27 +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;
-
-/**
- * Database catalog
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 Catalog
- extends SchemaContainer, Comparable<Catalog>
-{
- // 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 b502f61ca6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Column.java
+++ /dev/null
@@ -1,123 +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;
-
-import org.eclipse.jpt.utility.JavaType;
-
-/**
- * Database 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.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface Column
- extends DatabaseObject, Comparable<Column>
-{
- /**
- * Return the column's table.
- */
- Table getTable();
-
-
- // ********** constraints **********
-
- /**
- * Return whether the column is part of it's table's primary key.
- */
- boolean isPartOfPrimaryKey();
-
- /**
- * Return whether the column is part of one of it's 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 972848965c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionAdapter.java
+++ /dev/null
@@ -1,72 +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;
-
-
-/**
- * An empty implementation of ConnectionListener.
- *
- * 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 4f3b09bae8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionListener.java
+++ /dev/null
@@ -1,42 +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;
-
-import java.util.EventListener;
-
-
-/**
- * A ConnectionListener is notified of any changes to a connection.
- *
- * @see org.eclipse.datatools.connectivity.IManagedConnectionListener
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 c15db7aa7f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfile.java
+++ /dev/null
@@ -1,206 +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;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.datatools.connectivity.drivers.jdbc.IJDBCDriverDefinitionConstants;
-
-/**
- * Database 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.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface ConnectionProfile
- extends DatabaseObject, Comparable<ConnectionProfile>
-{
-
- // ********** 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 648daa5bf6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileAdapter.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.db;
-
-/**
- * An empty implementation of ProfileListener.
- *
- * 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 e44773953a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileFactory.java
+++ /dev/null
@@ -1,67 +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;
-
-import java.util.Iterator;
-
-/**
- * Database connection profile factory
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 ConnectionProfileFactory {
-
- /**
- * Return the names of the DTP connection profiles the factory can wrap with
- * new connection profiles.
- */
- Iterator<String> connectionProfileNames();
-
- /**
- * 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 finder to allow clients to control how
- * database objects are found based on their names.
- */
- ConnectionProfile buildConnectionProfile(String name, DatabaseFinder finder);
-
- /**
- * 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.
- * Clients should use this method when a JPA platform is unavailable
- * (e.g. during project creation). The returned connection profile will
- * not be able to search for database objects by any names other than
- * those supplied by the factory (i.e. lookups cannot be performed with
- * "identifiers").
- */
- 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 f020c5505d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileListener.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.db;
-
-import java.util.EventListener;
-
-/**
- * A ProfileListener is notified of any changes to the DTP connection profiles.
- *
- * @see org.eclipse.datatools.connectivity.IProfileListener
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 c101d40f59..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Database.java
+++ /dev/null
@@ -1,106 +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;
-
-import java.util.Iterator;
-
-/**
- * Database
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 Database
- extends SchemaContainer, Comparable<Database>
-{
-
- // ********** 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.
- */
- boolean supportsCatalogs();
-
- /**
- * Return the database's catalogs.
- * @see #supportsCatalogs()
- */
- Iterator<Catalog> catalogs();
-
- /**
- * Return the number of catalogs the database contains.
- * @see #supportsCatalogs()
- */
- int catalogsSize();
-
- /**
- * Return the catalog with specified name. The name must be an exact match
- * of the catalog's name.
- * @see #supportsCatalogs()
- * @see #getCatalogForIdentifier(String)
- */
- Catalog getCatalogNamed(String name);
-
- /**
- * Return the database's catalog identifiers, sorted by name.
- */
- Iterator<String> sortedCatalogIdentifiers();
-
- /**
- * 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).
- * @see #supportsCatalogs()
- * @see #getCatalogNamed(String)
- */
- Catalog getCatalogForIdentifier(String identifier);
-
- /**
- * Return the database's "default" catalog.
- * Return null if the database does not support catalogs.
- * @see #supportsCatalogs()
- */
- Catalog getDefaultCatalog();
-
-
- // ********** 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(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/DatabaseFinder.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/DatabaseFinder.java
deleted file mode 100644
index e7806e7933..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/DatabaseFinder.java
+++ /dev/null
@@ -1,96 +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;
-
-/**
- * This interface allows clients of the Dali db package to plug in a custom
- * strategy for comparing an identifier to the names of a collection of
- * 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.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface DatabaseFinder {
-
- /**
- * Select and return from the specified list of database objects the
- * database object identified by the specified identifier.
- */
- <T extends DatabaseObject> T selectDatabaseObjectForIdentifier(T[] databaseObjects, String identifier, DefaultCallback defaultCallback);
-
- /**
- * The platform-provided finder is passed a "default" callback that can be
- * used if appropriate.
- */
- interface DefaultCallback {
-
- /**
- * Select and return from the specified list of database objects the
- * database object identified by the specified identifier.
- */
- <T extends DatabaseObject> T selectDatabaseObjectForIdentifier(T[] databaseObjects, String identifier);
-
- }
-
- /**
- * This finder searches for an exact match.
- */
- final class Simple implements DatabaseFinder {
- public static final DatabaseFinder INSTANCE = new Simple();
- public static DatabaseFinder instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Simple() {
- super();
- }
- // search for an exact match on the name
- public <T extends DatabaseObject> T selectDatabaseObjectForIdentifier(T[] databaseObjects, String identifier, DefaultCallback defaultCallback) {
- for (T databaseObject : databaseObjects) {
- if (databaseObject.getName().equals(identifier)) {
- return databaseObject;
- }
- }
- return null;
- }
- @Override
- public String toString() {
- return "DatabaseFinder.Default"; //$NON-NLS-1$
- }
- }
-
- /**
- * This finder uses the passed in callback to search the list of database objects.
- */
- final class Default implements DatabaseFinder {
- public static final DatabaseFinder INSTANCE = new Default();
- public static DatabaseFinder instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Default() {
- super();
- }
- // simply use the callback
- public <T extends DatabaseObject> T selectDatabaseObjectForIdentifier(T[] databaseObjects, String identifier, DefaultCallback defaultCallback) {
- return defaultCallback.selectDatabaseObjectForIdentifier(databaseObjects, identifier);
- }
- @Override
- public String toString() {
- return "DatabaseFinder.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 e9f755dbb0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/DatabaseObject.java
+++ /dev/null
@@ -1,58 +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;
-
-/**
- * Common behavior to all 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.
- *
- * This interface is not intended to be implemented by clients.
- */
-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".
- */
- 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();
-
-}
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 0406b42eba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ForeignKey.java
+++ /dev/null
@@ -1,139 +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;
-
-import java.util.Iterator;
-
-/**
- * Database foreign key
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 ForeignKey
- extends DatabaseObject, Comparable<ForeignKey>
-{
-
- // ********** 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.
- */
- Iterator<ColumnPair> columnPairs();
-
- /**
- * Return the size of the foreign key's column pairs.
- */
- int columnPairsSize();
-
- /**
- * Return the foreign key's single column pair. Throw an
- * IllegalStateException if the foreign key has more than one column pair.
- */
- ColumnPair getColumnPair();
-
- /**
- * Return the foreign key's "base" columns.
- */
- Iterator<Column> baseColumns();
-
- /**
- * 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.)
- */
- Iterator<Column> nonPrimaryKeyBaseColumns();
-
- /**
- * Return the foreign key's "referenced" columns.
- */
- Iterator<Column> referencedColumns();
-
- /**
- * 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:
- * ForeignKey(EMP.CUBICLE_ID => CUBICLE.ID) => "CUBICLE"
- * Return a null if it does not adhere to the JPA spec:
- * ForeignKey(EMP.CUBICLE_ID => CUBICLE.CUBICLE_ID) => null
- * ForeignKey(EMP.CUBICLE => CUBICLE.ID) => null
- */
- 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
- * JoinColumn annotation's 'name' element. Return null if the attribute
- * maps to the join column by default.
- * 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.
- */
- 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 extends Comparable<ColumnPair> {
-
- /**
- * Return the column pair's "base" column.
- */
- Column getBaseColumn();
-
- /**
- * Return the column pair's "referenced" column.
- */
- Column getReferencedColumn();
-
- }
-
-}
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 346de5ba65..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/JptDbPlugin.java
+++ /dev/null
@@ -1,71 +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;
-
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.jpt.db.internal.DTPConnectionProfileFactory;
-import org.osgi.framework.BundleContext;
-
-/**
- * The JPT DB plug-in lifecycle implementation.
- * Globally available connection profile factory.
- *
- * 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();
- 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;
- }
-
-}
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 984dfb537a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Schema.java
+++ /dev/null
@@ -1,100 +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;
-
-import java.util.Iterator;
-
-
-/**
- * Database 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.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface Schema
- extends DatabaseObject, Comparable<Schema>
-{
- /**
- * Return the schema's container; either a catalog or a database.
- */
- SchemaContainer getContainer();
-
-
- // ********** tables **********
-
- /**
- * Return the schema's tables.
- */
- Iterator<Table> tables();
-
- /**
- * Return the number of tables the schema contains.
- */
- int tablesSize();
-
- /**
- * 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.
- */
- Iterator<String> sortedTableIdentifiers();
-
- /**
- * 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)
- */
- Table getTableForIdentifier(String identifier);
-
-
- // ********** sequences **********
-
- /**
- * Return the schema's sequences.
- */
- Iterator<Sequence> sequences();
-
- /**
- * Return the number of sequences the schema contains.
- */
- int sequencesSize();
-
- /**
- * 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.
- */
- Iterator<String> sortedSequenceIdentifiers();
-
- /**
- * 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)
- */
- 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 26372f4a03..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/SchemaContainer.java
+++ /dev/null
@@ -1,67 +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;
-
-import java.util.Iterator;
-
-/**
- * Schema "container" (i.e. Database or Catalog)
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 SchemaContainer
- extends DatabaseObject
-{
-
- /**
- * Return the container's schemata.
- */
- Iterator<Schema> schemata();
-
- /**
- * Return the number of schemata in the container.
- */
- int schemataSize();
-
- /**
- * Return the schema with specified name. The name must be an exact match
- * of the schema's name.
- * @see #schemaNames()
- * @see #getSchemaForIdentifier(String)
- */
- Schema getSchemaNamed(String name);
-
- /**
- * Return the container's schema identifiers, sorted by name.
- */
- Iterator<String> sortedSchemaIdentifiers();
-
- /**
- * 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 #schemaIdentifiers()
- * @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.
- */
- Schema getDefaultSchema();
-
-}
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 f4ccaa78f9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Sequence.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.db;
-
-/**
- * Database sequence
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 Sequence
- extends DatabaseObject, Comparable<Sequence>
-{
-
- /**
- * 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 ef4d334af0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Table.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db;
-
-import java.util.Iterator;
-
-/**
- * Database 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.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface Table
- extends DatabaseObject, Comparable<Table>
-{
-
- /**
- * Return the table's schema.
- */
- Schema getSchema();
-
-
- // ********** columns **********
-
- /**
- * Return the table's columns.
- */
- Iterator<Column> columns();
-
- /**
- * Return the number of columns the table contains.
- */
- int columnsSize();
-
- /**
- * 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.
- */
- Iterator<String> sortedColumnIdentifiers();
-
- /**
- * 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)
- */
- Column getColumnForIdentifier(String identifier);
-
-
- // ********** primary key columns **********
-
- /**
- * Return the table's primary key columns.
- */
- Iterator<Column> primaryKeyColumns();
-
- /**
- * Return the number of primary key columns the table contains.
- */
- int primaryKeyColumnsSize();
-
- /**
- * Return the table's single primary key column. Throw an
- * IllegalStateException if the table has more than one primary key column.
- */
- Column getPrimaryKeyColumn();
-
-
- // ********** foreign keys **********
-
- /**
- * Return the table's foreign keys.
- */
- Iterator<ForeignKey> foreignKeys();
-
- /**
- * Return the number of foreign keys the table contains.
- */
- int foreignKeysSize();
-
-
- // ********** join table support **********
-
- /**
- * Return whether the table is possibly a "join" table
- * (i.e. it contains only 2 foreign keys). Whether the table *actually* 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. "OWNINGTABLE_NONOWNINGTABLE").
- * @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 29e4b09683..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPCatalogWrapper.java
+++ /dev/null
@@ -1,97 +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.internal;
-
-import java.text.Collator;
-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) {
- return this.wraps(dtpSchema.getCatalog()) ?
- this.getSchema_(dtpSchema)
- :
- this.getDatabase().getSchema(dtpSchema);
- }
-
- @Override
- DTPTableWrapper getTable(org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- return this.wraps(dtpTable.getSchema().getCatalog()) ?
- this.getTable_(dtpTable)
- :
- this.getDatabase().getTable(dtpTable);
- }
-
- @Override
- DTPColumnWrapper getColumn(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- return this.wraps(dtpColumn.getTable().getSchema().getCatalog()) ?
- this.getColumn_(dtpColumn)
- :
- this.getDatabase().getColumn(dtpColumn);
- }
-
-
- // ********** DatabaseObject implementation **********
-
- public String getName() {
- return this.dtpCatalog.getName();
- }
-
-
- // ********** Comparable implementation **********
-
- public int compareTo(Catalog catalog) {
- return Collator.getInstance().compare(this.getName(), catalog.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 77608037ca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPColumnWrapper.java
+++ /dev/null
@@ -1,241 +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.internal;
-
-import java.text.Collator;
-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.ClassTools;
-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.getDefinition(dataType).getJavaClassName();
- return new SimpleJavaType(ClassTools.classNameForTypeDeclaration(dtpJavaClassName));
- }
-
- private PredefinedDataTypeDefinition getDefinition(PredefinedDataType dataType) {
- return this.getDatabase().getDTPDefinition().getPredefinedDataTypeDefinition(dataType.getName());
- }
-
-
- // ********** Comparable implementation **********
-
- public int compareTo(Column column) {
- return Collator.getInstance().compare(this.getName(), column.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:
- * [variable] primitives
- * [variable] primitive wrappers
- * java.lang.String
- * java.util.Date
- * java.sql.Date
- */
- 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 6e5df2860a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileFactory.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.db.internal;
-
-import java.util.Iterator;
-
-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.DatabaseFinder;
-import org.eclipse.jpt.utility.internal.ListenerList;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * 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 ConnectionProfile buildConnectionProfile(String name, DatabaseFinder finder) {
- for (IConnectionProfile dtpProfile : this.dtpProfileManager.getProfiles()) {
- if (dtpProfile.getName().equals(name)) {
- return new DTPConnectionProfileWrapper(dtpProfile, finder);
- }
- }
- return null;
- }
-
- public ConnectionProfile buildConnectionProfile(String name) {
- return this.buildConnectionProfile(name, DatabaseFinder.Simple.instance());
- }
-
- public Iterator<String> connectionProfileNames() {
- return new TransformationIterator<IConnectionProfile, String>(this.dtpConnectionProfiles()) {
- @Override
- protected String transform(IConnectionProfile dtpProfile) {
- return dtpProfile.getName();
- }
- };
- }
-
- private Iterator<IConnectionProfile> dtpConnectionProfiles() {
- return new ArrayIterator<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 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 3547a9867e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileWrapper.java
+++ /dev/null
@@ -1,543 +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.internal;
-
-import java.text.Collator;
-
-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.DatabaseFinder;
-import org.eclipse.jpt.db.DatabaseObject;
-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;
-
- // finder supplied by the JPA platform (determines case-sensitivity, etc.)
- private final DatabaseFinder finder;
-
- // callback passed to the finder
- private final DatabaseFinder.DefaultCallback databaseFinderCallback;
-
- // 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, DatabaseFinder finder) {
- super();
- this.dtpConnectionProfile = dtpConnectionProfile;
- this.finder = finder;
- this.databaseFinderCallback = new DatabaseFinderCallback();
- 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);
- }
-
- public String getUserName() {
- String userName = this.getProperty(IJDBCDriverDefinitionConstants.USERNAME_PROP_ID);
- // 208946 handle username like "sys as sysdba" on Oracle
- int index = userName.indexOf(' ');
- return (index == -1) ? userName : userName.substring(0, index);
- }
-
- 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 find a component by identifier
- * (e.g. Table.getColumnForIdentifier(String)). We channel all the calls to here
- * and then we delegate to the JPA platform-supplied "database finder".
- */
- <T extends DatabaseObject> T selectDatabaseObjectForIdentifier(T[] databaseObjects, String identifier) {
- return this.finder.selectDatabaseObjectForIdentifier(databaseObjects, identifier, this.databaseFinderCallback);
- }
-
- /**
- * The default "database finder" calls back to here so we can delegate to
- * the database, which contains all the information necessary to properly
- * match identifiers.
- */
- <T extends DatabaseObject> T selectDatabaseObjectForIdentifier_(T[] databaseObjects, String identifier) {
- // the database should not be null here - call its internal method
- return this.database.selectDatabaseObjectForIdentifier_(databaseObjects, identifier);
- }
-
- 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);
- }
-
-
- // ********** Comparable implementation **********
-
- public int compareTo(ConnectionProfile connectionProfile) {
- return Collator.getInstance().compare(this.getName(), connectionProfile.getName());
- }
-
-
- // ********** overrides **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.getName());
- }
-
-
- // ********** DTP connection listener **********
-
- /**
- * This listener translates and forwards IManagedConnectionListener and
- * IManagedConnectionOfflineListener events to ConnectionListeners.
- */
- 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 DatabaseFinderCallback implements DatabaseFinder.DefaultCallback {
- public <T extends DatabaseObject> T selectDatabaseObjectForIdentifier(T[] databaseObjects, String identifier) {
- // call back to the internal method
- return DTPConnectionProfileWrapper.this.selectDatabaseObjectForIdentifier_(databaseObjects, identifier);
- }
- }
-
-}
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 a4cfae644c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseObjectWrapper.java
+++ /dev/null
@@ -1,189 +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.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)
- 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();
- }
-
- /**
- * This is called by whenever we need to find a component by identifier
- * (e.g. Table.getColumnForIdentifier(String)). We channel all the calls to the
- * connection profile, which then delegates to the JPA platform-supplied
- * "database finder".
- */
- <T extends DatabaseObject> T selectDatabaseObjectForIdentifier(T[] databaseObjects, String identifier) {
- return this.getConnectionProfile().selectDatabaseObjectForIdentifier(databaseObjects, identifier);
- }
-
- /**
- * Convenience method.
- */
- <T extends DatabaseObject> T selectDatabaseObjectNamed(T[] databaseObjects, String name) {
- for (T dbObject : databaseObjects) {
- if (dbObject.getName().equals(name)) {
- return dbObject;
- }
- }
- return null;
- }
-
- /**
- * Examples:
- * Oracle etc.
- * Table(FOO) vs. "Foo" => null
- * Table(BAR) vs. "Foo" => "BAR"
- * Table(Foo) vs. "Foo" => "\"Foo\""
- * Table(Bar) vs. "Foo" => "\"Bar\""
- *
- * PostgreSQL etc.
- * Table(foo) vs. "Foo" => null
- * Table(bar) vs. "Foo" => "bar"
- * Table(Foo) vs. "Foo" => "\"Foo\""
- * Table(Bar) vs. "Foo" => "\"Bar\""
- *
- * SQL Server etc.
- * Table(Foo) vs. "Foo" => null
- * Table(foo) vs. "Foo" => "foo"
- * Table(bar) vs. "Foo" => "bar"
- * Table(Bar) vs. "Foo" => "Bar"
- */
- public String getIdentifier(String defaultName) {
- return this.getDatabase().convertNameToIdentifier(this.getName(), defaultName);
- }
-
- /**
- * Examples:
- * Oracle etc.
- * Table(FOO) => "FOO"
- * Table(Foo) => "\"Foo\""
- * Table(foo) => "\"foo\""
- * Table(foo++) => "\"foo++\""
- * Table(f"o) => "\"f\"\"o++\"" (i.e. "f""o")
- *
- * PostgreSQL etc.
- * Table(FOO) => "\"FOO\""
- * Table(Foo) => "\"Foo\""
- * Table(foo) => "foo"
- * Table(foo++) => "\"foo++\""
- * Table(f"o) => "\"f\"\"o++\"" (i.e. "f""o")
- *
- * SQL Server etc.
- * Table(FOO) => "FOO"
- * Table(Foo) => "Foo"
- * Table(foo) => "foo"
- * Table(foo++) => "\"foo++\""
- * Table(f"o) => "\"f\"\"o++\"" (i.e. "f""o")
- */
- public String getIdentifier() {
- return this.getDatabase().convertNameToIdentifier(this.getName());
- }
-
- @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 2c75aeae4e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseWrapper.java
+++ /dev/null
@@ -1,1191 +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.internal;
-
-import java.text.Collator;
-import java.util.Collections;
-import java.util.HashMap;
-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.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * Wrap a DTP Database.
- *
- * Catalogs vs. Schemata:
- * 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. (Note MySQL does not seem
- * to be consistent with this pattern.)
- *
- * Note:
- * 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;
-
- // lazy-initialized, sorted
- private DTPCatalogWrapper[] catalogs;
-
- // lazy-initialized - but it can be 'null' so we use a flag
- private DTPCatalogWrapper defaultCatalog;
- private boolean defaultCatalogCalculated = false;
-
-
- private static final DTPCatalogWrapper[] EMPTY_CATALOGS = new DTPCatalogWrapper[0];
-
-
- // ********** constructor **********
-
- DTPDatabaseWrapper(DTPConnectionProfileWrapper connectionProfile, org.eclipse.datatools.modelbase.sql.schema.Database dtpDatabase) {
- super(connectionProfile, dtpDatabase);
- this.dtpDatabase = dtpDatabase;
- }
-
-
- // ********** DTPWrapper implementation **********
-
- /* TODO
- * We might want to listen to the "virtual" catalog; but that's probably
- * not necessary since there is not 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
- @SuppressWarnings("unchecked")
- List<org.eclipse.datatools.modelbase.sql.schema.Schema> getDTPSchemata() {
- List<org.eclipse.datatools.modelbase.sql.schema.Catalog> dtpCatalogs = this.getDTPCatalogs();
- // if there are no catalogs, the database must hold the schemata directly
- if ((dtpCatalogs == null) || dtpCatalogs.isEmpty()) {
- return this.dtpDatabase.getSchemas();
- }
- org.eclipse.datatools.modelbase.sql.schema.Catalog virtualCatalog = getVirtualCatalog(dtpCatalogs);
- return (virtualCatalog != null) ? virtualCatalog.getSchemas() : Collections.emptyList();
- }
-
- @Override
- DTPSchemaWrapper getSchema(org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema) {
- return this.getSchema_(dtpSchema);
- }
-
- @Override
- DTPTableWrapper getTable(org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- return this.getTable_(dtpTable);
- }
-
- @Override
- DTPColumnWrapper getColumn(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- return this.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(T[] databaseObjects, String identifier) {
- return super.selectDatabaseObjectForIdentifier(databaseObjects, identifier);
- }
-
- // ***** catalogs
-
- public boolean supportsCatalogs() {
- return supportsCatalogs(this.getDTPCatalogs());
- }
-
- private static boolean supportsCatalogs(List<org.eclipse.datatools.modelbase.sql.schema.Catalog> dtpCatalogs) {
- // if there are no catalogs, they must not be supported
- if ((dtpCatalogs == null) || dtpCatalogs.isEmpty()) {
- return false;
- }
-
- // if we only have a single catalog with an empty name,
- // they are not really supported either...
- return ! listContainsOnlyAVirtualCatalog(dtpCatalogs);
- }
-
- /**
- * pre-condition: 'dtpCatalogs' is not null
- */
- private static boolean listContainsOnlyAVirtualCatalog(List<org.eclipse.datatools.modelbase.sql.schema.Catalog> dtpCatalogs) {
- return getVirtualCatalog(dtpCatalogs) != null;
- }
-
- /**
- * pre-condition: 'dtpCatalogs' is not null
- */
- private static org.eclipse.datatools.modelbase.sql.schema.Catalog getVirtualCatalog(List<org.eclipse.datatools.modelbase.sql.schema.Catalog> dtpCatalogs) {
- if (dtpCatalogs.size() == 1) {
- org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog = dtpCatalogs.get(0);
- if (dtpCatalog.getName().equals("")) { //$NON-NLS-1$
- return dtpCatalog;
- }
- }
- return null;
- }
-
- public Iterator<Catalog> catalogs() {
- return new ArrayIterator<Catalog>(this.getCatalogs());
- }
-
- private Iterator<DTPCatalogWrapper> catalogWrappers() {
- return new ArrayIterator<DTPCatalogWrapper>(this.getCatalogs());
- }
-
- private synchronized DTPCatalogWrapper[] getCatalogs() {
- if (this.catalogs == null) {
- this.catalogs = this.buildCatalogs();
- }
- return this.catalogs;
- }
-
- private DTPCatalogWrapper[] buildCatalogs() {
- List<org.eclipse.datatools.modelbase.sql.schema.Catalog> dtpCatalogs = this.getDTPCatalogs();
- if ( ! supportsCatalogs(dtpCatalogs)) {
- return EMPTY_CATALOGS;
- }
- DTPCatalogWrapper[] result = new DTPCatalogWrapper[dtpCatalogs.size()];
- for (int i = result.length; i-- > 0;) {
- result[i] = new DTPCatalogWrapper(this, dtpCatalogs.get(i));
- }
- return CollectionTools.sort(result);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.schema.Catalog> getDTPCatalogs() {
- return this.dtpDatabase.getCatalogs();
- }
-
- public int catalogsSize() {
- return this.getCatalogs().length;
- }
-
- /**
- * return the catalog for the specified DTP catalog
- */
- DTPCatalogWrapper getCatalog(org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog) {
- for (DTPCatalogWrapper catalog : this.getCatalogs()) {
- if (catalog.wraps(dtpCatalog)) {
- return catalog;
- }
- }
- throw new IllegalArgumentException("invalid DTP catalog: " + dtpCatalog); //$NON-NLS-1$
- }
-
- public DTPCatalogWrapper getCatalogNamed(String name) {
- return this.selectDatabaseObjectNamed(this.getCatalogs(), name);
- }
-
- public Iterator<String> sortedCatalogIdentifiers() {
- // the catalogs are already sorted
- return new TransformationIterator<DTPCatalogWrapper, String>(this.catalogWrappers()) {
- @Override
- protected String transform(DTPCatalogWrapper next) {
- return next.getIdentifier();
- }
- };
- }
-
- public DTPCatalogWrapper getCatalogForIdentifier(String identifier) {
- return this.selectDatabaseObjectForIdentifier(this.getCatalogs(), identifier);
- }
-
- public synchronized DTPCatalogWrapper getDefaultCatalog() {
- if ( ! this.defaultCatalogCalculated) {
- this.defaultCatalogCalculated = true;
- this.defaultCatalog = this.buildDefaultCatalog();
- }
- return this.defaultCatalog;
- }
-
- private DTPCatalogWrapper buildDefaultCatalog() {
- return this.supportsCatalogs() ? this.getVendor().getDefaultCatalog(this) : null;
- }
-
- // ***** schemata
-
- @Override
- synchronized DTPSchemaWrapper[] getSchemata() {
- DTPCatalogWrapper cat = this.getDefaultCatalog();
- return (cat != null) ? cat.getSchemata() : super.getSchemata();
- }
-
- /**
- * Return the specified schema container's default schema.
- */
- DTPSchemaWrapper getDefaultSchema(DTPSchemaContainerWrapper schemaContainer) {
- return this.getVendor().getDefaultSchema(schemaContainer);
- }
-
-
- // ********** names vs. identifiers **********
-
- /**
- * Convert the specified name to an identifier. Return null if the resulting
- * identifier matches the specified default name.
- */
- String convertNameToIdentifier(String name, String defaultName) {
- return this.getVendor().convertNameToIdentifier(name, defaultName);
- }
-
- /**
- * Convert the specified name to an identifier.
- */
- public String convertNameToIdentifier(String name) {
- return this.getVendor().convertNameToIdentifier(name);
- }
-
- /**
- * 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 "normal" (i.e. not delimited),
- * it will be folded to the appropriate case (typically uppercase).
- *
- * Since the database has the appropriate state to compare identifiers and
- * names, the connection profile delegates to here when using the default
- * "database finder".
- */
- <T extends DatabaseObject> T selectDatabaseObjectForIdentifier_(T[] databaseObjects, String identifier) {
- return this.selectDatabaseObjectNamed(databaseObjects, this.convertIdentifierToName(identifier));
- }
-
- /**
- * Convert the specified identifier to a name.
- */
- String convertIdentifierToName(String identifier) {
- return this.getVendor().convertIdentifierToName(identifier);
- }
-
-
- // ********** Comparable implementation **********
-
- public int compareTo(Database database) {
- return Collator.getInstance().compare(this.getName(), database.getName());
- }
-
-
- // ********** internal methods **********
-
- DatabaseDefinition getDTPDefinition() {
- return RDBCorePlugin.getDefault().getDatabaseDefinitionRegistry().getDefinition(this.dtpDatabase);
- }
-
- private Vendor getVendor() {
- return getVendor(this.getVendorName());
- }
-
-
- // ********** 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
- void clear() {
- this.defaultCatalogCalculated = false;
- this.defaultCatalog = null;
- if (this.catalogs != null) {
- this.clearCatalogs();
- }
- super.clear();
- }
-
- private void clearCatalogs() {
- this.stopCatalogs();
- for (DTPCatalogWrapper catalog : this.catalogs) {
- catalog.clear();
- }
- this.catalogs = null;
- }
-
-
- // ********** vendors **********
-
- private static Vendor getVendor(String name) {
- Vendor vendor = getVendors().get(name);
- return (vendor != null) ? vendor : Default.INSTANCE;
- }
-
- /**
- * keyed by vendor name
- */
- private static HashMap<String, Vendor> Vendors;
-
- private static synchronized HashMap<String, Vendor> getVendors() {
- if (Vendors == null) {
- Vendors = buildVendors();
- }
- return Vendors;
- }
-
- private static HashMap<String, Vendor> buildVendors() {
- HashMap<String, Vendor> map = new HashMap<String, Vendor>(20);
- putVendor(map, Derby.INSTANCE);
- putVendor(map, HSQLDB.INSTANCE);
- putVendor(map, DB2.UDB);
- putVendor(map, DB2.UDB_I_SERIES);
- putVendor(map, DB2.UDB_Z_SERIES);
- putVendor(map, Informix.INSTANCE);
- putVendor(map, SQLServer.INSTANCE);
- putVendor(map, MySQL.INSTANCE);
- putVendor(map, Oracle.INSTANCE);
- putVendor(map, Postgres.INSTANCE);
- putVendor(map, MaxDB.INSTANCE);
- putVendor(map, Sybase.ASA);
- putVendor(map, Sybase.ASE);
- return map;
- }
-
- private static void putVendor(HashMap<String, Vendor> map, Vendor vendor) {
- String name = vendor.getName();
- if (map.put(name, vendor) != null) {
- throw new IllegalArgumentException("Duplicate vendor: " + name); //$NON-NLS-1$
- }
- }
-
-
- // ********** vendor classes **********
-
- /**
- * Delegate vendor-specific behavior to implementations of this class"
- * - default catalog and schema
- * - converting names to identifiers and vice-versa
- *
- * Note:
- * 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).
- */
- private abstract static class Vendor {
-
- Vendor() {
- super();
- }
-
- /**
- * Return the vendor's name. This must match the name specified by the
- * DTP connection profile.
- */
- abstract String getName();
-
- /**
- * The SQL spec says a "normal" (non-delimited) identifier should be
- * folded to uppercase; but some databases do otherwise (e.g. Sybase).
- */
- Folder getFolder() {
- return Folder.UPPER;
- }
-
-
- // ********** default catalog and schema **********
-
- /**
- * Return whether the vendor supports catalogs.
- */
- abstract boolean supportsCatalogs();
-
- DTPCatalogWrapper getDefaultCatalog(DTPDatabaseWrapper database) {
- if ( ! this.supportsCatalogs()) {
- throw new UnsupportedOperationException();
- }
- return database.getCatalogForIdentifier(this.getDefaultCatalogIdentifier(database));
- }
-
- /**
- * Typically, the name of the default catalog is the user name.
- */
- String getDefaultCatalogIdentifier(DTPDatabaseWrapper database) {
- if ( ! this.supportsCatalogs()) {
- throw new UnsupportedOperationException();
- }
- return database.getConnectionProfile().getUserName();
- }
-
- DTPSchemaWrapper getDefaultSchema(DTPSchemaContainerWrapper sc) {
- return sc.getSchemaForIdentifier(this.getDefaultSchemaIdentifier(sc));
- }
-
- /**
- * Typically, the name of the default schema is the user name.
- */
- String getDefaultSchemaIdentifier(DTPSchemaContainerWrapper sc) {
- return sc.getDatabase().getConnectionProfile().getUserName();
- }
-
-
- // ********** name -> identifier **********
-
- /**
- * @see DTPDatabaseWrapper#convertNameToIdentifier(String, String)
- */
- final String convertNameToIdentifier(String name, String defaultName) {
- return this.nameRequiresDelimiters(name) ? this.delimitName(name)
- : this.normalNamesMatch(name, defaultName) ? null : name;
- }
-
- /**
- * @see DTPDatabaseWrapper#convertNameToIdentifier(String)
- */
- final 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.
- */
- final 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
- */
- final boolean nameContainsAnySpecialCharacters(String name) {
- char[] string = name.toCharArray();
- if (this.characterIsSpecialNameStart(string[0])) {
- return true;
- }
- for (int i = string.length; i-- > 1; ) { // note: stop at 1
- if (this.characterIsSpecialNamePart(string[i])) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified character is "special" for the first
- * character of a name.
- * Typically, databases are more restrictive about what characters can
- * be used to *start* an identifier (as opposed to the characters
- * allowed for the remainder of the identifier).
- */
- final boolean characterIsSpecialNameStart(char c) {
- return ! this.characterIsNormalNameStart(c);
- }
-
- /**
- * Return whether the specified character is "normal" for the first
- * character of a name.
- * The first character of an identifier can be:
- * - a letter
- * - any of the other, vendor-specific, "normal" start characters
- */
- boolean characterIsNormalNameStart(char c) {
- // all vendors allow a letter
- return Character.isLetter(c)
- || this.characterIsNormalNameStart_(c);
- }
-
- private boolean characterIsNormalNameStart_(char c) {
- return arrayContains(this.getNormalNameStartCharacters(), c);
- }
-
- /**
- * Return the "normal" characters, beyond letters, for the
- * first character of a name.
- * Return null if there are no additional characters.
- */
- char[] getNormalNameStartCharacters() {
- return null;
- }
-
- /**
- * Return whether the specified character is "special" for the second and
- * subsequent characters of a name.
- */
- final boolean characterIsSpecialNamePart(char c) {
- return ! this.characterIsNormalNamePart(c);
- }
-
- /**
- * Return whether the specified character is "normal" for the second and
- * subsequent characters of a name.
- * The second and subsequent characters of a "normal" name can be:
- * - a letter
- * - a digit
- * - any of the other, vendor-specific, "normal" start characters
- * - any of the other, vendor-specific, "normal" part characters
- */
- boolean characterIsNormalNamePart(char c) {
- // all vendors allow a letter or digit
- return Character.isLetterOrDigit(c)
- || this.characterIsNormalNameStart_(c)
- || this.characterIsNormalNamePart_(c);
- }
-
- private boolean characterIsNormalNamePart_(char c) {
- return arrayContains(this.getNormalNamePartCharacters(), c);
- }
-
- /**
- * Return the "normal" characters, beyond letters and digits and the
- * "normal" first characters, for the second and subsequent characters
- * of an identifier. Return null if there are no additional characters.
- */
- char[] getNormalNamePartCharacters() {
- return null;
- }
-
- /**
- * Return whether the specified name is not folded to the database's
- * case, requiring it to be delimited.
- */
- final boolean nameIsNotFolded(String name) {
- return ! this.getFolder().stringIsFolded(name);
- }
-
- /**
- * Return whether the specified "normal" names match.
- */
- final boolean normalNamesMatch(String name1, String name2) {
- return this.normalIdentifiersAreCaseSensitive() ?
- name1.equals(name2)
- :
- name1.equalsIgnoreCase(name2);
- }
-
- /**
- * Typically, "normal" identifiers are case-insensitive.
- */
- final boolean normalIdentifiersAreCaseSensitive() {
- return this.getFolder().isCaseSensitive();
- }
-
- /**
- * Wrap the specified name in delimiters (typically double-quotes),
- * converting it to an identifier.
- */
- String delimitName(String name) {
- return StringTools.quote(name);
- }
-
-
- // ********** identifier -> name **********
-
- /**
- * @see DTPDatabaseWrapper#selectDatabaseObjectForIdentifier_(DatabaseObject[], String)
- */
- // not sure how to handle an empty string:
- // both "" and "\"\"" are converted to "" ...
- // convert "" to 'null' since empty strings must be delimited?
- final String convertIdentifierToName(String identifier) {
- return (identifier == null) ? null :
- this.identifierIsDelimited(identifier) ?
- StringTools.undelimit(identifier)
- :
- this.getFolder().fold(identifier);
- }
-
- /**
- * Return whether the specified identifier is "delimited".
- * 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.getName();
- }
-
- /**
- * static convenience method - array null check
- */
- static boolean arrayContains(char[] array, char c) {
- return (array != null) && CollectionTools.contains(array, c);
- }
-
- /**
- * Handle database-specific case-folding issues.
- */
- enum Folder {
- UPPER {
- @Override String fold(String string) { return string.toUpperCase(); }
- @Override boolean stringIsFolded(String string) { return StringTools.stringIsUppercase(string); }
- @Override boolean isCaseSensitive() { return false; }
- },
- LOWER {
- @Override String fold(String string) { return string.toLowerCase(); }
- @Override boolean stringIsFolded(String string) { return StringTools.stringIsLowercase(string); }
- @Override boolean isCaseSensitive() { return false; }
- },
- NONE {
- @Override String fold(String string) { return string; }
- @Override boolean stringIsFolded(String string) { return true; }
- @Override boolean isCaseSensitive() { return true; }
- };
- abstract String fold(String string);
- abstract boolean stringIsFolded(String string);
- abstract boolean isCaseSensitive();
- }
-
- }
-
- private static class Default extends Vendor {
- static final Vendor INSTANCE = new Default();
-
- private Default() {
- super();
- }
-
- @Override
- String getName() {
- return "Default Vendor"; //$NON-NLS-1$
- }
-
- @Override
- boolean supportsCatalogs() {
- return true; // hmmm... ~bjv
- }
-
- }
-
- private static class Derby extends Vendor {
- static final Vendor INSTANCE = new Derby();
-
- private Derby() {
- super();
- }
-
- @Override
- String getName() {
- return "Derby"; //$NON-NLS-1$
- }
-
- @Override
- boolean supportsCatalogs() {
- return false;
- }
-
- /**
- * The default user name on Derby is "APP".
- */
- @Override
- String getDefaultSchemaIdentifier(DTPSchemaContainerWrapper sc) {
- String user = super.getDefaultSchemaIdentifier(sc);
- return ((user == null) || (user.length() == 0)) ?
- DEFAULT_USER_NAME
- :
- user;
- }
- private static final String DEFAULT_USER_NAME = "APP"; //$NON-NLS-1$
-
- @Override
- char[] getNormalNamePartCharacters() {
- return NORMAL_NAME_PART_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_PART_CHARACTERS = new char[] { '_' };
-
- }
-
- private static class HSQLDB extends Vendor {
- static final Vendor INSTANCE = new HSQLDB();
-
- private HSQLDB() {
- super();
- }
-
- @Override
- String getName() {
- return "HSQLDB"; //$NON-NLS-1$
- }
-
- @Override
- boolean supportsCatalogs() {
- return false;
- }
-
- @Override
- String getDefaultSchemaIdentifier(DTPSchemaContainerWrapper sc) {
- return PUBLIC_SCHEMA_NAME;
- }
- private static final String PUBLIC_SCHEMA_NAME = "PUBLIC"; //$NON-NLS-1$
-
- }
-
- private static class DB2 extends Vendor {
- static final Vendor UDB_I_SERIES = new DB2("DB2 UDB iSeries"); //$NON-NLS-1$
- static final Vendor UDB = new DB2("DB2 UDB"); //$NON-NLS-1$
- static final Vendor UDB_Z_SERIES = new DB2("DB2 UDB zSeries"); //$NON-NLS-1$
-
- private final String name;
-
- private DB2(String name) {
- super();
- this.name = name;
- }
-
- @Override
- String getName() {
- return this.name;
- }
-
- @Override
- boolean supportsCatalogs() {
- return false;
- }
-
- @Override
- char[] getNormalNamePartCharacters() {
- return NORMAL_NAME_PART_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_PART_CHARACTERS = new char[] { '_' };
-
- }
-
- private static class Informix extends Vendor {
- static final Vendor INSTANCE = new Informix();
-
- private Informix() {
- super();
- }
-
- @Override
- String getName() {
- return "Informix"; //$NON-NLS-1$
- }
-
- @Override
- boolean supportsCatalogs() {
- return false;
- }
-
- @Override
- Folder getFolder() {
- return Folder.LOWER;
- }
-
- @Override
- char[] getNormalNameStartCharacters() {
- return NORMAL_NAME_START_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_START_CHARACTERS = new char[] { '_' };
-
- @Override
- char[] getNormalNamePartCharacters() {
- return NORMAL_NAME_PART_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_PART_CHARACTERS = new char[] { '$' };
-
- }
-
- private static class SQLServer extends Vendor {
- static final Vendor INSTANCE = new SQLServer();
-
- private SQLServer() {
- super();
- }
-
- @Override
- String getName() {
- return "SQL Server"; //$NON-NLS-1$
- }
-
- @Override
- boolean supportsCatalogs() {
- return true;
- }
-
- /**
- * The default schema on SQL Server for any database (catalog) is 'dbo'.
- */
- @Override
- String getDefaultSchemaIdentifier(DTPSchemaContainerWrapper sc) {
- return DEFAULT_SCHEMA_NAME;
- }
- private static final String DEFAULT_SCHEMA_NAME = "dbo"; //$NON-NLS-1$
-
- /**
- * By default, SQL Server identifiers are case-sensitive, even without
- * delimiters. This can depend on the collation setting....
- */
- @Override
- Folder getFolder() {
- return Folder.NONE;
- }
-
- @Override
- char[] getNormalNameStartCharacters() {
- return NORMAL_NAME_START_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_START_CHARACTERS = new char[] { '_', '@', '#' };
-
- @Override
- char[] getNormalNamePartCharacters() {
- return NORMAL_NAME_PART_CHARACTERS;
- }
- private static final char[] NORMAL_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);
- }
-
- }
-
- private static class MySQL extends Vendor {
- static final Vendor INSTANCE = new MySQL();
-
- private MySQL() {
- super();
- }
-
- @Override
- String getName() {
- return "MySql"; //$NON-NLS-1$
- }
-
- @Override
- boolean supportsCatalogs() {
- return false;
- }
-
- /**
- * 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 table and column names, are folded;
- * but they are case-insensitive, unless delimited. See
- * http://dev.mysql.com/doc/refman/6.0/en/identifier-case-sensitivity.html.)
- */
- @Override
- Folder getFolder() {
- return Folder.NONE;
- }
-
- /**
- * The DTP model for MySQL has a database that contains no catalogs
- * but directly holds a single schema with the same name as the database.
- * 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
- String getDefaultSchemaIdentifier(DTPSchemaContainerWrapper sc) {
- return sc.getDatabase().getName(); // hmmm... ~bjv
- }
-
- /**
- * MySQL is the only vendor that allows a digit.
- * Although, the name cannnot be *all* digits.
- */
- @Override
- boolean characterIsNormalNameStart(char c) {
- return Character.isDigit(c) || super.characterIsNormalNameStart(c);
- }
-
- @Override
- char[] getNormalNameStartCharacters() {
- return NORMAL_NAME_START_CHARACTERS;
- }
- private static final char[] NORMAL_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 = '`';
-
- }
-
- private static class Oracle extends Vendor {
- static final Vendor INSTANCE = new Oracle();
-
- private Oracle() {
- super();
- }
-
- @Override
- String getName() {
- return "Oracle"; //$NON-NLS-1$
- }
-
- @Override
- boolean supportsCatalogs() {
- return false;
- }
-
- @Override
- char[] getNormalNamePartCharacters() {
- return NORMAL_NAME_PART_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_PART_CHARACTERS = new char[] { '_', '$', '#' };
-
- }
-
- private static class Postgres extends Vendor {
- static final Vendor INSTANCE = new Postgres();
-
- private Postgres() {
- super();
- }
-
- @Override
- String getName() {
- return "postgres"; //$NON-NLS-1$
- }
-
- @Override
- Folder getFolder() {
- return Folder.LOWER;
- }
-
- @Override
- boolean supportsCatalogs() {
- return false;
- }
-
- /**
- * PostgreSQL has a "schema search path". The default is:
- * "$user",public
- * If "$user" is not found, return "public".
- */
- @Override
- DTPSchemaWrapper getDefaultSchema(DTPSchemaContainerWrapper sc) {
- DTPSchemaWrapper userSchema = super.getDefaultSchema(sc);
- return (userSchema != null) ? userSchema : sc.getSchemaNamed(PUBLIC_SCHEMA_NAME);
- }
- private static final String PUBLIC_SCHEMA_NAME = "public"; //$NON-NLS-1$
-
- @Override
- char[] getNormalNameStartCharacters() {
- return NORMAL_NAME_START_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_START_CHARACTERS = new char[] { '_' };
-
- @Override
- char[] getNormalNamePartCharacters() {
- return NORMAL_NAME_PART_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_PART_CHARACTERS = new char[] { '$' };
-
- }
-
- private static class MaxDB extends Vendor {
- static final Vendor INSTANCE = new MaxDB();
-
- private MaxDB() {
- super();
- }
-
- @Override
- String getName() {
- return "MaxDB"; //$NON-NLS-1$
- }
-
- @Override
- boolean supportsCatalogs() {
- return false;
- }
-
- @Override
- char[] getNormalNameStartCharacters() {
- return NORMAL_NAME_START_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_START_CHARACTERS = new char[] { '#', '@', '$' };
-
- @Override
- char[] getNormalNamePartCharacters() {
- return NORMAL_NAME_PART_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_PART_CHARACTERS = new char[] { '_' };
-
- }
-
- private static class Sybase extends Vendor {
- static final Vendor ASA = new Sybase("Sybase_ASA"); //$NON-NLS-1$
- static final Vendor ASE = new Sybase("Sybase_ASE"); //$NON-NLS-1$
-
- private final String name;
-
- private Sybase(String name) {
- super();
- this.name = name;
- }
-
- @Override
- String getName() {
- return this.name;
- }
-
- @Override
- boolean supportsCatalogs() {
- return true;
- }
-
- /**
- * 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 table) first in the user's
- * schema, the it look 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
- String getDefaultSchemaIdentifier(DTPSchemaContainerWrapper sc) {
- return DEFAULT_SCHEMA_NAME;
- }
- private static final String DEFAULT_SCHEMA_NAME = "dbo"; //$NON-NLS-1$
-
- /**
- * By default, Sybase identifiers are case-sensitive, even without
- * delimiters. This can depend on the collation setting....
- */
- @Override
- Folder getFolder() {
- return Folder.NONE;
- }
-
- @Override
- char[] getNormalNameStartCharacters() {
- return NORMAL_NAME_START_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_START_CHARACTERS = new char[] { '_', '@' };
-
- @Override
- char[] getNormalNamePartCharacters() {
- return NORMAL_NAME_PART_CHARACTERS;
- }
- private static final char[] NORMAL_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/DTPForeignKeyWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPForeignKeyWrapper.java
deleted file mode 100644
index 10e9df6dd2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPForeignKeyWrapper.java
+++ /dev/null
@@ -1,339 +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.internal;
-
-import java.text.Collator;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * 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.getColumnPairs())); //$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.columnPairsSize() != 1) {
- return false;
- }
- if (this.getReferencedTable().primaryKeyColumnsSize() != 1) {
- return false;
- }
- return this.getColumnPair().getReferencedColumn() == this.getReferencedTable().getPrimaryKeyColumn();
- }
-
- // ***** column pairs
-
- public Iterator<ColumnPair> columnPairs() {
- return new ArrayIterator<ColumnPair>(this.getColumnPairs());
- }
-
- public LocalColumnPair getColumnPair() {
- LocalColumnPair[] pairs = this.getColumnPairs();
- if (pairs.length != 1) {
- throw new IllegalStateException("multiple column pairs: " + pairs.length); //$NON-NLS-1$
- }
- return pairs[0];
- }
-
- private Iterator<LocalColumnPair> localColumnPairs() {
- return new ArrayIterator<LocalColumnPair>(this.getColumnPairs());
- }
-
- private synchronized LocalColumnPair[] getColumnPairs() {
- if (this.columnPairs == null) {
- this.columnPairs = this.buildColumnPairs();
- }
- return this.columnPairs;
- }
-
- private LocalColumnPair[] buildColumnPairs() {
- 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 result;
- }
-
- // 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 columnPairsSize() {
- return this.getColumnPairs().length;
- }
-
- public Iterator<Column> baseColumns() {
- return new TransformationIterator<LocalColumnPair, Column>(this.localColumnPairs()) {
- @Override
- protected Column transform(LocalColumnPair pair) {
- return pair.getBaseColumn();
- }
- };
- }
-
- boolean baseColumnsContains(Column column) {
- return CollectionTools.contains(this.baseColumns(), column);
- }
-
- public Iterator<Column> nonPrimaryKeyBaseColumns() {
- return new FilteringIterator<Column, Column>(this.baseColumns()) {
- @Override
- protected boolean accept(Column column) {
- return ! column.isPartOfPrimaryKey();
- }
- };
- }
-
- public Iterator<Column> referencedColumns() {
- return new TransformationIterator<LocalColumnPair, Column>(this.localColumnPairs()) {
- @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.columnPairsSize() == 1) ?
- this.getNonDefaultAttributeNameFromBaseColumn()
- :
- this.getReferencedTable().getName();
- }
-
- /**
- * The underscore check is helpful when the referenced column is NOT the
- * primary key of the referenced table (i.e. it has only a UNIQUE constraint).
- * ForeignKey(EMP.CUBICLE_ID => CUBICLE.ID) => "CUBICLE"
- * ForeignKey(EMP.CUBICLEID => CUBICLE.ID) => "CUBICLE"
- * ForeignKey(EMP.CUBICLE_PK => CUBICLE.ID) => "CUBICLE_PK"
- */
- 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:
- * Oracle etc.
- * ForeignKey(FOO_ID => ID) vs. "foo" => null
- * ForeignKey(FOO_ID => FOO_ID) vs. "foo" => "FOO_ID"
- * ForeignKey(FOO => ID) vs. "foo" => "FOO"
- * ForeignKey(Foo_ID => ID) vs. "foo" => "\"Foo_ID\""
- *
- * PostgreSQL etc.
- * ForeignKey(foo_id => id) vs. "foo" => null
- * ForeignKey(foo_id => foo_id) vs. "foo" => "foo_id"
- * ForeignKey(foo => id) vs. "foo" => "foo"
- * ForeignKey(Foo_ID => ID) vs. "foo" => "\"Foo_ID\""
- *
- * SQL Server etc.
- * ForeignKey(foo_ID => ID) vs. "foo" => null
- * ForeignKey(FOO_ID => FOO_ID) vs. "foo" => "FOO_ID"
- * ForeignKey(FOO => ID) vs. "foo" => "FOO"
- * ForeignKey(Foo_ID => ID) vs. "foo" => "Foo_ID"
- */
- public String getJoinColumnAnnotationIdentifier(String attributeName) {
- String baseColumnName = this.getColumnPair().getBaseColumn().getName();
- String defaultBaseColumnName = attributeName + '_' + this.getReferencedTable().getPrimaryKeyColumn().getName();
- return this.getDatabase().convertNameToIdentifier(baseColumnName, defaultBaseColumnName);
- }
-
-
- // ********** Comparable implementation **********
-
- public int compareTo(ForeignKey foreignKey) {
- return Collator.getInstance().compare(this.getName(), foreignKey.getName());
- }
-
-
- // ********** internal methods **********
-
- boolean wraps(org.eclipse.datatools.modelbase.sql.constraints.ForeignKey foreignKey) {
- return this.dtpForeignKey == foreignKey;
- }
-
- @Override
- 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 **********
-
- private 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;
- }
-
- public int compareTo(ColumnPair columnPair) {
- return Collator.getInstance().compare(this.getBaseColumn().getName(), columnPair.getBaseColumn().getName());
- }
-
- @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 f04936cbff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSchemaContainerWrapper.java
+++ /dev/null
@@ -1,197 +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.internal;
-
-import java.util.Iterator;
-import java.util.List;
-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.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * 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 dtpObject) {
- super(parent, dtpObject);
- }
-
-
- // ********** 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.getSchemata()) {
- if (schema.wraps(dtpSchema)) {
- return schema;
- }
- }
- throw new IllegalArgumentException("invalid DTP schema: " + dtpSchema); //$NON-NLS-1$
- }
-
- /**
- * return the table for the specified DTP table
- */
- 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
- */
- 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 Iterator<Schema> schemata() {
- return new ArrayIterator<Schema>(this.getSchemata());
- }
-
- Iterator<DTPSchemaWrapper> schemaWrappers() {
- return new ArrayIterator<DTPSchemaWrapper>(this.getSchemata());
- }
-
- synchronized DTPSchemaWrapper[] getSchemata() {
- if (this.schemata == null) {
- this.schemata = this.buildSchemata();
- }
- return this.schemata;
- }
-
- private DTPSchemaWrapper[] buildSchemata() {
- 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 CollectionTools.sort(result);
- }
-
- public int schemataSize() {
- return this.getSchemata().length;
- }
-
- public DTPSchemaWrapper getSchemaNamed(String name) {
- return this.selectDatabaseObjectNamed(this.getSchemata(), name);
- }
-
- public Iterator<String> sortedSchemaIdentifiers() {
- // the schemata are already sorted
- return new TransformationIterator<DTPSchemaWrapper, String>(this.schemaWrappers()) {
- @Override
- protected String transform(DTPSchemaWrapper next) {
- return next.getIdentifier();
- }
- };
- }
-
- public DTPSchemaWrapper getSchemaForIdentifier(String identifier) {
- return this.selectDatabaseObjectForIdentifier(this.getSchemata(), identifier);
- }
-
- public DTPSchemaWrapper getDefaultSchema() {
- return this.getDatabase().getDefaultSchema(this);
- }
-
-
- // ********** 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 f1ceb477f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSchemaWrapper.java
+++ /dev/null
@@ -1,306 +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.internal;
-
-import java.text.Collator;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.Sequence;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * 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;
-
-
- // ********** 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 Iterator<Table> tables() {
- return new ArrayIterator<Table>(this.getTables());
- }
-
- private Iterator<DTPTableWrapper> tableWrappers() {
- return new ArrayIterator<DTPTableWrapper>(this.getTables());
- }
-
- private synchronized DTPTableWrapper[] getTables() {
- if (this.tables == null) {
- this.tables = this.buildTables();
- }
- return this.tables;
- }
-
- private DTPTableWrapper[] buildTables() {
- 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 CollectionTools.sort(result);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.tables.Table> getDTPTables() {
- return this.dtpSchema.getTables();
- }
-
- public int tablesSize() {
- return this.getTables().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.getTables()) {
- 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.getTables(), name);
- }
-
- public Iterator<String> sortedTableIdentifiers() {
- // the tables are already sorted
- return new TransformationIterator<DTPTableWrapper, String>(this.tableWrappers()) {
- @Override
- protected String transform(DTPTableWrapper table) {
- return table.getIdentifier();
- }
- };
- }
-
- public DTPTableWrapper getTableForIdentifier(String identifier) {
- return this.selectDatabaseObjectForIdentifier(this.getTables(), identifier);
- }
-
- // ***** sequences
-
- public Iterator<Sequence> sequences() {
- return new ArrayIterator<Sequence>(this.getSequences());
- }
-
- private Iterator<DTPSequenceWrapper> sequenceWrappers() {
- return new ArrayIterator<DTPSequenceWrapper>(this.getSequences());
- }
-
- private synchronized DTPSequenceWrapper[] getSequences() {
- if (this.sequences == null) {
- this.sequences = this.buildSequences();
- }
- return this.sequences;
- }
-
- private DTPSequenceWrapper[] buildSequences() {
- 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 CollectionTools.sort(result);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.schema.Sequence> getDTPSequences() {
- return this.dtpSchema.getSequences();
- }
-
- public int sequencesSize() {
- return this.getSequences().length;
- }
-
- public DTPSequenceWrapper getSequenceNamed(String name) {
- return this.selectDatabaseObjectNamed(this.getSequences(), name);
- }
-
- public Iterator<String> sortedSequenceIdentifiers() {
- // the sequences are already sorted
- return new TransformationIterator<DTPSequenceWrapper, String>(this.sequenceWrappers()) {
- @Override
- protected String transform(DTPSequenceWrapper sequence) {
- return sequence.getIdentifier();
- }
- };
- }
-
- public DTPSequenceWrapper getSequenceForIdentifier(String identifier) {
- return this.selectDatabaseObjectForIdentifier(this.getSequences(), identifier);
- }
-
-
- // ********** Comparable implementation **********
-
- public int compareTo(Schema schema) {
- return Collator.getInstance().compare(this.getName(), schema.getName());
- }
-
-
- // ********** 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) {
- 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 6b0b76a506..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSequenceWrapper.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.db.internal;
-
-import java.text.Collator;
-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();
- }
-
-
- // ********** Comparable implementation **********
-
- public int compareTo(Sequence sequence) {
- return Collator.getInstance().compare(this.getName(), sequence.getName());
- }
-
-
- // ********** 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 da8f333510..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPTableWrapper.java
+++ /dev/null
@@ -1,420 +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.internal;
-
-import java.text.Collator;
-import java.util.Iterator;
-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.ForeignKey;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * 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 Iterator<Column> columns() {
- return new ArrayIterator<Column>(this.getColumns());
- }
-
- private Iterator<DTPColumnWrapper> columnWrappers() {
- return new ArrayIterator<DTPColumnWrapper>(this.getColumns());
- }
-
- private synchronized DTPColumnWrapper[] getColumns() {
- if (this.columns == null) {
- this.columns = this.buildColumns();
- }
- return this.columns;
- }
-
- private DTPColumnWrapper[] buildColumns() {
- 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 CollectionTools.sort(result);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.tables.Column> getDTPColumns() {
- return this.dtpTable.getColumns();
- }
-
- public int columnsSize() {
- return this.getColumns().length;
- }
-
- public DTPColumnWrapper getColumnNamed(String name) {
- return this.selectDatabaseObjectNamed(this.getColumns(), 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.getColumns()) {
- if (column.wraps(dtpColumn)) {
- return column;
- }
- }
- throw new IllegalArgumentException("invalid DTP column: " + dtpColumn); //$NON-NLS-1$
- }
-
- public Iterator<String> sortedColumnIdentifiers() {
- // the columns are already sorted
- return new TransformationIterator<DTPColumnWrapper, String>(this.columnWrappers()) {
- @Override
- protected String transform(DTPColumnWrapper next) {
- return next.getIdentifier();
- }
- };
- }
-
- public DTPColumnWrapper getColumnForIdentifier(String identifier) {
- return this.selectDatabaseObjectForIdentifier(this.getColumns(), identifier);
- }
-
- // ***** primaryKeyColumns
-
- public Iterator<Column> primaryKeyColumns() {
- return new ArrayIterator<Column>(this.getPrimaryKeyColumns());
- }
-
- public DTPColumnWrapper getPrimaryKeyColumn() {
- DTPColumnWrapper[] pkColumns = this.getPrimaryKeyColumns();
- if (pkColumns.length != 1) {
- throw new IllegalStateException("multiple primary key columns: " + pkColumns.length); //$NON-NLS-1$
- }
- return pkColumns[0];
- }
-
- private synchronized DTPColumnWrapper[] getPrimaryKeyColumns() {
- if (this.primaryKeyColumns == null) {
- this.primaryKeyColumns = this.buildPrimaryKeyColumns();
- }
- return this.primaryKeyColumns;
- }
-
- private DTPColumnWrapper[] buildPrimaryKeyColumns() {
- 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 primaryKeyColumnsSize() {
- return this.getPrimaryKeyColumns().length;
- }
-
- boolean primaryKeyColumnsContains(Column column) {
- return CollectionTools.contains(this.getPrimaryKeyColumns(), column);
- }
-
- // ***** foreignKeys
-
- public Iterator<ForeignKey> foreignKeys() {
- return new ArrayIterator<ForeignKey>(this.getForeignKeys());
- }
-
- private synchronized DTPForeignKeyWrapper[] getForeignKeys() {
- if (this.foreignKeys == null) {
- this.foreignKeys = this.buildForeignKeys();
- }
- return this.foreignKeys;
- }
-
- private DTPForeignKeyWrapper[] buildForeignKeys() {
- 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 foreignKeysSize() {
- return this.getForeignKeys().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.getForeignKeys()) {
- if (fkWrapper.baseColumnsContains(column)) {
- return true;
- }
- }
- return false;
- }
-
- // ***** join table
-
- public boolean isPossibleJoinTable() {
- if (this.getForeignKeys().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 FOO_BAR and it joins tables FOO and BAR,
- * return the foreign key to FOO;
- * if the table name is BAR_FOO and it joins tables FOO and BAR,
- * return the foreign key to BAR;
- * otherwise simply return the first foreign key in the array.
- */
- public ForeignKey getJoinTableOwningForeignKey() {
- ForeignKey fk0 = this.getForeignKeys()[0];
- String name0 = fk0.getReferencedTable().getName();
-
- ForeignKey fk1 = this.getForeignKeys()[1];
- String name1 = fk1.getReferencedTable().getName();
-
- return this.getName().equals(name1 + '_' + name0) ? fk1 : fk0;
- }
-
- public ForeignKey getJoinTableNonOwningForeignKey() {
- ForeignKey fk0 = this.getForeignKeys()[0];
- ForeignKey fk1 = this.getForeignKeys()[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();
- }
-
-
- // ********** Comparable implementation **********
-
- public int compareTo(Table table) {
- return Collator.getInstance().compare(this.getName(), table.getName());
- }
-
-
- // ********** 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
- 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.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 7f327f0c93..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.0.300.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 6c3af6e2fe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/about.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>
-<!-- Run date = July 23, 2008 8:59:55 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>About this content</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="About this content" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<div class="sect1"><!-- infolevel="all" infotype="General" --><a id="sthref257" name="sthref257"></a>
-<h1>About this content</h1>
-<p>January, 2008</p>
-<a id="sthref258" name="sthref258"></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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 6c3af6e2fe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/about.html
+++ /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>
-<!-- Run date = July 23, 2008 8:59:55 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>About this content</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="About this content" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<div class="sect1"><!-- infolevel="all" infotype="General" --><a id="sthref257" name="sthref257"></a>
-<h1>About this content</h1>
-<p>January, 2008</p>
-<a id="sthref258" name="sthref258"></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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 4ecd752108..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/build.properties
+++ /dev/null
@@ -1,115 +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_generate_entities.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,\
- reference033.htm,\
- reference034.htm,\
- tasks023.htm,\
- tasks024.htm,\
- tasks025.htm,\
- whats_new004.htm,\
- whats_new005.htm,\
- whats_new006.htm,\
- whats_new007.htm,\
- whats_new008.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 4063527779..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concept_mapping.htm
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:41 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Understanding OR mappings</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Understanding OR mappings" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABBDJFI" name="BABBDJFI"></a></p>
-<div class="sect1">
-<h1>Understanding OR mappings</h1>
-<p><a id="sthref20" name="sthref20"></a><a id="sthref21" name="sthref21"></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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 d1fc4cdf05..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concept_persistence.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>
-<!-- Run date = July 23, 2008 8:59:41 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Understanding Java persistence</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Understanding Java persistence" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABCAHIC" name="BABCAHIC"></a></p>
-<div class="sect1">
-<h1>Understanding Java persistence</h1>
-<p><a id="sthref18" name="sthref18"></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="sthref19" name="sthref19"></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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 3663d63540..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts.htm
+++ /dev/null
@@ -1,59 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:41 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Concepts</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Concepts" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="sthref17" name="sthref17"></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>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 6a411500ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts001.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>
-<!-- Run date = July 23, 2008 8:59:41 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Understanding EJB 3.0 Java Persistence API</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Understanding EJB 3.0 Java Persistence API" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 f4751603c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts002.htm
+++ /dev/null
@@ -1,57 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:41 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>The persistence.xml file</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="The persistence.xml file" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CHDHAGIH" name="CHDHAGIH"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1><a id="sthref22" name="sthref22"></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="reference018.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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 43fff9a255..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts003.htm
+++ /dev/null
@@ -1,72 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:42 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>The orm.xml file</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="The orm.xml file" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CHDBIJAC" name="CHDBIJAC"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1><a id="sthref23" name="sthref23"></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="reference005.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>
-<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>
-Dali works exclusively with XML mapping files named <code>orm.xml</code>.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 34de0ef6d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/contexts.xml
+++ /dev/null
@@ -1,422 +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.</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>
-
-
-
-
-</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 c56c8c0a06..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started.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>
-<!-- Run date = July 23, 2008 8:59:41 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Getting started</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Getting started" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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/main.php">http://www.eclipse.org/webtools/dali/main.php</a></code>.</p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 0236f26b15..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started001.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>
-<!-- Run date = July 23, 2008 8:59:41 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Requirements and installation</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Requirements and installation" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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.4 (<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.0 (<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. The reference implementation can be obtained from:</p>
-</li>
-</ul>
-<pre xml:space="preserve" class="oac_no_warn">
-<code><a href="https://glassfish.dev.java.net/downloads/persistence/JavaPersistence.html">https://glassfish.dev.java.net/downloads/persistence/JavaPersistence.html</a></code>
-</pre>
-<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>Dali is included as part of WTP 2.0. No additional installation or configuration is required.</p>
-<a id="sthref5" name="sthref5"></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="sthref6" name="sthref6"></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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 9d7f54c7cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started002.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>
-<!-- Run date = July 23, 2008 8:59:41 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Dali quick start</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Dali quick start" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref7" name="sthref7"></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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 41907c16c9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started003.htm
+++ /dev/null
@@ -1,101 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:41 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Creating a new JPA project</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating a new JPA project" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref8" name="sthref8"></a>This quick start shows how to create a new JPA project.</p>
-<ol start="1">
-<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 <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a> 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>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="sthref9" name="sthref9"></a>
-<p class="titleinfigure">Project in Package 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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 e5c2f19db4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started004.htm
+++ /dev/null
@@ -1,200 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:41 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Creating a Java persistent entity with persistent fields</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating a Java persistent entity with persistent fields" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref10" name="sthref10"></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 start="1">
-<li>
-<p>Select the JPA project in the Navigator or Package 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">Entity</span> and then click <span class="bold">Next</span>. The Entity Class page 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="reference004.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="sthref11" name="sthref11"></a><a id="sthref12" name="sthref12"></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="sthref13" name="sthref13"></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="sthref14" name="sthref14"></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 start="1">
-<li>
-<p>Select the <span class="gui-object-action">Address</span> class in the Package 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="sthref15" name="sthref15"></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 Package Explorer and select <span class="bold">JPA Tools &gt; Synchronize Classes</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 start="1">
-<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="sthref16" name="sthref16"></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">
-<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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 ed27a5ce29..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/change_connection_profile.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/change_connection_profile.png
deleted file mode 100644
index 46ab05e0aa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/change_connection_profile.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/column_support_new.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/column_support_new.png
deleted file mode 100644
index 8716e8b33c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/column_support_new.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/convert_java_project_new.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/convert_java_project_new.png
deleted file mode 100644
index 91cda6e6a4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/convert_java_project_new.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_entity_new.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_entity_new.png
deleted file mode 100644
index 69c78a5ffb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_entity_new.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 f2c0a6c6ea..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 52a7fab8db..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/details_entitymappings.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/details_entitymappings.png
deleted file mode 100644
index 5bd48850fd..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/entering_query_new.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/entering_query_new.png
deleted file mode 100644
index 98ec0ac5b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/entering_query_new.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_entities.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/generate_entities.png
deleted file mode 100644
index e3cb22b69a..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/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 a9d721fcc4..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 ff7eaa63b0..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/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 d264d09639..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 fb3d1b263f..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 7a653db355..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 6ef54378f0..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/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 d7ffcdcad9..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 61e71bdac8..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/open_persistence_editor.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/open_persistence_editor.png
deleted file mode 100644
index 56911fe5a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/open_persistence_editor.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_editor_new.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_editor_new.png
deleted file mode 100644
index 6aefae4bab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_editor_new.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/persistence_xml_editor.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_xml_editor.png
deleted file mode 100644
index b14dc15936..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_xml_editor.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 8f6310c59f..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 c7c066427e..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 e6a9159fd8..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 8862770ac0..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/synchornize_classes.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/synchornize_classes.png
deleted file mode 100644
index bede63b968..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_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 98ec0ac5b0..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/index.xml b/jpa/plugins/org.eclipse.jpt.doc.user/index.xml
deleted file mode 100644
index 023c49b07f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/index.xml
+++ /dev/null
@@ -1,544 +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#sthref99" /></entry>
- </entry>
- <entry keyword="@Column">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref193" /></entry>
- </entry>
- <entry keyword="@DiscriminatorColumn">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref83" /></entry>
- </entry>
- <entry keyword="@DiscriminatorValue">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref85" /></entry>
- </entry>
- <entry keyword="@Embeddable">
- <entry keyword="Embeddable"><topic href="tasks007.htm#sthref68" /></entry>
- </entry>
- <entry keyword="@Embedded">
- <entry keyword="Embedded mapping"><topic href="tasks011.htm#sthref103" /></entry>
- </entry>
- <entry keyword="@EmbeddedId">
- <entry keyword="Embedded ID mapping"><topic href="tasks012.htm#sthref107" /></entry>
- </entry>
- <entry keyword="@Entity">
- <entry keyword="Entity"><topic href="tasks006.htm#sthref61" /></entry>
- </entry>
- <entry keyword="@Enumerated">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref203" /></entry>
- </entry>
- <entry keyword="@GeneratedValue">
- <entry keyword="Primary Key Generation information"><topic href="ref_primary_key.htm#sthref211" /></entry>
- </entry>
- <entry keyword="@Id">
- <entry keyword="ID mapping"><topic href="tasks013.htm#sthref111" /></entry>
- </entry>
- <entry keyword="@Inheritance">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref81" /></entry>
- </entry>
- <entry keyword="@JoinColumn">
- <entry keyword="Many-to-one mapping"><topic href="tasks015.htm#sthref122" /></entry>
- <entry keyword="One-to-one mapping"><topic href="tasks017.htm#sthref132" /></entry>
- <entry keyword="Join Table Information"><topic href="reference014.htm#sthref208" /></entry>
- <entry keyword="Join Columns Information"><topic href="reference015.htm#sthref210" /></entry>
- </entry>
- <entry keyword="@Lob">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref198" /></entry>
- </entry>
- <entry keyword="@ManyToMany">
- <entry keyword="Many-to-many mapping"><topic href="tasks014.htm#sthref115" /></entry>
- </entry>
- <entry keyword="@ManyToOne">
- <entry keyword="Many-to-one mapping"><topic href="tasks015.htm#sthref120" /></entry>
- </entry>
- <entry keyword="@MappedSuperclass">
- <entry keyword="Mapped superclass"><topic href="tasks008.htm#sthref75" /></entry>
- </entry>
- <entry keyword="@NamedQuery">
- <entry keyword="Creating Named Queries"><topic href="tasks009.htm#sthref95" /></entry>
- </entry>
- <entry keyword="@OneToMany">
- <entry keyword="One-to-many mapping"><topic href="tasks016.htm#sthref125" /></entry>
- </entry>
- <entry keyword="@OneToOne">
- <entry keyword="One-to-one mapping"><topic href="tasks017.htm#sthref129" /></entry>
- </entry>
- <entry keyword="@OrderBy">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref206" /></entry>
- </entry>
- <entry keyword="@SequenceGenerator">
- <entry keyword="Primary Key Generation information"><topic href="ref_primary_key.htm#sthref213" /></entry>
- </entry>
- <entry keyword="@Temporal">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref200" /></entry>
- </entry>
- <entry keyword="@Transient">
- <entry keyword="Transient mapping"><topic href="tasks018.htm#sthref135" /></entry>
- </entry>
- <entry keyword="@Version">
- <entry keyword="Version mapping"><topic href="tasks019.htm#sthref139" /></entry>
- </entry>
- <entry keyword="architecture of Dali feature">
- <entry keyword="Dali Developer Documentation"><topic href="reference034.htm#sthref247" /></entry>
- </entry>
- <entry keyword="attribute overrides">
- <entry keyword="Attribute overrides"><topic href="reference010.htm#sthref180" /></entry>
- </entry>
- <entry keyword="Attribute Overrides - in Java Details view">
- <entry keyword="Attribute overrides"><topic href="reference010.htm#sthref182" /></entry>
- </entry>
- <entry keyword="attributes">
- <entry keyword="JPA Details view">
- <entry keyword="JPA Details view (for attributes)"><topic href="ref_persistence_map_view.htm#sthref192" /></entry>
- </entry>
- <entry keyword="mapping">
- <entry keyword="Understanding OR mappings"><topic href="concept_mapping.htm#sthref20" /></entry>
- </entry>
- </entry>
- <entry keyword="basic mapping">
- <entry keyword="@Basic">
- <entry keyword="Basic mapping"><topic href="tasks010.htm#sthref100" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Basic mapping"><topic href="tasks010.htm#sthref98" /></entry>
- </entry>
- <entry keyword="(See also mappings)"></entry>
- </entry>
- <entry keyword="classes">
- <entry keyword="adding persistence to">
- <entry keyword="Adding persistence to a class"><topic href="task_add_persistence.htm#sthref56" /></entry>
- </entry>
- <entry keyword="embeddable">
- <entry keyword="Embeddable"><topic href="tasks007.htm#sthref67" /></entry>
- </entry>
- <entry keyword="entity">
- <entry keyword="Entity"><topic href="tasks006.htm#sthref59" /></entry>
- </entry>
- <entry keyword="mapped superclass">
- <entry keyword="Mapped superclass"><topic href="tasks008.htm#sthref73" /></entry>
- </entry>
- <entry keyword="synchronizing">
- <entry keyword="Synchronizing classes"><topic href="tasks003.htm#sthref43" /></entry>
- </entry>
- </entry>
- <entry keyword="columns">
- <entry keyword="discriminator">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref84" /></entry>
- </entry>
- <entry keyword="join">
- <entry keyword="Many-to-one mapping"><topic href="tasks015.htm#sthref121" /></entry>
- <entry keyword="One-to-one mapping"><topic href="tasks017.htm#sthref131" /></entry>
- <entry keyword="Join Table Information"><topic href="reference014.htm#sthref207" /></entry>
- <entry keyword="Join Columns Information"><topic href="reference015.htm#sthref209" /></entry>
- </entry>
- <entry keyword="mapping to">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref194" /></entry>
- </entry>
- <entry keyword="value">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref86" /></entry>
- </entry>
- </entry>
- <entry keyword="database tables">
- <entry keyword="generating entities from">
- <entry keyword="Generating entities from tables"><topic href="tasks020.htm#sthref145" /></entry>
- </entry>
- </entry>
- <entry keyword="database - persistence">
- <entry keyword="connection">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref236" /></entry>
- </entry>
- <entry keyword="schema">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref238" /></entry>
- </entry>
- </entry>
- <entry keyword="developer documentation - Dali">
- <entry keyword="Dali Developer Documentation"><topic href="reference034.htm#sthref246" /></entry>
- </entry>
- <entry keyword="eager fetch">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref196" /></entry>
- </entry>
- <entry keyword="embeddable class">
- <entry keyword="@Embeddable">
- <entry keyword="Embeddable"><topic href="tasks007.htm#sthref69" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Embeddable"><topic href="tasks007.htm#sthref66" /></entry>
- </entry>
- </entry>
- <entry keyword="embedded ID mapping">
- <entry keyword="@EmbeddedId">
- <entry keyword="Embedded ID mapping"><topic href="tasks012.htm#sthref108" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Embedded ID mapping"><topic href="tasks012.htm#sthref106" /></entry>
- </entry>
- </entry>
- <entry keyword="embedded mapping">
- <entry keyword="@Embedded">
- <entry keyword="Embedded mapping"><topic href="tasks011.htm#sthref104" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Embedded mapping"><topic href="tasks011.htm#sthref102" /></entry>
- </entry>
- </entry>
- <entry keyword="entities">
- <entry keyword="@Entity annotation">
- <entry keyword="Entity"><topic href="tasks006.htm#sthref62" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Understanding Java persistence"><topic href="concept_persistence.htm#sthref19" /></entry>
- </entry>
- <entry keyword="creating">
- <entry keyword="Creating a JPA Entity"><topic href="tasks001.htm#sthref30" /></entry>
- </entry>
- <entry keyword="embeddable">
- <entry keyword="Embeddable"><topic href="tasks007.htm#sthref70" /></entry>
- </entry>
- <entry keyword="from tables">
- <entry keyword="Generating entities from tables"><topic href="tasks020.htm#sthref141" /></entry>
- <entry keyword="Generate Entities from Tables dialog"><topic href="task_generate_entities.htm#sthref242" /></entry>
- </entry>
- <entry keyword="JPA Details view">
- <entry keyword="JPA Details view (for entities)"><topic href="ref_persistence_prop_view.htm#sthref179" /></entry>
- </entry>
- <entry keyword="mapped superclass">
- <entry keyword="Mapped superclass"><topic href="tasks008.htm#sthref76" /></entry>
- </entry>
- <entry keyword="mapping">
- <entry keyword="Creating a Java persistent entity with persistent fields"><topic href="getting_started004.htm#sthref12" /></entry>
- </entry>
- <entry keyword="persistence">
- <entry keyword="Creating a Java persistent entity with persistent fields"><topic href="getting_started004.htm#sthref10" /></entry>
- </entry>
- <entry keyword="persistent">
- <entry keyword="Entity"><topic href="tasks006.htm#sthref57" /></entry>
- <entry keyword="Entity"><topic href="tasks006.htm#sthref63" /></entry>
- </entry>
- <entry keyword="secondary tables">
- <entry keyword="Secondary table information"><topic href="reference011.htm#sthref185" /></entry>
- </entry>
- </entry>
- <entry keyword="enumerated">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref202" /></entry>
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref204" /></entry>
- </entry>
- <entry keyword="error messages - Dali">
- <entry keyword="Validating mappings and reporting problems"><topic href="tasks022.htm#sthref146" /></entry>
- <entry keyword="Error messages"><topic href="tasks023.htm#sthref151" /></entry>
- </entry>
- <entry keyword="extension points - Dali feature">
- <entry keyword="Dali Developer Documentation"><topic href="reference034.htm#sthref248" /></entry>
- </entry>
- <entry keyword="fetch type">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref195" /></entry>
- </entry>
- <entry keyword="Generate Entities from Tables dialog">
- <entry keyword="Generating entities from tables"><topic href="tasks020.htm#sthref144" /></entry>
- <entry keyword="Generate Entities from Tables dialog"><topic href="task_generate_entities.htm#sthref241" /></entry>
- </entry>
- <entry keyword="generated values">
- <entry keyword="ID mappings">
- <entry keyword="Primary Key Generation information"><topic href="ref_primary_key.htm#sthref212" /></entry>
- </entry>
- <entry keyword="sequence">
- <entry keyword="Primary Key Generation information"><topic href="ref_primary_key.htm#sthref214" /></entry>
- </entry>
- </entry>
- <entry keyword="ID mapping">
- <entry keyword="@Id">
- <entry keyword="ID mapping"><topic href="tasks013.htm#sthref112" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="ID mapping"><topic href="tasks013.htm#sthref110" /></entry>
- </entry>
- </entry>
- <entry keyword="inheritance">
- <entry keyword="entity">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref80" /></entry>
- <entry keyword="Inheritance information"><topic href="reference012.htm#sthref188" /></entry>
- </entry>
- <entry keyword="joined tables">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref92" /></entry>
- </entry>
- <entry keyword="single table">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref87" /></entry>
- </entry>
- </entry>
- <entry keyword="Inheritance - in Java Details view">
- <entry keyword="Inheritance information"><topic href="reference012.htm#sthref187" /></entry>
- </entry>
- <entry keyword="installation - Dali">
- <entry keyword="Requirements and installation"><topic href="getting_started001.htm#sthref3" /></entry>
- </entry>
- <entry keyword="joined tables - inheritance">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref93" /></entry>
- </entry>
- <entry keyword="JPA Details view">
- <entry keyword="attributes">
- <entry keyword="JPA Details view (for attributes)"><topic href="ref_persistence_map_view.htm#sthref190" /></entry>
- </entry>
- <entry keyword="entities">
- <entry keyword="JPA Details view (for entities)"><topic href="ref_persistence_prop_view.htm#sthref177" /></entry>
- </entry>
- </entry>
- <entry keyword="JPA Development perspective">
- <entry keyword="JPA Development perspective"><topic href="ref_persistence_perspective.htm#sthref244" /></entry>
- </entry>
- <entry keyword="JPA project">
- <entry keyword="creating new">
- <entry keyword="Creating a new JPA project"><topic href="task_create_new_project.htm#sthref26" /></entry>
- </entry>
- <entry keyword="platform">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref235" /></entry>
- </entry>
- </entry>
- <entry keyword="JPA Structure view">
- <entry keyword="JPA Structure view"><topic href="ref_persistence_outline.htm#sthref216" /></entry>
- </entry>
- <entry keyword="lazy fetch">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref197" /></entry>
- </entry>
- <entry keyword="many-to-many mapping">
- <entry keyword="@ManyToMany">
- <entry keyword="Many-to-many mapping"><topic href="tasks014.htm#sthref116" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Many-to-many mapping"><topic href="tasks014.htm#sthref114" /></entry>
- </entry>
- </entry>
- <entry keyword="many-to-one mapping">
- <entry keyword="@ManyToOne">
- <entry keyword="Many-to-one mapping"><topic href="tasks015.htm#sthref119" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Many-to-one mapping"><topic href="tasks015.htm#sthref118" /></entry>
- </entry>
- </entry>
- <entry keyword="mapped superclass">
- <entry keyword="@MappedSuperclass">
- <entry keyword="Mapped superclass"><topic href="tasks008.htm#sthref74" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Mapped superclass"><topic href="tasks008.htm#sthref72" /></entry>
- </entry>
- </entry>
- <entry keyword="mapping entities">
- <entry keyword="Creating a Java persistent entity with persistent fields"><topic href="getting_started004.htm#sthref11" /></entry>
- </entry>
- <entry keyword="mappings">
- <entry keyword="about">
- <entry keyword="Understanding OR mappings"><topic href="concept_mapping.htm#sthref21" /></entry>
- </entry>
- <entry keyword="basic">
- <entry keyword="Basic mapping"><topic href="tasks010.htm#sthref97" /></entry>
- </entry>
- <entry keyword="embedded">
- <entry keyword="Embedded mapping"><topic href="tasks011.htm#sthref101" /></entry>
- </entry>
- <entry keyword="embedded ID">
- <entry keyword="Embedded ID mapping"><topic href="tasks012.htm#sthref105" /></entry>
- </entry>
- <entry keyword="ID">
- <entry keyword="ID mapping"><topic href="tasks013.htm#sthref109" /></entry>
- </entry>
- <entry keyword="many-to-many">
- <entry keyword="Many-to-many mapping"><topic href="tasks014.htm#sthref113" /></entry>
- </entry>
- <entry keyword="many-to-one">
- <entry keyword="Many-to-one mapping"><topic href="tasks015.htm#sthref117" /></entry>
- </entry>
- <entry keyword="one-to-many">
- <entry keyword="One-to-many mapping"><topic href="tasks016.htm#sthref123" /></entry>
- </entry>
- <entry keyword="one-to-one">
- <entry keyword="One-to-one mapping"><topic href="tasks017.htm#sthref127" /></entry>
- </entry>
- <entry keyword="problems">
- <entry keyword="Validating mappings and reporting problems"><topic href="tasks022.htm#sthref149" /></entry>
- </entry>
- <entry keyword="transient">
- <entry keyword="Transient mapping"><topic href="tasks018.htm#sthref133" /></entry>
- </entry>
- <entry keyword="version">
- <entry keyword="Version mapping"><topic href="tasks019.htm#sthref137" /></entry>
- </entry>
- </entry>
- <entry keyword="named queries">
- <entry keyword="entity">
- <entry keyword="Creating Named Queries"><topic href="tasks009.htm#sthref94" /></entry>
- </entry>
- </entry>
- <entry keyword="nonpersistent">
- <entry keyword="classes">
- <entry keyword="Adding persistence to a class"><topic href="task_add_persistence.htm#sthref55" /></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#sthref126" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="One-to-many mapping"><topic href="tasks016.htm#sthref124" /></entry>
- </entry>
- </entry>
- <entry keyword="one-to-one mapping">
- <entry keyword="@OneToOne">
- <entry keyword="One-to-one mapping"><topic href="tasks017.htm#sthref130" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="One-to-one mapping"><topic href="tasks017.htm#sthref128" /></entry>
- </entry>
- </entry>
- <entry keyword="ordering">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref205" /></entry>
- </entry>
- <entry keyword="orm.xml file">
- <entry keyword="about">
- <entry keyword="The orm.xml file"><topic href="concepts003.htm#sthref23" /></entry>
- </entry>
- <entry keyword="managing">
- <entry keyword="Managing the orm.xml file"><topic href="task_manage_orm.htm#sthref46" /></entry>
- </entry>
- <entry keyword="sample">
- <entry keyword="Managing the orm.xml file"><topic href="task_manage_orm.htm#sthref47" /></entry>
- </entry>
- </entry>
- <entry keyword="overrides - JPA attributes">
- <entry keyword="Attribute overrides"><topic href="reference010.htm#sthref181" /></entry>
- </entry>
- <entry keyword="persistence">
- <entry keyword="about">
- <entry keyword="Understanding Java persistence"><topic href="concept_persistence.htm#sthref18" /></entry>
- </entry>
- <entry keyword="database connection">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref237" /></entry>
- </entry>
- <entry keyword="database schema">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref240" /></entry>
- </entry>
- <entry keyword="entity class">
- <entry keyword="Adding persistence to a class"><topic href="task_add_persistence.htm#sthref54" /></entry>
- </entry>
- <entry keyword="options">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref232" /></entry>
- </entry>
- </entry>
- <entry keyword="Persistence XML Editor">
- <entry keyword="Using the XML Editor to edit the persistence.xml file"><topic href="tasks002.htm#sthref40" /></entry>
- </entry>
- <entry keyword="persistence.xml file">
- <entry keyword="about">
- <entry keyword="The persistence.xml file"><topic href="concepts002.htm#sthref22" /></entry>
- </entry>
- <entry keyword="editor">
- <entry keyword="Using the XML Editor to edit the persistence.xml file"><topic href="tasks002.htm#sthref41" /></entry>
- </entry>
- <entry keyword="managing">
- <entry keyword="Managing the persistence.xml file"><topic href="task_manage_persistence.htm#sthref35" /></entry>
- <entry keyword="Using the XML Editor to edit the persistence.xml file"><topic href="tasks002.htm#sthref38" /></entry>
- <entry keyword="Working with orm.xml file"><topic href="tasks005.htm#sthref52" /></entry>
- </entry>
- <entry keyword="sample">
- <entry keyword="Managing the persistence.xml file"><topic href="task_manage_persistence.htm#sthref36" /></entry>
- </entry>
- <entry keyword="synchronizing with classes">
- <entry keyword="Synchronizing classes"><topic href="tasks003.htm#sthref44" /></entry>
- </entry>
- </entry>
- <entry keyword="persistent entity">
- <entry keyword="Entity"><topic href="tasks006.htm#sthref58" /></entry>
- </entry>
- <entry keyword="perspective - JPA Development">
- <entry keyword="JPA Development perspective"><topic href="ref_persistence_perspective.htm#sthref245" /></entry>
- </entry>
- <entry keyword="platform - JPA">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref234" /></entry>
- </entry>
- <entry keyword="problems">
- <entry keyword="Validating mappings and reporting problems"><topic href="tasks022.htm#sthref148" /></entry>
- </entry>
- <entry keyword="projects - JPA">
- <entry keyword="creating new">
- <entry keyword="Creating a new JPA project"><topic href="getting_started003.htm#sthref8" /></entry>
- <entry keyword="Creating a new JPA project"><topic href="task_create_new_project.htm#sthref25" /></entry>
- </entry>
- <entry keyword="options">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref233" /></entry>
- </entry>
- </entry>
- <entry keyword="quick start - Dali">
- <entry keyword="Dali quick start"><topic href="getting_started002.htm#sthref7" /></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#sthref60" /></entry>
- </entry>
- </entry>
- <entry keyword="schema - database">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref239" /></entry>
- </entry>
- <entry keyword="secondary tables">
- <entry keyword="Secondary table information"><topic href="reference011.htm#sthref183" /></entry>
- </entry>
- <entry keyword="Secondary Tables - in Java Details view">
- <entry keyword="Secondary table information"><topic href="reference011.htm#sthref186" /></entry>
- </entry>
- <entry keyword="single table inheritance">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref88" /></entry>
- </entry>
- <entry keyword="superclass">
- <entry keyword="Mapped superclass"><topic href="tasks008.htm#sthref77" /></entry>
- </entry>
- <entry keyword="tables">
- <entry keyword="creating entities from">
- <entry keyword="Generating entities from tables"><topic href="tasks020.htm#sthref142" /></entry>
- <entry keyword="Generate Entities from Tables dialog"><topic href="task_generate_entities.htm#sthref243" /></entry>
- </entry>
- <entry keyword="inheritance">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref89" /></entry>
- </entry>
- <entry keyword="secondary">
- <entry keyword="Secondary table information"><topic href="reference011.htm#sthref184" /></entry>
- </entry>
- </entry>
- <entry keyword="temporal">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref199" /></entry>
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref201" /></entry>
- </entry>
- <entry keyword="transient mapping">
- <entry keyword="@Transient">
- <entry keyword="Transient mapping"><topic href="tasks018.htm#sthref136" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Transient mapping"><topic href="tasks018.htm#sthref134" /></entry>
- </entry>
- </entry>
- <entry keyword="version mapping">
- <entry keyword="@Version">
- <entry keyword="Version mapping"><topic href="tasks019.htm#sthref140" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Version mapping"><topic href="tasks019.htm#sthref138" /></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#sthref178" /></entry>
- <entry keyword="JPA Details view (for attributes)"><topic href="ref_persistence_map_view.htm#sthref191" /></entry>
- </entry>
- <entry keyword="JPA Structure view">
- <entry keyword="JPA Structure view"><topic href="ref_persistence_outline.htm#sthref215" /></entry>
- </entry>
- </entry>
- <entry keyword="warning messages - Dali">
- <entry keyword="Validating mappings and reporting problems"><topic href="tasks022.htm#sthref147" /></entry>
- </entry>
- <entry keyword="XML editor">
- <entry keyword="Using the XML Editor to edit the persistence.xml file"><topic href="tasks002.htm#sthref37" /></entry>
- <entry keyword="Working with orm.xml file"><topic href="tasks005.htm#sthref51" /></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 25a99e40e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/legal.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>
-<!-- Run date = July 23, 2008 8:59:55 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Legal</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Legal" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="sthref256" name="sthref256"></a></p>
-<h1>Legal</h1>
-<p>Copyright &copy; 2006, 2008, 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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 865c0824a8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/plugin.properties
+++ /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
-###############################################################################
-# ====================================================================
-# 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 Documentation - Doc
-providerName = Eclipse.org
-
-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 2f308f3991..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 name="JPA Documentation Plug-in" id="org.eclipse.jpt.doc.user" version="2.0.0" provider-name="Oracle">
- <!-- =========== -->
- <!-- 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_details_orm.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_details_orm.htm
deleted file mode 100644
index cdda46b2ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_details_orm.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>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>JPA Details view (for orm.xml)</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Details view (for orm.xml)" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="reference016.htm#CACCACGH">General information</a></p>
-</li>
-<li>
-<p><a href="reference017.htm#CACEAGBG">Persistence Unit information</a></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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</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 88c5595061..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_jpa_facet.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>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>JPA Facet page</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Facet page" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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">
-<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">Platform</td>
-<td align="left" headers="r2c1-t3 r1c2-t3">Vendor-specific JPA implementation.</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">Connection</td>
-<td align="left" headers="r3c1-t3 r1c2-t3">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="r3c1-t3 r1c3-t3"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t3" headers="r1c1-t3">&nbsp;&nbsp;Override default schema from connection</td>
-<td align="left" headers="r4c1-t3 r1c2-t3">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="r4c1-t3 r1c3-t3">The value calculated by Dali.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t3" headers="r1c1-t3">JPA Implementation</td>
-<td align="left" headers="r5c1-t3 r1c2-t3">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>
-</td>
-<td align="left" headers="r5c1-t3 r1c3-t3">Determined by server.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t3" headers="r1c1-t3">Persistent class management</td>
-<td align="left" headers="r6c1-t3 r1c2-t3">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="r6c1-t3 r1c3-t3">Determined by server.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t3" headers="r1c1-t3">Create orm.xml</td>
-<td align="left" headers="r7c1-t3 r1c2-t3">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="r7c1-t3 r1c3-t3">Selected</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" --></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 df8834cfb4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_mapping_general.htm
+++ /dev/null
@@ -1,261 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:50 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>General information</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="General information" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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">
-<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>
-<th align="left" valign="bottom" id="r1c3-t10">Default</th>
-<th align="left" valign="bottom" id="r1c4-t10">Available for Mapping Type</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t10" headers="r1c1-t10">Mapping Type Hyperlink</td>
-<td align="left" headers="r2c1-t10 r1c2-t10">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-t10 r1c3-t10">Basic</td>
-<td align="left" headers="r2c1-t10 r1c4-t10">All mapping types</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t10" headers="r1c1-t10"><a id="CACGCBHB" name="CACGCBHB"></a>Column</td>
-<td align="left" headers="r3c1-t10 r1c2-t10"><a id="sthref193" name="sthref193"></a><a id="sthref194" name="sthref194"></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-t10 r1c3-t10">By default, the Column is assumed to be named identically to the attribute.</td>
-<td align="left" headers="r3c1-t10 r1c4-t10"><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-t10" headers="r1c1-t10">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r4c1-t10 r1c2-t10">Name of the database column.
-<p>This field corresponds to the <code>@Column</code> annotation.</p>
-</td>
-<td align="left" headers="r4c1-t10 r1c3-t10"><br /></td>
-<td align="left" headers="r4c1-t10 r1c4-t10"><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-t10" headers="r1c1-t10">&nbsp;&nbsp;Table</td>
-<td align="left" headers="r5c1-t10 r1c2-t10">Name of the database table that contains the selected column.</td>
-<td align="left" headers="r5c1-t10 r1c3-t10"><br /></td>
-<td align="left" headers="r5c1-t10 r1c4-t10"><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-t10" headers="r1c1-t10">&nbsp;&nbsp;Insertable</td>
-<td align="left" headers="r6c1-t10 r1c2-t10">Specifies if the column is always included in <code>SQL INSERT</code> statements.</td>
-<td align="left" headers="r6c1-t10 r1c3-t10">True</td>
-<td align="left" headers="r6c1-t10 r1c4-t10"><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-t10" headers="r1c1-t10">&nbsp;&nbsp;Updatable</td>
-<td align="left" headers="r7c1-t10 r1c2-t10">Specifies if this column is always included in <code>SQL UPDATE</code> statements.</td>
-<td align="left" headers="r7c1-t10 r1c3-t10">True</td>
-<td align="left" headers="r7c1-t10 r1c4-t10"><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-t10" headers="r1c1-t10">&nbsp;&nbsp;Unique</td>
-<td align="left" headers="r8c1-t10 r1c2-t10">Sets the <code>UNIQUE</code> constraint for the column.</td>
-<td align="left" headers="r8c1-t10 r1c3-t10">False</td>
-<td align="left" headers="r8c1-t10 r1c4-t10"><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-t10" headers="r1c1-t10">&nbsp;&nbsp;Nullable</td>
-<td align="left" headers="r9c1-t10 r1c2-t10">Specifies if the column allows null values.</td>
-<td align="left" headers="r9c1-t10 r1c3-t10">True</td>
-<td align="left" headers="r9c1-t10 r1c4-t10"><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-t10" headers="r1c1-t10">&nbsp;&nbsp;Length</td>
-<td align="left" headers="r10c1-t10 r1c2-t10">Sets the column length.</td>
-<td align="left" headers="r10c1-t10 r1c3-t10">255</td>
-<td align="left" headers="r10c1-t10 r1c4-t10"><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-t10" headers="r1c1-t10">&nbsp;&nbsp;Precision</td>
-<td align="left" headers="r11c1-t10 r1c2-t10">Sets the precision for the column values.</td>
-<td align="left" headers="r11c1-t10 r1c3-t10">0</td>
-<td align="left" headers="r11c1-t10 r1c4-t10"><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-t10" headers="r1c1-t10">&nbsp;&nbsp;Scale</td>
-<td align="left" headers="r12c1-t10 r1c2-t10">Sets the number of digits that appear to the right of the decimal point.</td>
-<td align="left" headers="r12c1-t10 r1c3-t10">0</td>
-<td align="left" headers="r12c1-t10 r1c4-t10"><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-t10" headers="r1c1-t10">&nbsp;&nbsp;Column Definition</td>
-<td align="left" headers="r13c1-t10 r1c2-t10">Define the DDL for a column. This is used when a table is being generated.</td>
-<td align="left" headers="r13c1-t10 r1c3-t10"><br /></td>
-<td align="left" headers="r13c1-t10 r1c4-t10"><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-t10" headers="r1c1-t10"><a id="CACGGGHB" name="CACGGGHB"></a><a id="sthref195" name="sthref195"></a><a id="sthref196" name="sthref196"></a><a id="sthref197" name="sthref197"></a>Fetch Type</td>
-<td align="left" headers="r14c1-t10 r1c2-t10">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-t10 r1c3-t10">Eager</td>
-<td align="left" headers="r14c1-t10 r1c4-t10"><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-t10" headers="r1c1-t10">Optional</td>
-<td align="left" headers="r15c1-t10 r1c2-t10">Specifies if this field is can be null.</td>
-<td align="left" headers="r15c1-t10 r1c3-t10">Yes</td>
-<td align="left" headers="r15c1-t10 r1c4-t10"><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-t10" headers="r1c1-t10"><a id="CACBBIBI" name="CACBBIBI"></a><a id="sthref198" name="sthref198"></a>Lob</td>
-<td align="left" headers="r16c1-t10 r1c2-t10">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-t10 r1c3-t10"><br /></td>
-<td align="left" headers="r16c1-t10 r1c4-t10"><a href="tasks010.htm#BABBABCE">Basic mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r17c1-t10" headers="r1c1-t10"><a id="CACEAJGD" name="CACEAJGD"></a><a id="sthref199" name="sthref199"></a><a id="sthref200" name="sthref200"></a><a id="sthref201" name="sthref201"></a>Temporal</td>
-<td align="left" headers="r17c1-t10 r1c2-t10">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-t10 r1c3-t10"><br /></td>
-<td align="left" headers="r17c1-t10 r1c4-t10"><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-t10" headers="r1c1-t10"><a id="sthref202" name="sthref202"></a><a id="sthref203" name="sthref203"></a><a id="sthref204" name="sthref204"></a>Enumerated</td>
-<td align="left" headers="r18c1-t10 r1c2-t10">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-t10 r1c3-t10">Ordinal</td>
-<td align="left" headers="r18c1-t10 r1c4-t10"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r19c1-t10" headers="r1c1-t10">Target Entity</td>
-<td align="left" headers="r19c1-t10 r1c2-t10">The persistent entity to which the attribute is mapped.</td>
-<td align="left" headers="r19c1-t10 r1c3-t10"><br /></td>
-<td align="left" headers="r19c1-t10 r1c4-t10"><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-t10" headers="r1c1-t10"><a id="CACJAIHB" name="CACJAIHB"></a>Cascade Type</td>
-<td align="left" headers="r20c1-t10 r1c2-t10">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="r20c1-t10 r1c3-t10"><br /></td>
-<td align="left" headers="r20c1-t10 r1c4-t10"><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="r21c1-t10" headers="r1c1-t10"><a id="CACJDJJA" name="CACJDJJA"></a>Mapped By</td>
-<td align="left" headers="r21c1-t10 r1c2-t10">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="r21c1-t10 r1c3-t10"><br /></td>
-<td align="left" headers="r21c1-t10 r1c4-t10"><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="r22c1-t10" headers="r1c1-t10"><a id="CACDADIH" name="CACDADIH"></a><a id="sthref205" name="sthref205"></a><a id="sthref206" name="sthref206"></a>Order By</td>
-<td align="left" headers="r22c1-t10 r1c2-t10">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="r22c1-t10 r1c3-t10">Primary key</td>
-<td align="left" headers="r22c1-t10 r1c4-t10"><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="r23c1-t10" headers="r1c1-t10">Attribute Overrides</td>
-<td align="left" headers="r23c1-t10 r1c2-t10">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="r23c1-t10 r1c3-t10"><br /></td>
-<td align="left" headers="r23c1-t10 r1c4-t10"><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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 36e6f539f5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project.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>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>New JPA Project page</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="New JPA Project page" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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">
-<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>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" --></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 bfb014e70e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project_wizard.htm
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Create New JPA Project wizard</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Create New JPA Project wizard" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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>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_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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</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 aba760059b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_map_view.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>
-<!-- Run date = July 23, 2008 8:59:50 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>JPA Details view (for attributes)</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Details view (for attributes)" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref190" name="sthref190"></a><a id="sthref191" name="sthref191"></a><a id="sthref192" name="sthref192"></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="reference014.htm#CACBAEBC">Join Table Information</a></p>
-</li>
-<li>
-<p><a href="reference015.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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 11fa6b2224..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_outline.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>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>JPA Structure view</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Structure view" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref215" name="sthref215"></a><a id="sthref216" name="sthref216"></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="sthref217" name="sthref217"></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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 7099087ada..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_perspective.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>
-<!-- Run date = July 23, 2008 8:59:52 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>JPA Development perspective</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Development perspective" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref244" name="sthref244"></a><a id="sthref245" name="sthref245"></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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 d7a07c83d5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_prop_view.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>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>JPA Details view (for entities)</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Details view (for entities)" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref177" name="sthref177"></a><a id="sthref178" name="sthref178"></a><a id="sthref179" name="sthref179"></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="reference009.htm#CACCAGGC">General information</a></p>
-</li>
-<li>
-<p><a href="reference010.htm#CACIJBGH">Attribute overrides</a></p>
-</li>
-<li>
-<p><a href="reference011.htm#CACBHIDA">Secondary table information</a></p>
-</li>
-<li>
-<p><a href="reference012.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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 c98a548484..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_primary_key.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>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Primary Key Generation information</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Primary Key Generation information" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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">
-<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="CACBAJBC" name="CACBAJBC"></a>Primary Key Generation</td>
-<td align="left" headers="r2c1-t13 r1c2-t13"><a id="sthref211" name="sthref211"></a><a id="sthref212" name="sthref212"></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-t13 r1c3-t13">Generated Value</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t13" headers="r1c1-t13"><a id="CACJEEEC" name="CACJEEEC"></a>&nbsp;&nbsp;&nbsp;Strategy</td>
-<td align="left" headers="r3c1-t13 r1c2-t13">
-<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-t13 r1c3-t13">Auto</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t13" headers="r1c1-t13"><a id="BABEEAHJ" name="BABEEAHJ"></a>&nbsp;&nbsp;Generator Name</td>
-<td align="left" headers="r4c1-t13 r1c2-t13">Unique name of the generated value.</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"><a id="CACGFEAH" name="CACGFEAH"></a>Table Generator</td>
-<td align="left" headers="r5c1-t13 r1c2-t13">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-t13 r1c3-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t13" headers="r1c1-t13">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r6c1-t13 r1c2-t13">Unique name of the generator.</td>
-<td align="left" headers="r6c1-t13 r1c3-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t13" headers="r1c1-t13">&nbsp;&nbsp;Table</td>
-<td align="left" headers="r7c1-t13 r1c2-t13">Database table that stores the generated ID values.</td>
-<td align="left" headers="r7c1-t13 r1c3-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t13" headers="r1c1-t13">&nbsp;&nbsp;Primary Key Column</td>
-<td align="left" headers="r8c1-t13 r1c2-t13">The column in the table generator's <span class="bold">Table</span> that contains the primary key.</td>
-<td align="left" headers="r8c1-t13 r1c3-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t13" headers="r1c1-t13">&nbsp;&nbsp;Value Column</td>
-<td align="left" headers="r9c1-t13 r1c2-t13">The column that stores the generated ID values.</td>
-<td align="left" headers="r9c1-t13 r1c3-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t13" headers="r1c1-t13">&nbsp;&nbsp;Primary Key Column Value</td>
-<td align="left" headers="r10c1-t13 r1c2-t13">The value for the <span class="bold">Primary Key Column</span> in the generator table.</td>
-<td align="left" headers="r10c1-t13 r1c3-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r11c1-t13" headers="r1c1-t13"><a id="CACFFHEH" name="CACFFHEH"></a>Sequence&nbsp;Generator</td>
-<td align="left" headers="r11c1-t13 r1c2-t13"><a id="sthref213" name="sthref213"></a><a id="sthref214" name="sthref214"></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-t13 r1c3-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r12c1-t13" headers="r1c1-t13">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r12c1-t13 r1c2-t13">Name of the sequence table to use for defining primary key values.</td>
-<td align="left" headers="r12c1-t13 r1c3-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r13c1-t13" headers="r1c1-t13">&nbsp;&nbsp;Sequence</td>
-<td align="left" headers="r13c1-t13 r1c2-t13">Unique name of the sequence.</td>
-<td align="left" headers="r13c1-t13 r1c3-t13"><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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 0fd473e54b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_project_properties.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>
-<!-- Run date = July 23, 2008 8:59:52 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Project Properties page - JPA Options</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Project Properties page - JPA Options" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABJHBCI" name="BABJHBCI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Project Properties page &ndash; JPA Options</h1>
-<p><a id="sthref232" name="sthref232"></a><a id="sthref233" name="sthref233"></a>Use the <span class="gui-object-title">JPA</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">
-<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>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t28" headers="r1c1-t28"><a id="sthref234" name="sthref234"></a><a id="sthref235" name="sthref235"></a><a id="sthref236" name="sthref236"></a><a id="sthref237" name="sthref237"></a>Platform</td>
-<td align="left" headers="r2c1-t28 r1c2-t28">Select the vendor-specific platform.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t28" headers="r1c1-t28"><a id="sthref238" name="sthref238"></a><a id="sthref239" name="sthref239"></a><a id="sthref240" name="sthref240"></a>Connection</td>
-<td align="left" headers="r3c1-t28 r1c2-t28">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="r4c1-t28" headers="r1c1-t28">&nbsp;&nbsp;Override default schema from connection</td>
-<td align="left" headers="r4c1-t28 r1c2-t28">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="r5c1-t28" headers="r1c1-t28">Persistent Class Management</td>
-<td align="left" headers="r5c1-t28 r1c2-t28">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>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks025.htm#BABDBCBI">Modifying persistent project properties</a></div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 ccf4052c61..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference.htm
+++ /dev/null
@@ -1,59 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Reference</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Reference" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="sthref168" name="sthref168"></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="reference008.htm#CACDJIIG">Property pages</a></p>
-</li>
-<li>
-<p><a href="reference028.htm#CACDEIEE">Preferences</a></p>
-</li>
-<li>
-<p><a href="reference029.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="reference031.htm#CACDHCIA">Icons and buttons</a></p>
-</li>
-<li>
-<p><a href="reference034.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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 0c326d1c60..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference001.htm
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Wizards</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Wizards" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="reference002.htm#CIAGGGDF">Create JPA Entity wizard</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 55322e391c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference002.htm
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Create JPA Entity wizard</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Create JPA Entity wizard" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="reference003.htm#CIAFEIGF">Entity Class page</a></p>
-</li>
-<li>
-<p><a href="reference004.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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 2cb08d872b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference003.htm
+++ /dev/null
@@ -1,131 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Entity Class page</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Entity Class page" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="reference002.htm#CIAGGGDF">Create JPA Entity wizard</a>.</p>
-<div class="tblformal"><a id="sthref169" name="sthref169"></a><a id="sthref170" name="sthref170"></a>
-<p class="titleintable">&nbsp;</p>
-<table class="Formal" title="" summary="This table describes the Entity Class page of the Create JPA Entities wizard." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<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">
-<p>Project</p>
-</td>
-<td align="left" headers="r2c1-t4 r1c2-t4">
-<p>The name of t he JPA project.</p>
-</td>
-<td align="left" headers="r2c1-t4 r1c3-t4"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t4" headers="r1c1-t4">
-<p>Source Folder</p>
-</td>
-<td align="left" headers="r3c1-t4 r1c2-t4">
-<p>The location of the JPA project's src folder.</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">
-<p>Java Package</p>
-</td>
-<td align="left" headers="r4c1-t4 r1c2-t4">
-<p>The name of the class package.</p>
-</td>
-<td align="left" headers="r4c1-t4 r1c3-t4"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t4" headers="r1c1-t4">
-<p>Class name</p>
-</td>
-<td align="left" headers="r5c1-t4 r1c2-t4">
-<p>The name of the Java class.</p>
-</td>
-<td align="left" headers="r5c1-t4 r1c3-t4"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t4" headers="r1c1-t4">
-<p>Superclass</p>
-</td>
-<td align="left" headers="r6c1-t4 r1c2-t4">
-<p>Select the superclass.</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">
-<p>Inheritance</p>
-</td>
-<td align="left" headers="r7c1-t4 r1c2-t4">
-<p>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>
-<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-t4 r1c3-t4">
-<p>Entity</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t4" headers="r1c1-t4">
-<p>XML Entity Mappings</p>
-</td>
-<td align="left" headers="r8c1-t4 r1c2-t4">
-<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>
-</td>
-<td align="left" headers="r8c1-t4 r1c3-t4"><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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 fd1b9996f5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference004.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>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Entity Properties page</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Entity Properties page" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="reference002.htm#CIAGGGDF">Create JPA Entity wizard</a>.</p>
-<div class="tblformal"><a id="sthref171" name="sthref171"></a><a id="sthref172" name="sthref172"></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">
-<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">
-<p>Entity Name</p>
-</td>
-<td align="left" headers="r2c1-t5 r1c2-t5">
-<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-t5 r1c3-t5">
-<p>Determined by server.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t5" headers="r1c1-t5">
-<p>Table Name</p>
-</td>
-<td align="left" headers="r3c1-t5 r1c2-t5">
-<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-t5 r1c3-t5">
-<p>Use default.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t5" headers="r1c1-t5">
-<p>Entity Fields</p>
-</td>
-<td align="left" headers="r4c1-t5 r1c2-t5">
-<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-t5 r1c3-t5"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t5" headers="r1c1-t5">
-<p>Access Type</p>
-</td>
-<td align="left" headers="r5c1-t5 r1c2-t5">
-<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-based</span> &ndash; Instance variables are accessed directly. All non-transient instance variables are persistent.</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>
-</ul>
-</td>
-<td align="left" headers="r5c1-t5 r1c3-t5">
-<p>Field-based</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="tasks001.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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 6bd404341b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference005.htm
+++ /dev/null
@@ -1,38 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Mapping File Wizard</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Mapping File Wizard" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 2028c23e2b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference006.htm
+++ /dev/null
@@ -1,119 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Mapping File Wizard</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Mapping File Wizard" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<div class="sect3"><!-- infolevel="all" infotype="General" --><a id="sthref173" name="sthref173"></a>
-<h1>Mapping File</h1>
-<p>This table lists the properties of the <a href="reference005.htm#CIAIJCCE">Mapping File Wizard</a>.</p>
-<div class="tblformal"><a id="sthref174" name="sthref174"></a><a id="sthref175" name="sthref175"></a>
-<p class="titleintable">Mapping File Wizard Properties</p>
-<table class="Formal" title="Mapping File Wizard Properties" summary="" dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<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>Project</p>
-</td>
-<td align="left" headers="r2c1-t6 r1c2-t6">
-<p>The name of the JPA project.</p>
-</td>
-<td align="left" headers="r2c1-t6 r1c3-t6">
-<p>Selected.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t6" headers="r1c1-t6">
-<p>Source folder</p>
-</td>
-<td align="left" headers="r3c1-t6 r1c2-t6">
-<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-t6 r1c3-t6">
-<p>Selected.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t6" headers="r1c1-t6">
-<p>File Path</p>
-</td>
-<td align="left" headers="r4c1-t6 r1c2-t6">
-<p>The location for the new <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r4c1-t6 r1c3-t6">
-<p>Selected.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t6" headers="r1c1-t6">
-<p>Default Access</p>
-</td>
-<td align="left" headers="r5c1-t6 r1c2-t6">
-<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-t6 r1c3-t6">
-<p>None</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t6" headers="r1c1-t6">
-<p>Add to persistence unit</p>
-</td>
-<td align="left" headers="r6c1-t6 r1c2-t6">
-<p>Designates the persistence unit for this object map file.</p>
-</td>
-<td align="left" headers="r6c1-t6 r1c3-t6">
-<p>Selected.</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" --></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 de8a03ae2a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference007.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>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Mapping File Wizard Properties</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Mapping File Wizard Properties" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<div class="sect2"><!-- infolevel="all" infotype="General" --><a id="sthref176" name="sthref176"></a>
-<h1>Generate DDL from Entities Wizard</h1>
-<p>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>
-</div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 e1a36d01e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference008.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>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Property pages</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Property pages" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</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 f1b9b244be..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference009.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>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>General information</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="General information" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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">
-<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>
-<th align="left" valign="bottom" id="r1c4-t7">Available for Entity&nbsp;Type</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t7" headers="r1c1-t7">Mapping Type Hyperlink</td>
-<td align="left" headers="r2c1-t7 r1c2-t7">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-t7 r1c3-t7">Entity</td>
-<td align="left" headers="r2c1-t7 r1c4-t7"><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-t7" headers="r1c1-t7">Name</td>
-<td align="left" headers="r3c1-t7 r1c2-t7">The name of this entity. By default, the class name is used as the entity name.</td>
-<td align="left" headers="r3c1-t7 r1c3-t7"><br /></td>
-<td align="left" headers="r3c1-t7 r1c4-t7"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t7" headers="r1c1-t7">Table</td>
-<td align="left" headers="r4c1-t7 r1c2-t7">The default database table information for this entity. These fields can be overridden by the information in the <a href="reference010.htm#CACIJBGH">Attribute overrides</a> area.</td>
-<td align="left" headers="r4c1-t7 r1c3-t7"><br /></td>
-<td align="left" headers="r4c1-t7 r1c4-t7"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t7" headers="r1c1-t7">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r5c1-t7 r1c2-t7">The name of the primary database table associated with the entity.</td>
-<td align="left" headers="r5c1-t7 r1c3-t7"><br /></td>
-<td align="left" headers="r5c1-t7 r1c4-t7"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t7" headers="r1c1-t7">&nbsp;&nbsp;Catalog</td>
-<td align="left" headers="r6c1-t7 r1c2-t7">The database catalog that contains the <span class="bold">Table</span>.</td>
-<td align="left" headers="r6c1-t7 r1c3-t7">As defined in <code>orm.xml</code>.</td>
-<td align="left" headers="r6c1-t7 r1c4-t7"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t7" headers="r1c1-t7">&nbsp;&nbsp;Schema</td>
-<td align="left" headers="r7c1-t7 r1c2-t7">The database schema that contains the <span class="bold">Table</span>.</td>
-<td align="left" headers="r7c1-t7 r1c3-t7">As defined in <code>orm.xml</code>.</td>
-<td align="left" headers="r7c1-t7 r1c4-t7"><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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 21bdad0d62..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference010.htm
+++ /dev/null
@@ -1,75 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Attribute overrides</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Attribute overrides" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref180" name="sthref180"></a><a id="sthref181" name="sthref181"></a><a id="sthref182" name="sthref182"></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="reference009.htm#CACCAGGC">General information</a> area of an attribute. Attribute overrides generally override/configure attribtues 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">
-<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">Default</th>
-<th align="left" valign="bottom" id="r1c4-t8">Available for Entity&nbsp;Type</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t8" headers="r1c1-t8">Attribute Overrides</td>
-<td align="left" headers="r2c1-t8 r1c2-t8">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-t8 r1c3-t8"><br /></td>
-<td align="left" headers="r2c1-t8 r1c4-t8"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t8" headers="r1c1-t8">Join Columns</td>
-<td align="left" headers="r3c1-t8 r1c2-t8"><br /></td>
-<td align="left" headers="r3c1-t8 r1c3-t8"><br /></td>
-<td align="left" headers="r3c1-t8 r1c4-t8"><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="reference009.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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 ed5e368429..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference011.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>
-<!-- Run date = July 23, 2008 8:59:50 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Secondary table information</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Secondary table information" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref183" name="sthref183"></a><a id="sthref184" name="sthref184"></a><a id="sthref185" name="sthref185"></a><a id="sthref186" name="sthref186"></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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 544604dfb5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference012.htm
+++ /dev/null
@@ -1,100 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:50 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Inheritance information</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Inheritance information" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref187" name="sthref187"></a><a id="sthref188" name="sthref188"></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">
-<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>
-<th align="left" valign="bottom" id="r1c3-t9">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t9" headers="r1c1-t9">Strategy</td>
-<td align="left" headers="r2c1-t9 r1c2-t9">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>
-</td>
-<td align="left" headers="r2c1-t9 r1c3-t9">Single table</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t9" headers="r1c1-t9">Discriminator Column</td>
-<td align="left" headers="r3c1-t9 r1c2-t9">Use to specify the name of the discriminator column when using a <span class="bold">Single</span> or <span class="bold">Joined</span> inheritance strategy.</td>
-<td align="left" headers="r3c1-t9 r1c3-t9"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t9" headers="r1c1-t9">Discriminator Type</td>
-<td align="left" headers="r4c1-t9 r1c2-t9">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="r4c1-t9 r1c3-t9">String</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t9" headers="r1c1-t9">Discriminator Value</td>
-<td align="left" headers="r5c1-t9 r1c2-t9">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="r5c1-t9 r1c3-t9"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t9" headers="r1c1-t9">Primary Key Join Columns</td>
-<td align="left" headers="r6c1-t9 r1c2-t9">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="r6c1-t9 r1c3-t9"><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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 dd495829e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference013.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>
-<!-- Run date = July 23, 2008 8:59:50 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Inheritance information</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Inheritance information" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<div class="sect3"><!-- infolevel="all" infotype="General" --><a id="sthref189" name="sthref189"></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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 d19978121e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference014.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>
-<!-- Run date = July 23, 2008 8:59:50 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Join Table Information</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Join Table Information" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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">
-<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>
-<th align="left" valign="bottom" id="r1c3-t11">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t11" headers="r1c1-t11">Name</td>
-<td align="left" headers="r2c1-t11 r1c2-t11">Name of the join table that contains the foreign key column.</td>
-<td align="left" headers="r2c1-t11 r1c3-t11">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-t11" headers="r1c1-t11"><a id="CACBBDFG" name="CACBBDFG"></a>Join Columns</td>
-<td align="left" headers="r3c1-t11 r1c2-t11"><a id="sthref207" name="sthref207"></a><a id="sthref208" name="sthref208"></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-t11 r1c3-t11">By default, the mapping is assumed to have a single join.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t11" headers="r1c1-t11">Inverse Join Columns</td>
-<td align="left" headers="r4c1-t11 r1c2-t11">Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</td>
-<td align="left" headers="r4c1-t11 r1c3-t11"><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="reference030.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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 11e35fa477..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference015.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>
-<!-- Run date = July 23, 2008 8:59:50 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Join Columns Information</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Join Columns Information" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACFCEJC" name="CACFCEJC"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Join Columns Information</h1>
-<p>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">
-<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>
-<th align="left" valign="bottom" id="r1c3-t12">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t12" headers="r1c1-t12">Join Column</td>
-<td align="left" headers="r2c1-t12 r1c2-t12"><a id="sthref209" name="sthref209"></a><a id="sthref210" name="sthref210"></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-t12 r1c3-t12">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="reference030.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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 b938a47f57..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference016.htm
+++ /dev/null
@@ -1,94 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>General information</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="General information" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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">
-<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">Package</td>
-<td align="left" headers="r2c1-t14 r1c2-t14">The Java package that contains the persistent entities. Click <span class="bold">Browse</span> and select the package</td>
-<td align="left" headers="r2c1-t14 r1c3-t14"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t14" headers="r1c1-t14">Schema</td>
-<td align="left" headers="r3c1-t14 r1c2-t14">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-t14 r1c3-t14"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t14" headers="r1c1-t14">Catalog</td>
-<td align="left" headers="r4c1-t14 r1c2-t14">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-t14 r1c3-t14"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t14" headers="r1c1-t14">Access</td>
-<td align="left" headers="r5c1-t14 r1c2-t14">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-t14 r1c3-t14"><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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 e183172b5a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference017.htm
+++ /dev/null
@@ -1,103 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Persistence Unit information</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Persistence Unit information" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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">
-<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">XML Mapping Data Complete</td>
-<td align="left" headers="r2c1-t15 r1c2-t15">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-t15 r1c3-t15"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t15" headers="r1c1-t15">Schema</td>
-<td align="left" headers="r3c1-t15 r1c2-t15">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-t15 r1c3-t15"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t15" headers="r1c1-t15">Catalog</td>
-<td align="left" headers="r4c1-t15 r1c2-t15">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-t15 r1c3-t15"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t15" headers="r1c1-t15">Access Type</td>
-<td align="left" headers="r5c1-t15 r1c2-t15">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="r5c1-t15 r1c3-t15">Property</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t15" headers="r1c1-t15">Cascade Persist</td>
-<td align="left" headers="r6c1-t15 r1c2-t15">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="r6c1-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_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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 fbdbc4646d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference018.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>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>persistence.xml Editor</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="persistence.xml Editor" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="reference019.htm#CIACIFGJ">General</a></p>
-</li>
-<li>
-<p><a href="reference020.htm#CIAFFJIE">Connection</a></p>
-</li>
-<li>
-<p><a href="reference021.htm#CIAJAFEG">Customization</a></p>
-</li>
-<li>
-<p><a href="reference022.htm#CIABEDCH">Caching</a></p>
-</li>
-<li>
-<p><a href="reference023.htm#CIABGHHI">Logging</a></p>
-</li>
-<li>
-<p><a href="reference024.htm#CIAFJCHE">Options</a></p>
-</li>
-<li>
-<p><a href="reference025.htm#CIACCFCB">Schema Generation</a></p>
-</li>
-<li>
-<p><a href="reference026.htm#CIAHJDFF">Properties</a></p>
-</li>
-<li>
-<p><a href="reference027.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="reference019.htm#CIACIFGJ">General</a></p>
-</li>
-<li>
-<p><a href="reference020.htm#CIAFFJIE">Connection</a></p>
-</li>
-<li>
-<p><a href="reference026.htm#CIAHJDFF">Properties</a></p>
-</li>
-<li>
-<p><a href="reference027.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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</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 69660c6367..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference019.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>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>General</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="General" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="reference018.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div class="tblformal"><a id="sthref218" name="sthref218"></a><a id="sthref219" name="sthref219"></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">
-<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">
-<p>Name</p>
-</td>
-<td align="left" headers="r2c1-t16 r1c2-t16">
-<p>Enter the name of the persistence unit.</p>
-</td>
-<td align="left" headers="r2c1-t16 r1c3-t16">
-<p>The project name.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t16" headers="r1c1-t16">
-<p>Persistence Provider</p>
-</td>
-<td align="left" headers="r3c1-t16 r1c2-t16">
-<p>Enter the name of the persistence provider.</p>
-</td>
-<td align="left" headers="r3c1-t16 r1c3-t16">
-<p>Determined by the server.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t16" headers="r1c1-t16">
-<p>Description</p>
-</td>
-<td align="left" headers="r4c1-t16 r1c2-t16">
-<p>Enter a description for this persistence unit. This is an optional property.</p>
-</td>
-<td align="left" headers="r4c1-t16 r1c3-t16"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t16" headers="r1c1-t16">
-<p>Managed Classes</p>
-</td>
-<td align="left" headers="r5c1-t16 r1c2-t16">
-<p>Add or remove the classes managed through the persistence unit.</p>
-</td>
-<td align="left" headers="r5c1-t16 r1c3-t16"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t16" headers="r1c1-t16">
-<p>Exclude Unlisted Classes</p>
-</td>
-<td align="left" headers="r6c1-t16 r1c2-t16">
-<p>Select to include all annotated entity classes in the root of the persistence unit.</p>
-</td>
-<td align="left" headers="r6c1-t16 r1c3-t16">
-<p>False</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t16" headers="r1c1-t16">
-<p>XML Mapping Files</p>
-</td>
-<td align="left" headers="r7c1-t16 r1c2-t16">
-<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-t16 r1c3-t16">
-<p>Meta-INF\orm.xml</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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 672b473bea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference020.htm
+++ /dev/null
@@ -1,163 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Connection</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Connection" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="reference018.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div class="tblformal"><a id="sthref220" name="sthref220"></a><a id="sthref221" name="sthref221"></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">
-<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">
-<p>Transaction Type</p>
-</td>
-<td align="left" headers="r2c1-t17 r1c2-t17">
-<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-t17 r1c3-t17"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t17" headers="r1c1-t17">
-<p>Batch Writing</p>
-</td>
-<td align="left" headers="r3c1-t17 r1c2-t17">
-<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-t17 r1c3-t17">
-<p>None</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t17" headers="r1c1-t17">
-<p>JTA Data Source Name</p>
-</td>
-<td align="left" headers="r4c1-t17 r1c2-t17">
-<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="r4c1-t17 r1c3-t17"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t17" headers="r1c1-t17">
-<p>Non-JTA Data Source Name</p>
-</td>
-<td align="left" headers="r5c1-t17 r1c2-t17">
-<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="r5c1-t17 r1c3-t17"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t17" headers="r1c1-t17">
-<p>&nbsp;&nbsp;Bind Parameters</p>
-</td>
-<td align="left" headers="r6c1-t17 r1c2-t17">
-<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="r6c1-t17 r1c3-t17"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t17" headers="r1c1-t17">
-<p>EclipseLink Connection Pool</p>
-</td>
-<td align="left" headers="r7c1-t17 r1c2-t17">
-<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="r7c1-t17 r1c3-t17"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t17" headers="r1c1-t17">
-<p>&nbsp;&nbsp;Read Connection</p>
-</td>
-<td align="left" headers="r8c1-t17 r1c2-t17">
-<p>The maximum and minimum number of connections allowed in the JDBC read connection pool.</p>
-<p>Note: These properties 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="r8c1-t17 r1c3-t17"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t17" headers="r1c1-t17">
-<p>&nbsp;&nbsp;Write Connection</p>
-</td>
-<td align="left" headers="r9c1-t17 r1c2-t17">
-<p>The maximum and minimum number of connections allowed in the JDBC write connection pool.</p>
-<p>Note: These properties 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="r9c1-t17 r1c3-t17"><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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 395b15aec7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference021.htm
+++ /dev/null
@@ -1,153 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Customization</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Customization" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="reference018.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div class="tblformal"><a id="sthref222" name="sthref222"></a><a id="sthref223" name="sthref223"></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">
-<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">
-<p>Weaving</p>
-</td>
-<td align="left" headers="r2c1-t18 r1c2-t18">
-<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-t18 r1c3-t18">
-<p>Weave Dynamically</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t18" headers="r1c1-t18">
-<p>&nbsp;&nbsp;Weaving Lazy</p>
-</td>
-<td align="left" headers="r3c1-t18 r1c2-t18">
-<p>Select this optoin to enable lazy weaving.</p>
-</td>
-<td align="left" headers="r3c1-t18 r1c3-t18"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t18" headers="r1c1-t18">
-<p>&nbsp;&nbsp;Weaving Fetch Groups</p>
-</td>
-<td align="left" headers="r4c1-t18 r1c2-t18">
-<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-t18 r1c3-t18"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t18" headers="r1c1-t18">
-<p>&nbsp;&nbsp;Weaving Change Tracking</p>
-</td>
-<td align="left" headers="r5c1-t18 r1c2-t18">
-<p>Select this option to use weaving to detect which fields or properties of the object change.</p>
-</td>
-<td align="left" headers="r5c1-t18 r1c3-t18"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t18" headers="r1c1-t18">
-<p>&nbsp;&nbsp;Throw Exceptions</p>
-</td>
-<td align="left" headers="r6c1-t18 r1c2-t18">
-<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="r6c1-t18 r1c3-t18"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t18" headers="r1c1-t18">
-<p>Session Customizer</p>
-</td>
-<td align="left" headers="r7c1-t18 r1c2-t18">
-<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="r7c1-t18 r1c3-t18"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t18" headers="r1c1-t18">
-<p>Descriptor Customizer</p>
-</td>
-<td align="left" headers="r8c1-t18 r1c2-t18">
-<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="r8c1-t18 r1c3-t18"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" -->
-<p>The following table lists the properties of the <a href="reference018.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="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 391d913f21..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference022.htm
+++ /dev/null
@@ -1,157 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Caching</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Caching" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIABEDCH" name="CIABEDCH"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Caching</h1>
-<p>This table lists the properties of the Caching page of the <a href="reference018.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div class="tblformal"><a id="sthref224" name="sthref224"></a><a id="sthref225" name="sthref225"></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">
-<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">
-<p>Default Cache Type</p>
-</td>
-<td align="left" headers="r2c1-t20 r1c2-t20">
-<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-t20 r1c3-t20">
-<p>Weak with hard subcache</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t20" headers="r1c1-t20">
-<p>Default Cache Size</p>
-</td>
-<td align="left" headers="r3c1-t20 r1c2-t20">
-<p>Set the size of the cache.</p>
-</td>
-<td align="left" headers="r3c1-t20 r1c3-t20">
-<p>1000</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t20" headers="r1c1-t20">
-<p>Default Shared Cache</p>
-</td>
-<td align="left" headers="r4c1-t20 r1c2-t20">
-<p>Specfies if cached instances should be in the shared cache or in a client isolated cache.</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">
-<p>Entity Caching</p>
-</td>
-<td align="left" headers="r5c1-t20 r1c2-t20">
-<p>Specify the entity.</p>
-</td>
-<td align="left" headers="r5c1-t20 r1c3-t20"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t20" headers="r1c1-t20">
-<p>&nbsp;&nbsp;Cache Type</p>
-</td>
-<td align="left" headers="r6c1-t20 r1c2-t20">
-<p>Select a cache type. See <span class="italic">Default Cache</span></p>
-</td>
-<td align="left" headers="r6c1-t20 r1c3-t20"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t20" headers="r1c1-t20">
-<p>&nbsp;&nbsp;Cache Size</p>
-</td>
-<td align="left" headers="r7c1-t20 r1c2-t20">
-<p>Set the size of the cache.</p>
-</td>
-<td align="left" headers="r7c1-t20 r1c3-t20"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t20" headers="r1c1-t20">
-<p>&nbsp;&nbsp;Shared Cache</p>
-</td>
-<td align="left" headers="r8c1-t20 r1c2-t20">
-<p>See <span class="italic">Default Shared Cache</span>.</p>
-</td>
-<td align="left" headers="r8c1-t20 r1c3-t20"><br /></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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 693ad1dd65..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference023.htm
+++ /dev/null
@@ -1,217 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Logging</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Logging" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="reference018.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="sthref226" name="sthref226"></a><a id="sthref227" name="sthref227"></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">
-<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">
-<p>Logging Level</p>
-</td>
-<td align="left" headers="r2c1-t23 r1c2-t23">
-<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-t23 r1c3-t23">
-<p>Info</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t23" headers="r1c1-t23">
-<p>&nbsp;&nbsp;TimeStamp</p>
-</td>
-<td align="left" headers="r3c1-t23 r1c2-t23">
-<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-t23 r1c3-t23"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t23" headers="r1c1-t23">
-<p>&nbsp;&nbsp;Thread</p>
-</td>
-<td align="left" headers="r4c1-t23 r1c2-t23">
-<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-t23 r1c3-t23"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t23" headers="r1c1-t23">
-<p>&nbsp;&nbsp;Session</p>
-</td>
-<td align="left" headers="r5c1-t23 r1c2-t23">
-<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-t23 r1c3-t23"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t23" headers="r1c1-t23">
-<p>&nbsp;&nbsp;Exceptions</p>
-</td>
-<td align="left" headers="r6c1-t23 r1c2-t23">
-<p>Control whether the exceptions thrown from within the TopLink 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-t23 r1c3-t23"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t23" headers="r1c1-t23">
-<p>Logger</p>
-</td>
-<td align="left" headers="r7c1-t23 r1c2-t23">
-<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="r7c1-t23 r1c3-t23">
-<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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 076e38dcee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference024.htm
+++ /dev/null
@@ -1,124 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Options</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Options" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="reference018.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="sthref228" name="sthref228"></a><a id="sthref229" name="sthref229"></a>
-<p class="titleintable">Properties of the Options Page</p>
-<table class="Formal" title="Properties of the Options Page" summary="" dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<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>Session Name</p>
-</td>
-<td align="left" headers="r2c1-t25 r1c2-t25">
-<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-t25 r1c3-t25"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t25" headers="r1c1-t25">
-<p>Sessions XML</p>
-</td>
-<td align="left" headers="r3c1-t25 r1c2-t25">
-<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, TopLink 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-t25 r1c3-t25"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t25" headers="r1c1-t25">
-<p>Target Database</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>Event Listener</p>
-</td>
-<td align="left" headers="r5c1-t25 r1c2-t25">
-<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="r5c1-t25 r1c3-t25"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t25" headers="r1c1-t25">
-<p>Include Descriptor Queries</p>
-</td>
-<td align="left" headers="r6c1-t25 r1c2-t25">
-<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="r6c1-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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 183e31790b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference025.htm
+++ /dev/null
@@ -1,139 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Schema Generation</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Schema Generation" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="reference018.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="sthref230" name="sthref230"></a><a id="sthref231" name="sthref231"></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">
-<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">
-<p>DDL Generation Type</p>
-</td>
-<td align="left" headers="r2c1-t27 r1c2-t27">
-<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-t27 r1c3-t27">
-<p>None</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t27" headers="r1c1-t27">
-<p>Output Mode</p>
-</td>
-<td align="left" headers="r3c1-t27 r1c2-t27">
-<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-t27 r1c3-t27"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t27" headers="r1c1-t27">
-<p>DDL Generation Location</p>
-</td>
-<td align="left" headers="r4c1-t27 r1c2-t27">
-<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-t27 r1c3-t27"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t27" headers="r1c1-t27">
-<p>Create DDL File Name</p>
-</td>
-<td align="left" headers="r5c1-t27 r1c2-t27">
-<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-t27 r1c3-t27">
-<p>createDDL.jdbc</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t27" headers="r1c1-t27">
-<p>Drop DDL File Name</p>
-</td>
-<td align="left" headers="r6c1-t27 r1c2-t27">
-<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-t27 r1c3-t27">
-<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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 000c41403c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference026.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>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Properties</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Properties" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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 persistence.xml.</p>
-</div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</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 2569ec9ef5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference027.htm
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Source</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Source" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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 persistence.xml 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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 72bfc39bb6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference028.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>
-<!-- Run date = July 23, 2008 8:59:52 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Preferences</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Preferences" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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; JPA Options</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 09d9498ec7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference029.htm
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:52 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Dialogs</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Dialogs" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="task_generate_entities.htm#CACDAFJD">Generate Entities from Tables dialog</a></p>
-</li>
-<li>
-<p><a href="reference030.htm#CACCGEHC">Edit Join Columns Dialog</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</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 0123de3e64..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference030.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>
-<!-- Run date = July 23, 2008 8:59:52 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Edit Join Columns Dialog</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Edit Join Columns Dialog" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t30">Property</th>
-<th align="left" valign="bottom" id="r1c2-t30">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t30" headers="r1c1-t30">Name</td>
-<td align="left" headers="r2c1-t30 r1c2-t30">Name of the joint table column that contains the foreign key column.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t30" headers="r1c1-t30">Referenced Column Name</td>
-<td align="left" headers="r3c1-t30 r1c2-t30">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="reference014.htm#CACBAEBC">Join Table Information</a><br />
-<a href="reference015.htm#CACFCEJC">Join Columns Information</a></div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</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 c9d1e3ec95..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference031.htm
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:52 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Icons and buttons</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Icons and buttons" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="reference032.htm#CACGEACG">Icons</a></p>
-</li>
-<li>
-<p><a href="reference033.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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</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 fc1cd84f6a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference032.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>
-<!-- Run date = July 23, 2008 8:59:52 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Icons</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Icons" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t31">Icon</th>
-<th align="left" valign="bottom" id="r1c2-t31">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t31" headers="r1c1-t31"><img src="img/new_icon_mappedentity.png" alt="" title="" /><br /></td>
-<td align="left" headers="r2c1-t31 r1c2-t31"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t31" headers="r1c1-t31"><img src="img/new_icon_embeddableentitymapping.png" alt="Embeddable entity icon" title="Embeddable entity icon" /><br /></td>
-<td align="left" headers="r3c1-t31 r1c2-t31"><a href="tasks007.htm#BABFEICE">Embeddable</a> entity</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t31" headers="r1c1-t31"><img src="img/new_icon_mappedsuperclass.png" alt="Mapped superclass icon" title="Mapped superclass icon" /><br /></td>
-<td align="left" headers="r4c1-t31 r1c2-t31"><a href="tasks008.htm#BABDAGCI">Mapped superclass</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t31" headers="r1c1-t31"><img src="img/new_icon_basicmappings.png" alt="Basic mapping icon" title="Basic mapping icon" /><br /></td>
-<td align="left" headers="r5c1-t31 r1c2-t31"><a href="tasks010.htm#BABBABCE">Basic mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t31" headers="r1c1-t31"><img src="img/new_icon_embeddedidmapping.png" alt="Embedded mapping icon" title="Embedded mapping icon" /><br /></td>
-<td align="left" headers="r6c1-t31 r1c2-t31"><a href="tasks011.htm#BABCBHDF">Embedded mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t31" headers="r1c1-t31"><img src="img/new_icon_embeddedmapping.png" alt="Embedded ID mapping icon" title="Embedded ID mapping icon" /><br /></td>
-<td align="left" headers="r7c1-t31 r1c2-t31"><a href="tasks012.htm#CIHDIAEE">Embedded ID mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t31" headers="r1c1-t31"><img src="img/new_icon_idmapping.png" alt="ID mapping icon" title="ID mapping icon" /><br /></td>
-<td align="left" headers="r8c1-t31 r1c2-t31"><a href="tasks013.htm#BABGCBHG">ID mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t31" headers="r1c1-t31"><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="r9c1-t31 r1c2-t31"><a href="tasks014.htm#BABEIEGD">Many-to-many mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t31" headers="r1c1-t31"><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="r10c1-t31 r1c2-t31"><a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r11c1-t31" headers="r1c1-t31"><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="r11c1-t31 r1c2-t31"><a href="tasks016.htm#BABHGEBD">One-to-many mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r12c1-t31" headers="r1c1-t31"><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="r12c1-t31 r1c2-t31"><a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r13c1-t31" headers="r1c1-t31"><img src="img/new_icon_transientmapping.png" alt="Transient mapping icon." title="Transient mapping icon." /><br /></td>
-<td align="left" headers="r13c1-t31 r1c2-t31"><a href="tasks018.htm#BABHFHEI">Transient mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r14c1-t31" headers="r1c1-t31"><img src="img/new_icon_versionmapping.png" alt="Version mapping icon." title="Version mapping icon." /><br /></td>
-<td align="left" headers="r14c1-t31 r1c2-t31"><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="reference031.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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 912e486719..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference033.htm
+++ /dev/null
@@ -1,59 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:53 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Buttons</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Buttons" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t32">Icon</th>
-<th align="left" valign="bottom" id="r1c2-t32">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t32" headers="r1c1-t32"><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-t32 r1c2-t32">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="reference031.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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference034.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference034.htm
deleted file mode 100644
index cf677e30bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference034.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>
-<!-- Run date = July 23, 2008 8:59:53 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Dali Developer Documentation</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Dali Developer Documentation" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref246" name="sthref246"></a><a id="sthref247" name="sthref247"></a><a id="sthref248" name="sthref248"></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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 2fde1e2c47..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_add_persistence.htm
+++ /dev/null
@@ -1,59 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:44 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Adding persistence to a class</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Adding persistence to a class" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABHICAI" name="BABHICAI"></a></p>
-<div class="sect1">
-<h1>Adding persistence to a class</h1>
-<p><a id="sthref54" name="sthref54"></a><a id="sthref55" name="sthref55"></a><a id="sthref56" name="sthref56"></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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 ba760f6083..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_additonal_tables.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>
-<!-- Run date = July 23, 2008 8:59:45 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Specifying additional tables</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Specifying additional tables" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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 more than one table.</p>
-<p>To add a secondary table to the entity,</p>
-<ol start="1">
-<li>
-<p>Select the entity in the <span class="gui-object-title">Package 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="sthref79" name="sthref79"></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>
-<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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 1a7ad4a032..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_create_new_project.htm
+++ /dev/null
@@ -1,128 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:42 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Creating a new JPA project</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating a new JPA project" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref25" name="sthref25"></a><a id="sthref26" name="sthref26"></a>Use this procedure to create a new JPA project.</p>
-<ol start="1">
-<li>
-<p>From the Navigator or Package 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="sthref27" name="sthref27"></a>
-<p class="titleinfigure">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="sthref28" name="sthref28"></a>
-<p class="titleinfigure">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>. <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a> appears.</p>
-<div class="figure"><a id="sthref29" name="sthref29"></a>
-<p class="titleinfigure">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, database connection, and JPA implementation library.</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="reference005.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>
-</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="reference005.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>
-<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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_generate_entities.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_generate_entities.htm
deleted file mode 100644
index 299aedd3db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_generate_entities.htm
+++ /dev/null
@@ -1,72 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:52 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Generate Entities from Tables dialog</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generate Entities from Tables dialog" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACDAFJD" name="CACDAFJD"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Generate Entities from Tables dialog</h1>
-<p><a id="sthref241" name="sthref241"></a><a id="sthref242" name="sthref242"></a><a id="sthref243" name="sthref243"></a>Use the <span class="gui-object-title">Generate Entities</span> dialog to create Java persistent entities from your database tables and columns.</p>
-<p>This table lists the properties available in the <span class="gui-object-title">Generate Entities dialog</span>.</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">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t29">Property</th>
-<th align="left" valign="bottom" id="r1c2-t29">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t29" headers="r1c1-t29">Source Folder</td>
-<td align="left" headers="r2c1-t29 r1c2-t29">Enter a project folder name in which to generate the Java persistent entities, or click <span class="bold">Browse</span> to select an existing folder.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t29" headers="r1c1-t29">Package</td>
-<td align="left" headers="r3c1-t29 r1c2-t29">Enter a package name in which to generate the Java persistent entities, or click <span class="bold">Browse</span> to select an existing package.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t29" headers="r1c1-t29">Synchronize Classes in persistence.xml</td>
-<td align="left" headers="r4c1-t29 r1c2-t29">Specify if Dali should update the persistence.xml file to include the generated classes.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t29" headers="r1c1-t29">Tables</td>
-<td align="left" headers="r5c1-t29 r1c2-t29">Select the tables from which to create Java persistent entities. The tables shown are determined by the database connection that you defined in the <a href="ref_project_properties.htm#BABJHBCI">Project Properties page &ndash; JPA Options</a>.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<p><a href="tasks020.htm#BABBAGFI">Generating entities from tables</a></p>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 d4e124b0ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_inheritance.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>
-<!-- Run date = July 23, 2008 8:59:45 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Specifying entity inheritance</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Specifying entity inheritance" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref80" name="sthref80"></a><a id="sthref81" name="sthref81"></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 start="1">
-<li>
-<p>Select the entity in the <span class="gui-object-title">Package 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="sthref82" name="sthref82"></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="reference012.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">
-<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"><a id="sthref83" name="sthref83"></a><a id="sthref84" name="sthref84"></a>Discriminator Column</td>
-<td align="left" headers="r2c1-t14 r1c2-t14">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-t14 r1c3-t14"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t14" headers="r1c1-t14">Discriminator Type</td>
-<td align="left" headers="r3c1-t14 r1c2-t14">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-t14 r1c3-t14">String</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t14" headers="r1c1-t14"><a id="sthref85" name="sthref85"></a><a id="sthref86" name="sthref86"></a>Discriminator Value</td>
-<td align="left" headers="r4c1-t14 r1c2-t14">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-t14 r1c3-t14"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t14" headers="r1c1-t14">Override Default</td>
-<td align="left" headers="r5c1-t14 r1c2-t14">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-t14 r1c3-t14"><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="sthref87" name="sthref87"></a><a id="sthref88" name="sthref88"></a><a id="sthref89" name="sthref89"></a>The following figures illustrates the different inheritance strategies.</p>
-<div class="figure"><a id="sthref90" name="sthref90"></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="sthref91" name="sthref91"></a>
-<p class="titleinfigure"><a id="sthref92" name="sthref92"></a><a id="sthref93" name="sthref93"></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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 76780e6360..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_orm.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>
-<!-- Run date = July 23, 2008 8:59:43 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Managing the orm.xml file</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Managing the orm.xml file" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHDGDCD" name="CIHDGDCD"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1><a id="sthref46" name="sthref46"></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="sthref47" name="sthref47"></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>
-<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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 8be90a2e23..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm
+++ /dev/null
@@ -1,212 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:43 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Managing the persistence.xml file</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Managing the persistence.xml file" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHDAJID" name="CIHDAJID"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1><a id="sthref35" name="sthref35"></a>Managing the persistence.xml file</h1>
-<p><a id="sthref36" name="sthref36"></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 <a href="tasks002.htm#CIHEJAIE">"Using the XML Editor to edit the persistence.xml file"</a>) or through the <a href="reference018.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>
-In additon to the General, Connection, Properties and Source pages, the persistence.xml Editor pages for projects that use the EclipseLink platform include the following:
-<ul>
-<li>
-<p><a href="reference021.htm#CIAJAFEG">Customization</a></p>
-<p>Use this page to define change-tracking and session customizer-related properties.</p>
-</li>
-<li>
-<p><a href="reference022.htm#CIABEDCH">Caching</a></p>
-<p>Use this page to define caching properties.</p>
-</li>
-<li>
-<p><a href="reference023.htm#CIABGHHI">Logging</a></p>
-<p>Use this page to define logging properties.</p>
-</li>
-<li>
-<p><a href="reference024.htm#CIAFJCHE">Options</a></p>
-<p>Use this page to define session and target database properties.</p>
-</li>
-<li>
-<p><a href="reference025.htm#CIACCFCB">Schema Generation</a></p>
-<p>Use this page to define DDL-related properties.</p>
-</li>
-</ul>
-<p>For projects using the EclipseLink platform, the Connections page also includes JDBC connection pool properties.</p>
-<p>If the project uses the Generic platform, then only the General, Connection, Properties and Source pages are available.</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<p>To use the <code>persistence.xml</code> Editor:</p>
-<ol start="1">
-<li>
-<p>Open the <code>peristence.xml</code> file. The <a href="reference019.htm#CIACIFGJ">General</a> page of the editor appears.</p>
-</li>
-<li>
-<p>Use the General 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">
-<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">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">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 Unlisted 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 Mapping 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>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" --></li>
-<li>
-<p>Use the <a href="reference020.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 start="1">
-<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 start="1">
-<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>
-</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 start="1">
-<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="reference018.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#CIHEJAIE">Using the XML Editor to edit the persistence.xml file</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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 8dc785df3b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_mapping.htm
+++ /dev/null
@@ -1,72 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:45 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Mapping an entity</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Mapping an entity" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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>
-</ul>
-<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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 31d4dd2087..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks.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>
-<!-- Run date = July 23, 2008 8:59:42 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Tasks</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Tasks" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="sthref24" name="sthref24"></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#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="tasks020.htm#BABBAGFI">Generating entities from tables</a></p>
-</li>
-<li>
-<p><a href="tasks022.htm#BABFAIBA">Validating mappings and reporting problems</a></p>
-</li>
-<li>
-<p><a href="tasks025.htm#BABDBCBI">Modifying persistent project properties</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 530bf91bba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm
+++ /dev/null
@@ -1,156 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:42 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Creating a JPA Entity</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating a JPA Entity" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABFBJBG" name="BABFBJBG"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1><a id="sthref30" name="sthref30"></a>Creating a JPA Entity</h1>
-<p>Use this procedure to create a JPA entity:</p>
-<ol start="1">
-<li>
-<p>From the Navigator or Package 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="sthref31" name="sthref31"></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">Entity</span> and then click <span class="bold">Next</span>. The <a href="reference003.htm#CIAFEIGF">Entity Class page</a> appears.</p>
-<div class="figure"><a id="sthref32" name="sthref32"></a>
-<p class="titleinfigure">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 Project field.</p>
-</li>
-<li>
-<p>In the Source Folder field, select, or enter, the location of the JPA project's src folder.</p>
-</li>
-<li>
-<p>Select, or enter, the name of the class package for this entity in the Java Package field.</p>
-</li>
-<li>
-<p>Enter the name of the Java class in the Class name 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</span> to entity mappings in XML 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="reference004.htm#CIADECIA">Entity Properties page</a> where you define the persistent fields for the entity.</p>
-<div class="figure"><a id="sthref33" name="sthref33"></a>
-<p class="titleinfigure">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 start="1">
-<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="reference003.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="sthref34" name="sthref34"></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>
-</ol>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="reference002.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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 d14c825ba4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks002.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>
-<!-- Run date = July 23, 2008 8:59:43 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Using the XML Editor to edit the persistence.xml file</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Using the XML Editor to edit the persistence.xml file" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHEJAIE" name="CIHEJAIE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Using the XML Editor to edit the persistence.xml file</h1>
-<p><a id="sthref37" name="sthref37"></a><a id="sthref38" name="sthref38"></a>You can work with the <code>persistence.xml</code> by using the XML Editor.</p>
-<p>Use this procedure to work with the <code>persistence.xml</code> file:</p>
-<ol start="1">
-<li>
-<p>Right-click the <code>persistence.xml</code> file in the <span class="gui-object-title">Package Explorer</span> and select <span class="gui-object-action">Open With &gt; XML Editor</span>.</p>
-<div class="figure"><a id="sthref39" name="sthref39"></a>
-<p class="titleinfigure">Opening the XML Editor</p>
-<img src="img/open_persistence_editor.png" alt="This figure shows the Open &gt; XML Editor option for the persistence.xml file." title="This figure shows the Open &gt; XML Editor option for the persistence.xml file." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p><a id="sthref40" name="sthref40"></a><a id="sthref41" name="sthref41"></a>Use the <span class="gui-object-title">XML Editor</span> to edit the <code>persistence.xml</code> file.</p>
-<div class="figure"><a id="sthref42" name="sthref42"></a>
-<p class="titleinfigure">XML Editor</p>
-<img src="img/persistence_xml_editor.png" alt="This figure shows the XML Editor." title="This figure shows the XML Editor." /><br /></div>
-<!-- class="figure" --></li>
-</ol>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="#CIHEJAIE">Using the XML Editor to edit the persistence.xml file</a><br />
-<a href="../org.eclipse.wst.xmleditor.doc.user/topics/cworkXML.html">Working with XML Files</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 /></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 cf80ff4c39..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks003.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>
-<!-- Run date = July 23, 2008 8:59:43 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Synchronizing classes</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Synchronizing classes" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref43" name="sthref43"></a><a id="sthref44" name="sthref44"></a></p>
-<p>Use this procedure to synchronize the <code>persistence.xml</code> file:</p>
-<ol start="1">
-<li>
-<p>Right-click the <code>persistence.xml</code> file in the <span class="gui-object-title">Package Explorer</span> and select <span class="gui-object-action">JPA Tools &gt; Synchronize Classes</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="sthref45" name="sthref45"></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="tasks002.htm#CIHEJAIE">Using the XML Editor to edit 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" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 98c8327cc5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks004.htm
+++ /dev/null
@@ -1,69 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:43 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Managing the orm.xml file</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Managing the orm.xml file" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<div class="sect2"><!-- infolevel="all" infotype="General" --><a id="sthref48" name="sthref48"></a>
-<h1>Creating an orm.xml file</h1>
-<p>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="reference005.htm#CIAIJCCE">Mapping File Wizard</a>.</p>
-<p>Use this procedure to create an <code>orm.xml</code> file:</p>
-<ol start="1">
-<li>
-<p>From the Navigator or Package Explorer, select <span class="bold">File &gt; New &gt; Other</span>. The Select a Wizard dialog appears.</p>
-<div class="figure"><a id="sthref49" name="sthref49"></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>
-<div class="figure"><a id="sthref50" name="sthref50"></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>
-<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 Mapping File Wizard will not allow you to proceed if you select a JPA project that already includes an <code>orm.xml</code> file.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-</ol>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 ea5d1dd6bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks005.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>
-<!-- Run date = July 23, 2008 8:59:44 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Working with orm.xml file</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Working with orm.xml file" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref51" name="sthref51"></a><a id="sthref52" name="sthref52"></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 start="1">
-<li>
-<p>Right-click the <code>orm.xml</code> file in the <span class="gui-object-title">Package 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="sthref53" name="sthref53"></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/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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 7aef6952a7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks006.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>
-<!-- Run date = July 23, 2008 8:59:44 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Entity</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Entity" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABGBIEE" name="BABGBIEE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Entity</h1>
-<p><a id="sthref57" name="sthref57"></a><a id="sthref58" name="sthref58"></a><a id="sthref59" name="sthref59"></a><a id="sthref60" name="sthref60"></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="sthref61" name="sthref61"></a><a id="sthref62" name="sthref62"></a><a id="sthref63" name="sthref63"></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 start="1">
-<li>
-<p>Open the Java class in the <span class="gui-object-title">Package 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="sthref64" name="sthref64"></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="sthref65" name="sthref65"></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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 efd109a179..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks007.htm
+++ /dev/null
@@ -1,69 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:44 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Embeddable</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Embeddable" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABFEICE" name="BABFEICE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Embeddable</h1>
-<p><a id="sthref66" name="sthref66"></a><a id="sthref67" name="sthref67"></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="sthref68" name="sthref68"></a><a id="sthref69" name="sthref69"></a><a id="sthref70" name="sthref70"></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 start="1">
-<li>
-<p>Open the Java class in the <span class="gui-object-title">Package 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="sthref71" name="sthref71"></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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 e03d3d0e13..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm
+++ /dev/null
@@ -1,83 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:44 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Mapped superclass</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Mapped superclass" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref72" name="sthref72"></a><a id="sthref73" name="sthref73"></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="sthref74" name="sthref74"></a><a id="sthref75" name="sthref75"></a><a id="sthref76" name="sthref76"></a><a id="sthref77" name="sthref77"></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 start="1">
-<li>
-<p>Open the Java class in the <span class="gui-object-title">Package 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="sthref78" name="sthref78"></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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 f88a6d7472..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks009.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>
-<!-- Run date = July 23, 2008 8:59:45 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Creating Named Queries</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating Named Queries" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref94" name="sthref94"></a><a id="sthref95" name="sthref95"></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 start="1">
-<li>
-<p>Select the entity in the Package 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>
-<div class="figure"><a id="sthref96" name="sthref96"></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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 d7c93f70a0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks010.htm
+++ /dev/null
@@ -1,181 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:46 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Basic mapping</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Basic mapping" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref97" name="sthref97"></a><a id="sthref98" name="sthref98"></a><a id="sthref99" name="sthref99"></a><a id="sthref100" name="sthref100"></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 start="1">
-<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">
-<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 Map Hyperlink</td>
-<td align="left" headers="r2c1-t15 r1c2-t15">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-t15 r1c3-t15">Basic</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t15" headers="r1c1-t15">Column</td>
-<td align="left" headers="r3c1-t15 r1c2-t15">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-t15 r1c3-t15">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-t15" headers="r1c1-t15">Table</td>
-<td align="left" headers="r4c1-t15 r1c2-t15">Name of the database table.</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">Fetch</td>
-<td align="left" headers="r5c1-t15 r1c2-t15">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-t15 r1c3-t15">Eager</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t15" headers="r1c1-t15">Optional</td>
-<td align="left" headers="r6c1-t15 r1c2-t15">Specifies if this field is can be null.</td>
-<td align="left" headers="r6c1-t15 r1c3-t15">Yes</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t15" headers="r1c1-t15">Temporal</td>
-<td align="left" headers="r7c1-t15 r1c2-t15">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="r7c1-t15 r1c3-t15"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t15" headers="r1c1-t15">Lob</td>
-<td align="left" headers="r8c1-t15 r1c2-t15">Specifies if this is a large objects (BLOB or CLOB). See <a href="ref_mapping_general.htm#CACBBIBI">"Lob"</a> for details.</td>
-<td align="left" headers="r8c1-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">
-@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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 d0d838df60..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks011.htm
+++ /dev/null
@@ -1,107 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:46 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Embedded mapping</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Embedded mapping" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref101" name="sthref101"></a><a id="sthref102" name="sthref102"></a><a id="sthref103" name="sthref103"></a><a id="sthref104" name="sthref104"></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 start="1">
-<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">
-<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 Hyperlnk</td>
-<td align="left" headers="r2c1-t16 r1c2-t16">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-t16 r1c3-t16">Embedded</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t16" headers="r1c1-t16">Attribute Overrides</td>
-<td align="left" headers="r3c1-t16 r1c2-t16">Specify to override the default mapping of an entity's attribute. Select <span class="bold">Override Default</span>.</td>
-<td align="left" headers="r3c1-t16 r1c3-t16"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t16" headers="r1c1-t16">Columns</td>
-<td align="left" headers="r4c1-t16 r1c2-t16">The database column (and its table) mapped to the entity attribute. See <a href="ref_mapping_general.htm#CACGCBHB">"Column"</a> for details.
-<ul>
-<li>
-<p>Name &ndash; Name of the database column.</p>
-</li>
-<li>
-<p>Table &ndash; Name of the database table.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r4c1-t16 r1c3-t16"><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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 6b35d9c247..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks012.htm
+++ /dev/null
@@ -1,87 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:46 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Embedded ID mapping</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Embedded ID mapping" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref105" name="sthref105"></a><a id="sthref106" name="sthref106"></a><a id="sthref107" name="sthref107"></a><a id="sthref108" name="sthref108"></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 start="1">
-<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">
-<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 a <span class="bold">Embedded Id</span>.
-<p>This corresponds to the <code>@EmbeddedId</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t17 r1c3-t17">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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 b8592d92ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks013.htm
+++ /dev/null
@@ -1,169 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:46 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>ID mapping</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="ID mapping" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref109" name="sthref109"></a><a id="sthref110" name="sthref110"></a><a id="sthref111" name="sthref111"></a><a id="sthref112" name="sthref112"></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 start="1">
-<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">
-<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">Entity Mapping Hyperlink</td>
-<td align="left" headers="r2c1-t18 r1c2-t18">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-t18 r1c3-t18">ID</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t18" headers="r1c1-t18">Column</td>
-<td align="left" headers="r3c1-t18 r1c2-t18">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-t18 r1c3-t18">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-t18" headers="r1c1-t18">Table</td>
-<td align="left" headers="r4c1-t18 r1c2-t18">The database table mapped to the entity attribute.</td>
-<td align="left" headers="r4c1-t18 r1c3-t18">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-t18" headers="r1c1-t18">Temporal</td>
-<td align="left" headers="r5c1-t18 r1c2-t18">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-t18 r1c3-t18"><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">
-<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">Primary Key Generation</td>
-<td align="left" headers="r2c1-t19 r1c2-t19">These fields define how the primary key is generated.</td>
-<td align="left" headers="r2c1-t19 r1c3-t19"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t19" headers="r1c1-t19">&nbsp;&nbsp;Strategy</td>
-<td align="left" headers="r3c1-t19 r1c2-t19">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-t19 r1c3-t19">Auto</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t19" headers="r1c1-t19">&nbsp;&nbsp;Generator&nbsp;Name</td>
-<td align="left" headers="r4c1-t19 r1c2-t19">Name of the primary key generator specified in the <span class="bold">Strategy</span></td>
-<td align="left" headers="r4c1-t19 r1c3-t19"><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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 91b6ae91c4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks014.htm
+++ /dev/null
@@ -1,172 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:47 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Many-to-many mapping</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Many-to-many mapping" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref113" name="sthref113"></a><a id="sthref114" name="sthref114"></a><a id="sthref115" name="sthref115"></a><a id="sthref116" name="sthref116"></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 start="1">
-<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-toMany</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">
-<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">Mapping Entity Hyperlink</td>
-<td align="left" headers="r2c1-t20 r1c2-t20">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-t20 r1c3-t20">Many to Many</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t20" headers="r1c1-t20">Target Entity</td>
-<td align="left" headers="r3c1-t20 r1c2-t20">The entity to which this attribute is mapped.</td>
-<td align="left" headers="r3c1-t20 r1c3-t20">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-t20" headers="r1c1-t20">Fetch</td>
-<td align="left" headers="r4c1-t20 r1c2-t20">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-t20 r1c3-t20">Lazy</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t20" headers="r1c1-t20">Mapped By</td>
-<td align="left" headers="r5c1-t20 r1c2-t20">The database field that owns the relationship.</td>
-<td align="left" headers="r5c1-t20 r1c3-t20"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t20" headers="r1c1-t20">Order By</td>
-<td align="left" headers="r6c1-t20 r1c2-t20">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-t20 r1c3-t20">No ordering</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Use this table to complete the fields in the <a href="reference014.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">
-<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">Name</td>
-<td align="left" headers="r2c1-t21 r1c2-t21">Name of the join table that contains the foreign key column.</td>
-<td align="left" headers="r2c1-t21 r1c3-t21">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-t21" headers="r1c1-t21">Join Columns</td>
-<td align="left" headers="r3c1-t21 r1c2-t21">Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</td>
-<td align="left" headers="r3c1-t21 r1c3-t21">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-t21" headers="r1c1-t21">Inverse Join Columns</td>
-<td align="left" headers="r4c1-t21 r1c2-t21">Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</td>
-<td align="left" headers="r4c1-t21 r1c3-t21">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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 b7943aaab5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks015.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>
-<!-- Run date = July 23, 2008 8:59:47 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Many-to-one mapping</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Many-to-one mapping" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref117" name="sthref117"></a><a id="sthref118" name="sthref118"></a><a id="sthref119" name="sthref119"></a><a id="sthref120" name="sthref120"></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 start="1">
-<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">
-<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">Mapping Entity Hyperlink</td>
-<td align="left" headers="r2c1-t22 r1c2-t22">Defines mapping as <span class="bold">Many-to-One</span>. This corresponds to the <code>@ManyToOne</code> annotation.</td>
-<td align="left" headers="r2c1-t22 r1c3-t22">Many-to-One</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t22" headers="r1c1-t22">Target Entity</td>
-<td align="left" headers="r3c1-t22 r1c2-t22">The entity to which this attribute is mapped.</td>
-<td align="left" headers="r3c1-t22 r1c3-t22">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-t22" headers="r1c1-t22">Fetch</td>
-<td align="left" headers="r4c1-t22 r1c2-t22">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-t22 r1c3-t22">Eager</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t22" headers="r1c1-t22">Cascade</td>
-<td align="left" headers="r5c1-t22 r1c2-t22">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-t22 r1c3-t22">Default</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t22" headers="r1c1-t22">Optional</td>
-<td align="left" headers="r6c1-t22 r1c2-t22">Specifies if this field is can be null.</td>
-<td align="left" headers="r6c1-t22 r1c3-t22">Yes</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Use this table to complete the fields on the <a href="reference015.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">
-<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">Join Column</td>
-<td align="left" headers="r2c1-t23 r1c2-t23"><a id="sthref121" name="sthref121"></a><a id="sthref122" name="sthref122"></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-t23 r1c3-t23">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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 c24117b252..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks016.htm
+++ /dev/null
@@ -1,190 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:47 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>One-to-many mapping</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="One-to-many mapping" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref123" name="sthref123"></a><a id="sthref124" name="sthref124"></a><a id="sthref125" name="sthref125"></a><a id="sthref126" name="sthref126"></a>Use a <span class="bold">One-to-Many Mapping</span> to define a relationship with one-to-many multiplicity.</p>
-<ol start="1">
-<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">
-<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">Mapping Entity Type Hyperlink</td>
-<td align="left" headers="r2c1-t24 r1c2-t24">Defines mapping as <span class="bold">One-to-Many</span>. This corresponds to the <code>@OneToMany</code> annotation.</td>
-<td align="left" headers="r2c1-t24 r1c3-t24">One-to-Many</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t24" headers="r1c1-t24">Target Entity</td>
-<td align="left" headers="r3c1-t24 r1c2-t24">The entity to which this attribute is mapped.</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">Cascade</td>
-<td align="left" headers="r4c1-t24 r1c2-t24">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-t24 r1c3-t24"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t24" headers="r1c1-t24">Fetch</td>
-<td align="left" headers="r5c1-t24 r1c2-t24">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-t24 r1c3-t24">Eager</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t24" headers="r1c1-t24">Mapped By</td>
-<td align="left" headers="r6c1-t24 r1c2-t24">The database field that owns the relationship.</td>
-<td align="left" headers="r6c1-t24 r1c3-t24"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t24" headers="r1c1-t24">Order By</td>
-<td align="left" headers="r7c1-t24 r1c2-t24">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-t24 r1c3-t24">No ordering</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Use this table to complete the <a href="reference014.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">
-<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">Name</td>
-<td align="left" headers="r2c1-t25 r1c2-t25">Name of the join table</td>
-<td align="left" headers="r2c1-t25 r1c3-t25">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-t25" headers="r1c1-t25">Join Columns</td>
-<td align="left" headers="r3c1-t25 r1c2-t25">Specify two or more join columns (that is, a primary key).</td>
-<td align="left" headers="r3c1-t25 r1c3-t25"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t25" headers="r1c1-t25">Inverse Join Columns</td>
-<td align="left" headers="r4c1-t25 r1c2-t25">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-t25 r1c3-t25"><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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 7502303b93..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks017.htm
+++ /dev/null
@@ -1,139 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:47 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>One-to-one mapping</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="One-to-one mapping" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref127" name="sthref127"></a><a id="sthref128" name="sthref128"></a><a id="sthref129" name="sthref129"></a><a id="sthref130" name="sthref130"></a>Use a <span class="bold">One-to-One Mapping</span> to define a relationship with one-to-many multiplicity.</p>
-<ol start="1">
-<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">
-<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">Mapped Entity Hyperlink</td>
-<td align="left" headers="r2c1-t26 r1c2-t26">Defines mapping as <span class="bold">One-to-One</span>. This corresponds to the <code>@OneToOne</code> annotation.</td>
-<td align="left" headers="r2c1-t26 r1c3-t26">One-to-One</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t26" headers="r1c1-t26">Target Entity</td>
-<td align="left" headers="r3c1-t26 r1c2-t26">The entity to which this attribute is mapped.</td>
-<td align="left" headers="r3c1-t26 r1c3-t26">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-t26" headers="r1c1-t26">Fetch Type</td>
-<td align="left" headers="r4c1-t26 r1c2-t26">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-t26 r1c3-t26">Eager</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t26" headers="r1c1-t26">Mapped By</td>
-<td align="left" headers="r5c1-t26 r1c2-t26">The database field that owns the relationship.</td>
-<td align="left" headers="r5c1-t26 r1c3-t26"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Use this table to complete the <a href="reference015.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">
-<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">Join Column</td>
-<td align="left" headers="r2c1-t27 r1c2-t27"><a id="sthref131" name="sthref131"></a><a id="sthref132" name="sthref132"></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-t27 r1c3-t27">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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 59bbb35eda..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks018.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>
-<!-- Run date = July 23, 2008 8:59:48 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Transient mapping</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Transient mapping" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref133" name="sthref133"></a><a id="sthref134" name="sthref134"></a><a id="sthref135" name="sthref135"></a><a id="sthref136" name="sthref136"></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 start="1">
-<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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 9dde2935bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks019.htm
+++ /dev/null
@@ -1,133 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:48 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Version mapping</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Version mapping" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref137" name="sthref137"></a><a id="sthref138" name="sthref138"></a><a id="sthref139" name="sthref139"></a><a id="sthref140" name="sthref140"></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 start="1">
-<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">
-<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">Mapped Entity Hyperlink</td>
-<td align="left" headers="r2c1-t28 r1c2-t28">Defines the mapping as Version. This corresponds to the <code>@Version</code> annotation.</td>
-<td align="left" headers="r2c1-t28 r1c3-t28">Version</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t28" headers="r1c1-t28">Column</td>
-<td align="left" headers="r3c1-t28 r1c2-t28">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-t28 r1c3-t28">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-t28" headers="r1c1-t28">Table</td>
-<td align="left" headers="r4c1-t28 r1c2-t28">Name of the database table. This must be the primary table associated with the attribute's entity.</td>
-<td align="left" headers="r4c1-t28 r1c3-t28"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t28" headers="r1c1-t28">Temporal</td>
-<td align="left" headers="r5c1-t28 r1c2-t28">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-t28 r1c3-t28"><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" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 15b7a7dbcd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks020.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>
-<!-- Run date = July 23, 2008 8:59:48 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Generating entities from tables</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generating entities from tables" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABBAGFI" name="BABBAGFI"></a></p>
-<div class="sect1">
-<h1>Generating entities from tables</h1>
-<p><a id="sthref141" name="sthref141"></a><a id="sthref142" name="sthref142"></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.</p>
-<ol start="1">
-<li>
-<p>Right-click the JPA project in the <span class="gui-object-title">Package Explorer</span> and select <span class="gui-object-action">JPA Tools &gt; Generate Entities</span>.</p>
-<div class="figure"><a id="sthref143" name="sthref143"></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>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>
-<p>To create a new database connection, click <span class="bold">Add connection</span>.</p>
-<p>After connecting to the database, click <span class="bold">Next</span>.</p>
-</li>
-<li>
-<p><a id="sthref144" name="sthref144"></a><a id="sthref145" name="sthref145"></a>On the <a href="task_generate_entities.htm#CACDAFJD">Generate Entities from Tables dialog</a> dialog, select the tables from which to generate Java persistent entities and click <span class="bold">Finish</span>.</p>
-</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; JPA Options</a></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 246f1e40da..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks021.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>
-<!-- Run date = July 23, 2008 8:59:48 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Generating DDL from Entities</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generating DDL from Entities" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHJIGBE" name="CIHJIGBE"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Generating DDL from Entities</h1>
-<p>When using a vendor-specific platform, you can create a DDL script from your persistent entities.</p>
-<p>To generate a DDL script:</p>
-<p>Right-click the JPA project in the <span class="gui-object-title">Package Explorer</span> and select <span class="gui-object-action">JPA Tools &gt; Generate DDL</span>.</p>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<p><a href="tasks001.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; JPA Options</a></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 892855f71c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks022.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>
-<!-- Run date = July 23, 2008 8:59:48 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Validating mappings and reporting problems</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Validating mappings and reporting problems" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABFAIBA" name="BABFAIBA"></a></p>
-<div class="sect1">
-<h1>Validating mappings and reporting problems</h1>
-<p><a id="sthref146" name="sthref146"></a><a id="sthref147" name="sthref147"></a><a id="sthref148" name="sthref148"></a><a id="sthref149" name="sthref149"></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="sthref150" name="sthref150"></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="tasks023.htm#CIHFEDEI">Error messages</a></p>
-</li>
-<li>
-<p><a href="tasks024.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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</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 af2541b288..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks023.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>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Error messages</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Error messages" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHFEDEI" name="CIHFEDEI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Error messages<a id="sthref151" name="sthref151"></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="sthref152" name="sthref152"></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="sthref153" name="sthref153"></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="sthref154" name="sthref154"></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="sthref155" name="sthref155"></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="sthref156" name="sthref156"></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="sthref157" name="sthref157"></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="sthref158" name="sthref158"></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="sthref159" name="sthref159"></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="sthref160" name="sthref160"></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="sthref161" name="sthref161"></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="reference014.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="sthref162" name="sthref162"></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="sthref163" name="sthref163"></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="sthref164" name="sthref164"></a>
-<p class="subhead2">Unresovlved 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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</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 fbcdec3bde..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks024.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>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Warning messages</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Warning messages" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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="sthref165" name="sthref165"></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="sthref166" name="sthref166"></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="tasks025.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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 ae5f8006c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks025.htm
+++ /dev/null
@@ -1,87 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Modifying persistent project properties</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Modifying persistent project properties" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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 start="1">
-<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="sthref167" name="sthref167"></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>Use this table to complete the remaining fields on the Properties &ndash; JPA page and click <span class="bold">OK</span>.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Properties - Java Persistence dialog." summary="This table lists the fields in the Properties - Java Persistence dialog." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t29">Property</th>
-<th align="left" valign="bottom" id="r1c2-t29">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t29" headers="r1c1-t29">Platform</td>
-<td align="left" headers="r2c1-t29 r1c2-t29">Select the vendor-specific platform for the JPA implementation.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t29" headers="r1c1-t29">Database Connection</td>
-<td align="left" headers="r3c1-t29 r1c2-t29">Database connection to use to store the persistent entities. To create a new connection, click <span class="bold">Add Connection</span>.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t29" headers="r1c1-t29">&nbsp;&nbsp;Override default schema from connection</td>
-<td align="left" headers="r4c1-t29 r1c2-t29">Select a schema other than the default one derived from the connection information. Use this option if the default schema cannot be used. For example, use this option in cases where the deployment login differs from the design-time login.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>To create a new connection, click <span class="bold">Add connections</span>.</p>
-<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; JPA 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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 4b31111351..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tips_and_tricks.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>
-<!-- Run date = July 23, 2008 8:59:53 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Tips and tricks</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Tips and tricks" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- 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">
-<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 reconnect to your database (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%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 c7d9998ef2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/toc.xml
+++ /dev/null
@@ -1,130 +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" label="Requirements and installation" />
- <topic href="getting_started002.htm" label="Dali quick start">
- <topic href="getting_started003.htm" label="Creating a new JPA project" />
- <topic href="getting_started004.htm" label="Creating a Java persistent entity with persistent fields" />
- </topic>
- </topic>
- <topic href="concepts.htm" label=" Concepts">
- <topic href="concept_persistence.htm" label="Understanding Java persistence" />
- <topic href="concept_mapping.htm" label="Understanding OR mappings" />
- <topic href="concepts001.htm" label="Understanding EJB 3.0 Java Persistence API">
- <topic href="concepts002.htm" label="The persistence.xml file" />
- <topic href="concepts003.htm" label="The orm.xml file" />
- </topic>
- </topic>
- <topic href="tasks.htm" label=" Tasks">
- <topic href="task_create_new_project.htm" label="Creating a new JPA project" />
- <topic href="tasks001.htm" label="Creating a JPA Entity" />
- <topic href="task_manage_persistence.htm" label="Managing the persistence.xml file">
- <topic href="tasks002.htm" label="Using the XML Editor to edit the persistence.xml file" />
- <topic href="tasks003.htm" label="Synchronizing classes" />
- </topic>
- <topic href="task_manage_orm.htm" label="Managing the orm.xml file">
- <topic href="tasks004.htm" label="Creating an orm.xml file" />
- <topic href="tasks005.htm" label="Working with orm.xml file" />
- </topic>
- <topic href="task_add_persistence.htm" label="Adding persistence to a class">
- <topic href="tasks006.htm" label="Entity" />
- <topic href="tasks007.htm" label="Embeddable" />
- <topic href="tasks008.htm" label="Mapped superclass" />
- </topic>
- <topic href="task_additonal_tables.htm" label="Specifying additional tables" />
- <topic href="task_inheritance.htm" label="Specifying entity inheritance" />
- <topic href="tasks009.htm" label="Creating Named Queries" />
- <topic href="task_mapping.htm" label="Mapping an entity">
- <topic href="tasks010.htm" label="Basic mapping" />
- <topic href="tasks011.htm" label="Embedded mapping" />
- <topic href="tasks012.htm" label="Embedded ID mapping" />
- <topic href="tasks013.htm" label="ID mapping" />
- <topic href="tasks014.htm" label="Many-to-many mapping" />
- <topic href="tasks015.htm" label="Many-to-one mapping" />
- <topic href="tasks016.htm" label="One-to-many mapping" />
- <topic href="tasks017.htm" label="One-to-one mapping" />
- <topic href="tasks018.htm" label="Transient mapping" />
- <topic href="tasks019.htm" label="Version mapping" />
- </topic>
- <topic href="tasks020.htm" label="Generating entities from tables" />
- <topic href="tasks021.htm" label="Generating DDL from Entities" />
- <topic href="tasks022.htm" label="Validating mappings and reporting problems">
- <topic href="tasks023.htm" label="Error messages" />
- <topic href="tasks024.htm" label="Warning messages" />
- </topic>
- <topic href="tasks025.htm" label="Modifying persistent project properties" />
- </topic>
- <topic label=" Reference">
- <topic label="Wizards">
- <topic href="ref_new_jpa_project_wizard.htm" label="Create New JPA Project wizard">
- <topic href="ref_new_jpa_project.htm" label="New JPA Project page" />
- <topic href="ref_jpa_facet.htm" label="JPA Facet page" />
- </topic>
- <topic href="reference002.htm" label="Create JPA Entity wizard">
- <topic href="reference003.htm" label="Entity Class page" />
- <topic href="reference004.htm" label="Entity Properties page" />
- </topic>
- <topic href="reference005.htm" label="Mapping File Wizard">
- <topic href="reference006.htm#sthref171" label="Mapping File" />
- </topic>
- <topic href="reference007.htm#sthref174" label="Generate DDL from Entities Wizard" />
- </topic>
- <topic label="Property pages">
- <topic href="ref_persistence_prop_view.htm" label="JPA Details view (for entities)">
- <topic href="reference009.htm" label="General information" />
- <topic href="reference010.htm" label="Attribute overrides" />
- <topic href="reference011.htm" label="Secondary table information" />
- <topic href="reference012.htm" label="Inheritance information" />
- <topic href="reference013.htm#sthref187" label="Queries" />
- </topic>
- <topic href="ref_persistence_map_view.htm" label="JPA Details view (for attributes)">
- <topic href="ref_mapping_general.htm" label="General information" />
- <topic href="reference014.htm" label="Join Table Information" />
- <topic href="reference015.htm" label="Join Columns Information" />
- <topic href="ref_primary_key.htm" label="Primary Key Generation information" />
- </topic>
- <topic href="ref_details_orm.htm" label="JPA Details view (for orm.xml)">
- <topic href="reference016.htm" label="General information" />
- <topic href="reference017.htm" label="Persistence Unit information" />
- </topic>
- <topic href="ref_persistence_outline.htm" label="JPA Structure view" />
- <topic href="reference018.htm" label="persistence.xml Editor">
- <topic href="reference019.htm" label="General" />
- <topic href="reference020.htm" label="Connection" />
- <topic href="reference021.htm" label="Customization" />
- <topic href="reference022.htm" label="Caching" />
- <topic href="reference023.htm" label="Logging" />
- <topic href="reference024.htm" label="Options" />
- <topic href="reference025.htm" label="Schema Generation" />
- <topic href="reference026.htm" label="Properties" />
- <topic href="reference027.htm" label="Source" />
- </topic>
- </topic>
- <topic label="Preferences">
- <topic href="ref_project_properties.htm" label="Project Properties page - JPA Options" />
- </topic>
- <topic label="Dialogs">
- <topic href="task_generate_entities.htm" label="Generate Entities from Tables dialog" />
- <topic href="reference030.htm" label="Edit Join Columns Dialog" />
- </topic>
- <topic href="ref_persistence_perspective.htm" label="JPA Development perspective" />
- <topic label="Icons and buttons">
- <topic href="reference032.htm" label="Icons" />
- <topic href="reference033.htm" label="Buttons" />
- </topic>
- <topic href="reference034.htm" label="Dali Developer Documentation" />
- </topic>
- <topic href="tips_and_tricks.htm" label="Tips and tricks">
- <topic href="whats_new001.htm" label="Create JPA Entity Wizard" />
- <topic href="whats_new002.htm" label="Named Query Support" />
- <topic href="whats_new003.htm" label="persistence.xml Editor" />
- <topic href="whats_new004.htm" label="Override the Default Schema for Connection" />
- <topic href="whats_new005.htm" label="New Mapping File Wizard" />
- <topic href="whats_new006.htm" label="Convert to Java Project" />
- <topic href="whats_new007.htm" label="Column Definition Support" />
- </topic>
- <topic href="legal.htm" label=" Legal">
- <topic href="about.htm" 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 b07f07eb11..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new.htm
+++ /dev/null
@@ -1,59 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:53 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>What's new</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" What's new" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="sthref249" name="sthref249"></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.0:</p>
-<ul>
-<li>
-<p><a href="whats_new001.htm#BGGCJHAG">Create JPA Entity Wizard</a></p>
-</li>
-<li>
-<p><a href="whats_new002.htm#BGGIHJCJ">Named Query Support</a></p>
-</li>
-<li>
-<p><a href="whats_new003.htm#BGGGACCD">persistence.xml Editor</a></p>
-</li>
-<li>
-<p><a href="whats_new004.htm#BGGIICEF">Override the Default Schema for Connection</a></p>
-</li>
-<li>
-<p><a href="whats_new005.htm#BGGGDGIE">New Mapping File Wizard</a></p>
-</li>
-<li>
-<p><a href="whats_new006.htm#BGGCGDJG">The Convert to Java Project Option</a></p>
-</li>
-<li>
-<p><a href="whats_new007.htm#BGGFGBHJ">Defining Columns in JPA Details View for Entity Attributes</a></p>
-</li>
-<li style="list-style: none"><a href="whats_new008.htm#CEGIDCCE">Generate DDL from Entities wizard</a></li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 a54720615f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new001.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>
-<!-- Run date = July 23, 2008 8:59:53 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Create JPA Entity Wizard</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Create JPA Entity Wizard" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BGGCJHAG" name="BGGCJHAG"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Create JPA Entity Wizard</h1>
-<p>Use the Create JPA Entity wizard to quickly create an entity. This wizard automatically creates a Java class annotated with <code>@Entity</code> and enables users to add persistence fields to the entity.</p>
-<div class="figure"><a id="sthref250" name="sthref250"></a>
-<p class="titleinfigure">The Create New JPA Entity Wizard</p>
-<img src="img/create_jpa_entity_new.png" alt="The Entity Class page of the Create New JPA Entity wizard." title="The Entity Class page of the Create New JPA Entity wizard." /><br /></div>
-<!-- class="figure" -->
-<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="reference005.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>
-<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></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 fc1912cf8c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new002.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>
-<!-- Run date = July 23, 2008 8:59:53 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Named Query Support</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Named Query Support" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BGGIHJCJ" name="BGGIHJCJ"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Named Query Support</h1>
-<p>The JPA Details view for an entity includes functions for adding named and named native queries to an entity.</p>
-<div class="figure"><a id="sthref251" name="sthref251"></a>
-<p class="titleinfigure">Entering a Named Query</p>
-<img src="img/entering_query_new.png" alt="The Queries section of the JPA Details view." title="The Queries section of the JPA Details view." /><br /></div>
-<!-- class="figure" -->
-<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_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="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 bcd134cc07..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new003.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>
-<!-- Run date = July 23, 2008 8:59:54 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>persistence.xml Editor</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="persistence.xml Editor" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BGGGACCD" name="BGGGACCD"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>persistence.xml Editor</h1>
-<p>Rather than edit the XML for <code>persistence.xml</code>, this release of Dali provides an editor that automatically populates the file's <code>&lt;persistence-unit&gt;</code> element, its <code>transaction type</code> attribute as well as its <code>&lt;provider&gt;</code>, <code>&lt;class&gt;</code>, data source and <code>&lt;properties&gt;</code> sub-elements. The edtior also enables you to edit the file directly.</p>
-<div class="figure"><a id="sthref252" name="sthref252"></a>
-<p class="titleinfigure">The persistence.xml Editor</p>
-<img src="img/persistence_editor_new.png" alt="The General page of the persistence.xml Editor." title="The General page of the persistence.xml Editor." /><br /></div>
-<!-- class="figure" -->
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="reference018.htm#CIACCHID">persistence.xml Editor</a>
-<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>
-<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 /></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 7d8acf3534..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new004.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>
-<!-- Run date = July 23, 2008 8:59:54 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Override the Default Schema for Connection</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Override the Default Schema for Connection" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BGGIICEF" name="BGGIICEF"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Override the Default Schema for Connection</h1>
-<p>In some cases, Dali cannot calculate the correct schema for a project. If such an instance arises, you can override the default schema derived from the connection information using the <span class="bold">Override the Default Schema for Connection</span> option in the JPA Facet page of the Create New JPA Entity wizard (illustrated in <a href="#BGGJFFCD">Figure: Changing the Schema for a Project</a>) or through the properties for the JPA project (accessed by selecting the JPA project and then <span class="bold">Properties &gt; JPA</span>). Use this option when the default login information cannot be used, such as when the deployment login differs from the design-time login.</p>
-<div class="figure"><a id="BGGJFFCD" name="BGGJFFCD"></a>
-<p class="titleinfigure">Changing the Schema for a Project</p>
-<img src="img/change_connection_profile.png" alt="The JPA Facet page of the Create New JPA Project wizard with the Override defualt schema selected." title="The JPA Facet page of the Create New JPA Project wizard with the Override defualt schema selected." /><br /></div>
-<!-- class="figure" -->
-<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>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 ccd08ee090..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new005.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>
-<!-- Run date = July 23, 2008 8:59:54 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Changing the Schema for a Project</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Changing the Schema for a Project" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<div class="sect1"><!-- infolevel="all" infotype="General" --><a id="sthref253" name="sthref253"></a>
-<h1>New Mapping File Wizard</h1>
-<p>The Mapping File wizard enables you to add an object map (orm.xml) to a JPA project if no object map exists at the location specified. Completing the wizard results in a stub <code>orm.xml</code> file.</p>
-<div class="figure"><a id="BGGGDGIE" name="BGGGDGIE"></a>
-<p class="titleinfigure">New Mapping File Wizard</p>
-<img src="img/mapping_file_new.png" alt="The Mapping File page of the New Mapping File wizard." title="The Mapping File page of the New Mapping File wizard." /><br /></div>
-<!-- class="figure" -->
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="reference005.htm#CIAIJCCE">Mapping File Wizard</a>
-<p>&nbsp;</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 />
-<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="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</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 e06dfdf434..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new006.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>
-<!-- Run date = July 23, 2008 8:59:54 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>New Mapping File Wizard</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="New Mapping File Wizard" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<div class="sect1"><!-- infolevel="all" infotype="General" --><a id="sthref254" name="sthref254"></a>
-<h1>Convert to Java Project</h1>
-<p>The Convert to JPA Project option (accessed by selecting a Java project and then clicking <span class="bold">New &gt; JPA Tools &gt; Convert to JPA Project</span>) enables you to convert a non-faceted Java project into a faceted Java project. Selecting this option invokes the Modify Faceted Project wizard, which prompts you to add the JPA facet.</p>
-<div class="figure"><a id="BGGCGDJG" name="BGGCGDJG"></a>
-<p class="titleinfigure">The Convert to Java Project Option</p>
-<img src="img/convert_java_project_new.png" alt="A Java project in the Navigator with the JPA Tools &gt; Convert to Java option selected." title="A Java project in the Navigator with the JPA Tools &gt; Convert to Java option selected." /><br /></div>
-<!-- class="figure" --></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new007.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new007.htm
deleted file mode 100644
index 3ffd422541..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new007.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>
-<!-- Run date = July 23, 2008 8:59:54 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>The Convert to Java Project Option</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="The Convert to Java Project Option" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<div class="sect1"><!-- infolevel="all" infotype="General" --><a id="sthref255" name="sthref255"></a>
-<h1>Column Definition Support</h1>
-<p>The JPA Details view for attributes enables you to modify the nullable and unique column constraints and such column properties as length, scale, and precision.</p>
-<div class="figure"><a id="BGGFGBHJ" name="BGGFGBHJ"></a>
-<p class="titleinfigure">Defining Columns in JPA Details View for Entity Attributes</p>
-<img src="img/column_support_new.png" alt="The JPA Details View for an entity with its Details section expanded to show the column configuration parameters." title="The JPA Details View for an entity with its Details section expanded to show the column configuration parameters." /><br /></div>
-<!-- class="figure" -->
-<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>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new008.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new008.htm
deleted file mode 100644
index 098e2ea801..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new008.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>
-<!-- Run date = July 23, 2008 8:59:54 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Generate DDL from Entities wizard</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generate DDL from Entities wizard" />
-<meta name="relnum" content="Release 2.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" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CEGIDCCE" name="CEGIDCCE"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Generate DDL from Entities wizard</h1>
-<p>Use the <span class="gui-object-title">Generate DDL</span> 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>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks021.htm#CIHJIGBE">Generating DDL from Entities</a></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
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 9600ce84df..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="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 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.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 db2b450ba5..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.100.qualifier
-Bundle-ClassPath: lib/persistence.jar
-Bundle-Localization: plugin
-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
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
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 0f7bce31e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/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/
-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 0e31122359..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/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 = Java Persistence API Tools - EclipseLink Support - DDL Generation
-providerName = Eclipse.org
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 c1b91c325b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/src/org/eclipse/jpt/eclipselink/core/ddlgen/Main.java
+++ /dev/null
@@ -1,217 +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.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.internal.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 614eeccda3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Mon Apr 07 14:26:48 EDT 2008
-eclipse.preferences.version=1
-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 d8daa445e2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,50 +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.1.0.qualifier
-Bundle-Activator: org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-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;bundle-version="[2.4.0,3.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",
- 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.wst.common.emf;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.emfworkbench.integration;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.frameworks;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.modulecore;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="1.3.3",
- 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.internal,
- org.eclipse.jpt.eclipselink.core.internal.context.java,
- org.eclipse.jpt.eclipselink.core.internal.context.orm,
- org.eclipse.jpt.eclipselink.core.internal.context.persistence,
- org.eclipse.jpt.eclipselink.core.internal.context.persistence.caching,
- org.eclipse.jpt.eclipselink.core.internal.context.persistence.connection,
- org.eclipse.jpt.eclipselink.core.internal.context.persistence.customization,
- org.eclipse.jpt.eclipselink.core.internal.context.persistence.general,
- org.eclipse.jpt.eclipselink.core.internal.context.persistence.logging,
- org.eclipse.jpt.eclipselink.core.internal.context.persistence.options,
- org.eclipse.jpt.eclipselink.core.internal.context.persistence.schema.generation,
- org.eclipse.jpt.eclipselink.core.internal.ddlgen,
- org.eclipse.jpt.eclipselink.core.internal.operations,
- org.eclipse.jpt.eclipselink.core.internal.resource.java,
- org.eclipse.jpt.eclipselink.core.internal.resource.orm,
- org.eclipse.jpt.eclipselink.core.internal.resource.orm.translators,
- org.eclipse.jpt.eclipselink.core.resource.java,
- org.eclipse.jpt.eclipselink.core.resource.orm
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
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 3294ef7e8b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/build.properties
+++ /dev/null
@@ -1,23 +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 = .
-src.includes = model/
-src.includes = model/
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 26a96e9994..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/model/eclipselink_orm.ecore
+++ /dev/null
@@ -1,192 +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="XmlNamedConverter" 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="XmlConverter" abstract="true" interface="true"
- 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="XmlConverterImpl" eSuperTypes="#//XmlConverter"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTypeConverter" abstract="true" interface="true"
- 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="XmlTypeConverterImpl" eSuperTypes="#//XmlTypeConverter"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlConversionValue" abstract="true"
- interface="true">
- <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="XmlConversionValueImpl" eSuperTypes="#//XmlConversionValue"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlObjectTypeConverter" abstract="true"
- interface="true" 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="XmlObjectTypeConverterImpl" eSuperTypes="#//XmlObjectTypeConverter"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlStructConverter" abstract="true"
- interface="true" 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="XmlStructConverterImpl" eSuperTypes="#//XmlStructConverter"/>
- <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="XmlEntityMappings" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlEntityMappings #//XmlConvertersHolder"/>
- <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="#//XmlCustomizer"
- containment="true" resolveProxies="false"/>
- </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: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="XmlEmbeddable" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlEmbeddable #//XmlCustomizerHolder #//XmlChangeTrackingHolder #//XmlConvertersHolder"/>
- <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: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="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: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="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: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: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="XmlEntity" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlEntity #//XmlReadOnly #//XmlCustomizerHolder #//XmlChangeTrackingHolder #//XmlCacheHolder #//XmlConvertersHolder"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMappedSuperclass" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlMappedSuperclass #//XmlReadOnly #//XmlCustomizerHolder #//XmlChangeTrackingHolder #//XmlCacheHolder #//XmlConvertersHolder"/>
- <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="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="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="XmlId" abstract="true" interface="true"
- eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlId #//XmlMutable #//XmlConvertibleMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlIdImpl" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlIdImpl #//XmlId"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasic" abstract="true" interface="true"
- eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlBasic #//XmlMutable #//XmlConvertibleMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasicImpl" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlBasicImpl #//XmlBasic"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlVersion" abstract="true" interface="true"
- eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlVersion #//XmlMutable #//XmlConvertibleMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlVersionImpl" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlVersionImpl #//XmlVersion"/>
- <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:EEnum" name="XmlJoinFetchType">
- <eLiterals name="INNER"/>
- <eLiterals name="OUTER" value="1" literal="OUTER"/>
- </eClassifiers>
- <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="XmlOneToOne" abstract="true" interface="true"
- eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlOneToOne #//XmlPrivateOwned #//XmlJoinFetch"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToOneImpl" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlOneToOneImpl #//XmlOneToOne"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToMany" abstract="true" interface="true"
- eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlOneToMany #//XmlPrivateOwned #//XmlJoinFetch"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToManyImpl" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlOneToManyImpl #//XmlOneToMany"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToOne" abstract="true" interface="true"
- eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlManyToOne #//XmlJoinFetch"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToOneImpl" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlManyToOneImpl #//XmlManyToOne"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToMany" abstract="true" interface="true"
- eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlManyToMany #//XmlJoinFetch"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToManyImpl" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlManyToManyImpl #//XmlManyToMany"/>
- <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"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasicCollection" abstract="true"
- interface="true" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlAttributeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasicCollectionImpl" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//AbstractXmlAttributeMapping #//XmlBasicCollection"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasicMap" abstract="true" interface="true"
- eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlAttributeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasicMapImpl" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//AbstractXmlAttributeMapping #//XmlBasicMap"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTransformation" abstract="true" interface="true"
- eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlAttributeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTransformationImpl" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//AbstractXmlAttributeMapping #//XmlTransformation"/>
-</ecore:EPackage>
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/model/jptEclipseLinkResourceModels.genmodel b/jpa/plugins/org.eclipse.jpt.eclipselink.core/model/jptEclipseLinkResourceModels.genmodel
deleted file mode 100644
index f321353bee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/model/jptEclipseLinkResourceModels.genmodel
+++ /dev/null
@@ -1,163 +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.common.JpaEObject"
- rootExtendsClass="org.eclipse.jpt.core.resource.common.AbstractJpaEObject" suppressInterfaces="true"
- testsDirectory="" testSuiteClass="" importerID="org.eclipse.emf.importer.ecore"
- complianceLevel="5.0" copyrightFields="false" usedGenPackages="../../org.eclipse.jpt.core/model/jptResourceModels.genmodel#//orm">
- <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#//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#//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#//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#//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>
- <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#//XmlConverter">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlConverter/className"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlConverterImpl"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlTypeConverter">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlTypeConverter/dataType"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlTypeConverter/objectType"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlTypeConverterImpl"/>
- <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#//XmlConversionValueImpl"/>
- <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#//XmlObjectTypeConverterImpl"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlStructConverter">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlStructConverter/converter"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlStructConverterImpl"/>
- <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#//XmlEntityMappings"/>
- <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#//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#//XmlEmbeddable"/>
- <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#//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 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#//XmlEntity"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlMappedSuperclass"/>
- <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#//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 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#//XmlId"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlIdImpl"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlBasic"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlBasicImpl"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlVersion"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlVersionImpl"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlPrivateOwned">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlPrivateOwned/privateOwned"/>
- </genClasses>
- <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#//XmlOneToOne"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlOneToOneImpl"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlOneToMany"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlOneToManyImpl"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlManyToOne"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlManyToOneImpl"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlManyToMany"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlManyToManyImpl"/>
- <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"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlBasicCollection"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlBasicCollectionImpl"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlBasicMap"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlBasicMapImpl"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlTransformation"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlTransformationImpl"/>
- </genPackages>
-</genmodel:GenModel>
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 5abb2a97dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/plugin.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-# ====================================================================
-# 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 Tools - EclipseLink Support - Core
-providerName = Eclipse.org
-
-ECLIPSELINK_ORM_XML_CONTENT = EclipseLink ORM XML Content
-ECLIPSELINK_PLATFORM = EclipseLink
-
-
-ECLIPSELINK_ORM_XML_CONTENT = EclipseLink ORM XML Content
-ECLIPSELINK_PLATFORM = EclipseLink
-
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 c2ec232587..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/plugin.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
-
- <extension
- point="org.eclipse.core.runtime.contentTypes">
-
- <content-type
- id="org.eclipse.jpt.eclipselink.core.content.orm"
- name="%ECLIPSELINK_ORM_XML_CONTENT"
- base-type="org.eclipse.core.runtime.xml">
- <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.jpaPlatform">
-
- <jpaPlatform
- id="org.eclipse.eclipselink.platform"
- class="org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaPlatform"
- label="%ECLIPSELINK_PLATFORM">
- </jpaPlatform>
-
- </extension>
-
-
- <extension
- point="org.eclipse.jpt.core.resourceModelProviders">
-
- <modelProvider
- fileContentType="org.eclipse.jpt.eclipselink.core.content.orm"
- factoryClass="org.eclipse.jpt.eclipselink.core.internal.resource.orm.EclipseLinkOrmResourceModelProviderFactory"/>
-
- </extension>
-
-
- <!-- ***** WTP extensions ***** -->
-
- <extension
- point="org.eclipse.wst.common.modulecore.resourceFactories">
-
- <resourceFactory
- class="org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmResourceFactory"
- 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">
-
- <uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_1_0.xsd"
- uri="schemas/eclipselink_orm_1_0.xsd" />
-
- <public
- publicId="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
- uri="schemas/eclipselink_orm_1_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 12df2233e2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/property_files/eclipselink_jpa_validation.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-################################################################################
-# Copyright (c) 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-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}\" \ No newline at end of file
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/src/org/eclipse/jpt/eclipselink/core/EclipseLinkJpaFile.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/EclipseLinkJpaFile.java
deleted file mode 100644
index f142851e3f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/EclipseLinkJpaFile.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core;
-
-import org.eclipse.jpt.core.JpaFile;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * 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 EclipseLinkJpaFile extends JpaFile {
- /**
- * Constant representing an eclipselink mapping file (e.g. eclipselink-orm.xml) resource type
- * @see org.eclipse.jpt.core.ResourceModel#getResourceType()
- */
- static final String ECLIPSELINK_ORM_RESOURCE_TYPE = "ECLIPSELINK_ORM_RESOURCE_TYPE"; //$NON-NLS-1$
-
-}
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 7aaa7f4351..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/EclipseLinkMappingKeys.java
+++ /dev/null
@@ -1,27 +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;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/BasicCollectionMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/BasicCollectionMapping.java
deleted file mode 100644
index e396ef0d7c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/BasicCollectionMapping.java
+++ /dev/null
@@ -1,28 +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.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 BasicCollectionMapping extends AttributeMapping
-{
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/BasicMapMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/BasicMapMapping.java
deleted file mode 100644
index f9a37b3d73..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/BasicMapMapping.java
+++ /dev/null
@@ -1,28 +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.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 BasicMapMapping extends AttributeMapping
-{
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/CacheCoordinationType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/CacheCoordinationType.java
deleted file mode 100644
index 33bb3c8391..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/CacheCoordinationType.java
+++ /dev/null
@@ -1,106 +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.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 CacheCoordinationType {
-
- SEND_OBJECT_CHANGES,
- INVALIDATE_CHANGED_OBJECTS,
- SEND_NEW_OBJECTS_WITH_CHANGES,
- NONE;
-
-
- public static CacheCoordinationType 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(CacheCoordinationType 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 CacheCoordinationType 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(CacheCoordinationType 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/CacheType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/CacheType.java
deleted file mode 100644
index ade7450182..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/CacheType.java
+++ /dev/null
@@ -1,133 +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.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 CacheType {
-
- SOFT_WEAK,
- HARD_WEAK,
- WEAK,
- SOFT,
- FULL,
- CACHE,
- NONE;
-
-
- public static CacheType 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(CacheType 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 CacheType 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(CacheType 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/Caching.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Caching.java
deleted file mode 100644
index 5f9ab68768..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Caching.java
+++ /dev/null
@@ -1,205 +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.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 Caching 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 = "defaultSharedProperty"; //$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 = "specifiedSharedProperty"; //$NON-NLS-1$
-
-
- //***************** cache type ************************
-
- /**
- * This is the combination of defaultType and specifiedType.
- * If getSpecifiedType() returns null, then return getDefaultType()
- */
- CacheType getType();
-
- CacheType getDefaultType();
- String DEFAULT_TYPE_PROPERTY = "defaultTypeProperty"; //$NON-NLS-1$
- CacheType DEFAULT_TYPE = CacheType.SOFT_WEAK;
-
- CacheType getSpecifiedType();
- void setSpecifiedType(CacheType newSpecifiedType);
- String SPECIFIED_TYPE_PROPERTY = "specifiedTypeProperty"; //$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 = "defaultSizeProperty"; //$NON-NLS-1$
-
- Integer getSpecifiedSize();
- void setSpecifiedSize(Integer newSpecifiedSize);
- String SPECIFIED_SIZE_PROPERTY = "spcifiedSizeProperty"; //$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 = "defaultAlwaysRefreshProperty"; //$NON-NLS-1$
- boolean DEFAULT_ALWAYS_REFRESH = false;
-
- Boolean getSpecifiedAlwaysRefresh();
- void setSpecifiedAlwaysRefresh(Boolean newSpecifiedAlwaysRefresh);
- String SPECIFIED_ALWAYS_REFRESH_PROPERTY = "specifiedAlwaysRefreshProperty"; //$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 = "defaultRefreshOnlyIfNewerProperty"; //$NON-NLS-1$
- boolean DEFAULT_REFRESH_ONLY_IF_NEWER = false;
-
- Boolean getSpecifiedRefreshOnlyIfNewer();
- void setSpecifiedRefreshOnlyIfNewer(Boolean newSpecifiedRefreshOnlyIfNewer);
- String SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY = "specifiedRefreshOnlyIfNewerProperty"; //$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 = "defaultDisableHitsProperty"; //$NON-NLS-1$
- boolean DEFAULT_DISABLE_HITS = false;
-
- Boolean getSpecifiedDisableHits();
- void setSpecifiedDisableHits(Boolean newSpecifiedDisableHits);
- String SPECIFIED_DISABLE_HITS_PROPERTY = "specifiedDisableHitsProperty"; //$NON-NLS-1$
-
-
- //***************** coordination type ************************
-
- /**
- * This is the combination of defaultCoordinationType and specifiedCoordinationType.
- * If getSpecifiedCoordinationType() returns null, then return getDefaultCoordinationType()
- */
- CacheCoordinationType getCoordinationType();
-
- CacheCoordinationType getDefaultCoordinationType();
- String DEFAULT_COORDINATION_TYPE_PROPERTY = "defaultCoordinationTypeProperty"; //$NON-NLS-1$
- CacheCoordinationType DEFAULT_COORDINATION_TYPE = CacheCoordinationType.SEND_OBJECT_CHANGES;
-
- CacheCoordinationType getSpecifiedCoordinationType();
- void setSpecifiedCoordinationType(CacheCoordinationType newSpecifiedCoordinationType);
- String SPECIFIED_COORDINATION_TYPE_PROPERTY = "specifiedCoordinationTypeProperty"; //$NON-NLS-1$
-
-
- //***************** existence checking ************************
-
- /**
- * This is the combination of defaultExistenceType and specifiedExistenceType.
- * If getSpecifiedExistenceType() returns null, then return getDefaultExistenceType()
- */
- ExistenceType getExistenceType();
-
- ExistenceType getDefaultExistenceType();
- String DEFAULT_EXISTENCE_TYPE_PROPERTY = "defaultExistenceTypeProperty"; //$NON-NLS-1$
- ExistenceType DEFAULT_EXISTENCE_TYPE = ExistenceType.CHECK_DATABASE;
-
- ExistenceType getSpecifiedExistenceType();
- void setSpecifiedExistenceType(ExistenceType newSpecifiedExistenceType);
- String SPECIFIED_EXISTENCE_TYPE_PROPERTY = "specifiedExistenceTypeProperty"; //$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 = "expiryProperty"; //$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.
- */
- ExpiryTimeOfDay 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
- */
- ExpiryTimeOfDay addExpiryTimeOfDay();
-
- /**
- * Removes the Cache expiryTimeOfDay annotation/xml element
- */
- void removeExpiryTimeOfDay();
- String EXPIRY_TIME_OF_DAY_PROPERTY = "expiryTimeOfDayProperty"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ChangeTracking.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ChangeTracking.java
deleted file mode 100644
index 2f64b2d8b6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ChangeTracking.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.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 ChangeTracking extends JpaContextNode
-{
- /**
- * This is the combination of defaultType and specifiedType.
- * If getSpecifiedType() returns null, then return getDefaultType()
- */
- ChangeTrackingType getType();
-
- ChangeTrackingType getDefaultType();
- String DEFAULT_TYPE_PROPERTY = "defaultTypeProperty"; //$NON-NLS-1$
- ChangeTrackingType DEFAULT_TYPE = ChangeTrackingType.AUTO;
-
- ChangeTrackingType getSpecifiedType();
- void setSpecifiedType(ChangeTrackingType newSpecifiedType);
- String SPECIFIED_TYPE_PROPERTY = "specifiedTypeProperty"; //$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/ChangeTrackingType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ChangeTrackingType.java
deleted file mode 100644
index 396500f9f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ChangeTrackingType.java
+++ /dev/null
@@ -1,106 +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.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 ChangeTrackingType {
-
- ATTRIBUTE,
- OBJECT,
- DEFERRED,
- AUTO;
-
-
- public static ChangeTrackingType 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(ChangeTrackingType 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 ChangeTrackingType 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);
- }
- }
-
- public static XmlChangeTrackingType toOrmResourceModel(ChangeTrackingType 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);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ConversionValue.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ConversionValue.java
deleted file mode 100644
index 0e36428e39..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ConversionValue.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.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 ConversionValue extends JpaContextNode
-{
- String getDataValue();
- void setDataValue(String dataValue);
- String DATA_VALUE_PROPERTY = "dataValueProperty"; //$NON-NLS-1$
-
- String getObjectValue();
- void setObjectValue(String objectValue);
- String OBJECT_VALUE_PROPERTY = "objectValueProperty"; //$NON-NLS-1$
-
- ObjectTypeConverter getParent();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Convert.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Convert.java
deleted file mode 100644
index 87a9ff9b04..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Convert.java
+++ /dev/null
@@ -1,86 +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.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 Convert extends JpaContextNode, Converter
-{
-
- String ECLIPSE_LINK_CONVERTER = "eclipseLinkConverter"; //$NON-NLS-1$
-
- String getConverterName();
-
- String getDefaultConverterName();
- String DEFAULT_CONVERTER_NAME_PROPERTY = "defaultConverterNameProperty"; //$NON-NLS-1$
-
- String getSpecifiedConverterName();
-
- void setSpecifiedConverterName(String converterName);
- String SPECIFIED_CONVERTER_NAME_PROPERTY = "specifiedConverterNameProperty"; //$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 = "converterProperty"; //$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/CustomConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/CustomConverter.java
deleted file mode 100644
index b2e33db1a1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/CustomConverter.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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 CustomConverter extends EclipseLinkConverter
-{
-
- String getConverterClass();
- void setConverterClass(String converterClass);
- String CONVERTER_CLASS_PROPERTY = "converterClassProperty"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Customizer.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Customizer.java
deleted file mode 100644
index d8729979fe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Customizer.java
+++ /dev/null
@@ -1,38 +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.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 Customizer extends JpaContextNode
-{
-
- String getCustomizerClass();
-
- String getDefaultCustomizerClass();
- String DEFAULT_CUSTOMIZER_CLASS_PROPERTY = "defaultCustomizerClassProperty"; //$NON-NLS-1$
-
- String getSpecifiedCustomizerClass();
- void setSpecifiedCustomizerClass(String customizerClass);
- String SPECIFIED_CUSTOMIZER_CLASS_PROPERTY = "specifiedCustomizerClassProperty"; //$NON-NLS-1$
-
-}
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 3bd5ae1909..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * 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
-{
- Mutable getMutable();
-}
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 b47a1af53c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkConverter.java
+++ /dev/null
@@ -1,58 +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.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 = "nameProperty"; //$NON-NLS-1$
-
- /**
- * 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/EclipseLinkEmbeddable.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkEmbeddable.java
deleted file mode 100644
index 03c1395da4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkEmbeddable.java
+++ /dev/null
@@ -1,29 +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.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.1
- * @since 2.1
- */
-public interface EclipseLinkEmbeddable extends Embeddable
-{
- Customizer getCustomizer();
-
- ChangeTracking 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 c6683a695c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkEntity.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.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.1
- * @since 2.1
- */
-public interface EclipseLinkEntity extends Entity
-{
- Caching getCaching();
-
- ReadOnly getReadOnly();
-
- Customizer getCustomizer();
-
- ChangeTracking getChangeTracking();
-}
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 c5b6ac9cc5..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * 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
-{
- Mutable getMutable();
-}
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 4ab4a1a6a2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkMappedSuperclass.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.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.1
- * @since 2.1
- */
-public interface EclipseLinkMappedSuperclass extends MappedSuperclass
-{
- Caching getCaching();
-
- ReadOnly getReadOnly();
-
- Customizer getCustomizer();
-
- ChangeTracking getChangeTracking();
-} \ No newline at end of file
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 41342ead4e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkOneToManyMapping.java
+++ /dev/null
@@ -1,29 +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.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
-{
- PrivateOwned getPrivateOwned();
-}
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 be1c9b3e2f..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * 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
-{
- PrivateOwned getPrivateOwned();
-}
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 810e8d9cef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkRelationshipMapping.java
+++ /dev/null
@@ -1,29 +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.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
-{
- JoinFetch getJoinFetch();
-}
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 90ff9aba9a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkVersionMapping.java
+++ /dev/null
@@ -1,29 +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.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
-{
- Mutable getMutable();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ExistenceType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ExistenceType.java
deleted file mode 100644
index a1e3807511..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ExistenceType.java
+++ /dev/null
@@ -1,106 +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.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 ExistenceType {
-
- CHECK_CACHE,
- CHECK_DATABASE,
- ASSUME_EXISTENCE,
- ASSUME_NON_EXISTENCE;
-
-
- public static ExistenceType 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(ExistenceType 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 ExistenceType 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(ExistenceType 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/ExpiryTimeOfDay.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ExpiryTimeOfDay.java
deleted file mode 100644
index a5bbdbbfd7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ExpiryTimeOfDay.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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 ExpiryTimeOfDay extends JpaContextNode
-{
-
- Integer getHour();
- void setHour(Integer hour);
- String HOUR_PROPERTY = "hourProperty"; //$NON-NLS-1$
-
- Integer getMinute();
- void setMinute(Integer minute);
- String MINUTE_PROPERTY = "minuteProperty"; //$NON-NLS-1$
-
- Integer getSecond();
- void setSecond(Integer second);
- String SECOND_PROPERTY = "secondProperty"; //$NON-NLS-1$
-
- Integer getMillisecond();
- void setMillisecond(Integer millisecond);
- String MILLISECOND_PROPERTY = "millisecondProperty"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/JoinFetch.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/JoinFetch.java
deleted file mode 100644
index da4e7ba413..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/JoinFetch.java
+++ /dev/null
@@ -1,30 +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.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 JoinFetch extends JpaContextNode
-{
- JoinFetchType getValue();
- void setValue(JoinFetchType newJoinFetchValue);
- String VALUE_PROPERTY = "JoinFetch.valueProperty"; //$NON-NLS-1$
- JoinFetchType DEFAULT_VALUE = JoinFetchType.INNER;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/JoinFetchType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/JoinFetchType.java
deleted file mode 100644
index c01b4edfe8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/JoinFetchType.java
+++ /dev/null
@@ -1,89 +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.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 JoinFetchType {
-
- INNER,
- OUTER;
-
-
- public static JoinFetchType 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(JoinFetchType 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 JoinFetchType 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(JoinFetchType 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/Mutable.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Mutable.java
deleted file mode 100644
index a4bb91911b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Mutable.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.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 Mutable extends JpaContextNode
-{
- boolean isMutable();
-
- boolean isDefaultMutable();
- String DEFAULT_MUTABLE_PROPERTY = "defaultMutableProperty"; //$NON-NLS-1$
-
- Boolean getSpecifiedMutable();
- void setSpecifiedMutable(Boolean newSpecifiedMutable);
- String SPECIFIED_MUTABLE_PROPERTY = "specifiedMutableProperty"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ObjectTypeConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ObjectTypeConverter.java
deleted file mode 100644
index e659130306..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ObjectTypeConverter.java
+++ /dev/null
@@ -1,92 +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.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 ObjectTypeConverter extends EclipseLinkConverter
-{
- String getDataType();
- void setDataType(String dataType);
- String DATA_TYPE_PROPERTY = "dataTypeProperty"; //$NON-NLS-1$
-
- String getObjectType();
- void setObjectType(String objectType);
- String OBJECT_TYPE_PROPERTY = "objectTypeProperty"; //$NON-NLS-1$
-
-
- // **************** conversion values **************************************
-
- /**
- * Return a list iterator of the conversion values.
- * This will not be null.
- */
- <T extends ConversionValue> 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.
- */
- ConversionValue addConversionValue(int index);
-
- /**
- * Add a conversion value to the object type mapping return the object
- * representing it.
- */
- ConversionValue 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(ConversionValue conversionValue);
-
- /**
- * Move the conversion values from the source index to the target index.
- */
- void moveConversionValue(int targetIndex, int sourceIndex);
- String CONVERSION_VALUES_LIST = "conversionValuesList"; //$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 = "defaultObjectValueProperty"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/PrivateOwned.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/PrivateOwned.java
deleted file mode 100644
index edae11e299..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/PrivateOwned.java
+++ /dev/null
@@ -1,29 +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.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 PrivateOwned extends JpaContextNode
-{
- boolean isPrivateOwned();
- void setPrivateOwned(boolean privateOwned);
- String PRIVATE_OWNED_PROPERTY = "privateOwnedProperty"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ReadOnly.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ReadOnly.java
deleted file mode 100644
index 78f3ceea33..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ReadOnly.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.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 ReadOnly 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/StructConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/StructConverter.java
deleted file mode 100644
index 1ceed3537f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/StructConverter.java
+++ /dev/null
@@ -1,30 +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.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 StructConverter extends EclipseLinkConverter
-{
- String getConverterClass();
- void setConverterClass(String converterClass);
- String CONVERTER_CLASS_PROPERTY = "converterClassProperty"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/TransformationMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/TransformationMapping.java
deleted file mode 100644
index d2f8015cc3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/TransformationMapping.java
+++ /dev/null
@@ -1,28 +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.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 TransformationMapping extends AttributeMapping
-{
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/TypeConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/TypeConverter.java
deleted file mode 100644
index 7297776e04..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/TypeConverter.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.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 TypeConverter extends EclipseLinkConverter
-{
- String getDataType();
- void setDataType(String dataType);
- String DATA_TYPE_PROPERTY = "dataTypeProperty"; //$NON-NLS-1$
-
- String getObjectType();
- void setObjectType(String objectType);
- String OBJECT_TYPE_PROPERTY = "objectTypeProperty"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/EclipseLinkJavaEmbeddable.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/EclipseLinkJavaEmbeddable.java
deleted file mode 100644
index 7ce177464a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/EclipseLinkJavaEmbeddable.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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 EclipseLinkJavaEmbeddable extends EclipseLinkEmbeddable, JavaEmbeddable
-{
- JavaConverterHolder getConverterHolder();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/EclipseLinkJavaEntity.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/EclipseLinkJavaEntity.java
deleted file mode 100644
index c8b60cc7bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/EclipseLinkJavaEntity.java
+++ /dev/null
@@ -1,54 +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.context.java;
-
-import java.util.ListIterator;
-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.java.JavaNamedNativeQuery;
-import org.eclipse.jpt.core.context.java.JavaNamedQuery;
-import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaSecondaryTable;
-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 EclipseLinkJavaEntity extends EclipseLinkEntity, JavaEntity
-{
- JavaConverterHolder getConverterHolder();
-
- JavaCaching getCaching();
-
- // included these to prevent warnings on the implementation
- ListIterator<JavaSecondaryTable> secondaryTables();
- ListIterator<JavaSecondaryTable> specifiedSecondaryTables();
- ListIterator<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns();
- ListIterator<JavaPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns();
- ListIterator<JavaAttributeOverride> attributeOverrides();
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides();
- ListIterator<JavaAttributeOverride> virtualAttributeOverrides();
- ListIterator<JavaAssociationOverride> associationOverrides();
- ListIterator<JavaAssociationOverride> specifiedAssociationOverrides();
- ListIterator<JavaAssociationOverride> virtualAssociationOverrides();
- ListIterator<JavaNamedQuery> namedQueries();
- ListIterator<JavaNamedNativeQuery> namedNativeQueries();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/EclipseLinkJavaMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/EclipseLinkJavaMappedSuperclass.java
deleted file mode 100644
index 2b8aab7da4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/EclipseLinkJavaMappedSuperclass.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.eclipselink.core.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-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 2.1
- * @since 2.1
- */
-public interface EclipseLinkJavaMappedSuperclass extends EclipseLinkMappedSuperclass, JavaMappedSuperclass
-{
- JavaConverterHolder getConverterHolder();
-
- //********* covariant overrides ***********
-
- JavaCaching getCaching();
-
- Iterator<JavaPersistentAttribute> overridableAttributes();
- Iterator<JavaPersistentAttribute> overridableAssociations();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaCaching.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaCaching.java
deleted file mode 100644
index efee968cba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaCaching.java
+++ /dev/null
@@ -1,52 +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.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.Caching;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * 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 JavaCaching extends Caching, 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 = "existenceCheckingProperty"; //$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/JavaConverterHolder.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaConverterHolder.java
deleted file mode 100644
index d5cc5f8296..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaConverterHolder.java
+++ /dev/null
@@ -1,65 +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.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.CustomConverter;
-import org.eclipse.jpt.eclipselink.core.context.ObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.StructConverter;
-import org.eclipse.jpt.eclipselink.core.context.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 JavaConverterHolder 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);
-
- CustomConverter getConverter();
- CustomConverter addConverter();
- void removeConverter();
- String CONVERTER_PROPERTY = "converterProperty"; //$NON-NLS-1$
-
- ObjectTypeConverter getObjectTypeConverter();
- ObjectTypeConverter addObjectTypeConverter();
- void removeObjectTypeConverter();
- String OBJECT_TYPE_CONVERTER_PROPERTY = "objectTypeConverterProperty"; //$NON-NLS-1$
-
- StructConverter getStructConverter();
- StructConverter addStructConverter();
- void removeStructConverter();
- String STRUCT_CONVERTER_PROPERTY = "structConverterProperty"; //$NON-NLS-1$
-
- TypeConverter getTypeConverter();
- TypeConverter addTypeConverter();
- void removeTypeConverter();
- String TYPE_CONVERTER_PROPERTY = "typeCnverterProperty"; //$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/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/EclipseLinkConstants.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkConstants.java
deleted file mode 100644
index 2f777d2b19..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkConstants.java
+++ /dev/null
@@ -1,19 +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.internal;
-
-public interface EclipseLinkConstants
-{
- String ECLIPSELINK_ORM_NS_URL = "http://www.eclipse.org/eclipselink/xsds/persistence/orm"; //$NON-NLS-1$
- String ECLIPSELINK_ORM_SCHEMA_LOC_1_0 = "http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_1_0.xsd"; //$NON-NLS-1$
-
- String VERSION_1_0_TEXT = "1.0"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaAnnotationProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaAnnotationProvider.java
deleted file mode 100644
index dd614ea98d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaAnnotationProvider.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal;
-
-import java.util.List;
-
-import org.eclipse.jpt.core.internal.platform.GenericJpaAnnotationProvider;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.BasicCollectionImpl.BasicCollectionAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.BasicMapImpl.BasicMapAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.CacheImpl.CacheAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.ChangeTrackingImpl.ChangeTrackingAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.ConvertImpl.ConvertAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.ConverterImpl.ConverterAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.CustomizerImpl.CustomizerAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.ExistenceCheckingImpl.ExistenceCheckingAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.JoinFetchImpl.JoinFetchAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.MutableImpl.MutableAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.ObjectTypeConverterImpl.ObjectTypeConverterAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.PrivateOwnedImpl.PrivateOwnedAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.ReadOnlyImpl.ReadOnlyAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.ReadTransformerImpl.ReadTransformerAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.StructConverterImpl.StructConverterAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.TransformationImpl.TransformationAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.TypeConverterImpl.TypeConverterAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.WriteTransformerImpl.WriteTransformerAnnotationDefinition;
-
-public class EclipseLinkJpaAnnotationProvider
- extends GenericJpaAnnotationProvider
-{
-
- @Override
- protected void addTypeSupportingAnnotationDefinitionsTo(List<AnnotationDefinition> definitions) {
- super.addTypeSupportingAnnotationDefinitionsTo(definitions);
- definitions.add(CacheAnnotationDefinition.instance());
- definitions.add(ChangeTrackingAnnotationDefinition.instance());
- definitions.add(ConverterAnnotationDefinition.instance());
- definitions.add(CustomizerAnnotationDefinition.instance());
- definitions.add(ExistenceCheckingAnnotationDefinition.instance());
- definitions.add(ObjectTypeConverterAnnotationDefinition.instance());
- definitions.add(ReadOnlyAnnotationDefinition.instance());
- definitions.add(StructConverterAnnotationDefinition.instance());
- definitions.add(TypeConverterAnnotationDefinition.instance());
- }
-
- // 245996 addresses how the attribute mapping annotations should be ordered
- @Override
- protected void addAttributeMappingAnnotationDefinitionsTo(List<AnnotationDefinition> definitions) {
- super.addAttributeMappingAnnotationDefinitionsTo(definitions);
- definitions.add(BasicCollectionAnnotationDefinition.instance());
- definitions.add(BasicMapAnnotationDefinition.instance());
- definitions.add(TransformationAnnotationDefinition.instance());
- }
-
- @Override
- protected void addAttributeSupportingAnnotationDefinitionsTo(List<AnnotationDefinition> definitions) {
- super.addAttributeSupportingAnnotationDefinitionsTo(definitions);
- definitions.add(ConvertAnnotationDefinition.instance());
- definitions.add(ConverterAnnotationDefinition.instance());
- definitions.add(JoinFetchAnnotationDefinition.instance());
- definitions.add(MutableAnnotationDefinition.instance());
- definitions.add(ObjectTypeConverterAnnotationDefinition.instance());
- definitions.add(PrivateOwnedAnnotationDefinition.instance());
- definitions.add(ReadTransformerAnnotationDefinition.instance());
- definitions.add(StructConverterAnnotationDefinition.instance());
- definitions.add(TypeConverterAnnotationDefinition.instance());
- definitions.add(WriteTransformerAnnotationDefinition.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 32f9195aef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaFactory.java
+++ /dev/null
@@ -1,375 +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.internal;
-
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.jpt.core.context.XmlContextNode;
-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.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.OrmPersistentTypeContext;
-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.context.persistence.MappingFileRef;
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.internal.platform.GenericJpaFactory;
-import org.eclipse.jpt.core.resource.common.JpaXmlResource;
-import org.eclipse.jpt.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-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.XmlOneToMany;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.core.resource.orm.XmlVersion;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkJpaFile;
-import org.eclipse.jpt.eclipselink.core.context.java.EclipseLinkJavaEntity;
-import org.eclipse.jpt.eclipselink.core.context.java.EclipseLinkJavaMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaBasicCollectionMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaBasicMapMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMappingImpl;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddableImpl;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaEntityImpl;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaIdMappingImpl;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaManyToManyMappingImpl;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaManyToOneMappingImpl;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaMappedSuperclassImpl;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaOneToManyMappingImpl;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaOneToOneMappingImpl;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaTransformationMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaVersionMappingImpl;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkEntityMappingsImpl;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmBasicCollectionMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmBasicMapMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmBasicMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmEmbeddableImpl;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmEntityImpl;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmIdMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmManyToManyMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmManyToOneMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmMappedSuperclassImpl;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmOneToManyMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmPersistentType;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmTransformationMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmVersionMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmXml;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkVirtualXmlBasic;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualXmlBasicCollection;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualXmlBasicMap;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkVirtualXmlId;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkVirtualXmlManyToMany;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkVirtualXmlManyToOne;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkVirtualXmlOneToMany;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkVirtualXmlOneToOne;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualXmlTransformation;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkVirtualXmlVersion;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmResource;
-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.XmlTransformation;
-
-public class EclipseLinkJpaFactory
- extends GenericJpaFactory
-{
- protected EclipseLinkJpaFactory() {
- super();
- }
-
-
- // **************** Context objects ****************************************
-
- @Override
- public XmlContextNode buildContextNode(JpaContextNode parent, JpaXmlResource resource) {
- if (resource.getType() == EclipseLinkJpaFile.ECLIPSELINK_ORM_RESOURCE_TYPE) {
- return buildEclipseLinkOrmXml((MappingFileRef) parent, (EclipseLinkOrmResource) resource);
- }
- return super.buildContextNode(parent, resource);
- }
-
- protected EclipseLinkOrmXml buildEclipseLinkOrmXml(MappingFileRef parent, EclipseLinkOrmResource resource) {
- return new EclipseLinkOrmXml(parent, resource);
- }
-
-
- // **************** persistence context objects ****************************
-
- @Override
- public PersistenceUnit buildPersistenceUnit(Persistence parent, XmlPersistenceUnit persistenceUnit) {
- return new EclipseLinkPersistenceUnit(parent, persistenceUnit);
- }
-
- @Override
- public EntityMappings buildEntityMappings(OrmXml parent, XmlEntityMappings xmlEntityMappings) {
- if (parent.getEResource().getType() == EclipseLinkJpaFile.ECLIPSELINK_ORM_RESOURCE_TYPE) {
- return new EclipseLinkEntityMappingsImpl((EclipseLinkOrmXml) parent, (org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntityMappings) xmlEntityMappings);
- }
- return super.buildEntityMappings(parent, xmlEntityMappings);
- }
-
-
- // **************** orm resource objects ***********************************
-
- @Override
- public XmlBasic buildVirtualXmlBasic(OrmTypeMapping ormTypeMapping, JavaBasicMapping javaBasicMapping) {
- if (ormTypeMapping.getEResource().getType() == EclipseLinkJpaFile.ECLIPSELINK_ORM_RESOURCE_TYPE) {
- return new EclipseLinkVirtualXmlBasic(ormTypeMapping, javaBasicMapping);
- }
- return super.buildVirtualXmlBasic(ormTypeMapping, javaBasicMapping);
- }
-
- @Override
- public XmlId buildVirtualXmlId(OrmTypeMapping ormTypeMapping, JavaIdMapping javaIdMapping) {
- if (ormTypeMapping.getEResource().getType() == EclipseLinkJpaFile.ECLIPSELINK_ORM_RESOURCE_TYPE) {
- return new EclipseLinkVirtualXmlId(ormTypeMapping, javaIdMapping);
- }
- return super.buildVirtualXmlId(ormTypeMapping, javaIdMapping);
- }
-
- @Override
- public XmlManyToMany buildVirtualXmlManyToMany(OrmTypeMapping ormTypeMapping, JavaManyToManyMapping javaManyToManyMapping) {
- if (ormTypeMapping.getEResource().getType() == EclipseLinkJpaFile.ECLIPSELINK_ORM_RESOURCE_TYPE) {
- return new EclipseLinkVirtualXmlManyToMany(ormTypeMapping, javaManyToManyMapping);
- }
- return super.buildVirtualXmlManyToMany(ormTypeMapping, javaManyToManyMapping);
- }
-
- @Override
- public XmlManyToOne buildVirtualXmlManyToOne(OrmTypeMapping ormTypeMapping, JavaManyToOneMapping javaManyToOneMapping) {
- if (ormTypeMapping.getEResource().getType() == EclipseLinkJpaFile.ECLIPSELINK_ORM_RESOURCE_TYPE) {
- return new EclipseLinkVirtualXmlManyToOne(ormTypeMapping, javaManyToOneMapping);
- }
- return super.buildVirtualXmlManyToOne(ormTypeMapping, javaManyToOneMapping);
- }
-
- @Override
- public XmlOneToMany buildVirtualXmlOneToMany(OrmTypeMapping ormTypeMapping, JavaOneToManyMapping javaOneToManyMapping) {
- if (ormTypeMapping.getEResource().getType() == EclipseLinkJpaFile.ECLIPSELINK_ORM_RESOURCE_TYPE) {
- return new EclipseLinkVirtualXmlOneToMany(ormTypeMapping, javaOneToManyMapping);
- }
- return super.buildVirtualXmlOneToMany(ormTypeMapping, javaOneToManyMapping);
- }
-
- @Override
- public XmlOneToOne buildVirtualXmlOneToOne(OrmTypeMapping ormTypeMapping, JavaOneToOneMapping javaOneToOneMapping) {
- if (ormTypeMapping.getEResource().getType() == EclipseLinkJpaFile.ECLIPSELINK_ORM_RESOURCE_TYPE) {
- return new EclipseLinkVirtualXmlOneToOne(ormTypeMapping, javaOneToOneMapping);
- }
- return super.buildVirtualXmlOneToOne(ormTypeMapping, javaOneToOneMapping);
- }
-
- @Override
- public XmlVersion buildVirtualXmlVersion(OrmTypeMapping ormTypeMapping, JavaVersionMapping javaVersionMapping) {
- if (ormTypeMapping.getEResource().getType() == EclipseLinkJpaFile.ECLIPSELINK_ORM_RESOURCE_TYPE) {
- return new EclipseLinkVirtualXmlVersion(ormTypeMapping, javaVersionMapping);
- }
- return super.buildVirtualXmlVersion(ormTypeMapping, javaVersionMapping);
- }
-
-
- // **************** eclipselink orm context objects ************************
-
- @Override
- public OrmPersistentType buildOrmPersistentType(OrmPersistentTypeContext parent, String mappingKey) {
- return new EclipseLinkOrmPersistentType(parent, mappingKey);
- }
-
- @Override
- public OrmEmbeddable buildOrmEmbeddable(OrmPersistentType parent) {
- if (parent.getEResource().getType() == EclipseLinkJpaFile.ECLIPSELINK_ORM_RESOURCE_TYPE) {
- return new EclipseLinkOrmEmbeddableImpl(parent);
- }
- return super.buildOrmEmbeddable(parent);
- }
-
- @Override
- public OrmEntity buildOrmEntity(OrmPersistentType parent) {
- if (parent.getEResource().getType() == EclipseLinkJpaFile.ECLIPSELINK_ORM_RESOURCE_TYPE) {
- return new EclipseLinkOrmEntityImpl(parent);
- }
- return super.buildOrmEntity(parent);
- }
-
- @Override
- public OrmMappedSuperclass buildOrmMappedSuperclass(OrmPersistentType parent) {
- if (parent.getEResource().getType() == EclipseLinkJpaFile.ECLIPSELINK_ORM_RESOURCE_TYPE) {
- return new EclipseLinkOrmMappedSuperclassImpl(parent);
- }
- return super.buildOrmMappedSuperclass(parent);
- }
-
- @Override
- public OrmIdMapping buildOrmIdMapping(OrmPersistentAttribute parent) {
- if (parent.getEResource().getType() == EclipseLinkJpaFile.ECLIPSELINK_ORM_RESOURCE_TYPE) {
- return new EclipseLinkOrmIdMapping(parent);
- }
- return super.buildOrmIdMapping(parent);
- }
-
- @Override
- public OrmBasicMapping buildOrmBasicMapping(OrmPersistentAttribute parent) {
- if (parent.getEResource().getType() == EclipseLinkJpaFile.ECLIPSELINK_ORM_RESOURCE_TYPE) {
- return new EclipseLinkOrmBasicMapping(parent);
- }
- return super.buildOrmBasicMapping(parent);
- }
-
- @Override
- public OrmVersionMapping buildOrmVersionMapping(OrmPersistentAttribute parent) {
- if (parent.getEResource().getType() == EclipseLinkJpaFile.ECLIPSELINK_ORM_RESOURCE_TYPE) {
- return new EclipseLinkOrmVersionMapping(parent);
- }
- return super.buildOrmVersionMapping(parent);
- }
-
- @Override
- public OrmManyToOneMapping buildOrmManyToOneMapping(OrmPersistentAttribute parent) {
- if (parent.getEResource().getType() == EclipseLinkJpaFile.ECLIPSELINK_ORM_RESOURCE_TYPE) {
- return new EclipseLinkOrmManyToOneMapping(parent);
- }
- return super.buildOrmManyToOneMapping(parent);
- }
-
- @Override
- public OrmOneToManyMapping buildOrmOneToManyMapping(OrmPersistentAttribute parent) {
- if (parent.getEResource().getType() == EclipseLinkJpaFile.ECLIPSELINK_ORM_RESOURCE_TYPE) {
- return new EclipseLinkOrmOneToManyMapping(parent);
- }
- return super.buildOrmOneToManyMapping(parent);
- }
-
- @Override
- public OrmOneToOneMapping buildOrmOneToOneMapping(OrmPersistentAttribute parent) {
- if (parent.getEResource().getType() == EclipseLinkJpaFile.ECLIPSELINK_ORM_RESOURCE_TYPE) {
- return new EclipseLinkOrmOneToOneMapping(parent);
- }
- return super.buildOrmOneToOneMapping(parent);
- }
-
- @Override
- public OrmManyToManyMapping buildOrmManyToManyMapping(OrmPersistentAttribute parent) {
- if (parent.getEResource().getType() == EclipseLinkJpaFile.ECLIPSELINK_ORM_RESOURCE_TYPE) {
- return new EclipseLinkOrmManyToManyMapping(parent);
- }
- return super.buildOrmManyToManyMapping(parent);
- }
-
-
- // **************** java context objects ***********************************
-
- @Override
- public JavaBasicMapping buildJavaBasicMapping(JavaPersistentAttribute parent) {
- return new EclipseLinkJavaBasicMappingImpl(parent);
- }
-
- @Override
- public JavaEmbeddable buildJavaEmbeddable(JavaPersistentType parent) {
- return new EclipseLinkJavaEmbeddableImpl(parent);
- }
-
- @Override
- public EclipseLinkJavaEntity buildJavaEntity(JavaPersistentType parent) {
- return new EclipseLinkJavaEntityImpl(parent);
- }
-
- @Override
- public JavaIdMapping buildJavaIdMapping(JavaPersistentAttribute parent) {
- return new EclipseLinkJavaIdMappingImpl(parent);
- }
-
- @Override
- public EclipseLinkJavaMappedSuperclass buildJavaMappedSuperclass(JavaPersistentType parent) {
- return new EclipseLinkJavaMappedSuperclassImpl(parent);
- }
-
- @Override
- public JavaVersionMapping buildJavaVersionMapping(JavaPersistentAttribute parent) {
- return new EclipseLinkJavaVersionMappingImpl(parent);
- }
-
- @Override
- public JavaOneToManyMapping buildJavaOneToManyMapping(JavaPersistentAttribute parent) {
- return new EclipseLinkJavaOneToManyMappingImpl(parent);
- }
-
- @Override
- public JavaOneToOneMapping buildJavaOneToOneMapping(JavaPersistentAttribute parent) {
- return new EclipseLinkJavaOneToOneMappingImpl(parent);
- }
-
- @Override
- public JavaManyToManyMapping buildJavaManyToManyMapping(JavaPersistentAttribute parent) {
- return new EclipseLinkJavaManyToManyMappingImpl(parent);
- }
-
- @Override
- public JavaManyToOneMapping buildJavaManyToOneMapping(JavaPersistentAttribute parent) {
- return new EclipseLinkJavaManyToOneMappingImpl(parent);
- }
-
- public JavaBasicCollectionMapping buildJavaBasicCollectionMapping(JavaPersistentAttribute parent) {
- return new JavaBasicCollectionMapping(parent);
- }
-
- public JavaBasicMapMapping buildJavaBasicMapMapping(JavaPersistentAttribute parent) {
- return new JavaBasicMapMapping(parent);
- }
-
- public JavaTransformationMapping buildJavaTransformationMapping(JavaPersistentAttribute parent) {
- return new JavaTransformationMapping(parent);
- }
-
- public OrmBasicCollectionMapping buildOrmBasicCollectionMapping(OrmPersistentAttribute parent) {
- return new OrmBasicCollectionMapping(parent);
- }
-
- public OrmBasicMapMapping buildOrmBasicMapMapping(OrmPersistentAttribute parent) {
- return new OrmBasicMapMapping(parent);
- }
-
- public OrmTransformationMapping buildOrmTransformationMapping(OrmPersistentAttribute parent) {
- return new OrmTransformationMapping(parent);
- }
-
- public XmlBasicCollection buildVirtualXmlBasicCollection(OrmTypeMapping ormTypeMapping, JavaBasicCollectionMapping javaBasicCollectionMapping) {
- return new VirtualXmlBasicCollection(ormTypeMapping, javaBasicCollectionMapping);
- }
-
- public XmlBasicMap buildVirtualXmlBasicMap(OrmTypeMapping ormTypeMapping, JavaBasicMapMapping javaBasicMapMapping) {
- return new VirtualXmlBasicMap(ormTypeMapping, javaBasicMapMapping);
- }
-
- public XmlTransformation buildVirtualXmlTransformation(OrmTypeMapping ormTypeMapping, JavaTransformationMapping javaTransformationMapping) {
- return new VirtualXmlTransformation(ormTypeMapping, javaTransformationMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaPlatform.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaPlatform.java
deleted file mode 100644
index 94f8d39ea5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaPlatform.java
+++ /dev/null
@@ -1,89 +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.internal;
-
-import java.util.List;
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.JpaFileProvider;
-import org.eclipse.jpt.core.context.java.DefaultJavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.internal.platform.GenericJpaPlatform;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaOneToManyMappingProvider;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaOneToOneMappingProvider;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaBasicCollectionMappingProvider;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaBasicMapMappingProvider;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaTransformationMappingProvider;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmBasicCollectionMappingProvider;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmBasicMapMappingProvider;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmTransformationMappingProvider;
-
-/**
- * EclipseLink platform
- */
-public class EclipseLinkJpaPlatform
- extends GenericJpaPlatform
-{
- public static final String ID = "org.eclipse.eclipselink.platform"; //$NON-NLS-1$
-
-
- public EclipseLinkJpaPlatform() {
- super();
- }
-
- @Override
- public String getId() {
- return EclipseLinkJpaPlatform.ID;
- }
-
- // ********* factory *********
- @Override
- protected JpaFactory buildJpaFactory() {
- return new EclipseLinkJpaFactory();
- }
-
- // ********* JPA files *********
- @Override
- protected void addJpaFileProvidersTo(List<JpaFileProvider> providers) {
- super.addJpaFileProvidersTo(providers);
- providers.add(EclipseLinkOrmJpaFileProvider.instance());
- }
-
- // ********* java annotations *********
- @Override
- protected JpaAnnotationProvider buildAnnotationProvider() {
- return new EclipseLinkJpaAnnotationProvider();
- }
-
- @Override
- protected void addJavaAttributeMappingProvidersTo(List<JavaAttributeMappingProvider> providers) {
- super.addJavaAttributeMappingProvidersTo(providers);
- providers.add(JavaBasicCollectionMappingProvider.instance());
- providers.add(JavaBasicMapMappingProvider.instance());
- providers.add(JavaTransformationMappingProvider.instance());
- }
-
- @Override
- protected void addDefaultJavaAttributeMappingProvidersTo(List<DefaultJavaAttributeMappingProvider> providers) {
- providers.add(EclipseLinkJavaOneToOneMappingProvider.instance());
- providers.add(EclipseLinkJavaOneToManyMappingProvider.instance());
- //add these before calling super, want to check for Basic last in case the reference object is Serializable
- super.addDefaultJavaAttributeMappingProvidersTo(providers);
- }
-
- @Override
- protected void addOrmAttributeMappingProvidersTo(List<OrmAttributeMappingProvider> providers) {
- super.addOrmAttributeMappingProvidersTo(providers);
- providers.add(OrmBasicCollectionMappingProvider.instance());
- providers.add(OrmBasicMapMappingProvider.instance());
- providers.add(OrmTransformationMappingProvider.instance());
- }
-}
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 352eaa4aae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaValidationMessages.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.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";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkOrmJpaFileProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkOrmJpaFileProvider.java
deleted file mode 100644
index 671eac4873..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkOrmJpaFileProvider.java
+++ /dev/null
@@ -1,52 +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.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaFileProvider;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.internal.XmlJpaFile;
-import org.eclipse.jpt.eclipselink.core.internal.resource.orm.EclipseLinkOrmResourceModelProvider;
-
-/**
- * EclipseLink orm.xml
- */
-public class EclipseLinkOrmJpaFileProvider
- implements JpaFileProvider
-{
-
- // singleton
- private static final EclipseLinkOrmJpaFileProvider INSTANCE = new EclipseLinkOrmJpaFileProvider();
-
- /**
- * Return the singleton.
- */
- public static EclipseLinkOrmJpaFileProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private EclipseLinkOrmJpaFileProvider() {
- super();
- }
-
- public String getContentId() {
- return JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE;
- }
-
- public JpaFile buildJpaFile(JpaProject jpaProject, IFile file, JpaFactory factory) {
- return new XmlJpaFile(jpaProject, file, EclipseLinkOrmResourceModelProvider.getModelProvider(file).getResource());
- }
-
-}
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 626a913327..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/JptEclipseLinkCorePlugin.java
+++ /dev/null
@@ -1,102 +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.internal;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jpt.core.JptCorePlugin;
-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$
-
- /**
- * 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 String ECLIPSELINK_ORM_XML_CONTENT_TYPE = PLUGIN_ID + ".content.orm"; //$NON-NLS-1$
-
- public static final String DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH = "META-INF/eclipselink-orm.xml"; //$NON-NLS-1$
-
-
- // The shared instance
- private static JptEclipseLinkCorePlugin plugin;
-
-
- /**
- * The constructor
- */
- public JptEclipseLinkCorePlugin() {}
-
-
- /**
- * 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) {
- plugin.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 **********
-
- @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 JptEclipseLinkCorePlugin getDefault() {
- return plugin;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMappingImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMappingImpl.java
deleted file mode 100644
index 3859a0abd4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMappingImpl.java
+++ /dev/null
@@ -1,84 +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.internal.context.java;
-
-import java.util.List;
-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.GenericJavaBasicMapping;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.context.Convert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkBasicMapping;
-import org.eclipse.jpt.eclipselink.core.context.Mutable;
-import org.eclipse.jpt.eclipselink.core.resource.java.ConvertAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkJavaBasicMappingImpl extends GenericJavaBasicMapping implements EclipseLinkBasicMapping
-{
-
- protected final EclipseLinkJavaMutable mutable;
-
- public EclipseLinkJavaBasicMappingImpl(JavaPersistentAttribute parent) {
- super(parent);
- this.mutable = new EclipseLinkJavaMutable(this);
- }
-
- @Override
- protected JavaConverter buildSpecifiedConverter(String converterType) {
- JavaConverter javaConverter = super.buildSpecifiedConverter(converterType);
- if (javaConverter != null) {
- return javaConverter;
- }
- if (converterType == Convert.ECLIPSE_LINK_CONVERTER) {
- return new EclipseLinkJavaConvert(this, this.resourcePersistentAttribute);
- }
- return null;
- }
-
- @Override
- protected String specifiedConverterType(JavaResourcePersistentAttribute jrpa) {
- //check @Convert first, this is the order that EclipseLink searches
- if (jrpa.getSupportingAnnotation(ConvertAnnotation.ANNOTATION_NAME) != null) {
- return Convert.ECLIPSE_LINK_CONVERTER;
- }
- return super.specifiedConverterType(jrpa);
- }
-
- //************ EclipselinkJavaBasicMapping implementation ****************
-
- public Mutable getMutable() {
- return this.mutable;
- }
-
-
- //************ initialization/update ****************
-
- @Override
- public void initialize(JavaResourcePersistentAttribute jrpa) {
- super.initialize(jrpa);
- this.mutable.initialize(jrpa);
- }
-
- @Override
- public void update(JavaResourcePersistentAttribute jrpa) {
- super.update(jrpa);
- this.mutable.update(jrpa);
- }
-
-
- //************ validation ****************
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- this.mutable.validate(messages, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaCaching.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaCaching.java
deleted file mode 100644
index f16ace15c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaCaching.java
+++ /dev/null
@@ -1,557 +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.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.CacheCoordinationType;
-import org.eclipse.jpt.eclipselink.core.context.CacheType;
-import org.eclipse.jpt.eclipselink.core.context.Caching;
-import org.eclipse.jpt.eclipselink.core.context.ExistenceType;
-import org.eclipse.jpt.eclipselink.core.context.ExpiryTimeOfDay;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaCaching;
-import org.eclipse.jpt.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.eclipselink.core.resource.java.CacheAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.ExistenceCheckingAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.TimeOfDayAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkJavaCaching extends AbstractJavaJpaContextNode implements JavaCaching
-{
-
- protected CacheType specifiedType;
- protected Integer specifiedSize;
- protected Boolean specifiedShared;
- protected Boolean specifiedAlwaysRefresh;
- protected Boolean specifiedRefreshOnlyIfNewer;
- protected Boolean specifiedDisableHits;
-
- protected boolean existenceChecking;
- protected ExistenceType specifiedExistenceType;
- protected ExistenceType defaultExistenceType;
-
- protected CacheCoordinationType specifiedCoordinationType;
-
- protected Integer expiry;
- protected EclipseLinkJavaExpiryTimeOfDay expiryTimeOfDay;
-
-
- protected JavaResourcePersistentType resourcePersistentType;
-
- public EclipseLinkJavaCaching(JavaTypeMapping parent) {
- super(parent);
- }
-
- @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 CacheAnnotation getCacheAnnotation() {
- return (CacheAnnotation) this.resourcePersistentType.getNonNullSupportingAnnotation(getCacheAnnotationName());
- }
-
- protected ExistenceCheckingAnnotation getExistenceCheckingAnnotation() {
- return (ExistenceCheckingAnnotation) this.resourcePersistentType.getSupportingAnnotation(getExistenceCheckingAnnotationName());
- }
-
- protected String getCacheAnnotationName() {
- return CacheAnnotation.ANNOTATION_NAME;
- }
-
- protected String getExistenceCheckingAnnotationName() {
- return ExistenceCheckingAnnotation.ANNOTATION_NAME;
- }
-
- public CacheType getType() {
- return (this.getSpecifiedType() == null) ? this.getDefaultType() : this.getSpecifiedType();
- }
-
- public CacheType getDefaultType() {
- return DEFAULT_TYPE;
- }
-
- public CacheType getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(CacheType newSpecifiedType) {
- CacheType oldSpecifiedType = this.specifiedType;
- this.specifiedType = newSpecifiedType;
- this.getCacheAnnotation().setType(CacheType.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_(CacheType newSpecifiedType) {
- CacheType 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 Caching.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 Caching.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(Caching.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(Caching.SPECIFIED_SHARED_PROPERTY, oldSpecifiedShared, newSpecifiedShared);
- }
-
- public boolean isAlwaysRefresh() {
- return (this.specifiedAlwaysRefresh == null) ? this.isDefaultAlwaysRefresh() : this.specifiedAlwaysRefresh.booleanValue();
- }
-
- public boolean isDefaultAlwaysRefresh() {
- return Caching.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(Caching.SPECIFIED_ALWAYS_REFRESH_PROPERTY, oldAlwaysRefresh, newSpecifiedAlwaysRefresh);
- }
-
- protected void setSpecifiedAlwaysRefresh_(Boolean newSpecifiedAlwaysRefresh) {
- Boolean oldAlwaysRefresh = this.specifiedAlwaysRefresh;
- this.specifiedAlwaysRefresh = newSpecifiedAlwaysRefresh;
- firePropertyChanged(Caching.SPECIFIED_ALWAYS_REFRESH_PROPERTY, oldAlwaysRefresh, newSpecifiedAlwaysRefresh);
- }
-
- public boolean isRefreshOnlyIfNewer() {
- return (this.specifiedRefreshOnlyIfNewer == null) ? this.isDefaultRefreshOnlyIfNewer() : this.specifiedRefreshOnlyIfNewer.booleanValue();
- }
-
- public boolean isDefaultRefreshOnlyIfNewer() {
- return Caching.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(Caching.SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY, oldRefreshOnlyIfNewer, newSpecifiedRefreshOnlyIfNewer);
- }
-
- protected void setSpecifiedRefreshOnlyIfNewer_(Boolean newSpecifiedRefreshOnlyIfNewer) {
- Boolean oldRefreshOnlyIfNewer = this.specifiedRefreshOnlyIfNewer;
- this.specifiedRefreshOnlyIfNewer = newSpecifiedRefreshOnlyIfNewer;
- firePropertyChanged(Caching.SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY, oldRefreshOnlyIfNewer, newSpecifiedRefreshOnlyIfNewer);
- }
-
- public boolean isDisableHits() {
- return (this.specifiedDisableHits == null) ? this.isDefaultDisableHits() : this.specifiedDisableHits.booleanValue();
- }
-
- public boolean isDefaultDisableHits() {
- return Caching.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(Caching.SPECIFIED_DISABLE_HITS_PROPERTY, oldDisableHits, newSpecifiedDisableHits);
- }
-
- protected void setSpecifiedDisableHits_(Boolean newSpecifiedDisableHits) {
- Boolean oldDisableHits = this.specifiedDisableHits;
- this.specifiedDisableHits = newSpecifiedDisableHits;
- firePropertyChanged(Caching.SPECIFIED_DISABLE_HITS_PROPERTY, oldDisableHits, newSpecifiedDisableHits);
- }
-
- public CacheCoordinationType getCoordinationType() {
- return (this.getSpecifiedCoordinationType() == null) ? this.getDefaultCoordinationType() : this.getSpecifiedCoordinationType();
- }
-
- public CacheCoordinationType getDefaultCoordinationType() {
- return DEFAULT_COORDINATION_TYPE;
- }
-
- public CacheCoordinationType getSpecifiedCoordinationType() {
- return this.specifiedCoordinationType;
- }
-
- public void setSpecifiedCoordinationType(CacheCoordinationType newSpecifiedCoordinationType) {
- CacheCoordinationType oldSpecifiedCoordinationType = this.specifiedCoordinationType;
- this.specifiedCoordinationType = newSpecifiedCoordinationType;
- this.getCacheAnnotation().setCoordinationType(CacheCoordinationType.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_(CacheCoordinationType newSpecifiedCoordinationType) {
- CacheCoordinationType 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.addSupportingAnnotation(getExistenceCheckingAnnotationName());
- }
- else {
- this.resourcePersistentType.removeSupportingAnnotation(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 ExistenceType caclulateDefaultExistenceType() {
- if (hasExistenceChecking()) {
- return ExistenceType.CHECK_CACHE;
- }
- return DEFAULT_EXISTENCE_TYPE;
- }
-
- public ExistenceType getExistenceType() {
- return (this.getSpecifiedExistenceType() == null) ? this.getDefaultExistenceType() : this.getSpecifiedExistenceType();
- }
-
- public ExistenceType getDefaultExistenceType() {
- return this.defaultExistenceType;
- }
-
- protected void setDefaultExistenceType(ExistenceType newDefaultExistenceType) {
- ExistenceType oldDefaultExistenceType = this.defaultExistenceType;
- this.defaultExistenceType = newDefaultExistenceType;
- firePropertyChanged(DEFAULT_EXISTENCE_TYPE_PROPERTY, oldDefaultExistenceType, newDefaultExistenceType);
- }
-
- public ExistenceType getSpecifiedExistenceType() {
- return this.specifiedExistenceType;
- }
-
- public void setSpecifiedExistenceType(ExistenceType newSpecifiedExistenceType) {
- if (!hasExistenceChecking()) {
- if (newSpecifiedExistenceType != null) {
- setExistenceChecking(true);
- }
- else {
- return;
- }
- }
- ExistenceType oldSpecifiedExistenceType = this.specifiedExistenceType;
- this.specifiedExistenceType = newSpecifiedExistenceType;
- this.getExistenceCheckingAnnotation().setValue(ExistenceType.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_(ExistenceType newSpecifiedExistenceType) {
- ExistenceType 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 ExpiryTimeOfDay getExpiryTimeOfDay() {
- return this.expiryTimeOfDay;
- }
-
- public ExpiryTimeOfDay addExpiryTimeOfDay() {
- if (this.expiryTimeOfDay != null) {
- throw new IllegalStateException("expiryTimeOfDay already exists, use getExpiryTimeOfDay()"); //$NON-NLS-1$
- }
- if (this.resourcePersistentType.getSupportingAnnotation(getCacheAnnotationName()) == null) {
- this.resourcePersistentType.addSupportingAnnotation(getCacheAnnotationName());
- }
- EclipseLinkJavaExpiryTimeOfDay newExpiryTimeOfDay = new EclipseLinkJavaExpiryTimeOfDay(this);
- this.expiryTimeOfDay = newExpiryTimeOfDay;
- TimeOfDayAnnotation 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$
- }
- ExpiryTimeOfDay oldExpiryTimeOfDay = this.expiryTimeOfDay;
- this.expiryTimeOfDay = null;
- getCacheAnnotation().removeExpiryTimeOfDay();
- firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, oldExpiryTimeOfDay, null);
- }
-
- protected void setExpiryTimeOfDay(EclipseLinkJavaExpiryTimeOfDay newExpiryTimeOfDay) {
- EclipseLinkJavaExpiryTimeOfDay oldExpiryTimeOfDay = this.expiryTimeOfDay;
- this.expiryTimeOfDay = newExpiryTimeOfDay;
- firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, oldExpiryTimeOfDay, newExpiryTimeOfDay);
- }
-
- public void initialize(JavaResourcePersistentType resourcePersistentType) {
- this.resourcePersistentType = resourcePersistentType;
- initialize(getCacheAnnotation());
- initialize(getExistenceCheckingAnnotation());
- }
-
- protected void initialize(CacheAnnotation 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(ExistenceCheckingAnnotation existenceChecking) {
- this.existenceChecking = existenceChecking != null;
- this.specifiedExistenceType = specifiedExistenceType(existenceChecking);
- this.defaultExistenceType = this.caclulateDefaultExistenceType();
- }
-
- protected void initializeExpiry(CacheAnnotation 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 EclipseLinkJavaExpiryTimeOfDay(this);
- this.expiryTimeOfDay.initialize(cache.getExpiryTimeOfDay());
- }
- }
- }
-
- public void update(JavaResourcePersistentType resourcePersistentType) {
- this.resourcePersistentType = resourcePersistentType;
- update(getCacheAnnotation());
- update(getExistenceCheckingAnnotation());
- updateExpiry(getCacheAnnotation());
- }
-
- protected void update(CacheAnnotation 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(ExistenceCheckingAnnotation existenceChecking) {
- setExistenceChecking_(existenceChecking != null);
- setSpecifiedExistenceType_(specifiedExistenceType(existenceChecking));
- setDefaultExistenceType(caclulateDefaultExistenceType());
- }
-
- protected void updateExpiry(CacheAnnotation 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 EclipseLinkJavaExpiryTimeOfDay(this));
- this.expiryTimeOfDay.initialize(cache.getExpiryTimeOfDay());
- }
- else { //handle with validation if both expiry and expiryTimeOfDay are set
- setExpiryTimeOfDay(null);
- }
- }
- }
-
- protected CacheType specifiedType(CacheAnnotation cache) {
- return CacheType.fromJavaResourceModel(cache.getType());
- }
-
- protected Integer specifiedSize(CacheAnnotation cache) {
- return cache.getSize();
- }
-
- protected Boolean specifiedShared(CacheAnnotation cache) {
- return cache.getShared();
- }
-
- protected Boolean specifiedAlwaysRefresh(CacheAnnotation cache) {
- return cache.getAlwaysRefresh();
- }
-
- protected Boolean specifiedRefreshOnlyIfNewer(CacheAnnotation cache) {
- return cache.getRefreshOnlyIfNewer();
- }
-
- protected Boolean specifiedDisableHits(CacheAnnotation cache) {
- return cache.getDisableHits();
- }
-
- protected CacheCoordinationType specifiedCoordinationType(CacheAnnotation cache) {
- return CacheCoordinationType.fromJavaResourceModel(cache.getCoordinationType());
- }
-
- protected Integer expiry(CacheAnnotation cache) {
- return cache.getExpiry();
- }
-
- protected ExistenceType specifiedExistenceType(ExistenceCheckingAnnotation existenceChecking) {
- if (existenceChecking == null) {
- return null;
- }
- return ExistenceType.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, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- this.validateExpiry(messages, astRoot);
- }
-
- protected void validateExpiry(List<IMessage> messages, CompilationUnit astRoot) {
- CacheAnnotation 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/EclipseLinkJavaChangeTracking.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaChangeTracking.java
deleted file mode 100644
index 429c3281fa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaChangeTracking.java
+++ /dev/null
@@ -1,134 +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.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.ChangeTracking;
-import org.eclipse.jpt.eclipselink.core.context.ChangeTrackingType;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.eclipselink.core.resource.java.ChangeTrackingAnnotation;
-
-public class EclipseLinkJavaChangeTracking extends AbstractJavaJpaContextNode implements ChangeTracking
-{
- protected JavaResourcePersistentType resourcePersistentType;
-
- protected ChangeTrackingType specifiedType;
-
-
- public EclipseLinkJavaChangeTracking(JavaTypeMapping parent) {
- super(parent);
- }
-
- @Override
- public JavaTypeMapping getParent() {
- return (JavaTypeMapping) super.getParent();
- }
-
- @Override
- protected EclipseLinkJpaFactory getJpaFactory() {
- return (EclipseLinkJpaFactory) super.getJpaFactory();
- }
-
- protected String getChangeTrackingAnnotationName() {
- return ChangeTrackingAnnotation.ANNOTATION_NAME;
- }
-
- protected ChangeTrackingAnnotation getChangeTrackingAnnotation() {
- return (ChangeTrackingAnnotation) this.resourcePersistentType.getSupportingAnnotation(getChangeTrackingAnnotationName());
- }
-
- protected void addChangeTrackingAnnotation() {
- this.resourcePersistentType.addSupportingAnnotation(getChangeTrackingAnnotationName());
- }
-
- protected void removeChangeTrackingAnnotation() {
- this.resourcePersistentType.removeSupportingAnnotation(getChangeTrackingAnnotationName());
- }
-
- public ChangeTrackingType getType() {
- return (this.getSpecifiedType() != null) ? this.getSpecifiedType() : this.getDefaultType();
- }
-
- public ChangeTrackingType getDefaultType() {
- return DEFAULT_TYPE;
- }
-
- public ChangeTrackingType getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(ChangeTrackingType newSpecifiedType) {
- if (this.specifiedType == newSpecifiedType) {
- return;
- }
-
- ChangeTrackingType oldSpecifiedType = this.specifiedType;
- this.specifiedType = newSpecifiedType;
-
- if (newSpecifiedType != null) {
- if (getChangeTrackingAnnotation() == null) {
- addChangeTrackingAnnotation();
- }
- getChangeTrackingAnnotation().setValue(ChangeTrackingType.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_(ChangeTrackingType newSpecifiedType) {
- ChangeTrackingType oldSpecifiedType = this.specifiedType;
- this.specifiedType = newSpecifiedType;
- firePropertyChanged(SPECIFIED_TYPE_PROPERTY, oldSpecifiedType, newSpecifiedType);
- }
-
- public void initialize(JavaResourcePersistentType resourcePersistentType) {
- this.resourcePersistentType = resourcePersistentType;
- ChangeTrackingAnnotation changeTrackingAnnotation = this.getChangeTrackingAnnotation();
- this.specifiedType = changeTrackingType(changeTrackingAnnotation);
- }
-
- public void update(JavaResourcePersistentType resourcePersistentType) {
- this.resourcePersistentType = resourcePersistentType;
- ChangeTrackingAnnotation changeTrackingAnnotation = this.getChangeTrackingAnnotation();
- this.setSpecifiedType_(changeTrackingType(changeTrackingAnnotation));
- }
-
- protected ChangeTrackingType changeTrackingType(ChangeTrackingAnnotation changeTracking) {
- if (changeTracking == null) {
- return null;
- }
- else if (changeTracking.getValue() == null) {
- return ChangeTracking.DEFAULT_TYPE;
- }
- else {
- return ChangeTrackingType.fromJavaResourceModel(changeTracking.getValue());
- }
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- ChangeTrackingAnnotation 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/EclipseLinkJavaConversionValue.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaConversionValue.java
deleted file mode 100644
index c1c579d3b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaConversionValue.java
+++ /dev/null
@@ -1,131 +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.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.ConversionValue;
-import org.eclipse.jpt.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.eclipselink.core.resource.java.ConversionValueAnnotation;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkJavaConversionValue extends AbstractJavaJpaContextNode implements ConversionValue
-{
- private ConversionValueAnnotation resourceConversionValue;
-
- private String dataValue;
-
- private String objectValue;
-
- public EclipseLinkJavaConversionValue(EclipseLinkJavaObjectTypeConverter parent) {
- super(parent);
- }
-
- @Override
- public EclipseLinkJavaObjectTypeConverter getParent() {
- return (EclipseLinkJavaObjectTypeConverter) super.getParent();
- }
-
- protected String getAnnotationName() {
- return ConversionValueAnnotation.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(ConversionValueAnnotation resourceConversionValue) {
- this.resourceConversionValue = resourceConversionValue;
- this.dataValue = this.dataValue();
- this.objectValue = this.objectValue();
- }
-
- public void update(ConversionValueAnnotation 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, CompilationUnit astRoot) {
- super.validate(messages, 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/EclipseLinkJavaConvert.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaConvert.java
deleted file mode 100644
index dd06dc52d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaConvert.java
+++ /dev/null
@@ -1,199 +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.internal.context.java;
-
-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.Convert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.resource.java.ConvertAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.ConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.ObjectTypeConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.StructConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.TypeConverterAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkJavaConvert extends AbstractJavaJpaContextNode implements Convert, JavaConverter
-{
- private String specifiedConverterName;
-
- private JavaResourcePersistentAttribute resourcePersistentAttribute;
-
- private EclipseLinkJavaConverter converter;
-
- public EclipseLinkJavaConvert(JavaAttributeMapping parent, JavaResourcePersistentAttribute jrpa) {
- super(parent);
- this.initialize(jrpa);
- }
-
- @Override
- public JavaAttributeMapping getParent() {
- return (JavaAttributeMapping) super.getParent();
- }
-
- public String getType() {
- return Convert.ECLIPSE_LINK_CONVERTER;
- }
-
- protected String getAnnotationName() {
- return ConvertAnnotation.ANNOTATION_NAME;
- }
-
- public void addToResourceModel() {
- this.resourcePersistentAttribute.addSupportingAnnotation(getAnnotationName());
- }
-
- public void removeFromResourceModel() {
- this.resourcePersistentAttribute.removeSupportingAnnotation(getAnnotationName());
- if (getConverter() != null) {
- this.resourcePersistentAttribute.removeSupportingAnnotation(getConverter().getAnnotationName());
- }
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getResourceConvert().getTextRange(astRoot);
- }
-
- protected ConvertAnnotation getResourceConvert() {
- return (ConvertAnnotation) this.resourcePersistentAttribute.getSupportingAnnotation(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 EclipseLinkJavaConverter 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;
- }
- EclipseLinkJavaConverter oldConverter = this.converter;
- EclipseLinkJavaConverter newConverter = buildConverter(converterType);
- this.converter = null;
- if (oldConverter != null) {
- this.resourcePersistentAttribute.removeSupportingAnnotation(oldConverter.getAnnotationName());
- }
- this.converter = newConverter;
- if (newConverter != null) {
- this.resourcePersistentAttribute.addSupportingAnnotation(newConverter.getAnnotationName());
- }
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- protected void setConverter(EclipseLinkJavaConverter newConverter) {
- EclipseLinkJavaConverter oldConverter = this.converter;
- this.converter = newConverter;
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- protected void initialize(JavaResourcePersistentAttribute jrpa) {
- this.resourcePersistentAttribute = jrpa;
- this.specifiedConverterName = this.specifiedConverterName(getResourceConvert());
- this.converter = this.buildConverter(this.converterType(jrpa));
- }
-
- public void update(JavaResourcePersistentAttribute jrpa) {
- this.resourcePersistentAttribute = jrpa;
- this.setSpecifiedConverterName_(this.specifiedConverterName(getResourceConvert()));
- if (converterType(jrpa) == getConverterType()) {
- getConverter().update(jrpa);
- }
- else {
- EclipseLinkJavaConverter javaConverter = buildConverter(converterType(jrpa));
- setConverter(javaConverter);
- }
- }
-
- protected String specifiedConverterName(ConvertAnnotation resourceConvert) {
- return resourceConvert == null ? null : resourceConvert.getValue();
- }
-
-
- protected EclipseLinkJavaConverter buildConverter(String converterType) {
- if (converterType == EclipseLinkConverter.NO_CONVERTER) {
- return null;
- }
- if (converterType == EclipseLinkConverter.CUSTOM_CONVERTER) {
- return new EclipseLinkJavaCustomConverter(this, this.resourcePersistentAttribute);
- }
- else if (converterType == EclipseLinkConverter.TYPE_CONVERTER) {
- return new EclipseLinkJavaTypeConverter(this, this.resourcePersistentAttribute);
- }
- else if (converterType == EclipseLinkConverter.OBJECT_TYPE_CONVERTER) {
- return new EclipseLinkJavaObjectTypeConverter(this, this.resourcePersistentAttribute);
- }
- else if (converterType == EclipseLinkConverter.STRUCT_CONVERTER) {
- return new EclipseLinkJavaStructConverter(this, this.resourcePersistentAttribute);
- }
- return null;
- }
-
- protected String converterType(JavaResourcePersistentAttribute jrpa) {
- if (jrpa.getSupportingAnnotation(ConverterAnnotation.ANNOTATION_NAME) != null) {
- return EclipseLinkConverter.CUSTOM_CONVERTER;
- }
- else if (jrpa.getSupportingAnnotation(TypeConverterAnnotation.ANNOTATION_NAME) != null) {
- return EclipseLinkConverter.TYPE_CONVERTER;
- }
- else if (jrpa.getSupportingAnnotation(ObjectTypeConverterAnnotation.ANNOTATION_NAME) != null) {
- return EclipseLinkConverter.OBJECT_TYPE_CONVERTER;
- }
- else if (jrpa.getSupportingAnnotation(StructConverterAnnotation.ANNOTATION_NAME) != null) {
- return EclipseLinkConverter.STRUCT_CONVERTER;
- }
-
- return null;
- }
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- if (getConverter() != null) {
- getConverter().validate(messages, astRoot);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaConverter.java
deleted file mode 100644
index ec670aba04..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaConverter.java
+++ /dev/null
@@ -1,106 +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.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.NamedConverterAnnotation;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-public abstract class EclipseLinkJavaConverter extends AbstractJavaJpaContextNode
- implements EclipseLinkConverter
-{
- private JavaResourcePersistentMember resourcePersistentMember;
-
- private String name;
-
-
- protected EclipseLinkJavaConverter(JavaJpaContextNode parent, JavaResourcePersistentMember jrpm) {
- super(parent);
- this.initialize(jrpm);
- }
-
-
- protected NamedConverterAnnotation getAnnotation() {
- return (NamedConverterAnnotation) this.resourcePersistentMember.getSupportingAnnotation(getAnnotationName());
- }
-
- protected abstract String getAnnotationName();
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
-
- // **************** 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());
- getPersistenceUnit().addConverter(this);
- }
-
- protected void update(JavaResourcePersistentMember jrpm) {
- this.resourcePersistentMember = jrpm;
- this.setName_(this.name(getAnnotation()));
- getPersistenceUnit().addConverter(this);
- }
-
- protected String name(NamedConverterAnnotation 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/EclipseLinkJavaConverterHolder.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaConverterHolder.java
deleted file mode 100644
index 56ec6898f6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaConverterHolder.java
+++ /dev/null
@@ -1,345 +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.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.CustomConverter;
-import org.eclipse.jpt.eclipselink.core.context.ObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.StructConverter;
-import org.eclipse.jpt.eclipselink.core.context.TypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaConverterHolder;
-import org.eclipse.jpt.eclipselink.core.resource.java.ConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.ObjectTypeConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.StructConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.TypeConverterAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkJavaConverterHolder extends AbstractJavaJpaContextNode implements JavaConverterHolder
-{
- protected JavaResourcePersistentType resourcePersistentType;
-
- protected EclipseLinkJavaCustomConverter converter;
- protected EclipseLinkJavaObjectTypeConverter objectTypeConverter;
- protected EclipseLinkJavaStructConverter structConverter;
- protected EclipseLinkJavaTypeConverter typeConverter;
-
- public EclipseLinkJavaConverterHolder(JavaTypeMapping parent) {
- super(parent);
- }
-
- //************** converter *************
- public CustomConverter getConverter() {
- return this.converter;
- }
-
- public CustomConverter addConverter() {
- if (this.converter != null) {
- throw new IllegalStateException("converter already exists"); //$NON-NLS-1$
- }
- this.converter = new EclipseLinkJavaCustomConverter(this, this.resourcePersistentType);
- this.resourcePersistentType.addSupportingAnnotation(this.converter.getAnnotationName());
- firePropertyChanged(CONVERTER_PROPERTY, null, this.converter);
- return this.converter;
- }
-
- protected void addConverter_() {
- this.converter = new EclipseLinkJavaCustomConverter(this, this.resourcePersistentType);
- firePropertyChanged(CONVERTER_PROPERTY, null, this.converter);
- }
-
- public void removeConverter() {
- if (this.converter == null) {
- throw new IllegalStateException("converter is null"); //$NON-NLS-1$
- }
- EclipseLinkJavaCustomConverter oldConverter = this.converter;
- this.converter = null;
- this.resourcePersistentType.removeSupportingAnnotation(oldConverter.getAnnotationName());
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, null);
- }
-
- protected void removeConverter_() {
- this.converter = null;
- firePropertyChanged(CONVERTER_PROPERTY, this.converter, null);
- }
-
- protected String getConverterAnnotationName() {
- return ConverterAnnotation.ANNOTATION_NAME;
- }
-
- protected ConverterAnnotation getResourceConverter() {
- return (ConverterAnnotation) this.resourcePersistentType.getSupportingAnnotation(getConverterAnnotationName());
- }
-
-
- //************** object type converter *************
- public ObjectTypeConverter getObjectTypeConverter() {
- return this.objectTypeConverter;
- }
-
- public ObjectTypeConverter addObjectTypeConverter() {
- if (this.objectTypeConverter != null) {
- throw new IllegalStateException("object type converter already exists"); //$NON-NLS-1$
- }
- this.objectTypeConverter = new EclipseLinkJavaObjectTypeConverter(this, this.resourcePersistentType);
- this.resourcePersistentType.addSupportingAnnotation(this.objectTypeConverter.getAnnotationName());
- firePropertyChanged(OBJECT_TYPE_CONVERTER_PROPERTY, null, this.objectTypeConverter);
- return this.objectTypeConverter;
- }
-
- protected void addObjectTypeConverter_() {
- this.objectTypeConverter = new EclipseLinkJavaObjectTypeConverter(this, this.resourcePersistentType);
- 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$
- }
- EclipseLinkJavaObjectTypeConverter oldConverter = this.objectTypeConverter;
- this.objectTypeConverter = null;
- this.resourcePersistentType.removeSupportingAnnotation(oldConverter.getAnnotationName());
- firePropertyChanged(OBJECT_TYPE_CONVERTER_PROPERTY, oldConverter, null);
- }
-
- protected void removeObjectTypeConverter_() {
- ObjectTypeConverter oldConverter = this.objectTypeConverter;
- this.objectTypeConverter = null;
- firePropertyChanged(OBJECT_TYPE_CONVERTER_PROPERTY, oldConverter, null);
- }
-
- protected String getObjectTypeConverterAnnotationName() {
- return ObjectTypeConverterAnnotation.ANNOTATION_NAME;
- }
-
- protected ObjectTypeConverterAnnotation getResourceObjectTypeConverter() {
- return (ObjectTypeConverterAnnotation) this.resourcePersistentType.getSupportingAnnotation(getObjectTypeConverterAnnotationName());
- }
-
-
- //************** type converter *************
- public TypeConverter getTypeConverter() {
- return this.typeConverter;
- }
-
- public TypeConverter addTypeConverter() {
- if (this.typeConverter != null) {
- throw new IllegalStateException("type converter already exists"); //$NON-NLS-1$
- }
- this.typeConverter = new EclipseLinkJavaTypeConverter(this, this.resourcePersistentType);
- this.resourcePersistentType.addSupportingAnnotation(this.typeConverter.getAnnotationName());
- firePropertyChanged(TYPE_CONVERTER_PROPERTY, null, this.typeConverter);
- return this.typeConverter;
- }
-
- protected void addTypeConverter_() {
- this.typeConverter = new EclipseLinkJavaTypeConverter(this, this.resourcePersistentType);
- firePropertyChanged(TYPE_CONVERTER_PROPERTY, null, this.typeConverter);
- }
-
- public void removeTypeConverter() {
- if (this.typeConverter == null) {
- throw new IllegalStateException("type converter is null"); //$NON-NLS-1$
- }
- EclipseLinkJavaTypeConverter oldConverter = this.typeConverter;
- this.typeConverter = null;
- this.resourcePersistentType.removeSupportingAnnotation(oldConverter.getAnnotationName());
- firePropertyChanged(TYPE_CONVERTER_PROPERTY, oldConverter, null);
- }
-
- protected void removeTypeConverter_() {
- TypeConverter oldConverter = this.typeConverter;
- this.typeConverter = null;
- firePropertyChanged(TYPE_CONVERTER_PROPERTY, oldConverter, null);
- }
-
- protected String getTypeConverterAnnotationName() {
- return TypeConverterAnnotation.ANNOTATION_NAME;
- }
-
- protected TypeConverterAnnotation getResourceTypeConverter() {
- return (TypeConverterAnnotation) this.resourcePersistentType.getSupportingAnnotation(getTypeConverterAnnotationName());
- }
-
-
- //************** struct converter *************
- public StructConverter getStructConverter() {
- return this.structConverter;
- }
-
- public StructConverter addStructConverter() {
- if (this.structConverter != null) {
- throw new IllegalStateException("struct converter already exists"); //$NON-NLS-1$
- }
- this.structConverter = new EclipseLinkJavaStructConverter(this, this.resourcePersistentType);
- this.resourcePersistentType.addSupportingAnnotation(this.structConverter.getAnnotationName());
- firePropertyChanged(STRUCT_CONVERTER_PROPERTY, null, this.structConverter);
- return this.structConverter;
- }
-
- protected void addStructConverter_() {
- this.structConverter = new EclipseLinkJavaStructConverter(this, this.resourcePersistentType);
- firePropertyChanged(STRUCT_CONVERTER_PROPERTY, null, this.structConverter);
- }
-
- public void removeStructConverter() {
- if (this.structConverter == null) {
- throw new IllegalStateException("struct converter is null"); //$NON-NLS-1$
- }
- EclipseLinkJavaStructConverter oldConverter = this.structConverter;
- this.structConverter = null;
- this.resourcePersistentType.removeSupportingAnnotation(oldConverter.getAnnotationName());
- firePropertyChanged(STRUCT_CONVERTER_PROPERTY, oldConverter, null);
- }
-
- protected void removeStructConverter_() {
- StructConverter oldConverter = this.structConverter;
- this.structConverter = null;
- firePropertyChanged(STRUCT_CONVERTER_PROPERTY, oldConverter, null);
- }
-
- protected String getStructConverterAnnotationName() {
- return StructConverterAnnotation.ANNOTATION_NAME;
- }
-
- protected StructConverterAnnotation getResourceStructConverter() {
- return (StructConverterAnnotation) this.resourcePersistentType.getSupportingAnnotation(getStructConverterAnnotationName());
- }
-
- public void update(JavaResourcePersistentType jrpt) {
- this.resourcePersistentType = jrpt;
- this.updateConverter();
- this.updateObjectTypeConverter();
- this.updateTypeConverter();
- this.updateStructConverter();
- }
-
- protected void updateConverter() {
- if (getResourceConverter() != null) {
- if (this.converter != null) {
- this.converter.update(this.resourcePersistentType);
- }
- else {
- addConverter_();
- }
- }
- else {
- if (this.converter != null) {
- removeConverter_();
- }
- }
- }
-
- 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.initializeConverter();
- this.initializeObjectTypeConverter();
- this.initializeTypeConverter();
- this.initializeStructConverter();
- }
-
- protected void initializeConverter() {
- if (getResourceConverter() != null) {
- this.converter = new EclipseLinkJavaCustomConverter(this, this.resourcePersistentType);
- }
- }
-
- protected void initializeObjectTypeConverter() {
- if (getResourceObjectTypeConverter() != null) {
- this.objectTypeConverter = new EclipseLinkJavaObjectTypeConverter(this, this.resourcePersistentType);
- }
- }
-
- protected void initializeTypeConverter() {
- if (getResourceTypeConverter() != null) {
- this.typeConverter = new EclipseLinkJavaTypeConverter(this, this.resourcePersistentType);
- }
- }
-
- protected void initializeStructConverter() {
- if (getResourceStructConverter() != null) {
- this.structConverter = new EclipseLinkJavaStructConverter(this, this.resourcePersistentType);
- }
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.resourcePersistentType.getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- if (this.converter != null) {
- this.converter.validate(messages, astRoot);
- }
- if (this.objectTypeConverter != null) {
- this.objectTypeConverter.validate(messages, astRoot);
- }
- if (this.typeConverter != null) {
- this.typeConverter.validate(messages, astRoot);
- }
- if (this.structConverter != null) {
- this.structConverter.validate(messages, astRoot);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaCustomConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaCustomConverter.java
deleted file mode 100644
index 8f0cc2736c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaCustomConverter.java
+++ /dev/null
@@ -1,110 +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.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.CustomConverter;
-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.ConverterAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkJavaCustomConverter extends EclipseLinkJavaConverter
- implements CustomConverter
-{
- private String converterClass;
-
- public EclipseLinkJavaCustomConverter(JavaJpaContextNode parent, JavaResourcePersistentMember jrpm) {
- super(parent, jrpm);
- }
-
-
- public String getType() {
- return EclipseLinkConverter.CUSTOM_CONVERTER;
- }
-
- public String getAnnotationName() {
- return ConverterAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected ConverterAnnotation getAnnotation() {
- return (ConverterAnnotation) 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);
- }
-
-
- // **************** resource interaction ***********************************
-
- protected void initialize(JavaResourcePersistentMember jrpm) {
- super.initialize(jrpm);
- this.converterClass = this.converterClass(getAnnotation());
- }
-
- public void update(JavaResourcePersistentMember jrpm) {
- super.update(jrpm);
- this.setConverterClass_(this.converterClass(getAnnotation()));
- }
-
- protected String converterClass(ConverterAnnotation resourceConverter) {
- return resourceConverter == null ? null : resourceConverter.getConverterClass();
- }
-
- public TextRange getConverterClassTextRange(CompilationUnit astRoot) {
- return getAnnotation().getConverterClassTextRange(astRoot);
- }
-
-
- //************ validation ***************
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- validateConverterClass(messages, astRoot);
- }
-
- protected void validateConverterClass(List<IMessage> messages, CompilationUnit astRoot) {
- if (! getAnnotation().implementsConverter()) {
- 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/EclipseLinkJavaCustomizer.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaCustomizer.java
deleted file mode 100644
index 527aaf1d8c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaCustomizer.java
+++ /dev/null
@@ -1,138 +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.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.Customizer;
-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.CustomizerAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkJavaCustomizer extends AbstractJavaJpaContextNode implements Customizer
-{
- private JavaResourcePersistentType resourcePersistentType;
-
- private String customizerClass;
-
- public EclipseLinkJavaCustomizer(JavaJpaContextNode parent) {
- super(parent);
- }
-
- @Override
- protected EclipseLinkJpaFactory getJpaFactory() {
- return (EclipseLinkJpaFactory) super.getJpaFactory();
- }
-
- protected String getAnnotationName() {
- return CustomizerAnnotation.ANNOTATION_NAME;
- }
-
- protected void addResourceCustomizer() {
- this.resourcePersistentType.addSupportingAnnotation(getAnnotationName());
- }
-
- protected void removeResourceCustomizer() {
- this.resourcePersistentType.removeSupportingAnnotation(getAnnotationName());
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getResourceCustomizer().getTextRange(astRoot);
- }
-
- protected CustomizerAnnotation getResourceCustomizer() {
- return (CustomizerAnnotation) this.resourcePersistentType.getSupportingAnnotation(getAnnotationName());
- }
-
- public String getCustomizerClass() {
- return getSpecifiedCustomizerClass();
- }
-
- public String getDefaultCustomizerClass() {
- return null;
- }
-
- public String getSpecifiedCustomizerClass() {
- return this.customizerClass;
- }
-
- 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;
- CustomizerAnnotation resourceCustomizer = getResourceCustomizer();
- this.customizerClass = this.customizerClass(resourceCustomizer);
- }
-
- public void update(JavaResourcePersistentType jrpt) {
- this.resourcePersistentType = jrpt;
- CustomizerAnnotation resourceCustomizer = getResourceCustomizer();
- this.setCustomizerClass_(this.customizerClass(resourceCustomizer));
- }
-
- protected String customizerClass(CustomizerAnnotation resourceCustomizer) {
- return resourceCustomizer == null ? null : resourceCustomizer.getValue();
- }
-
- public TextRange getCustomizerClassTextRange(CompilationUnit astRoot) {
- return getResourceCustomizer().getValueTextRange(astRoot);
- }
-
- //************ validation ***************
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- validateConverterClass(messages, astRoot);
- }
-
- protected void validateConverterClass(List<IMessage> messages, CompilationUnit astRoot) {
- CustomizerAnnotation resourceCustomizer = getResourceCustomizer();
- if (resourceCustomizer != null && !resourceCustomizer.implementsDescriptorCustomizer()) {
- 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/EclipseLinkJavaEmbeddableImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddableImpl.java
deleted file mode 100644
index d3e1c24a66..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddableImpl.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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.GenericJavaEmbeddable;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.context.ChangeTracking;
-import org.eclipse.jpt.eclipselink.core.context.Customizer;
-import org.eclipse.jpt.eclipselink.core.context.java.EclipseLinkJavaEmbeddable;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaConverterHolder;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkJavaEmbeddableImpl extends GenericJavaEmbeddable implements EclipseLinkJavaEmbeddable
-{
-
- protected final JavaConverterHolder converterHolder;
-
- protected final EclipseLinkJavaCustomizer customizer;
-
- protected final EclipseLinkJavaChangeTracking changeTracking;
-
- public EclipseLinkJavaEmbeddableImpl(JavaPersistentType parent) {
- super(parent);
- this.converterHolder = new EclipseLinkJavaConverterHolder(this);
- this.customizer = new EclipseLinkJavaCustomizer(this);
- this.changeTracking = new EclipseLinkJavaChangeTracking(this);
- }
-
- public JavaConverterHolder getConverterHolder() {
- return this.converterHolder;
- }
-
- public Customizer getCustomizer() {
- return this.customizer;
- }
-
- public ChangeTracking 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, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- this.converterHolder.validate(messages, astRoot);
- this.customizer.validate(messages, astRoot);
- this.changeTracking.validate(messages, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaEntityImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaEntityImpl.java
deleted file mode 100644
index e8f0dfc4d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaEntityImpl.java
+++ /dev/null
@@ -1,98 +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.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.GenericJavaEntity;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.context.ChangeTracking;
-import org.eclipse.jpt.eclipselink.core.context.Customizer;
-import org.eclipse.jpt.eclipselink.core.context.ReadOnly;
-import org.eclipse.jpt.eclipselink.core.context.java.EclipseLinkJavaEntity;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaCaching;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaConverterHolder;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkJavaEntityImpl extends GenericJavaEntity implements EclipseLinkJavaEntity
-{
- protected final JavaCaching eclipseLinkCaching;
-
- protected final JavaConverterHolder converterHolder;
-
- protected final EclipseLinkJavaReadOnly readOnly;
-
- protected final EclipseLinkJavaCustomizer customizer;
-
- protected final EclipseLinkJavaChangeTracking changeTracking;
-
- public EclipseLinkJavaEntityImpl(JavaPersistentType parent) {
- super(parent);
- this.eclipseLinkCaching = new EclipseLinkJavaCaching(this);
- this.converterHolder = new EclipseLinkJavaConverterHolder(this);
- this.readOnly = new EclipseLinkJavaReadOnly(this);
- this.changeTracking = new EclipseLinkJavaChangeTracking(this);
- this.customizer = new EclipseLinkJavaCustomizer(this);
- }
-
- public JavaCaching getCaching() {
- return this.eclipseLinkCaching;
- }
-
- public JavaConverterHolder getConverterHolder() {
- return this.converterHolder;
- }
-
- public ReadOnly getReadOnly() {
- return this.readOnly;
- }
-
- public Customizer getCustomizer() {
- return this.customizer;
- }
-
- public ChangeTracking getChangeTracking() {
- return this.changeTracking;
- }
-
- @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, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- this.eclipseLinkCaching.validate(messages, astRoot);
- this.converterHolder.validate(messages, astRoot);
- this.readOnly.validate(messages, astRoot);
- this.customizer.validate(messages, astRoot);
- this.changeTracking.validate(messages, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaExpiryTimeOfDay.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaExpiryTimeOfDay.java
deleted file mode 100644
index b893c2c6cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaExpiryTimeOfDay.java
+++ /dev/null
@@ -1,137 +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.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.Caching;
-import org.eclipse.jpt.eclipselink.core.context.ExpiryTimeOfDay;
-import org.eclipse.jpt.eclipselink.core.resource.java.TimeOfDayAnnotation;
-
-public class EclipseLinkJavaExpiryTimeOfDay extends AbstractJavaJpaContextNode
- implements ExpiryTimeOfDay
-{
-
- protected Integer hour;
- protected Integer minute;
- protected Integer second;
- protected Integer millisecond;
-
- protected TimeOfDayAnnotation timeOfDay;
-
- public EclipseLinkJavaExpiryTimeOfDay(Caching 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(TimeOfDayAnnotation timeOfDay) {
- this.timeOfDay = timeOfDay;
- this.hour = getHour(timeOfDay);
- this.minute = getMinute(timeOfDay);
- this.second = getSecond(timeOfDay);
- this.millisecond = getMillisecond(timeOfDay);
- }
-
- public void update(TimeOfDayAnnotation timeOfDay) {
- this.timeOfDay = timeOfDay;
- this.setHour_(getHour(timeOfDay));
- this.setMinute_(getMinute(timeOfDay));
- this.setSecond_(getSecond(timeOfDay));
- this.setMillisecond_(getMillisecond(timeOfDay));
- }
-
- protected Integer getHour(TimeOfDayAnnotation timeOfDay) {
- return timeOfDay.getHour();
- }
-
- protected Integer getMinute(TimeOfDayAnnotation timeOfDay) {
- return timeOfDay.getMinute();
- }
-
- protected Integer getSecond(TimeOfDayAnnotation timeOfDay) {
- return timeOfDay.getSecond();
- }
-
- protected Integer getMillisecond(TimeOfDayAnnotation timeOfDay) {
- return timeOfDay.getMillisecond();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaIdMappingImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaIdMappingImpl.java
deleted file mode 100644
index 5ec2f068ab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaIdMappingImpl.java
+++ /dev/null
@@ -1,84 +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.internal.context.java;
-
-import java.util.List;
-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.GenericJavaIdMapping;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.context.Convert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkIdMapping;
-import org.eclipse.jpt.eclipselink.core.context.Mutable;
-import org.eclipse.jpt.eclipselink.core.resource.java.ConvertAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkJavaIdMappingImpl extends GenericJavaIdMapping implements EclipseLinkIdMapping
-{
- protected final EclipseLinkJavaMutable mutable;
-
- public EclipseLinkJavaIdMappingImpl(JavaPersistentAttribute parent) {
- super(parent);
- this.mutable = new EclipseLinkJavaMutable(this);
- }
-
- @Override
- protected JavaConverter buildSpecifiedConverter(String converterType) {
- JavaConverter javaConverter = super.buildSpecifiedConverter(converterType);
- if (javaConverter != null) {
- return javaConverter;
- }
- if (converterType == Convert.ECLIPSE_LINK_CONVERTER) {
- return new EclipseLinkJavaConvert(this, this.resourcePersistentAttribute);
- }
- return null;
- }
-
- @Override
- protected String specifiedConverterType(JavaResourcePersistentAttribute jrpa) {
- //check @Convert first, this is the order that EclipseLink searches
- if (jrpa.getSupportingAnnotation(ConvertAnnotation.ANNOTATION_NAME) != null) {
- return Convert.ECLIPSE_LINK_CONVERTER;
- }
- return super.specifiedConverterType(jrpa);
- }
-
-
- //************ EclipselinkJavaIdMapping implementation ****************
-
- public Mutable getMutable() {
- return this.mutable;
- }
-
-
- //************ initialization/update ****************
-
- @Override
- public void initialize(JavaResourcePersistentAttribute jrpa) {
- super.initialize(jrpa);
- this.mutable.initialize(jrpa);
- }
-
- @Override
- public void update(JavaResourcePersistentAttribute jrpa) {
- super.update(jrpa);
- this.mutable.update(jrpa);
- }
-
-
- //************ validation ****************
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- this.mutable.validate(messages, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaJoinFetch.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaJoinFetch.java
deleted file mode 100644
index 73d73b83c7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaJoinFetch.java
+++ /dev/null
@@ -1,118 +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.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.JoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.JoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchAnnotation;
-
-public class EclipseLinkJavaJoinFetch extends AbstractJavaJpaContextNode implements JoinFetch
-{
- protected JoinFetchType joinFetchValue;
-
- protected JavaResourcePersistentAttribute resourcePersistentAttribute;
-
-
- public EclipseLinkJavaJoinFetch(JavaAttributeMapping parent) {
- super(parent);
- }
-
-
- protected String getJoinFetchAnnotationName() {
- return JoinFetchAnnotation.ANNOTATION_NAME;
- }
-
- protected JoinFetchAnnotation getResourceJoinFetch() {
- return (JoinFetchAnnotation) this.resourcePersistentAttribute.getSupportingAnnotation(getJoinFetchAnnotationName());
- }
-
- protected void addResourceJoinFetch() {
- this.resourcePersistentAttribute.addSupportingAnnotation(getJoinFetchAnnotationName());
- }
-
- protected void removeResourceJoinFetch() {
- this.resourcePersistentAttribute.removeSupportingAnnotation(getJoinFetchAnnotationName());
- }
-
- public JoinFetchType getValue() {
- return this.joinFetchValue;
- }
-
- protected JoinFetchType getDefaultValue() {
- return JoinFetch.DEFAULT_VALUE;
- }
-
- public void setValue(JoinFetchType newJoinFetchValue) {
- if (this.joinFetchValue == newJoinFetchValue) {
- return;
- }
-
- JoinFetchType oldJoinFetchValue = this.joinFetchValue;
- this.joinFetchValue = newJoinFetchValue;
-
- if (newJoinFetchValue != null) {
- if (getResourceJoinFetch() == null) {
- addResourceJoinFetch();
- }
- getResourceJoinFetch().setValue(JoinFetchType.toJavaResourceModel(newJoinFetchValue));
- }
- else {
- if (getResourceJoinFetch() != null) {
- removeResourceJoinFetch();
- }
- }
- firePropertyChanged(JoinFetch.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_(JoinFetchType newJoinFetchValue) {
- JoinFetchType oldJoinFetchValue = this.joinFetchValue;
- this.joinFetchValue = newJoinFetchValue;
- firePropertyChanged(JoinFetch.VALUE_PROPERTY, oldJoinFetchValue, newJoinFetchValue);
- }
-
- public void initialize(JavaResourcePersistentAttribute jrpa) {
- this.resourcePersistentAttribute = jrpa;
- JoinFetchAnnotation resourceJoinFetch = this.getResourceJoinFetch();
- this.joinFetchValue = this.joinFetch(resourceJoinFetch);
- }
-
- public void update(JavaResourcePersistentAttribute jrpa) {
- this.resourcePersistentAttribute = jrpa;
- JoinFetchAnnotation resourceJoinFetch = this.getResourceJoinFetch();
- setValue_(joinFetch(resourceJoinFetch));
- }
-
- private JoinFetchType joinFetch(JoinFetchAnnotation resourceJoinFetch) {
- if (resourceJoinFetch == null) {
- return null;
- }
- if (resourceJoinFetch.getValue() == null) {
- // @JoinFetch is equivalent to @JoinFetch(JoinFetch.INNER)
- return getDefaultValue();
- }
- return JoinFetchType.fromJavaResourceModel(resourceJoinFetch.getValue());
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- JoinFetchAnnotation 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/EclipseLinkJavaManyToManyMappingImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaManyToManyMappingImpl.java
deleted file mode 100644
index 16581ea2bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaManyToManyMappingImpl.java
+++ /dev/null
@@ -1,53 +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.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaManyToManyMapping;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.eclipselink.core.context.JoinFetch;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkJavaManyToManyMappingImpl extends GenericJavaManyToManyMapping implements EclipseLinkRelationshipMapping
-{
- protected final EclipseLinkJavaJoinFetch joinFetch;
-
-
- public EclipseLinkJavaManyToManyMappingImpl(JavaPersistentAttribute parent) {
- super(parent);
- this.joinFetch = new EclipseLinkJavaJoinFetch(this);
- }
-
-
- public JoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
- @Override
- public void initialize(JavaResourcePersistentAttribute jrpa) {
- super.initialize(jrpa);
- this.joinFetch.initialize(jrpa);
- }
-
- @Override
- public void update(JavaResourcePersistentAttribute jrpa) {
- super.update(jrpa);
- this.joinFetch.update(jrpa);
- }
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- this.joinFetch.validate(messages, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaManyToOneMappingImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaManyToOneMappingImpl.java
deleted file mode 100644
index 3eff7dc4ca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaManyToOneMappingImpl.java
+++ /dev/null
@@ -1,53 +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.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaManyToOneMapping;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.eclipselink.core.context.JoinFetch;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkJavaManyToOneMappingImpl extends GenericJavaManyToOneMapping implements EclipseLinkRelationshipMapping
-{
- protected final EclipseLinkJavaJoinFetch joinFetch;
-
-
- public EclipseLinkJavaManyToOneMappingImpl(JavaPersistentAttribute parent) {
- super(parent);
- this.joinFetch = new EclipseLinkJavaJoinFetch(this);
- }
-
-
- public JoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
- @Override
- public void initialize(JavaResourcePersistentAttribute jrpa) {
- super.initialize(jrpa);
- this.joinFetch.initialize(jrpa);
- }
-
- @Override
- public void update(JavaResourcePersistentAttribute jrpa) {
- super.update(jrpa);
- this.joinFetch.update(jrpa);
- }
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- this.joinFetch.validate(messages, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassImpl.java
deleted file mode 100644
index de0fa20727..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassImpl.java
+++ /dev/null
@@ -1,98 +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.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.GenericJavaMappedSuperclass;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.context.ChangeTracking;
-import org.eclipse.jpt.eclipselink.core.context.Customizer;
-import org.eclipse.jpt.eclipselink.core.context.ReadOnly;
-import org.eclipse.jpt.eclipselink.core.context.java.EclipseLinkJavaMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaCaching;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaConverterHolder;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkJavaMappedSuperclassImpl extends GenericJavaMappedSuperclass implements EclipseLinkJavaMappedSuperclass
-{
- protected JavaCaching eclipseLinkCaching;
-
- protected final JavaConverterHolder converterHolder;
-
- protected final EclipseLinkJavaReadOnly readOnly;
-
- protected final EclipseLinkJavaCustomizer customizer;
-
- protected final EclipseLinkJavaChangeTracking changeTracking;
-
- public EclipseLinkJavaMappedSuperclassImpl(JavaPersistentType parent) {
- super(parent);
- this.eclipseLinkCaching = new EclipseLinkJavaCaching(this);
- this.converterHolder = new EclipseLinkJavaConverterHolder(this);
- this.readOnly = new EclipseLinkJavaReadOnly(this);
- this.customizer = new EclipseLinkJavaCustomizer(this);
- this.changeTracking = new EclipseLinkJavaChangeTracking(this);
- }
-
- public JavaCaching getCaching() {
- return this.eclipseLinkCaching;
- }
-
- public JavaConverterHolder getConverterHolder() {
- return this.converterHolder;
- }
-
- public ReadOnly getReadOnly() {
- return this.readOnly;
- }
-
- public Customizer getCustomizer() {
- return this.customizer;
- }
-
- public ChangeTracking getChangeTracking() {
- return this.changeTracking;
- }
-
- @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, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- this.eclipseLinkCaching.validate(messages, astRoot);
- this.converterHolder.validate(messages, astRoot);
- this.readOnly.validate(messages, astRoot);
- this.customizer.validate(messages, astRoot);
- this.changeTracking.validate(messages, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaMutable.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaMutable.java
deleted file mode 100644
index 154baa39be..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaMutable.java
+++ /dev/null
@@ -1,140 +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.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.Mutable;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.resource.java.MutableAnnotation;
-
-public class EclipseLinkJavaMutable extends AbstractJavaJpaContextNode implements Mutable
-{
- protected boolean defaultMutable;
- protected Boolean specifiedMutable;
-
- protected JavaResourcePersistentAttribute resourcePersistentAttribute;
-
- public EclipseLinkJavaMutable(JavaAttributeMapping parent) {
- super(parent);
- }
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
- protected String getMutableAnnotationName() {
- return MutableAnnotation.ANNOTATION_NAME;
- }
-
- protected MutableAnnotation getResourceMutable() {
- return (MutableAnnotation) this.resourcePersistentAttribute.getSupportingAnnotation(getMutableAnnotationName());
- }
-
- protected void addResourceMutable() {
- this.resourcePersistentAttribute.addSupportingAnnotation(getMutableAnnotationName());
- }
-
- protected void removeResourceMutable() {
- this.resourcePersistentAttribute.removeSupportingAnnotation(getMutableAnnotationName());
- }
-
- protected boolean calculateDefaultMutable() {
- if (this.resourcePersistentAttribute.typeIsDateOrCalendar()) {
- Boolean persistenceUnitDefaultMutable = getPersistenceUnit().getOptions().getTemporalMutable();
- return persistenceUnitDefaultMutable == null ? false : persistenceUnitDefaultMutable.booleanValue();
- }
- return this.resourcePersistentAttribute.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(Mutable.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;
- MutableAnnotation resourceMutable = this.getResourceMutable();
- this.specifiedMutable = this.specifiedMutable(resourceMutable);
- this.defaultMutable = this.calculateDefaultMutable();
- }
-
- public void update(JavaResourcePersistentAttribute jrpa) {
- this.resourcePersistentAttribute = jrpa;
- MutableAnnotation resourceMutable = this.getResourceMutable();
- this.setSpecifiedMutable_(this.specifiedMutable(resourceMutable));
- this.setDefaultMutable(this.calculateDefaultMutable());
- }
-
- private Boolean specifiedMutable(MutableAnnotation 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) {
- MutableAnnotation 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/EclipseLinkJavaObjectTypeConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaObjectTypeConverter.java
deleted file mode 100644
index d85b55954f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaObjectTypeConverter.java
+++ /dev/null
@@ -1,258 +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.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.ConversionValue;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.context.ObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.java.ConversionValueAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.ObjectTypeConverterAnnotation;
-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;
-
-public class EclipseLinkJavaObjectTypeConverter extends EclipseLinkJavaConverter
- implements ObjectTypeConverter
-{
- private String dataType;
-
- private String objectType;
-
- private String defaultObjectValue;
-
- private final List<EclipseLinkJavaConversionValue> conversionValues;
-
-
- public EclipseLinkJavaObjectTypeConverter(JavaJpaContextNode parent, JavaResourcePersistentMember jrpm) {
- super(parent, jrpm);
- this.conversionValues = new ArrayList<EclipseLinkJavaConversionValue>();
- }
-
-
- public String getType() {
- return EclipseLinkConverter.OBJECT_TYPE_CONVERTER;
- }
-
- public String getAnnotationName() {
- return ObjectTypeConverterAnnotation.ANNOTATION_NAME;
- }
-
- protected ObjectTypeConverterAnnotation getAnnotation() {
- return (ObjectTypeConverterAnnotation) 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);
- }
-
-
- // **************** 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);
- }
-
-
- // **************** conversion values **************************************
-
- public ListIterator<EclipseLinkJavaConversionValue> conversionValues() {
- return new CloneListIterator<EclipseLinkJavaConversionValue>(this.conversionValues);
- }
-
- public int conversionValuesSize() {
- return this.conversionValues.size();
- }
-
- public EclipseLinkJavaConversionValue addConversionValue(int index) {
- EclipseLinkJavaConversionValue conversionValue = new EclipseLinkJavaConversionValue(this);
- this.conversionValues.add(index, conversionValue);
- ConversionValueAnnotation resourceConversionValue = getAnnotation().addConversionValue(index);
- conversionValue.initialize(resourceConversionValue);
- fireItemAdded(CONVERSION_VALUES_LIST, index, conversionValue);
- return conversionValue;
- }
-
- public EclipseLinkJavaConversionValue addConversionValue() {
- return this.addConversionValue(this.conversionValues.size());
- }
-
- protected void addConversionValue(int index, EclipseLinkJavaConversionValue conversionValue) {
- addItemToList(index, conversionValue, this.conversionValues, CONVERSION_VALUES_LIST);
- }
-
- protected void addConversionValue(EclipseLinkJavaConversionValue conversionValue) {
- this.addConversionValue(this.conversionValues.size(), conversionValue);
- }
-
- public void removeConversionValue(ConversionValue conversionValue) {
- this.removeConversionValue(this.conversionValues.indexOf(conversionValue));
- }
-
- public void removeConversionValue(int index) {
- EclipseLinkJavaConversionValue removedConversionValue = this.conversionValues.remove(index);
- getAnnotation().removeConversionValue(index);
- fireItemRemoved(CONVERSION_VALUES_LIST, index, removedConversionValue);
- }
-
- protected void removeConversionValue_(EclipseLinkJavaConversionValue 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<EclipseLinkJavaConversionValue, String>(conversionValues()) {
- @Override
- protected String transform(EclipseLinkJavaConversionValue 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 ***********************************
-
- protected void initialize(JavaResourcePersistentMember jrpm) {
- super.initialize(jrpm);
- ObjectTypeConverterAnnotation resourceConverter = getAnnotation();
- this.dataType = this.dataType(resourceConverter);
- this.objectType = this.objectType(resourceConverter);
- this.defaultObjectValue = this.defaultObjectValue(resourceConverter);
- this.initializeConversionValues(resourceConverter);
- }
-
- protected void initializeConversionValues(ObjectTypeConverterAnnotation resourceConverter) {
- if (resourceConverter == null) {
- return;
- }
- ListIterator<ConversionValueAnnotation> resourceConversionValues = resourceConverter.conversionValues();
-
- while(resourceConversionValues.hasNext()) {
- this.conversionValues.add(buildConversionValue(resourceConversionValues.next()));
- }
- }
-
- protected EclipseLinkJavaConversionValue buildConversionValue(ConversionValueAnnotation resourceConversionValue) {
- EclipseLinkJavaConversionValue conversionValue = new EclipseLinkJavaConversionValue(this);
- conversionValue.initialize(resourceConversionValue);
- return conversionValue;
- }
-
- public void update(JavaResourcePersistentMember jrpm) {
- super.update(jrpm);
- ObjectTypeConverterAnnotation resourceConverter = getAnnotation();
- this.setDataType_(this.dataType(resourceConverter));
- this.setObjectType_(this.objectType(resourceConverter));
- this.setDefaultObjectValue_(this.defaultObjectValue(resourceConverter));
- this.updateConversionValues(resourceConverter);
- }
-
- protected void updateConversionValues(ObjectTypeConverterAnnotation resourceConverter) {
- ListIterator<EclipseLinkJavaConversionValue> contextConversionValues = conversionValues();
- ListIterator<ConversionValueAnnotation> resourceConversionValues = resourceConverter.conversionValues();
- while (contextConversionValues.hasNext()) {
- EclipseLinkJavaConversionValue conversionValues = contextConversionValues.next();
- if (resourceConversionValues.hasNext()) {
- conversionValues.update(resourceConversionValues.next());
- }
- else {
- removeConversionValue_(conversionValues);
- }
- }
-
- while (resourceConversionValues.hasNext()) {
- addConversionValue(buildConversionValue(resourceConversionValues.next()));
- }
- }
-
- protected String dataType(ObjectTypeConverterAnnotation resourceConverter) {
- return resourceConverter == null ? null : resourceConverter.getDataType();
- }
-
- protected String objectType(ObjectTypeConverterAnnotation resourceConverter) {
- return resourceConverter == null ? null : resourceConverter.getObjectType();
- }
-
- protected String defaultObjectValue(ObjectTypeConverterAnnotation resourceConverter) {
- return resourceConverter == null ? null : resourceConverter.getDefaultObjectValue();
- }
-
-
- // **************** validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- for (Iterator<EclipseLinkJavaConversionValue> stream = conversionValues(); stream.hasNext();) {
- stream.next().validate(messages, astRoot);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingImpl.java
deleted file mode 100644
index f8089015dc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingImpl.java
+++ /dev/null
@@ -1,81 +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.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaOneToManyMapping;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkOneToManyMapping;
-import org.eclipse.jpt.eclipselink.core.context.JoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.PrivateOwned;
-import org.eclipse.jpt.eclipselink.core.resource.java.PrivateOwnedAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkJavaOneToManyMappingImpl extends GenericJavaOneToManyMapping implements EclipseLinkOneToManyMapping
-{
- protected final EclipseLinkJavaJoinFetch joinFetch;
-
- protected final EclipseLinkJavaPrivateOwned privateOwned;
-
-
- public EclipseLinkJavaOneToManyMappingImpl(JavaPersistentAttribute parent) {
- super(parent);
- this.joinFetch = new EclipseLinkJavaJoinFetch(this);
- this.privateOwned = new EclipseLinkJavaPrivateOwned(this);
- }
-
-
- protected String getPrivateOwnedAnnotationName() {
- return PrivateOwnedAnnotation.ANNOTATION_NAME;
- }
-
- protected PrivateOwnedAnnotation getResourcePrivateOwned() {
- return (PrivateOwnedAnnotation) this.resourcePersistentAttribute.getSupportingAnnotation(getPrivateOwnedAnnotationName());
- }
-
- protected void addResourcePrivateOwned() {
- this.resourcePersistentAttribute.addSupportingAnnotation(getPrivateOwnedAnnotationName());
- }
-
- protected void removeResourcePrivateOwned() {
- this.resourcePersistentAttribute.removeSupportingAnnotation(getPrivateOwnedAnnotationName());
- }
-
- public JoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
- public PrivateOwned getPrivateOwned() {
- return this.privateOwned;
- }
-
- @Override
- public void initialize(JavaResourcePersistentAttribute jrpa) {
- super.initialize(jrpa);
- this.joinFetch.initialize(jrpa);
- this.privateOwned.initialize(jrpa);
- }
-
- @Override
- public void update(JavaResourcePersistentAttribute jrpa) {
- super.update(jrpa);
- this.joinFetch.update(jrpa);
- this.privateOwned.update(jrpa);
- }
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- this.joinFetch.validate(messages, astRoot);
- this.privateOwned.validate(messages, 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/EclipseLinkJavaOneToManyMappingProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingProvider.java
deleted file mode 100644
index 9f03ae01bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingProvider.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.DefaultJavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.JavaOneToManyMappingProvider;
-
-public class EclipseLinkJavaOneToManyMappingProvider
- implements DefaultJavaAttributeMappingProvider
-{
-
- // singleton
- private static final EclipseLinkJavaOneToManyMappingProvider INSTANCE = new EclipseLinkJavaOneToManyMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkJavaOneToManyMappingProvider() {
- super();
- }
-
- public String getKey() {
- return JavaOneToManyMappingProvider.instance().getKey();
- }
-
- public String getAnnotationName() {
- return JavaOneToManyMappingProvider.instance().getAnnotationName();
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return JavaOneToManyMappingProvider.instance().buildMapping(parent, factory);
- }
-
- public boolean defaultApplies(JavaPersistentAttribute persistentAttribute) {
- if (!persistentAttribute.getResourcePersistentAttribute().typeIsContainer()) {
- return false;
- }
- String targetEntity = persistentAttribute.getResourcePersistentAttribute().getQualifiedReferenceEntityElementTypeName();
- if (targetEntity == null) {
- return false;
- }
- return persistentAttribute.getPersistenceUnit().getEntity(targetEntity) != null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingImpl.java
deleted file mode 100644
index 214d9229fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingImpl.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaOneToOneMapping;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.context.JoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.PrivateOwned;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkJavaOneToOneMappingImpl extends GenericJavaOneToOneMapping implements EclipseLinkOneToOneMapping
-{
- protected final EclipseLinkJavaJoinFetch joinFetch;
-
- protected final EclipseLinkJavaPrivateOwned privateOwned;
-
-
- public EclipseLinkJavaOneToOneMappingImpl(JavaPersistentAttribute parent) {
- super(parent);
- this.joinFetch = new EclipseLinkJavaJoinFetch(this);
- this.privateOwned = new EclipseLinkJavaPrivateOwned(this);
- }
-
-
- public JoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
- public PrivateOwned getPrivateOwned() {
- return this.privateOwned;
- }
-
- @Override
- public void initialize(JavaResourcePersistentAttribute jrpa) {
- super.initialize(jrpa);
- this.joinFetch.initialize(jrpa);
- this.privateOwned.initialize(jrpa);
- }
-
- @Override
- public void update(JavaResourcePersistentAttribute jrpa) {
- super.update(jrpa);
- this.joinFetch.update(jrpa);
- this.privateOwned.update(jrpa);
- }
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- this.joinFetch.validate(messages, astRoot);
- this.privateOwned.validate(messages, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingProvider.java
deleted file mode 100644
index 47c6915148..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingProvider.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.DefaultJavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.JavaOneToOneMappingProvider;
-
-public class EclipseLinkJavaOneToOneMappingProvider
- implements DefaultJavaAttributeMappingProvider
-{
-
- // singleton
- private static final EclipseLinkJavaOneToOneMappingProvider INSTANCE = new EclipseLinkJavaOneToOneMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkJavaOneToOneMappingProvider() {
- super();
- }
-
- public String getKey() {
- return JavaOneToOneMappingProvider.instance().getKey();
- }
-
- public String getAnnotationName() {
- return JavaOneToOneMappingProvider.instance().getAnnotationName();
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return JavaOneToOneMappingProvider.instance().buildMapping(parent, factory);
- }
-
- public boolean defaultApplies(JavaPersistentAttribute persistentAttribute) {
- if (persistentAttribute.getResourcePersistentAttribute().typeIsContainer()) {
- return false;
- }
- String targetEntity = persistentAttribute.getResourcePersistentAttribute().getQualifiedReferenceEntityTypeName();
- if (targetEntity == null) {
- return false;
- }
- return persistentAttribute.getPersistenceUnit().getEntity(targetEntity) != null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaPrivateOwned.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaPrivateOwned.java
deleted file mode 100644
index 98cf3ec2bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaPrivateOwned.java
+++ /dev/null
@@ -1,94 +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.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.PrivateOwned;
-import org.eclipse.jpt.eclipselink.core.resource.java.PrivateOwnedAnnotation;
-
-public class EclipseLinkJavaPrivateOwned extends AbstractJavaJpaContextNode implements PrivateOwned
-{
- protected boolean privateOwned;
-
- protected JavaResourcePersistentAttribute resourcePersistentAttribute;
-
- public EclipseLinkJavaPrivateOwned(JavaAttributeMapping parent) {
- super(parent);
- }
-
- protected String getPrivateOwnedAnnotationName() {
- return PrivateOwnedAnnotation.ANNOTATION_NAME;
- }
-
- protected PrivateOwnedAnnotation getResourcePrivateOwned() {
- return (PrivateOwnedAnnotation) this.resourcePersistentAttribute.getSupportingAnnotation(getPrivateOwnedAnnotationName());
- }
-
- protected void addResourcePrivateOwned() {
- this.resourcePersistentAttribute.addSupportingAnnotation(getPrivateOwnedAnnotationName());
- }
-
- protected void removeResourcePrivateOwned() {
- this.resourcePersistentAttribute.removeSupportingAnnotation(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) {
- PrivateOwnedAnnotation 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/EclipseLinkJavaReadOnly.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaReadOnly.java
deleted file mode 100644
index f7caeddb82..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaReadOnly.java
+++ /dev/null
@@ -1,103 +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.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.ReadOnly;
-import org.eclipse.jpt.eclipselink.core.resource.java.ReadOnlyAnnotation;
-
-public class EclipseLinkJavaReadOnly extends AbstractJavaJpaContextNode implements ReadOnly
-{
- protected Boolean specifiedReadOnly;
-
- protected JavaResourcePersistentType resourcePersistentType;
-
-
- public EclipseLinkJavaReadOnly(JavaTypeMapping parent) {
- super(parent);
- }
-
-
- protected String getReadOnlyAnnotationName() {
- return ReadOnlyAnnotation.ANNOTATION_NAME;
- }
-
- protected ReadOnlyAnnotation getResourceReadOnly() {
- return (ReadOnlyAnnotation) this.resourcePersistentType.getSupportingAnnotation(getReadOnlyAnnotationName());
- }
-
- protected void addResourceReadOnly() {
- this.resourcePersistentType.addSupportingAnnotation(getReadOnlyAnnotationName());
- }
-
- protected void removeResourceReadOnly() {
- this.resourcePersistentType.removeSupportingAnnotation(getReadOnlyAnnotationName());
- }
-
- public boolean isReadOnly() {
- return (this.getSpecifiedReadOnly() != null) ? this.getSpecifiedReadOnly().booleanValue() : this.isDefaultReadOnly();
- }
-
- public boolean isDefaultReadOnly() {
- return ReadOnly.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) {
- ReadOnlyAnnotation 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/EclipseLinkJavaStructConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaStructConverter.java
deleted file mode 100644
index ee59f71802..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaStructConverter.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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.StructConverter;
-import org.eclipse.jpt.eclipselink.core.resource.java.StructConverterAnnotation;
-
-public class EclipseLinkJavaStructConverter extends EclipseLinkJavaConverter
- implements StructConverter
-{
- private String converterClass;
-
-
- public EclipseLinkJavaStructConverter(JavaJpaContextNode parent, JavaResourcePersistentMember jrpm) {
- super(parent, jrpm);
- }
-
-
- public String getType() {
- return EclipseLinkConverter.STRUCT_CONVERTER;
- }
-
- public String getAnnotationName() {
- return StructConverterAnnotation.ANNOTATION_NAME;
- }
-
- protected StructConverterAnnotation getAnnotation() {
- return (StructConverterAnnotation) 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 ***********************************
-
- protected void initialize(JavaResourcePersistentMember jrpm) {
- super.initialize(jrpm);
- this.converterClass = this.converterClass(getAnnotation());
- }
-
- public void update(JavaResourcePersistentMember jrpm) {
- super.update(jrpm);
- this.setConverterClass_(this.converterClass(getAnnotation()));
- }
-
- protected String converterClass(StructConverterAnnotation 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/EclipseLinkJavaTypeConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaTypeConverter.java
deleted file mode 100644
index 7c5f222705..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaTypeConverter.java
+++ /dev/null
@@ -1,106 +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.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.TypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.java.TypeConverterAnnotation;
-
-public class EclipseLinkJavaTypeConverter extends EclipseLinkJavaConverter
- implements TypeConverter
-{
- private String dataType;
-
- private String objectType;
-
-
- public EclipseLinkJavaTypeConverter(JavaJpaContextNode parent, JavaResourcePersistentMember jrpm) {
- super(parent, jrpm);
- }
-
- public String getType() {
- return EclipseLinkConverter.TYPE_CONVERTER;
- }
-
- public String getAnnotationName() {
- return TypeConverterAnnotation.ANNOTATION_NAME;
- }
-
- protected TypeConverterAnnotation getAnnotation() {
- return (TypeConverterAnnotation) 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);
- }
-
-
- // **************** 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);
- }
-
-
- // **************** resource interaction ***********************************
-
- protected void initialize(JavaResourcePersistentMember jrpm) {
- super.initialize(jrpm);
- TypeConverterAnnotation resourceConverter = getAnnotation();
- this.dataType = this.dataType(resourceConverter);
- this.objectType = this.objectType(resourceConverter);
- }
-
- public void update(JavaResourcePersistentMember jrpm) {
- super.update(jrpm);
- TypeConverterAnnotation resourceConverter = getAnnotation();
- this.setDataType_(this.dataType(resourceConverter));
- this.setObjectType_(this.objectType(resourceConverter));
- }
-
- protected String dataType(TypeConverterAnnotation resourceConverter) {
- return resourceConverter == null ? null : resourceConverter.getDataType();
- }
-
- protected String objectType(TypeConverterAnnotation 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/EclipseLinkJavaVersionMappingImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaVersionMappingImpl.java
deleted file mode 100644
index 0f5490e4f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaVersionMappingImpl.java
+++ /dev/null
@@ -1,86 +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.internal.context.java;
-
-import java.util.List;
-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.GenericJavaVersionMapping;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.context.Convert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkVersionMapping;
-import org.eclipse.jpt.eclipselink.core.context.Mutable;
-import org.eclipse.jpt.eclipselink.core.resource.java.ConvertAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkJavaVersionMappingImpl extends GenericJavaVersionMapping implements EclipseLinkVersionMapping
-{
- protected final EclipseLinkJavaMutable mutable;
-
- public EclipseLinkJavaVersionMappingImpl(JavaPersistentAttribute parent) {
- super(parent);
- this.mutable = new EclipseLinkJavaMutable(this);
- }
-
- @Override
- protected JavaConverter buildSpecifiedConverter(String converterType) {
- JavaConverter javaConverter = super.buildSpecifiedConverter(converterType);
- if (javaConverter != null) {
- return javaConverter;
- }
- if (converterType == Convert.ECLIPSE_LINK_CONVERTER) {
- return new EclipseLinkJavaConvert(this, this.resourcePersistentAttribute);
- }
- return null;
- }
-
- @Override
- protected String specifiedConverterType(JavaResourcePersistentAttribute jrpa) {
- //check @Convert first, this is the order that EclipseLink searches
- if (jrpa.getSupportingAnnotation(ConvertAnnotation.ANNOTATION_NAME) != null) {
- return Convert.ECLIPSE_LINK_CONVERTER;
- }
- return super.specifiedConverterType(jrpa);
- }
-
-
-
- //************ EclipselinkVersionMapping implementation ****************
-
- public Mutable getMutable() {
- return this.mutable;
- }
-
-
- //************ initialization/update ****************
-
- @Override
- public void initialize(JavaResourcePersistentAttribute jrpa) {
- super.initialize(jrpa);
- this.mutable.initialize(jrpa);
- }
-
- @Override
- public void update(JavaResourcePersistentAttribute jrpa) {
- super.update(jrpa);
- this.mutable.update(jrpa);
- }
-
-
- //************ validation ****************
-
- @Override
- public void validate(List<IMessage> messages, CompilationUnit astRoot) {
- super.validate(messages, astRoot);
- this.mutable.validate(messages, astRoot);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicCollectionMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicCollectionMapping.java
deleted file mode 100644
index 6f193da06b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicCollectionMapping.java
+++ /dev/null
@@ -1,38 +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.internal.context.java;
-
-import java.util.Iterator;
-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.BasicCollectionMapping;
-import org.eclipse.jpt.eclipselink.core.resource.java.BasicCollectionAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-public class JavaBasicCollectionMapping extends AbstractJavaAttributeMapping<BasicCollectionAnnotation> implements BasicCollectionMapping
-{
-
- public JavaBasicCollectionMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return BasicCollectionAnnotation.ANNOTATION_NAME;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return EmptyIterator.instance();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicCollectionMappingProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicCollectionMappingProvider.java
deleted file mode 100644
index b2c084cc27..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicCollectionMappingProvider.java
+++ /dev/null
@@ -1,52 +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.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.eclipselink.core.resource.java.BasicCollectionAnnotation;
-
-public class JavaBasicCollectionMappingProvider
- implements JavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaBasicCollectionMappingProvider INSTANCE = new JavaBasicCollectionMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaBasicCollectionMappingProvider() {
- super();
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return BasicCollectionAnnotation.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return ((EclipseLinkJpaFactory) factory).buildJavaBasicCollectionMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicMapMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicMapMapping.java
deleted file mode 100644
index 0fda365086..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicMapMapping.java
+++ /dev/null
@@ -1,38 +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.internal.context.java;
-
-import java.util.Iterator;
-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.BasicMapMapping;
-import org.eclipse.jpt.eclipselink.core.resource.java.BasicMapAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-public class JavaBasicMapMapping extends AbstractJavaAttributeMapping<BasicMapAnnotation> implements BasicMapMapping
-{
-
- public JavaBasicMapMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return BasicMapAnnotation.ANNOTATION_NAME;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return EmptyIterator.instance();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicMapMappingProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicMapMappingProvider.java
deleted file mode 100644
index 7c1eadad99..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicMapMappingProvider.java
+++ /dev/null
@@ -1,52 +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.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.eclipselink.core.resource.java.BasicMapAnnotation;
-
-public class JavaBasicMapMappingProvider
- implements JavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaBasicMapMappingProvider INSTANCE = new JavaBasicMapMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaBasicMapMappingProvider() {
- super();
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return BasicMapAnnotation.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return ((EclipseLinkJpaFactory) factory).buildJavaBasicMapMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaTransformationMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaTransformationMapping.java
deleted file mode 100644
index 8e5d78fcd2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaTransformationMapping.java
+++ /dev/null
@@ -1,38 +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.internal.context.java;
-
-import java.util.Iterator;
-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.TransformationMapping;
-import org.eclipse.jpt.eclipselink.core.resource.java.TransformationAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-public class JavaTransformationMapping extends AbstractJavaAttributeMapping<TransformationAnnotation> implements TransformationMapping
-{
-
- public JavaTransformationMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return TransformationAnnotation.ANNOTATION_NAME;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return EmptyIterator.instance();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaTransformationMappingProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaTransformationMappingProvider.java
deleted file mode 100644
index ea3f9ee390..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaTransformationMappingProvider.java
+++ /dev/null
@@ -1,52 +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.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.eclipselink.core.resource.java.TransformationAnnotation;
-
-public class JavaTransformationMappingProvider
- implements JavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaTransformationMappingProvider INSTANCE = new JavaTransformationMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaTransformationMappingProvider() {
- super();
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return TransformationAnnotation.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return ((EclipseLinkJpaFactory) factory).buildJavaTransformationMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/ConverterHolder.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/ConverterHolder.java
deleted file mode 100644
index b814c8e125..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/ConverterHolder.java
+++ /dev/null
@@ -1,164 +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.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.jpt.eclipselink.core.context.CustomConverter;
-import org.eclipse.jpt.eclipselink.core.context.ObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.StructConverter;
-import org.eclipse.jpt.eclipselink.core.context.TypeConverter;
-
-public interface ConverterHolder extends JpaContextNode
-{
- //************ customConverters *********************
-
- /**
- * Return a list iterator of the custom converters.
- * This will not be null.
- */
- <T extends CustomConverter> ListIterator<T> customConverters();
-
- /**
- * Return the number of custom converters.
- */
- int customConvertersSize();
-
- /**
- * Add a custom converter to the converter holder, return the object representing it.
- */
- CustomConverter 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(CustomConverter converter);
-
- /**
- * Move the custom converter from the source index to the target index.
- */
- void moveCustomConverter(int targetIndex, int sourceIndex);
-
- String CUSTOM_CONVERTERS_LIST = "customConvertersList"; //$NON-NLS-1$
-
-
- //************ object type converters *********************
-
- /**
- * Return a list iterator of the object type converters.
- * This will not be null.
- */
- <T extends ObjectTypeConverter> 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.
- */
- ObjectTypeConverter 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(ObjectTypeConverter 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 = "objectTypeConvertersList"; //$NON-NLS-1$
-
-
- //************ struct converters *********************
-
- /**
- * Return a list iterator of the struct converters.
- * This will not be null.
- */
- <T extends StructConverter> ListIterator<T> structConverters();
-
- /**
- * Return the number of struct converters.
- */
- int structConvertersSize();
-
- /**
- * Add a struct converter to the converter holder, return the object representing it.
- */
- StructConverter 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(StructConverter converter);
-
- /**
- * Move the struct converter from the source index to the target index.
- */
- void moveStructConverter(int targetIndex, int sourceIndex);
-
- String STRUCT_CONVERTERS_LIST = "structConvertersList"; //$NON-NLS-1$
-
-
- //************ type converters *********************
-
- /**
- * Return a list iterator of the type converters.
- * This will not be null.
- */
- <T extends TypeConverter> ListIterator<T> typeConverters();
-
- /**
- * Return the number of type converters.
- */
- int typeConvertersSize();
-
- /**
- * Add a type converter to the converter holder, return the object representing it.
- */
- TypeConverter 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(TypeConverter converter);
-
- /**
- * Move the type converter from the source index to the target index.
- */
- void moveTypeConverter(int targetIndex, int sourceIndex);
-
- String TYPE_CONVERTERS_LIST = "typeConvertersList"; //$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/internal/context/orm/EclipseLinkEntityMappings.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkEntityMappings.java
deleted file mode 100644
index bbec02a44a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkEntityMappings.java
+++ /dev/null
@@ -1,20 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-
-public interface EclipseLinkEntityMappings
- extends EntityMappings
-{
-
- ConverterHolder getConverterHolder();
-
-}
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 90cb72e86f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkEntityMappingsImpl.java
+++ /dev/null
@@ -1,66 +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.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.orm.OrmStructureNodes;
-import org.eclipse.jpt.core.internal.context.orm.GenericEntityMappings;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntityMappings;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkEntityMappingsImpl
- extends GenericEntityMappings
- implements EclipseLinkEntityMappings
-{
-
- protected final EclipseLinkOrmConverterHolder converterHolder;
-
- public EclipseLinkEntityMappingsImpl(EclipseLinkOrmXml parent, XmlEntityMappings xmlEntityMappings) {
- super(parent, xmlEntityMappings);
- this.converterHolder = new EclipseLinkOrmConverterHolder(this);
- this.converterHolder.initialize(xmlEntityMappings);
- }
-
-
- // **************** JpaNode impl *******************************************
-
- @Override
- public EclipseLinkOrmXml getParent() {
- return (EclipseLinkOrmXml) super.getParent();
- }
-
- // **************** JpaStructureNode impl **********************************
-
- @Override
- public String getId() {
- return OrmStructureNodes.ENTITY_MAPPINGS_ID;
- }
-
-
- // **************** EclipseLinkEntityMappings impl **********************************
-
- public ConverterHolder getConverterHolder() {
- return this.converterHolder;
- }
-
- @Override
- public void update() {
- super.update();
- this.converterHolder.update((XmlEntityMappings) this.xmlEntityMappings);
- }
-
- // **************** validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- this.converterHolder.validate(messages);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmBasicMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmBasicMapping.java
deleted file mode 100644
index 82bf185cbe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmBasicMapping.java
+++ /dev/null
@@ -1,95 +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.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.GenericOrmBasicMapping;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.context.Convert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkBasicMapping;
-import org.eclipse.jpt.eclipselink.core.context.Mutable;
-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.XmlMutable;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkOrmBasicMapping extends GenericOrmBasicMapping
- implements EclipseLinkBasicMapping
-{
- protected EclipseLinkOrmMutable mutable;
-
-
- public EclipseLinkOrmBasicMapping(OrmPersistentAttribute parent) {
- super(parent);
- this.mutable = new EclipseLinkOrmMutable(this);
- }
-
-
- public Mutable getMutable() {
- return this.mutable;
- }
-
- @Override
- protected OrmConverter buildSpecifiedConverter(String converterType) {
- OrmConverter ormConverter = super.buildSpecifiedConverter(converterType);
- if (ormConverter != null) {
- return ormConverter;
- }
- if (converterType == Convert.ECLIPSE_LINK_CONVERTER) {
- return new EclipseLinkOrmConvert(this, (XmlBasic) this.resourceAttributeMapping);
- }
- return null;
- }
-
- @Override
- protected String specifiedConverterType() {
- //check @Convert first, this is the order that EclipseLink searches
- if (((XmlBasic) this.resourceAttributeMapping).getConvert() != null) {
- return Convert.ECLIPSE_LINK_CONVERTER;
- }
- return super.specifiedConverterType();
- }
-
-
- // **************** resource-context interaction ***************************
-
- @Override
- public XmlBasic addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlBasic basic = EclipseLinkOrmFactory.eINSTANCE.createXmlBasicImpl();
- getPersistentAttribute().initialize(basic);
- typeMapping.getAttributes().getBasics().add(basic);
- return basic;
- }
-
- @Override
- public void initialize(XmlAttributeMapping attributeMapping) {
- super.initialize(attributeMapping);
- this.mutable.initialize((XmlMutable) this.resourceAttributeMapping);
- }
-
- @Override
- public void update() {
- super.update();
- this.mutable.update();
- }
-
-
- // **************** validation **************************************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- // TODO - mutable validation
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmCaching.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmCaching.java
deleted file mode 100644
index 2ddb5884c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmCaching.java
+++ /dev/null
@@ -1,652 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.CacheCoordinationType;
-import org.eclipse.jpt.eclipselink.core.context.CacheType;
-import org.eclipse.jpt.eclipselink.core.context.Caching;
-import org.eclipse.jpt.eclipselink.core.context.ExistenceType;
-import org.eclipse.jpt.eclipselink.core.context.ExpiryTimeOfDay;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaCaching;
-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 EclipseLinkOrmCaching extends AbstractXmlContextNode
- implements Caching
-{
- protected XmlCacheHolder resource;
-
- protected int defaultSize;
- protected Integer specifiedSize;
-
- protected boolean defaultShared;
- protected Boolean specifiedShared;
-
- protected CacheType defaultType;
- protected CacheType specifiedType;
-
- protected boolean defaultAlwaysRefresh;
- protected Boolean specifiedAlwaysRefresh;
-
- protected boolean defaultRefreshOnlyIfNewer;
- protected Boolean specifiedRefreshOnlyIfNewer;
-
- protected boolean defaultDisableHits;
- protected Boolean specifiedDisableHits;
-
- protected CacheCoordinationType defaultCoordinationType;
- protected CacheCoordinationType specifiedCoordinationType;
-
- protected ExistenceType specifiedExistenceType;
- protected ExistenceType defaultExistenceType;
-
- protected Integer expiry;
- protected EclipseLinkOrmExpiryTimeOfDay expiryTimeOfDay;
-
- public EclipseLinkOrmCaching(OrmTypeMapping parent) {
- super(parent);
- }
-
- 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().isAllFeaturesUnset()) {
- 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().isAllFeaturesUnset()) {
- removeResourceCache();
- }
- }
- else if (newSpecifiedShared != null) {
- addResourceCache();
- getResourceCache().setShared(newSpecifiedShared);
- }
- }
- firePropertyChanged(SPECIFIED_SHARED_PROPERTY, oldSpecifiedShared, newSpecifiedShared);
- }
-
- 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().isAllFeaturesUnset()) {
- 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().isAllFeaturesUnset()) {
- 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().isAllFeaturesUnset()) {
- 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 CacheType getType() {
- return (this.specifiedType == null) ? this.defaultType : this.specifiedType;
- }
-
- public CacheType getDefaultType() {
- return this.defaultType;
- }
-
- protected void setDefaultType(CacheType newDefaultType) {
- CacheType oldDefaultType= this.defaultType;
- this.defaultType = newDefaultType;
- firePropertyChanged(DEFAULT_TYPE_PROPERTY, oldDefaultType, newDefaultType);
- }
-
- public CacheType getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(CacheType newSpecifiedType) {
- CacheType oldSpecifiedType = this.specifiedType;
- this.specifiedType = newSpecifiedType;
- if (oldSpecifiedType != newSpecifiedType) {
- if (this.getResourceCache() != null) {
- this.getResourceCache().setType(CacheType.toOrmResourceModel(newSpecifiedType));
- if (this.getResourceCache().isAllFeaturesUnset()) {
- removeResourceCache();
- }
- }
- else if (newSpecifiedType != null) {
- addResourceCache();
- getResourceCache().setType(CacheType.toOrmResourceModel(newSpecifiedType));
- }
- }
- firePropertyChanged(SPECIFIED_TYPE_PROPERTY, oldSpecifiedType, newSpecifiedType);
- }
-
- protected void setSpecifiedType_(CacheType newSpecifiedType) {
- CacheType oldSpecifiedType= this.specifiedType;
- this.specifiedType = newSpecifiedType;
- firePropertyChanged(SPECIFIED_TYPE_PROPERTY, oldSpecifiedType, newSpecifiedType);
- }
-
-
- public CacheCoordinationType getCoordinationType() {
- return (this.specifiedCoordinationType == null) ? this.defaultCoordinationType : this.specifiedCoordinationType;
- }
-
- public CacheCoordinationType getDefaultCoordinationType() {
- return this.defaultCoordinationType;
- }
-
- protected void setDefaultCoordinationType(CacheCoordinationType newDefaultcCoordinationType) {
- CacheCoordinationType oldDefaultcCoordinationType= this.defaultCoordinationType;
- this.defaultCoordinationType = newDefaultcCoordinationType;
- firePropertyChanged(DEFAULT_COORDINATION_TYPE_PROPERTY, oldDefaultcCoordinationType, newDefaultcCoordinationType);
- }
-
- public CacheCoordinationType getSpecifiedCoordinationType() {
- return this.specifiedCoordinationType;
- }
-
- public void setSpecifiedCoordinationType(CacheCoordinationType newSpecifiedCoordinationType) {
- CacheCoordinationType oldSpecifiedCoordinationType = this.specifiedCoordinationType;
- this.specifiedCoordinationType = newSpecifiedCoordinationType;
- if (oldSpecifiedCoordinationType != newSpecifiedCoordinationType) {
- if (this.getResourceCache() != null) {
- this.getResourceCache().setCoordinationType(CacheCoordinationType.toOrmResourceModel(newSpecifiedCoordinationType));
- if (this.getResourceCache().isAllFeaturesUnset()) {
- removeResourceCache();
- }
- }
- else if (newSpecifiedCoordinationType != null) {
- addResourceCache();
- getResourceCache().setCoordinationType(CacheCoordinationType.toOrmResourceModel(newSpecifiedCoordinationType));
- }
- }
- firePropertyChanged(SPECIFIED_COORDINATION_TYPE_PROPERTY, oldSpecifiedCoordinationType, newSpecifiedCoordinationType);
- }
-
- protected void setSpecifiedCoordinationType_(CacheCoordinationType newSpecifiedCoordinationType) {
- CacheCoordinationType oldSpecifiedCoordinationType = this.specifiedCoordinationType;
- this.specifiedCoordinationType = newSpecifiedCoordinationType;
- firePropertyChanged(SPECIFIED_COORDINATION_TYPE_PROPERTY, oldSpecifiedCoordinationType, newSpecifiedCoordinationType);
- }
-
- public ExistenceType getExistenceType() {
- return (this.specifiedExistenceType == null) ? this.defaultExistenceType : this.specifiedExistenceType;
- }
-
- public ExistenceType getDefaultExistenceType() {
- return this.defaultExistenceType;
- }
-
- protected void setDefaultExistenceType(ExistenceType newDefaultExistenceType) {
- ExistenceType oldDefaultExistenceType = this.defaultExistenceType;
- this.defaultExistenceType = newDefaultExistenceType;
- firePropertyChanged(DEFAULT_EXISTENCE_TYPE_PROPERTY, oldDefaultExistenceType, newDefaultExistenceType);
- }
-
- public ExistenceType getSpecifiedExistenceType() {
- return this.specifiedExistenceType;
- }
-
- public void setSpecifiedExistenceType(ExistenceType newSpecifiedExistenceType) {
- ExistenceType oldSpecifiedExistenceType = this.specifiedExistenceType;
- this.specifiedExistenceType = newSpecifiedExistenceType;
- this.resource.setExistenceChecking(ExistenceType.toOrmResourceModel(newSpecifiedExistenceType));
- firePropertyChanged(SPECIFIED_EXISTENCE_TYPE_PROPERTY, oldSpecifiedExistenceType, newSpecifiedExistenceType);
- }
-
- protected void setSpecifiedExistenceType_(ExistenceType newSpecifiedExistenceType) {
- ExistenceType 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().isAllFeaturesUnset()) {
- removeResourceCache();
- }
- }
- else if (newExpiry != null) {
- addResourceCache();
- this.getResourceCache().setExpiry(newExpiry);
- }
- }
- firePropertyChanged(EXPIRY_PROPERTY, oldExpiry, newExpiry);
- }
-
- protected void setExpiry_(Integer newExpiry) {
- Integer oldExpiry = this.expiry;
- this.expiry = newExpiry;
- firePropertyChanged(EXPIRY_PROPERTY, oldExpiry, newExpiry);
- }
-
- public ExpiryTimeOfDay getExpiryTimeOfDay() {
- return this.expiryTimeOfDay;
- }
-
- public ExpiryTimeOfDay addExpiryTimeOfDay() {
- if (this.expiryTimeOfDay != null) {
- throw new IllegalStateException("expiryTimeOfDay already exists, use getExpiryTimeOfDay()"); //$NON-NLS-1$
- }
- if (getResourceCache() == null) {
- addResourceCache();
- }
- EclipseLinkOrmExpiryTimeOfDay newExpiryTimeOfDay = new EclipseLinkOrmExpiryTimeOfDay(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$
- }
- ExpiryTimeOfDay oldExpiryTimeOfDay = this.expiryTimeOfDay;
- this.expiryTimeOfDay = null;
- getResourceCache().setExpiryTimeOfDay(null);
- if (this.getResourceCache().isAllFeaturesUnset()) {
- removeResourceCache();
- }
- firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, oldExpiryTimeOfDay, null);
- }
-
- protected void setExpiryTimeOfDay(EclipseLinkOrmExpiryTimeOfDay newExpiryTimeOfDay) {
- EclipseLinkOrmExpiryTimeOfDay 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);
- }
-
-
- // **************** initialize/update **************************************
-
- protected void initialize(XmlCacheHolder resource, JavaCaching javaCaching) {
- this.resource = resource;
- XmlCache resourceCache = getResourceCache();
- this.defaultSize = this.defaultSize(javaCaching);
- this.specifiedSize = specifiedSize(resourceCache);
- this.defaultShared = this.defaultShared(javaCaching);
- this.specifiedShared = this.specifiedShared(resourceCache);
- this.defaultAlwaysRefresh = this.defaultAlwaysRefresh(javaCaching);
- this.specifiedAlwaysRefresh = this.specifiedAlwaysRefresh(resourceCache);
- this.defaultRefreshOnlyIfNewer = this.defaultRefreshOnlyIfNewer(javaCaching);
- this.specifiedRefreshOnlyIfNewer = this.specifiedRefreshOnlyIfNewer(resourceCache);
- this.defaultDisableHits = this.defaultDisableHits(javaCaching);
- this.specifiedDisableHits = this.specifiedDisableHits(resourceCache);
- this.defaultType = this.defaultType(javaCaching);
- this.specifiedType = this.specifiedType(resourceCache);
- this.defaultCoordinationType = this.defaultCoordinationType(javaCaching);
- this.specifiedCoordinationType = this.specifiedCoordinationType(resourceCache);
- this.defaultExistenceType = this.defaultExistenceType(javaCaching);
- this.specifiedExistenceType = this.specifiedExistenceType(resource);
- this.initializeExpiry(resourceCache);
- }
-
- 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 EclipseLinkOrmExpiryTimeOfDay(this);
- this.expiryTimeOfDay.initialize(resourceCache.getExpiryTimeOfDay());
- }
- }
- }
-
- protected void update(XmlCacheHolder resource, JavaCaching javaCaching) {
- this.resource = resource;
- XmlCache resourceCache = getResourceCache();
- setDefaultSize(this.defaultSize(javaCaching));
- setSpecifiedSize_(this.specifiedSize(resourceCache));
- setDefaultShared(this.defaultShared(javaCaching));
- setSpecifiedShared_(this.specifiedShared(resourceCache));
- setDefaultAlwaysRefresh(this.defaultAlwaysRefresh(javaCaching));
- setSpecifiedAlwaysRefresh_(this.specifiedAlwaysRefresh(resourceCache));
- setDefaultRefreshOnlyIfNewer(this.defaultRefreshOnlyIfNewer(javaCaching));
- setSpecifiedRefreshOnlyIfNewer_(this.specifiedRefreshOnlyIfNewer(resourceCache));
- setDefaultDisableHits(this.defaultDisableHits(javaCaching));
- setSpecifiedDisableHits_(this.specifiedDisableHits(resourceCache));
- setDefaultType(this.defaultType(javaCaching));
- setSpecifiedType_(this.specifiedType(resourceCache));
- setDefaultCoordinationType(this.defaultCoordinationType(javaCaching));
- setSpecifiedCoordinationType_(this.specifiedCoordinationType(resourceCache));
- setDefaultExistenceType(this.defaultExistenceType(javaCaching));
- setSpecifiedExistenceType_(this.specifiedExistenceType(resource));
- this.updateExpiry(resourceCache);
- }
-
- 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 EclipseLinkOrmExpiryTimeOfDay(this));
- this.expiryTimeOfDay.initialize(resourceCache.getExpiryTimeOfDay());
- }
- else { //handle with validation if both expiry and expiryTimeOfDay are set
- setExpiryTimeOfDay(null);
- }
- }
- }
-
- protected int defaultSize(JavaCaching javaCaching) {
- return (javaCaching == null) ? DEFAULT_SIZE : javaCaching.getSize();
- }
-
- protected Integer specifiedSize(XmlCache resource) {
- return (resource == null) ? null : resource.getSize();
- }
-
- protected boolean defaultShared(JavaCaching javaCaching) {
- if (javaCaching == null) {
- return DEFAULT_SHARED;
- }
- return getResourceCache() == null ? javaCaching.isShared() : DEFAULT_SHARED;
- }
-
- protected Boolean specifiedShared(XmlCache resource) {
- return (resource == null) ? null : resource.getShared();
- }
-
- protected boolean defaultAlwaysRefresh(JavaCaching javaCaching) {
- if (javaCaching == null) {
- return DEFAULT_ALWAYS_REFRESH;
- }
- return getResourceCache() == null ? javaCaching.isAlwaysRefresh() : DEFAULT_ALWAYS_REFRESH;
- }
-
- protected Boolean specifiedAlwaysRefresh(XmlCache resource) {
- return (resource == null) ? null : resource.getAlwaysRefresh();
- }
-
- protected boolean defaultRefreshOnlyIfNewer(JavaCaching javaCaching) {
- if (javaCaching == null) {
- return DEFAULT_REFRESH_ONLY_IF_NEWER;
- }
- return getResourceCache() == null ? javaCaching.isRefreshOnlyIfNewer() : DEFAULT_REFRESH_ONLY_IF_NEWER;
- }
-
- protected Boolean specifiedRefreshOnlyIfNewer(XmlCache resource) {
- return (resource == null) ? null : resource.getRefreshOnlyIfNewer();
- }
-
- protected boolean defaultDisableHits(JavaCaching javaCaching) {
- if (javaCaching == null) {
- return DEFAULT_DISABLE_HITS;
- }
- return getResourceCache() == null ? javaCaching.isDisableHits() : DEFAULT_DISABLE_HITS;
- }
-
- protected Boolean specifiedDisableHits(XmlCache resource) {
- return (resource == null) ? null : resource.getDisableHits();
- }
-
- protected CacheType defaultType(JavaCaching javaCaching) {
- if (javaCaching == null) {
- return DEFAULT_TYPE;
- }
- return getResourceCache() == null ? javaCaching.getType() : DEFAULT_TYPE;
- }
-
- protected CacheType specifiedType(XmlCache resource) {
- return (resource == null) ? null : CacheType.fromOrmResourceModel(resource.getType());
- }
-
- protected CacheCoordinationType defaultCoordinationType(JavaCaching javaCaching) {
- if (javaCaching == null) {
- return DEFAULT_COORDINATION_TYPE;
- }
- return getResourceCache() == null ? javaCaching.getCoordinationType() : DEFAULT_COORDINATION_TYPE;
- }
-
- protected CacheCoordinationType specifiedCoordinationType(XmlCache resource) {
- return (resource == null) ? null : CacheCoordinationType.fromOrmResourceModel(resource.getCoordinationType());
- }
-
- protected ExistenceType defaultExistenceType(JavaCaching javaCaching) {
- return (javaCaching == null) ? DEFAULT_EXISTENCE_TYPE : javaCaching.getExistenceType();
- }
-
- protected ExistenceType specifiedExistenceType(XmlCacheHolder resource) {
- return (resource == null) ? null : ExistenceType.fromOrmResourceModel(resource.getExistenceChecking());
- }
-
- protected Integer expiry(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/EclipseLinkOrmChangeTracking.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmChangeTracking.java
deleted file mode 100644
index fe7d564d88..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmChangeTracking.java
+++ /dev/null
@@ -1,107 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.ChangeTracking;
-import org.eclipse.jpt.eclipselink.core.context.ChangeTrackingType;
-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 EclipseLinkOrmChangeTracking extends AbstractXmlContextNode
- implements ChangeTracking
-{
- protected XmlChangeTrackingHolder resource;
-
- protected ChangeTrackingType defaultType;
-
- protected ChangeTrackingType specifiedType;
-
-
- public EclipseLinkOrmChangeTracking(OrmTypeMapping parent) {
- super(parent);
- }
-
-
- public ChangeTrackingType getType() {
- return (getSpecifiedType() != null) ? getSpecifiedType() : getDefaultType();
- }
-
- public ChangeTrackingType getDefaultType() {
- return this.defaultType;
- }
-
- protected void setDefaultType_(ChangeTrackingType newDefaultType) {
- ChangeTrackingType oldDefaultType = this.defaultType;
- this.defaultType = newDefaultType;
- firePropertyChanged(DEFAULT_TYPE_PROPERTY, oldDefaultType, newDefaultType);
- }
-
- public ChangeTrackingType getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(ChangeTrackingType newSpecifiedType) {
- ChangeTrackingType 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(ChangeTrackingType.toOrmResourceModel(newSpecifiedType));
- }
-
- firePropertyChanged(SPECIFIED_TYPE_PROPERTY, oldSpecifiedType, newSpecifiedType);
- }
-
- protected void setSpecifiedType_(ChangeTrackingType newSpecifiedType) {
- ChangeTrackingType oldSpecifiedType = this.specifiedType;
- this.specifiedType = newSpecifiedType;
- firePropertyChanged(SPECIFIED_TYPE_PROPERTY, oldSpecifiedType, newSpecifiedType);
- }
-
-
- // **************** initialize/update **************************************
-
- protected void initialize(XmlChangeTrackingHolder xmlChangeTrackingHolder, ChangeTracking javaChangeTracking) {
- this.resource = xmlChangeTrackingHolder;
- this.defaultType = calculateDefaultType(javaChangeTracking);
- this.specifiedType = calculateSpecifiedType(xmlChangeTrackingHolder);
- }
-
- protected void update(XmlChangeTrackingHolder xmlChangeTrackingHolder, ChangeTracking javaChangeTracking) {
- setDefaultType_(calculateDefaultType(javaChangeTracking));
- setSpecifiedType_(calculateSpecifiedType(xmlChangeTrackingHolder));
- }
-
- protected ChangeTrackingType calculateDefaultType(ChangeTracking javaChangeTracking) {
- return (javaChangeTracking != null) ? javaChangeTracking.getType() : ChangeTracking.DEFAULT_TYPE;
- }
-
- protected ChangeTrackingType calculateSpecifiedType(XmlChangeTrackingHolder xmlChangeTrackingHolder) {
- XmlChangeTracking xmlChangeTracking = xmlChangeTrackingHolder.getChangeTracking();
- return (xmlChangeTracking != null) ? ChangeTrackingType.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/EclipseLinkOrmConversionValue.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmConversionValue.java
deleted file mode 100644
index d12cc740d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmConversionValue.java
+++ /dev/null
@@ -1,126 +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.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.ConversionValue;
-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;
-
-public class EclipseLinkOrmConversionValue extends AbstractXmlContextNode implements ConversionValue
-{
- private XmlConversionValue resourceConversionValue;
-
- private String dataValue;
-
- private String objectValue;
-
- public EclipseLinkOrmConversionValue(EclipseLinkOrmObjectTypeConverter parent) {
- super(parent);
- }
-
- @Override
- public EclipseLinkOrmObjectTypeConverter getParent() {
- return (EclipseLinkOrmObjectTypeConverter) 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.dataValue();
- this.objectValue = this.objectValue();
- }
-
- public void update(XmlConversionValue 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() {
- return this.resourceConversionValue.getDataValueTextRange();
- }
-
- public TextRange getObjectValueTextRange() {
- return this.resourceConversionValue.getObjectValueTextRange();
- }
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- 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/EclipseLinkOrmConvert.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmConvert.java
deleted file mode 100644
index adce47c718..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmConvert.java
+++ /dev/null
@@ -1,250 +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.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.AbstractXmlContextNode;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.Convert;
-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;
-
-public class EclipseLinkOrmConvert extends AbstractXmlContextNode implements Convert, OrmConverter
-{
- protected String specifiedConverterName;
-
- protected XmlConvertibleMapping resourceMapping;
-
- protected EclipseLinkOrmConverter converter;
-
- public EclipseLinkOrmConvert(OrmAttributeMapping parent, XmlConvertibleMapping resourceMapping) {
- super(parent);
- this.initialize(resourceMapping);
- }
-
- @Override
- public OrmAttributeMapping getParent() {
- return (OrmAttributeMapping) super.getParent();
- }
-
- public String getType() {
- return Convert.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 EclipseLinkOrmConverter 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;
- }
- EclipseLinkOrmConverter 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);
- EclipseLinkOrmConverter 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.createXmlConverterImpl();
- }
- else if (converterType == EclipseLinkConverter.TYPE_CONVERTER) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverterImpl();
- }
- else if (converterType == EclipseLinkConverter.OBJECT_TYPE_CONVERTER) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverterImpl();
- }
- else if (converterType == EclipseLinkConverter.STRUCT_CONVERTER) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverterImpl();
- }
- 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 EclipseLinkOrmConverter buildConverter(String converterType, JpaEObject resourceConverter) {
- if (converterType == EclipseLinkConverter.NO_CONVERTER) {
- return null;
- }
- if (converterType == EclipseLinkConverter.CUSTOM_CONVERTER) {
- return new EclipseLinkOrmCustomConverter(this, (XmlConverter) resourceConverter);
- }
- else if (converterType == EclipseLinkConverter.TYPE_CONVERTER) {
- return new EclipseLinkOrmTypeConverter(this, (XmlTypeConverter) resourceConverter);
- }
- else if (converterType == EclipseLinkConverter.OBJECT_TYPE_CONVERTER) {
- return new EclipseLinkOrmObjectTypeConverter(this, (XmlObjectTypeConverter) resourceConverter);
- }
- else if (converterType == EclipseLinkConverter.STRUCT_CONVERTER) {
- return new EclipseLinkOrmStructConverter(this, (XmlStructConverter) resourceConverter);
- }
- return null;
- }
-
- protected void setConverter(EclipseLinkOrmConverter newConverter) {
- EclipseLinkOrmConverter oldConverter = this.converter;
- this.converter = newConverter;
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- protected void initialize(XmlConvertibleMapping resourceMapping) {
- this.resourceMapping = resourceMapping;
- this.specifiedConverterName = this.specifiedConverterName();
- this.converter = this.buildConverter();
- }
-
- public void update() {
- this.setSpecifiedConverterName_(this.specifiedConverterName());
- if (converterType() == getConverterType()) {
- this.converter.update();
- }
- else {
- setConverter(buildConverter());
- }
- }
-
- protected String specifiedConverterName() {
- return this.resourceMapping == null ? null : this.resourceMapping.getConvert();
- }
-
- protected String converterType() {
- 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 EclipseLinkOrmConverter buildConverter() {
- if (this.resourceMapping.getConverter() != null) {
- return new EclipseLinkOrmCustomConverter(this, this.resourceMapping.getConverter());
- }
- else if (this.resourceMapping.getTypeConverter() != null) {
- return new EclipseLinkOrmTypeConverter(this, this.resourceMapping.getTypeConverter());
- }
- else if (this.resourceMapping.getObjectTypeConverter() != null) {
- return new EclipseLinkOrmObjectTypeConverter(this, this.resourceMapping.getObjectTypeConverter());
- }
- else if (this.resourceMapping.getStructConverter() != null) {
- return new EclipseLinkOrmStructConverter(this, this.resourceMapping.getStructConverter());
- }
-
- return null;
- }
-
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- if (getConverter() != null) {
- getConverter().validate(messages);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmConverter.java
deleted file mode 100644
index 1405c7fe75..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmConverter.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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaConverter;
-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 EclipseLinkOrmConverter
- extends AbstractXmlContextNode implements EclipseLinkConverter
-{
- private XmlNamedConverter xmlResource;
-
- private String name;
-
-
- public EclipseLinkOrmConverter(XmlContextNode parent, XmlNamedConverter xmlResource) {
- super(parent);
- initialize(xmlResource);
- }
-
-
- protected XmlNamedConverter getXmlResource() {
- return this.xmlResource;
- }
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
-
- // **************** name ***************************************************
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- getXmlResource().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(XmlNamedConverter resource) {
- this.xmlResource = resource;
- this.name = calculateName();
- getPersistenceUnit().addConverter(this);
- }
-
- public void update() {
- this.setName_(calculateName());
- getPersistenceUnit().addConverter(this);
- }
-
- protected String calculateName() {
- return getXmlResource().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 EclipseLinkJavaConverter;
- }
-
- 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 getXmlResource().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/EclipseLinkOrmConverterHolder.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmConverterHolder.java
deleted file mode 100644
index 4fd428e2b3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmConverterHolder.java
+++ /dev/null
@@ -1,430 +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.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.AbstractXmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.CustomConverter;
-import org.eclipse.jpt.eclipselink.core.context.ObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.StructConverter;
-import org.eclipse.jpt.eclipselink.core.context.TypeConverter;
-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.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkOrmConverterHolder extends AbstractXmlContextNode implements ConverterHolder
-{
- private XmlConvertersHolder resourceConvertersHolder;
-
- protected final List<EclipseLinkOrmCustomConverter> customConverters;
- protected final List<EclipseLinkOrmObjectTypeConverter> objectTypeConverters;
- protected final List<EclipseLinkOrmStructConverter> structConverters;
- protected final List<EclipseLinkOrmTypeConverter> typeConverters;
-
- public EclipseLinkOrmConverterHolder(XmlContextNode parent) {
- super(parent);
- this.customConverters = new ArrayList<EclipseLinkOrmCustomConverter>();
- this.objectTypeConverters = new ArrayList<EclipseLinkOrmObjectTypeConverter>();
- this.structConverters = new ArrayList<EclipseLinkOrmStructConverter>();
- this.typeConverters = new ArrayList<EclipseLinkOrmTypeConverter>();
- }
-
- public ListIterator<EclipseLinkOrmCustomConverter> customConverters() {
- return this.customConverters.listIterator();
- }
-
- public int customConvertersSize() {
- return this.customConverters.size();
- }
-
- public CustomConverter addCustomConverter(int index) {
- XmlConverter resourceConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlConverterImpl();
- EclipseLinkOrmCustomConverter contextConverter = new EclipseLinkOrmCustomConverter(this, 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, EclipseLinkOrmCustomConverter converter) {
- addItemToList(index, converter, this.customConverters, CUSTOM_CONVERTERS_LIST);
- }
-
- protected void addCustomConverter(EclipseLinkOrmCustomConverter converter) {
- this.addCustomConverter(this.customConverters.size(), converter);
- }
-
- public void removeCustomConverter(int index) {
- EclipseLinkOrmCustomConverter removedConverter = this.customConverters.remove(index);
- this.resourceConvertersHolder.getConverters().remove(index);
- fireItemRemoved(CUSTOM_CONVERTERS_LIST, index, removedConverter);
- }
-
- public void removeCustomConverter(CustomConverter converter) {
- this.removeCustomConverter(this.customConverters.indexOf(converter));
- }
-
- protected void removeConverter_(CustomConverter 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, EclipseLinkOrmCustomConverter converter) {
- moveItemInList(index, this.customConverters.indexOf(converter), this.customConverters, CUSTOM_CONVERTERS_LIST);
- }
-
- public ListIterator<EclipseLinkOrmObjectTypeConverter> objectTypeConverters() {
- return this.objectTypeConverters.listIterator();
- }
-
- public int objectTypeConvertersSize() {
- return this.objectTypeConverters.size();
- }
-
- public ObjectTypeConverter addObjectTypeConverter(int index) {
- XmlObjectTypeConverter resourceObjectTypeConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverterImpl();
- EclipseLinkOrmObjectTypeConverter contextObjectTypeConverter = new EclipseLinkOrmObjectTypeConverter(this, 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, EclipseLinkOrmObjectTypeConverter converter) {
- addItemToList(index, converter, this.objectTypeConverters, OBJECT_TYPE_CONVERTERS_LIST);
- }
-
- protected void addObjectTypeConverter(EclipseLinkOrmObjectTypeConverter converter) {
- this.addObjectTypeConverter(this.objectTypeConverters.size(), converter);
- }
-
- public void removeObjectTypeConverter(int index) {
- EclipseLinkOrmObjectTypeConverter removedObjectTypeConverter = this.objectTypeConverters.remove(index);
- this.resourceConvertersHolder.getObjectTypeConverters().remove(index);
- fireItemRemoved(OBJECT_TYPE_CONVERTERS_LIST, index, removedObjectTypeConverter);
- }
-
- public void removeObjectTypeConverter(ObjectTypeConverter converter) {
- this.removeObjectTypeConverter(this.objectTypeConverters.indexOf(converter));
- }
-
- protected void removeObjectTypeConverter_(ObjectTypeConverter 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, EclipseLinkOrmObjectTypeConverter converter) {
- moveItemInList(index, this.objectTypeConverters.indexOf(converter), this.objectTypeConverters, OBJECT_TYPE_CONVERTERS_LIST);
- }
-
- public ListIterator<EclipseLinkOrmStructConverter> structConverters() {
- return this.structConverters.listIterator();
- }
-
- public int structConvertersSize() {
- return this.structConverters.size();
- }
-
- public StructConverter addStructConverter(int index) {
- XmlStructConverter resourceStructConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverterImpl();
- EclipseLinkOrmStructConverter contextStructConverter = new EclipseLinkOrmStructConverter(this, 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, EclipseLinkOrmStructConverter converter) {
- addItemToList(index, converter, this.structConverters, STRUCT_CONVERTERS_LIST);
- }
-
- protected void addStructConverter(EclipseLinkOrmStructConverter converter) {
- this.addStructConverter(this.structConverters.size(), converter);
- }
-
- public void removeStructConverter(int index) {
- EclipseLinkOrmStructConverter removedStructConverter = this.structConverters.remove(index);
- this.resourceConvertersHolder.getStructConverters().remove(index);
- fireItemRemoved(STRUCT_CONVERTERS_LIST, index, removedStructConverter);
- }
-
- public void removeStructConverter(StructConverter converter) {
- this.removeStructConverter(this.structConverters.indexOf(converter));
- }
-
- protected void removeStructConverter_(StructConverter 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, EclipseLinkOrmStructConverter converter) {
- moveItemInList(index, this.structConverters.indexOf(converter), this.structConverters, STRUCT_CONVERTERS_LIST);
- }
-
-
- public ListIterator<EclipseLinkOrmTypeConverter> typeConverters() {
- return this.typeConverters.listIterator();
- }
-
- public int typeConvertersSize() {
- return this.typeConverters.size();
- }
-
- public TypeConverter addTypeConverter(int index) {
- XmlTypeConverter resourceTypeConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverterImpl();
- EclipseLinkOrmTypeConverter contextTypeConverter = new EclipseLinkOrmTypeConverter(this, 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, EclipseLinkOrmTypeConverter converter) {
- addItemToList(index, converter, this.typeConverters, TYPE_CONVERTERS_LIST);
- }
-
- protected void addTypeConverter(EclipseLinkOrmTypeConverter converter) {
- this.addTypeConverter(this.typeConverters.size(), converter);
- }
-
- public void removeTypeConverter(int index) {
- EclipseLinkOrmTypeConverter removedTypeConverter = this.typeConverters.remove(index);
- this.resourceConvertersHolder.getTypeConverters().remove(index);
- fireItemRemoved(TYPE_CONVERTERS_LIST, index, removedTypeConverter);
- }
-
- public void removeTypeConverter(TypeConverter converter) {
- this.removeTypeConverter(this.typeConverters.indexOf(converter));
- }
-
- protected void removeTypeConverter_(TypeConverter 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, EclipseLinkOrmTypeConverter converter) {
- moveItemInList(index, this.typeConverters.indexOf(converter), this.typeConverters, TYPE_CONVERTERS_LIST);
- }
-
-
-
- public void initialize(XmlConvertersHolder resourceConvertersHolder) {
- this.resourceConvertersHolder = resourceConvertersHolder;
- this.initializeCustomConverters();
- this.initializeObjectTypeConverters();
- this.initializeStructConverters();
- this.initializeTypeConverters();
- }
-
- protected void initializeCustomConverters() {
- for (XmlConverter resourceConverter : this.resourceConvertersHolder.getConverters()) {
- this.customConverters.add(new EclipseLinkOrmCustomConverter(this, resourceConverter));
- }
- }
-
- protected void initializeObjectTypeConverters() {
- for (XmlObjectTypeConverter resourceConverter : this.resourceConvertersHolder.getObjectTypeConverters()) {
- this.objectTypeConverters.add(new EclipseLinkOrmObjectTypeConverter(this, resourceConverter));
- }
- }
-
- protected void initializeStructConverters() {
- for (XmlStructConverter resourceConverter : this.resourceConvertersHolder.getStructConverters()) {
- this.structConverters.add(new EclipseLinkOrmStructConverter(this, resourceConverter));
- }
- }
-
- protected void initializeTypeConverters() {
- for (XmlTypeConverter resourceConverter : this.resourceConvertersHolder.getTypeConverters()) {
- this.typeConverters.add(new EclipseLinkOrmTypeConverter(this, resourceConverter));
- }
- }
-
- public void update(XmlConvertersHolder resourceConvertersHolder) {
- this.resourceConvertersHolder = resourceConvertersHolder;
- this.updateCustomConverters();
- this.updateObjectTypeConverters();
- this.updateStructConverters();
- this.updateTypeConverters();
- }
-
- protected void updateCustomConverters() {
- Collection<EclipseLinkOrmCustomConverter> contextConvertersToRemove = CollectionTools.collection(customConverters());
- Collection<EclipseLinkOrmCustomConverter> contextConvertersToUpdate = new ArrayList<EclipseLinkOrmCustomConverter>();
- ListIterator<XmlConverter> resourceConverters = new CloneListIterator<XmlConverter>(this.resourceConvertersHolder.getConverters());//prevent ConcurrentModificiationException
- int resourceIndex = 0;
-
- for (XmlConverter resourceConverter : CollectionTools.iterable(resourceConverters)) {
- boolean contextConverterFound = false;
- for (EclipseLinkOrmCustomConverter contextConverter : contextConvertersToRemove) {
- if (contextConverter.getXmlResource() == resourceConverter) {
- moveCustomConverter_(resourceIndex, contextConverter);
- contextConvertersToRemove.remove(contextConverter);
- contextConvertersToUpdate.add(contextConverter);
- contextConverterFound = true;
- break;
- }
- }
- if (!contextConverterFound) {
- addCustomConverter(new EclipseLinkOrmCustomConverter(this, resourceConverter));
- }
- resourceIndex++;
- }
- for (EclipseLinkOrmCustomConverter 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 (EclipseLinkOrmCustomConverter contextConverter : contextConvertersToUpdate) {
- contextConverter.update();
- }
- }
-
- protected void updateObjectTypeConverters() {
- Collection<EclipseLinkOrmObjectTypeConverter> contextObjectTypeConvertersToRemove = CollectionTools.collection(objectTypeConverters());
- Collection<EclipseLinkOrmObjectTypeConverter> contextObjectTypeConvertersToUpdate = new ArrayList<EclipseLinkOrmObjectTypeConverter>();
- ListIterator<XmlObjectTypeConverter> resourceObjectTypeConverters = new CloneListIterator<XmlObjectTypeConverter>(this.resourceConvertersHolder.getObjectTypeConverters());//prevent ConcurrentModificiationException
- int resourceIndex = 0;
-
- for (XmlObjectTypeConverter resourceObjectTypeConverter : CollectionTools.iterable(resourceObjectTypeConverters)) {
- boolean contextObjectTypeConverterFound = false;
- for (EclipseLinkOrmObjectTypeConverter contextObjectTypeConverter : contextObjectTypeConvertersToRemove) {
- if (contextObjectTypeConverter.getXmlResource() == resourceObjectTypeConverter) {
- moveObjectTypeConverter_(resourceIndex, contextObjectTypeConverter);
- contextObjectTypeConvertersToRemove.remove(contextObjectTypeConverter);
- contextObjectTypeConvertersToUpdate.add(contextObjectTypeConverter);
- contextObjectTypeConverterFound = true;
- break;
- }
- }
- if (!contextObjectTypeConverterFound) {
- addObjectTypeConverter(new EclipseLinkOrmObjectTypeConverter(this, resourceObjectTypeConverter));
- }
- resourceIndex++;
- }
- for (EclipseLinkOrmObjectTypeConverter contextObjectTypeConverter : contextObjectTypeConvertersToRemove) {
- removeObjectTypeConverter_(contextObjectTypeConverter);
- }
- //first handle adding/removing of the converters, then update the others last,
- //this causes less churn in the update process
- for (EclipseLinkOrmObjectTypeConverter contextObjectTypeConverter : contextObjectTypeConvertersToUpdate) {
- contextObjectTypeConverter.update();
- }
- }
-
- protected void updateTypeConverters() {
- Collection<EclipseLinkOrmTypeConverter> contextTypeConvertersToRemove = CollectionTools.collection(typeConverters());
- Collection<EclipseLinkOrmTypeConverter> contextTypeConvertersToUpdate = new ArrayList<EclipseLinkOrmTypeConverter>();
- ListIterator<XmlTypeConverter> resourceTypeConverters = new CloneListIterator<XmlTypeConverter>(this.resourceConvertersHolder.getTypeConverters());//prevent ConcurrentModificiationException
- int resourceIndex = 0;
-
- for (XmlTypeConverter resourceTypeConverter : CollectionTools.iterable(resourceTypeConverters)) {
- boolean contextTypeConverterFound = false;
- for (EclipseLinkOrmTypeConverter contextTypeConverter : contextTypeConvertersToRemove) {
- if (contextTypeConverter.getXmlResource() == resourceTypeConverter) {
- moveTypeConverter_(resourceIndex, contextTypeConverter);
- contextTypeConvertersToRemove.remove(contextTypeConverter);
- contextTypeConvertersToUpdate.add(contextTypeConverter);
- contextTypeConverterFound = true;
- break;
- }
- }
- if (!contextTypeConverterFound) {
- addTypeConverter(new EclipseLinkOrmTypeConverter(this, resourceTypeConverter));
- }
- resourceIndex++;
- }
- for (EclipseLinkOrmTypeConverter contextTypeConverter : contextTypeConvertersToRemove) {
- removeTypeConverter_(contextTypeConverter);
- }
- //first handle adding/removing of the converters, then update the others last,
- //this causes less churn in the update process
- for (EclipseLinkOrmTypeConverter contextTypeConverter : contextTypeConvertersToUpdate) {
- contextTypeConverter.update();
- }
- }
-
- protected void updateStructConverters() {
- Collection<EclipseLinkOrmStructConverter> contextStructConvertersToRemove = CollectionTools.collection(structConverters());
- Collection<EclipseLinkOrmStructConverter> contextStructConvertersToUpdate = new ArrayList<EclipseLinkOrmStructConverter>();
- ListIterator<XmlStructConverter> resourceStructConverters = new CloneListIterator<XmlStructConverter>(this.resourceConvertersHolder.getStructConverters());//prevent ConcurrentModificiationException
- int resourceIndex = 0;
-
- for (XmlStructConverter resourceStructConverter : CollectionTools.iterable(resourceStructConverters)) {
- boolean contextStructConverterFound = false;
- for (EclipseLinkOrmStructConverter contextStructConverter : contextStructConvertersToRemove) {
- if (contextStructConverter.getXmlResource() == resourceStructConverter) {
- moveStructConverter_(resourceIndex, contextStructConverter);
- contextStructConvertersToRemove.remove(contextStructConverter);
- contextStructConvertersToUpdate.add(contextStructConverter);
- contextStructConverterFound = true;
- break;
- }
- }
- if (!contextStructConverterFound) {
- addStructConverter(new EclipseLinkOrmStructConverter(this, resourceStructConverter));
- }
- resourceIndex++;
- }
- for (EclipseLinkOrmStructConverter contextStructConverter : contextStructConvertersToRemove) {
- removeStructConverter_(contextStructConverter);
- }
- //first handle adding/removing of the converters, then update the others last,
- //this causes less churn in the update process
- for (EclipseLinkOrmStructConverter contextStructConverter : contextStructConvertersToUpdate) {
- contextStructConverter.update();
- }
- }
-
- //************ validation ***************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- }
-
-
- 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/EclipseLinkOrmCustomConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmCustomConverter.java
deleted file mode 100644
index 6c63448ffc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmCustomConverter.java
+++ /dev/null
@@ -1,102 +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.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.eclipselink.core.context.CustomConverter;
-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;
-
-public class EclipseLinkOrmCustomConverter extends EclipseLinkOrmConverter
- implements CustomConverter
-{
- private String converterClass;
-
-
- public EclipseLinkOrmCustomConverter(XmlContextNode parent, XmlConverter xmlResource) {
- super(parent, xmlResource);
- }
-
-
- public String getType() {
- return EclipseLinkConverter.CUSTOM_CONVERTER;
- }
-
- @Override
- protected XmlConverter getXmlResource() {
- return (XmlConverter) super.getXmlResource();
- }
-
-
- // **************** converter class ****************************************
-
- public String getConverterClass() {
- return this.converterClass;
- }
-
- public void setConverterClass(String newConverterClass) {
- String oldConverterClass = this.converterClass;
- this.converterClass = newConverterClass;
- getXmlResource().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 ***********************************
-
- protected void initialize(XmlConverter xmlResource) {
- super.initialize(xmlResource);
- this.converterClass = calculateConverterClass();
- }
-
- public void update() {
- super.update();
- setConverterClass_(calculateConverterClass());
- }
-
- protected String calculateConverterClass() {
- return getXmlResource().getClassName();
- }
-
-
- // **************** validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- 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/EclipseLinkOrmCustomizer.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmCustomizer.java
deleted file mode 100644
index 24be842238..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmCustomizer.java
+++ /dev/null
@@ -1,114 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.Customizer;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlCustomizer;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlCustomizerHolder;
-
-public class EclipseLinkOrmCustomizer extends AbstractXmlContextNode
- implements Customizer
-{
- protected XmlCustomizerHolder resource;
-
- protected String specifiedCustomizerClass;
-
- protected String defaultCustomizerClass;
-
- public EclipseLinkOrmCustomizer(OrmTypeMapping parent) {
- super(parent);
- }
-
- 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().setCustomizerClassName(newCustomizerClass);
- if (this.getResourceCustomizer().isAllFeaturesUnset()) {
- removeResourceCustomizer();
- }
- }
- else if (newCustomizerClass != null) {
- addResourceCustomizer();
- getResourceCustomizer().setCustomizerClassName(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 XmlCustomizer getResourceCustomizer() {
- return this.resource.getCustomizer();
- }
-
- protected void addResourceCustomizer() {
- this.resource.setCustomizer(EclipseLinkOrmFactory.eINSTANCE.createXmlCustomizer());
- }
-
- protected void removeResourceCustomizer() {
- this.resource.setCustomizer(null);
- }
-
- // **************** initialize/update **************************************
-
- protected void initialize(XmlCustomizerHolder resource, Customizer javaCustomizer) {
- this.resource = resource;
- this.defaultCustomizerClass = (javaCustomizer == null) ? null : javaCustomizer.getCustomizerClass();
- this.specifiedCustomizerClass = specifiedCustomizerClass(getResourceCustomizer());
- }
-
- protected void update(XmlCustomizerHolder resource, Customizer javaCustomizer) {
- this.resource = resource;
- setDefaultCustomizerClass((javaCustomizer == null) ? null : javaCustomizer.getCustomizerClass());
- setSpecifiedCustomizerClass_(specifiedCustomizerClass(getResourceCustomizer()));
- }
-
- protected String specifiedCustomizerClass(XmlCustomizer resource) {
- return (resource == null) ? null : resource.getCustomizerClassName();
- }
-
-
- // **************** validation **************************************
-
- public TextRange getValidationTextRange() {
- XmlCustomizer resource = getResourceCustomizer();
- return resource == null ? null : resource.getCustomizerClassNameTextRange();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmEmbeddable.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmEmbeddable.java
deleted file mode 100644
index 22811ef27b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmEmbeddable.java
+++ /dev/null
@@ -1,30 +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.internal.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 EclipseLinkOrmEmbeddable extends EclipseLinkEmbeddable, OrmEmbeddable
-{
- ConverterHolder getConverterHolder();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmEmbeddableImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmEmbeddableImpl.java
deleted file mode 100644
index c2d4b941c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmEmbeddableImpl.java
+++ /dev/null
@@ -1,107 +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.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmEmbeddable;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.eclipselink.core.context.ChangeTracking;
-import org.eclipse.jpt.eclipselink.core.context.Customizer;
-import org.eclipse.jpt.eclipselink.core.context.java.EclipseLinkJavaEmbeddable;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-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.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkOrmEmbeddableImpl extends GenericOrmEmbeddable
- implements EclipseLinkOrmEmbeddable
-{
- protected final EclipseLinkOrmCustomizer customizer;
-
- protected final EclipseLinkOrmChangeTracking changeTracking;
-
- protected final EclipseLinkOrmConverterHolder converterHolder;
-
- public EclipseLinkOrmEmbeddableImpl(OrmPersistentType parent) {
- super(parent);
- this.customizer = new EclipseLinkOrmCustomizer(this);
- this.changeTracking = new EclipseLinkOrmChangeTracking(this);
- this.converterHolder = new EclipseLinkOrmConverterHolder(this);
- }
-
- public Customizer getCustomizer() {
- return this.customizer;
- }
-
- public ChangeTracking getChangeTracking() {
- return this.changeTracking;
- }
-
- public ConverterHolder getConverterHolder() {
- return this.converterHolder;
- }
-
-
-
- // **************** resource-context interaction ***************************
-
- @Override
- public XmlEmbeddable addToResourceModel(XmlEntityMappings entityMappings) {
- XmlEmbeddable embeddable = EclipseLinkOrmFactory.eINSTANCE.createXmlEmbeddable();
- getPersistentType().initialize(embeddable);
- entityMappings.getEmbeddables().add(embeddable);
- return embeddable;
- }
-
- @Override
- public void initialize(XmlEmbeddable embeddable) {
- super.initialize(embeddable);
- this.customizer.initialize((XmlCustomizerHolder) embeddable, getJavaCustomizer());
- this.changeTracking.initialize((XmlChangeTrackingHolder) embeddable, getJavaChangeTracking());
- this.converterHolder.initialize((XmlConvertersHolder) embeddable);
- }
-
- @Override
- public void update(XmlEmbeddable embeddable) {
- super.update(embeddable);
- this.customizer.update((XmlCustomizerHolder) embeddable, getJavaCustomizer());
- this.changeTracking.update((XmlChangeTrackingHolder) embeddable, getJavaChangeTracking());
- this.converterHolder.update((XmlConvertersHolder) embeddable);
- }
-
- @Override
- protected EclipseLinkJavaEmbeddable getJavaEmbeddableForDefaults() {
- return (EclipseLinkJavaEmbeddable) super.getJavaEmbeddableForDefaults();
- }
-
-
- protected Customizer getJavaCustomizer() {
- EclipseLinkJavaEmbeddable javaEmbeddable = getJavaEmbeddableForDefaults();
- return (javaEmbeddable == null) ? null : javaEmbeddable.getCustomizer();
- }
-
- protected ChangeTracking getJavaChangeTracking() {
- EclipseLinkJavaEmbeddable javaEmbeddable = getJavaEmbeddableForDefaults();
- return (javaEmbeddable == null) ? null : javaEmbeddable.getChangeTracking();
- }
-
-
- // **************** validation **************************************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- this.customizer.validate(messages);
- this.changeTracking.validate(messages);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmEntity.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmEntity.java
deleted file mode 100644
index 43fafde3e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmEntity.java
+++ /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
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkEntity;
-
-public interface EclipseLinkOrmEntity extends EclipseLinkEntity, OrmEntity
-{
- ConverterHolder getConverterHolder();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmEntityImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmEntityImpl.java
deleted file mode 100644
index eda9adc885..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmEntityImpl.java
+++ /dev/null
@@ -1,140 +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.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmEntity;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.eclipselink.core.context.Caching;
-import org.eclipse.jpt.eclipselink.core.context.ChangeTracking;
-import org.eclipse.jpt.eclipselink.core.context.Customizer;
-import org.eclipse.jpt.eclipselink.core.context.ReadOnly;
-import org.eclipse.jpt.eclipselink.core.context.java.EclipseLinkJavaEntity;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaCaching;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-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.XmlReadOnly;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkOrmEntityImpl extends GenericOrmEntity
- implements EclipseLinkOrmEntity
-{
- protected final EclipseLinkOrmReadOnly readOnly;
-
- protected final EclipseLinkOrmCustomizer customizer;
-
- protected final EclipseLinkOrmChangeTracking changeTracking;
-
- protected final EclipseLinkOrmCaching caching;
-
- protected final EclipseLinkOrmConverterHolder converterHolder;
-
-
- public EclipseLinkOrmEntityImpl(OrmPersistentType parent) {
- super(parent);
- this.readOnly = new EclipseLinkOrmReadOnly(this);
- this.customizer = new EclipseLinkOrmCustomizer(this);
- this.changeTracking = new EclipseLinkOrmChangeTracking(this);
- this.caching = new EclipseLinkOrmCaching(this);
- this.converterHolder = new EclipseLinkOrmConverterHolder(this);
- }
-
- public Caching getCaching() {
- return this.caching;
- }
-
- public Customizer getCustomizer() {
- return this.customizer;
- }
-
- public ChangeTracking getChangeTracking() {
- return this.changeTracking;
- }
-
- public EclipseLinkOrmReadOnly getReadOnly() {
- return this.readOnly;
- }
-
- public ConverterHolder getConverterHolder() {
- return this.converterHolder;
- }
-
- // **************** resource-context interaction ***************************
-
- @Override
- public XmlEntity addToResourceModel(XmlEntityMappings entityMappings) {
- XmlEntity entity = EclipseLinkOrmFactory.eINSTANCE.createXmlEntity();
- getPersistentType().initialize(entity);
- entityMappings.getEntities().add(entity);
- return entity;
- }
-
- @Override
- public void initialize(XmlEntity entity) {
- super.initialize(entity);
- this.readOnly.initialize((XmlReadOnly) entity, getJavaReadOnly());
- this.customizer.initialize((XmlCustomizerHolder) entity, getJavaCustomizer());
- this.changeTracking.initialize((XmlChangeTrackingHolder) entity, getJavaChangeTracking());
- this.caching.initialize((XmlCacheHolder) entity, getJavaCaching());
- this.converterHolder.initialize((XmlConvertersHolder) entity);
- }
-
- @Override
- public void update(XmlEntity entity) {
- super.update(entity);
- this.readOnly.update((XmlReadOnly) entity, getJavaReadOnly());
- this.customizer.update((XmlCustomizerHolder) entity, getJavaCustomizer());
- this.changeTracking.update((XmlChangeTrackingHolder) entity, getJavaChangeTracking());
- this.caching.update((XmlCacheHolder) entity, getJavaCaching());
- this.converterHolder.update((XmlConvertersHolder) entity);
- }
-
- @Override
- protected EclipseLinkJavaEntity getJavaEntityForDefaults() {
- return (EclipseLinkJavaEntity) super.getJavaEntityForDefaults();
- }
-
- protected ReadOnly getJavaReadOnly() {
- EclipseLinkJavaEntity javaEntity = getJavaEntityForDefaults();
- return (javaEntity == null) ? null : javaEntity.getReadOnly();
- }
-
- protected Customizer getJavaCustomizer() {
- EclipseLinkJavaEntity javaEntity = getJavaEntityForDefaults();
- return (javaEntity == null) ? null : javaEntity.getCustomizer();
- }
-
- protected ChangeTracking getJavaChangeTracking() {
- EclipseLinkJavaEntity javaEntity = getJavaEntityForDefaults();
- return (javaEntity == null) ? null : javaEntity.getChangeTracking();
- }
-
- protected JavaCaching getJavaCaching() {
- EclipseLinkJavaEntity javaEntity = getJavaEntityForDefaults();
- return (javaEntity == null) ? null : javaEntity.getCaching();
- }
-
-
- // **************** validation **************************************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- this.readOnly.validate(messages);
- this.customizer.validate(messages);
- this.changeTracking.validate(messages);
- this.caching.validate(messages);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmExpiryTimeOfDay.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmExpiryTimeOfDay.java
deleted file mode 100644
index 3a48bf9122..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmExpiryTimeOfDay.java
+++ /dev/null
@@ -1,137 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.Caching;
-import org.eclipse.jpt.eclipselink.core.context.ExpiryTimeOfDay;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTimeOfDay;
-
-public class EclipseLinkOrmExpiryTimeOfDay extends AbstractXmlContextNode
- implements ExpiryTimeOfDay
-{
-
- protected Integer hour;
- protected Integer minute;
- protected Integer second;
- protected Integer millisecond;
-
- protected XmlTimeOfDay resourceTimeOfDay;
-
- public EclipseLinkOrmExpiryTimeOfDay(Caching 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 = hour();
- this.minute = minute();
- this.second = second();
- this.millisecond = millisecond();
- }
-
- public void update(XmlTimeOfDay resource) {
- this.resourceTimeOfDay = resource;
- this.setHour_(hour());
- this.setMinute_(minute());
- this.setSecond_(second());
- this.setMillisecond_(millisecond());
- }
-
- protected Integer hour() {
- return this.resourceTimeOfDay.getHour();
- }
-
- protected Integer minute() {
- return this.resourceTimeOfDay.getMinute();
- }
-
- protected Integer second() {
- return this.resourceTimeOfDay.getSecond();
- }
-
- protected Integer millisecond() {
- return this.resourceTimeOfDay.getMillisecond();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmIdMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmIdMapping.java
deleted file mode 100644
index 54d4aae114..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmIdMapping.java
+++ /dev/null
@@ -1,94 +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.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.GenericOrmIdMapping;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.context.Convert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkIdMapping;
-import org.eclipse.jpt.eclipselink.core.context.Mutable;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlId;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlMutable;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkOrmIdMapping extends GenericOrmIdMapping
- implements EclipseLinkIdMapping
-{
- protected EclipseLinkOrmMutable mutable;
-
-
- public EclipseLinkOrmIdMapping(OrmPersistentAttribute parent) {
- super(parent);
- this.mutable = new EclipseLinkOrmMutable(this);
- }
-
-
- public Mutable getMutable() {
- return this.mutable;
- }
-
- @Override
- protected OrmConverter buildSpecifiedConverter(String converterType) {
- OrmConverter ormConverter = super.buildSpecifiedConverter(converterType);
- if (ormConverter != null) {
- return ormConverter;
- }
- if (converterType == Convert.ECLIPSE_LINK_CONVERTER) {
- return new EclipseLinkOrmConvert(this, (XmlId) this.resourceAttributeMapping);
- }
- return null;
- }
-
- @Override
- protected String specifiedConverterType() {
- //check @Convert first, this is the order that EclipseLink searches
- if (((XmlId) this.resourceAttributeMapping).getConvert() != null) {
- return Convert.ECLIPSE_LINK_CONVERTER;
- }
- return super.specifiedConverterType();
- }
-
- // **************** resource-context interaction ***************************
-
- @Override
- public XmlId addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlId id = EclipseLinkOrmFactory.eINSTANCE.createXmlIdImpl();
- getPersistentAttribute().initialize(id);
- typeMapping.getAttributes().getIds().add(id);
- return id;
- }
-
- @Override
- public void initialize(XmlAttributeMapping xmlAttributeMapping) {
- super.initialize(xmlAttributeMapping);
- this.mutable.initialize((XmlMutable) this.resourceAttributeMapping);
- }
-
- @Override
- public void update() {
- super.update();
- this.mutable.update();
- }
-
-
- // **************** validation **************************************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- // TODO - mutable validation
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmJoinFetch.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmJoinFetch.java
deleted file mode 100644
index 59c4b1eca0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmJoinFetch.java
+++ /dev/null
@@ -1,68 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.JoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.JoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetch;
-
-public class EclipseLinkOrmJoinFetch extends AbstractXmlContextNode
- implements JoinFetch
-{
- protected XmlJoinFetch resource;
-
- protected JoinFetchType joinFetchValue;
-
-
- public EclipseLinkOrmJoinFetch(OrmAttributeMapping parent) {
- super(parent);
- }
-
-
- public JoinFetchType getValue() {
- return this.joinFetchValue;
- }
-
- public void setValue(JoinFetchType newJoinFetchValue) {
- JoinFetchType oldJoinFetchValue = this.joinFetchValue;
- this.joinFetchValue = newJoinFetchValue;
- this.resource.setJoinFetch(JoinFetchType.toOrmResourceModel(newJoinFetchValue));
- firePropertyChanged(VALUE_PROPERTY, oldJoinFetchValue, newJoinFetchValue);
- }
-
- protected void setValue_(JoinFetchType newJoinFetchValue) {
- JoinFetchType oldJoinFetchValue = this.joinFetchValue;
- this.joinFetchValue = newJoinFetchValue;
- firePropertyChanged(VALUE_PROPERTY, oldJoinFetchValue, newJoinFetchValue);
- }
-
-
- // **************** initialize/update **************************************
-
- protected void initialize(XmlJoinFetch xmlJoinFetch) {
- this.resource = xmlJoinFetch;
- this.joinFetchValue = JoinFetchType.fromOrmResourceModel(this.resource.getJoinFetch());
- }
-
- protected void update() {
- setValue_(JoinFetchType.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/EclipseLinkOrmManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmManyToManyMapping.java
deleted file mode 100644
index 9c805dabfc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmManyToManyMapping.java
+++ /dev/null
@@ -1,73 +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.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmManyToManyMapping;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.eclipselink.core.context.JoinFetch;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetch;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToMany;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkOrmManyToManyMapping
- extends GenericOrmManyToManyMapping
- implements EclipseLinkRelationshipMapping
-{
- protected EclipseLinkOrmJoinFetch joinFetch;
-
-
- public EclipseLinkOrmManyToManyMapping(OrmPersistentAttribute parent) {
- super(parent);
- this.joinFetch = new EclipseLinkOrmJoinFetch(this);
- }
-
-
- public JoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // **************** resource-context interaction ***************************
-
- @Override
- public XmlManyToMany addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlManyToMany manyToMany = EclipseLinkOrmFactory.eINSTANCE.createXmlManyToManyImpl();
- getPersistentAttribute().initialize(manyToMany);
- typeMapping.getAttributes().getManyToManys().add(manyToMany);
- return manyToMany;
- }
-
- @Override
- public void initialize(XmlAttributeMapping attributeMapping) {
- super.initialize(attributeMapping);
- this.joinFetch.initialize((XmlJoinFetch) this.resourceAttributeMapping);
- }
-
- @Override
- public void update() {
- super.update();
- this.joinFetch.update();
- }
-
-
- // **************** validation **************************************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- // 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/EclipseLinkOrmManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmManyToOneMapping.java
deleted file mode 100644
index fe53115d43..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmManyToOneMapping.java
+++ /dev/null
@@ -1,72 +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.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmManyToOneMapping;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.eclipselink.core.context.JoinFetch;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetch;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkOrmManyToOneMapping extends GenericOrmManyToOneMapping
- implements EclipseLinkRelationshipMapping
-{
- protected EclipseLinkOrmJoinFetch joinFetch;
-
-
- public EclipseLinkOrmManyToOneMapping(OrmPersistentAttribute parent) {
- super(parent);
- this.joinFetch = new EclipseLinkOrmJoinFetch(this);
- }
-
-
- public JoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // **************** resource-context interaction ***************************
-
- @Override
- public XmlManyToOne addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlManyToOne manyToOne = EclipseLinkOrmFactory.eINSTANCE.createXmlManyToOneImpl();
- getPersistentAttribute().initialize(manyToOne);
- typeMapping.getAttributes().getManyToOnes().add(manyToOne);
- return manyToOne;
- }
-
- @Override
- public void initialize(XmlAttributeMapping attributeMapping) {
- super.initialize(attributeMapping);
- this.joinFetch.initialize((XmlJoinFetch) this.resourceAttributeMapping);
- }
-
- @Override
- public void update() {
- super.update();
- this.joinFetch.update();
- }
-
-
- // **************** validation **************************************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- // 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/EclipseLinkOrmMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmMappedSuperclass.java
deleted file mode 100644
index 09950fc8e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmMappedSuperclass.java
+++ /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
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMappedSuperclass;
-
-public interface EclipseLinkOrmMappedSuperclass extends EclipseLinkMappedSuperclass, OrmMappedSuperclass
-{
- ConverterHolder getConverterHolder();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmMappedSuperclassImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmMappedSuperclassImpl.java
deleted file mode 100644
index 2c8d9bde71..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmMappedSuperclassImpl.java
+++ /dev/null
@@ -1,141 +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.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmMappedSuperclass;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.context.Caching;
-import org.eclipse.jpt.eclipselink.core.context.ChangeTracking;
-import org.eclipse.jpt.eclipselink.core.context.Customizer;
-import org.eclipse.jpt.eclipselink.core.context.ReadOnly;
-import org.eclipse.jpt.eclipselink.core.context.java.EclipseLinkJavaMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaCaching;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-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.XmlReadOnly;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkOrmMappedSuperclassImpl extends GenericOrmMappedSuperclass
- implements EclipseLinkOrmMappedSuperclass
-{
- protected final EclipseLinkOrmReadOnly readOnly;
-
- protected final EclipseLinkOrmCustomizer customizer;
-
- protected final EclipseLinkOrmChangeTracking changeTracking;
-
- protected final EclipseLinkOrmCaching caching;
-
- protected final EclipseLinkOrmConverterHolder converterHolder;
-
-
- public EclipseLinkOrmMappedSuperclassImpl(OrmPersistentType parent) {
- super(parent);
- this.readOnly = new EclipseLinkOrmReadOnly(this);
- this.customizer = new EclipseLinkOrmCustomizer(this);
- this.changeTracking = new EclipseLinkOrmChangeTracking(this);
- this.caching = new EclipseLinkOrmCaching(this);
- this.converterHolder = new EclipseLinkOrmConverterHolder(this);
-}
-
- public Caching getCaching() {
- return this.caching;
- }
-
- public Customizer getCustomizer() {
- return this.customizer;
- }
-
- public ChangeTracking getChangeTracking() {
- return this.changeTracking;
- }
-
- public EclipseLinkOrmReadOnly getReadOnly() {
- return this.readOnly;
- }
-
- public ConverterHolder getConverterHolder() {
- return this.converterHolder;
- }
-
-
- // **************** resource-context interaction ***************************
-
- @Override
- public XmlMappedSuperclass addToResourceModel(XmlEntityMappings entityMappings) {
- XmlMappedSuperclass mappedSuperclass = EclipseLinkOrmFactory.eINSTANCE.createXmlMappedSuperclass();
- getPersistentType().initialize(mappedSuperclass);
- entityMappings.getMappedSuperclasses().add(mappedSuperclass);
- return mappedSuperclass;
- }
-
- @Override
- public void initialize(XmlMappedSuperclass mappedSuperclass) {
- super.initialize(mappedSuperclass);
- this.readOnly.initialize((XmlReadOnly) mappedSuperclass, getJavaReadOnly());
- this.customizer.initialize((XmlCustomizerHolder) mappedSuperclass, getJavaCustomizer());
- this.changeTracking.initialize((XmlChangeTrackingHolder) mappedSuperclass, getJavaChangeTracking());
- this.caching.initialize((XmlCacheHolder) mappedSuperclass, getJavaCaching());
- this.converterHolder.initialize((XmlConvertersHolder) mappedSuperclass);
- }
-
- @Override
- public void update(XmlMappedSuperclass mappedSuperclass) {
- super.update(mappedSuperclass);
- this.readOnly.update((XmlReadOnly) mappedSuperclass, getJavaReadOnly());
- this.customizer.update((XmlCustomizerHolder) mappedSuperclass, getJavaCustomizer());
- this.changeTracking.update((XmlChangeTrackingHolder) mappedSuperclass, getJavaChangeTracking());
- this.caching.update((XmlCacheHolder) mappedSuperclass, getJavaCaching());
- this.converterHolder.update((XmlConvertersHolder) mappedSuperclass);
- }
-
- @Override
- protected EclipseLinkJavaMappedSuperclass getJavaMappedSuperclassForDefaults() {
- return (EclipseLinkJavaMappedSuperclass) super.getJavaMappedSuperclassForDefaults();
- }
-
- protected ReadOnly getJavaReadOnly() {
- EclipseLinkJavaMappedSuperclass javaMappedSuperclass = getJavaMappedSuperclassForDefaults();
- return (javaMappedSuperclass == null) ? null : javaMappedSuperclass.getReadOnly();
- }
-
- protected Customizer getJavaCustomizer() {
- EclipseLinkJavaMappedSuperclass javaMappedSuperclass = getJavaMappedSuperclassForDefaults();
- return (javaMappedSuperclass == null) ? null : javaMappedSuperclass.getCustomizer();
- }
-
- protected ChangeTracking getJavaChangeTracking() {
- EclipseLinkJavaMappedSuperclass javaMappedSuperclass = getJavaMappedSuperclassForDefaults();
- return (javaMappedSuperclass == null) ? null : javaMappedSuperclass.getChangeTracking();
- }
-
- protected JavaCaching getJavaCaching() {
- EclipseLinkJavaMappedSuperclass javaMappedSuperclass = getJavaMappedSuperclassForDefaults();
- return (javaMappedSuperclass == null) ? null : javaMappedSuperclass.getCaching();
- }
-
-
- // **************** validation **************************************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- this.readOnly.validate(messages);
- this.customizer.validate(messages);
- this.changeTracking.validate(messages);
- this.caching.validate(messages);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmMutable.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmMutable.java
deleted file mode 100644
index c585d9863c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmMutable.java
+++ /dev/null
@@ -1,100 +0,0 @@
-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.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.Mutable;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlMutable;
-
-public class EclipseLinkOrmMutable extends AbstractXmlContextNode
- implements Mutable
-{
- protected XmlMutable resource;
-
- protected boolean defaultMutable;
-
- protected Boolean specifiedMutable;
-
-
- public EclipseLinkOrmMutable(OrmAttributeMapping parent) {
- super(parent);
- }
-
- @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 initialize(XmlMutable resource) {
- this.resource = resource;
- this.defaultMutable = calculateDefaultMutable();
- this.specifiedMutable = resource.getMutable();
- }
-
- protected void update() {
- setDefaultMutable(calculateDefaultMutable());
- setSpecifiedMutable_(this.resource.getMutable());
- }
-
- protected boolean calculateDefaultMutable() {
- OrmAttributeMapping attributeMapping = getAttributeMapping();
- JavaPersistentAttribute javaAttribute = attributeMapping.getJavaPersistentAttribute();
- if (javaAttribute == null) {
- return false;
- }
- JavaResourcePersistentAttribute javaResourceAttribute = javaAttribute.getResourcePersistentAttribute();
- if (javaResourceAttribute.typeIsDateOrCalendar()) {
- Boolean persistenceUnitDefaultMutable = getPersistenceUnit().getOptions().getTemporalMutable();
- return persistenceUnitDefaultMutable == null ? false : persistenceUnitDefaultMutable.booleanValue();
- }
- return javaResourceAttribute.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/EclipseLinkOrmObjectTypeConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmObjectTypeConverter.java
deleted file mode 100644
index 4bf7b0ddc4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmObjectTypeConverter.java
+++ /dev/null
@@ -1,249 +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.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.ConversionValue;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.context.ObjectTypeConverter;
-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.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkOrmObjectTypeConverter extends EclipseLinkOrmConverter
- implements ObjectTypeConverter
-{
- private String dataType;
-
- private String objectType;
-
- private final List<EclipseLinkOrmConversionValue> conversionValues;
-
- private String defaultObjectValue;
-
-
- public EclipseLinkOrmObjectTypeConverter(XmlContextNode parent, XmlObjectTypeConverter xmlResource) {
- super(parent, xmlResource);
- this.conversionValues = new ArrayList<EclipseLinkOrmConversionValue>();
- }
-
-
- public String getType() {
- return EclipseLinkConverter.OBJECT_TYPE_CONVERTER;
- }
-
- @Override
- protected XmlObjectTypeConverter getXmlResource() {
- return (XmlObjectTypeConverter) super.getXmlResource();
- }
-
-
- // **************** 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<EclipseLinkOrmConversionValue> conversionValues() {
- return new CloneListIterator<EclipseLinkOrmConversionValue>(this.conversionValues);
- }
-
- public int conversionValuesSize() {
- return this.conversionValues.size();
- }
-
- public EclipseLinkOrmConversionValue addConversionValue(int index) {
- XmlConversionValue resourceConversionValue = EclipseLinkOrmFactory.eINSTANCE.createXmlConversionValueImpl();
- EclipseLinkOrmConversionValue contextConversionValue = buildConversionValue(resourceConversionValue);
- this.conversionValues.add(index, contextConversionValue);
- getXmlResource().getConversionValues().add(index, resourceConversionValue);
- fireItemAdded(CONVERSION_VALUES_LIST, index, contextConversionValue);
- return contextConversionValue;
- }
-
- public EclipseLinkOrmConversionValue addConversionValue() {
- return this.addConversionValue(this.conversionValues.size());
- }
-
- protected void addConversionValue(int index, EclipseLinkOrmConversionValue conversionValue) {
- addItemToList(index, conversionValue, this.conversionValues, CONVERSION_VALUES_LIST);
- }
-
- protected void addConversionValue(EclipseLinkOrmConversionValue conversionValue) {
- this.addConversionValue(this.conversionValues.size(), conversionValue);
- }
-
- public void removeConversionValue(int index) {
- EclipseLinkOrmConversionValue removedJoinColumn = this.conversionValues.remove(index);
- getXmlResource().getConversionValues().remove(index);
- fireItemRemoved(CONVERSION_VALUES_LIST, index, removedJoinColumn);
- }
-
- public void removeConversionValue(ConversionValue conversionValue) {
- this.removeConversionValue(this.conversionValues.indexOf(conversionValue));
- }
-
- protected void removeConversionValue_(ConversionValue 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<EclipseLinkOrmConversionValue, String>(conversionValues()) {
- @Override
- protected String transform(EclipseLinkOrmConversionValue 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 ***********************************
-
- protected void initialize(XmlObjectTypeConverter xmlResource) {
- super.initialize(xmlResource);
- this.dataType = this.calculateDataType();
- this.objectType = this.calculateObjectType();
- this.defaultObjectValue = this.calculateDefaultObjectValue();
- this.initializeConversionValues();
- }
-
- protected void initializeConversionValues() {
- for (XmlConversionValue resourceConversionValue : getXmlResource().getConversionValues()) {
- this.conversionValues.add(buildConversionValue(resourceConversionValue));
- }
- }
-
- public void update() {
- super.update();
- setDataType_(calculateDataType());
- setObjectType_(calculateObjectType());
- setDefaultObjectValue_(calculateDefaultObjectValue());
- updateConversionValues();
- }
-
- protected void updateConversionValues( ) {
- ListIterator<EclipseLinkOrmConversionValue> contextConversionValues = conversionValues();
- ListIterator<XmlConversionValue> resourceConversionValues =
- new CloneListIterator<XmlConversionValue>(getXmlResource().getConversionValues());//prevent ConcurrentModificiationException
-
- while (contextConversionValues.hasNext()) {
- EclipseLinkOrmConversionValue conversionValues = contextConversionValues.next();
- if (resourceConversionValues.hasNext()) {
- conversionValues.update(resourceConversionValues.next());
- }
- else {
- removeConversionValue_(conversionValues);
- }
- }
-
- while (resourceConversionValues.hasNext()) {
- addConversionValue(buildConversionValue(resourceConversionValues.next()));
- }
- }
-
- protected EclipseLinkOrmConversionValue buildConversionValue(XmlConversionValue resourceConversionValue) {
- EclipseLinkOrmConversionValue conversionValue = new EclipseLinkOrmConversionValue(this);
- conversionValue.initialize(resourceConversionValue);
- return conversionValue;
- }
-
- protected String calculateDataType() {
- return getXmlResource().getDataType();
- }
-
- protected String calculateObjectType() {
- return getXmlResource().getObjectType();
- }
-
- protected String calculateDefaultObjectValue() {
- return getXmlResource().getDefaultObjectValue();
- }
-
-
- // **************** validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- for (Iterator<EclipseLinkOrmConversionValue> stream = conversionValues(); stream.hasNext();) {
- stream.next().validate(messages);
- }
- }
-} \ 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/EclipseLinkOrmOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmOneToManyMapping.java
deleted file mode 100644
index bc58d60b53..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmOneToManyMapping.java
+++ /dev/null
@@ -1,83 +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.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmOneToManyMapping;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkOneToManyMapping;
-import org.eclipse.jpt.eclipselink.core.context.JoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.PrivateOwned;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetch;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlPrivateOwned;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkOrmOneToManyMapping extends GenericOrmOneToManyMapping
- implements EclipseLinkOneToManyMapping
-{
- protected EclipseLinkOrmPrivateOwned privateOwned;
-
- protected EclipseLinkOrmJoinFetch joinFetch;
-
-
- public EclipseLinkOrmOneToManyMapping(OrmPersistentAttribute parent) {
- super(parent);
- this.privateOwned = new EclipseLinkOrmPrivateOwned(this);
- this.joinFetch = new EclipseLinkOrmJoinFetch(this);
- }
-
-
- public PrivateOwned getPrivateOwned() {
- return this.privateOwned;
- }
-
- public JoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // **************** resource-context interaction ***************************
-
- @Override
- public XmlOneToMany addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlOneToMany oneToMany = EclipseLinkOrmFactory.eINSTANCE.createXmlOneToManyImpl();
- getPersistentAttribute().initialize(oneToMany);
- typeMapping.getAttributes().getOneToManys().add(oneToMany);
- return oneToMany;
- }
-
- @Override
- public void initialize(XmlAttributeMapping attributeMapping) {
- super.initialize(attributeMapping);
- this.privateOwned.initialize((XmlPrivateOwned) this.resourceAttributeMapping);
- this.joinFetch.initialize((XmlJoinFetch) this.resourceAttributeMapping);
- }
-
- @Override
- public void update() {
- super.update();
- this.privateOwned.update();
- this.joinFetch.update();
- }
-
-
- // **************** validation **************************************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- // 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/EclipseLinkOrmOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmOneToOneMapping.java
deleted file mode 100644
index b5aa086121..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmOneToOneMapping.java
+++ /dev/null
@@ -1,82 +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.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmOneToOneMapping;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.context.JoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.PrivateOwned;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetch;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlPrivateOwned;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkOrmOneToOneMapping extends GenericOrmOneToOneMapping
- implements EclipseLinkOneToOneMapping
-{
- protected EclipseLinkOrmPrivateOwned privateOwned;
-
- protected EclipseLinkOrmJoinFetch joinFetch;
-
-
- public EclipseLinkOrmOneToOneMapping(OrmPersistentAttribute parent) {
- super(parent);
- this.privateOwned = new EclipseLinkOrmPrivateOwned(this);
- this.joinFetch = new EclipseLinkOrmJoinFetch(this);
- }
-
-
- public PrivateOwned getPrivateOwned() {
- return this.privateOwned;
- }
-
- public JoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // **************** resource-context interaction ***************************
-
- @Override
- public XmlOneToOne addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlOneToOne oneToOne = EclipseLinkOrmFactory.eINSTANCE.createXmlOneToOneImpl();
- getPersistentAttribute().initialize(oneToOne);
- typeMapping.getAttributes().getOneToOnes().add(oneToOne);
- return oneToOne;
- }
-
- @Override
- public void initialize(XmlAttributeMapping attributeMapping) {
- super.initialize(attributeMapping);
- this.privateOwned.initialize((XmlPrivateOwned) this.resourceAttributeMapping);
- this.joinFetch.initialize((XmlJoinFetch) this.resourceAttributeMapping);
- }
-
- @Override
- public void update() {
- super.update();
- this.privateOwned.update();
- this.joinFetch.update();
- }
-
-
- // **************** validation **************************************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- // 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/EclipseLinkOrmPersistentType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmPersistentType.java
deleted file mode 100644
index f02d132bd3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmPersistentType.java
+++ /dev/null
@@ -1,28 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.context.PersistentTypeContext;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmPersistentType;
-import org.eclipse.jpt.core.resource.orm.Attributes;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-
-public class EclipseLinkOrmPersistentType extends GenericOrmPersistentType
-{
-
- public EclipseLinkOrmPersistentType(PersistentTypeContext parent, String mappingKey) {
- super(parent, mappingKey);
- }
-
- @Override
- protected Attributes createAttributesResource() {
- return EclipseLinkOrmFactory.eINSTANCE.createAttributes();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmPrivateOwned.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmPrivateOwned.java
deleted file mode 100644
index 75365e2100..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmPrivateOwned.java
+++ /dev/null
@@ -1,67 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.PrivateOwned;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlPrivateOwned;
-
-public class EclipseLinkOrmPrivateOwned extends AbstractXmlContextNode
- implements PrivateOwned
-{
- protected XmlPrivateOwned resource;
-
- protected boolean privateOwned;
-
-
- public EclipseLinkOrmPrivateOwned(OrmAttributeMapping parent) {
- super(parent);
- }
-
-
- 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 initialize(XmlPrivateOwned xmlPrivateOwned) {
- this.resource = xmlPrivateOwned;
- this.privateOwned = this.resource.isPrivateOwned();
- }
-
- protected void update() {
- setPrivateOwned_(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/EclipseLinkOrmReadOnly.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmReadOnly.java
deleted file mode 100644
index 2c40ecabe5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmReadOnly.java
+++ /dev/null
@@ -1,80 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.ReadOnly;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlReadOnly;
-
-public class EclipseLinkOrmReadOnly extends AbstractXmlContextNode
- implements ReadOnly
-{
- protected XmlReadOnly resource;
-
- protected boolean defaultReadOnly;
-
- protected Boolean specifiedReadOnly;
-
-
- public EclipseLinkOrmReadOnly(OrmTypeMapping parent) {
- super(parent);
- }
-
-
- 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 initialize(XmlReadOnly resource, ReadOnly javaReadOnly) {
- this.resource = resource;
- this.defaultReadOnly = (javaReadOnly == null) ? false : javaReadOnly.isReadOnly();
- this.specifiedReadOnly = resource.getReadOnly();
- }
-
- protected void update(XmlReadOnly resource, ReadOnly javaReadOnly) {
- this.resource = resource;
- setDefaultReadOnly((javaReadOnly == null) ? false : javaReadOnly.isReadOnly());
- setSpecifiedReadOnly(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/EclipseLinkOrmStructConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmStructConverter.java
deleted file mode 100644
index c1cda517ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmStructConverter.java
+++ /dev/null
@@ -1,103 +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.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.StructConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkOrmStructConverter extends EclipseLinkOrmConverter
- implements StructConverter
-{
- private String converterClass;
-
-
- public EclipseLinkOrmStructConverter(XmlContextNode parent, XmlStructConverter xmlResource) {
- super(parent, xmlResource);
- }
-
-
- public String getType() {
- return EclipseLinkConverter.STRUCT_CONVERTER;
- }
-
- @Override
- protected XmlStructConverter getXmlResource() {
- return (XmlStructConverter) super.getXmlResource();
- }
-
-
- // **************** 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 ***********************************
-
- protected void initialize(XmlStructConverter xmlResource) {
- super.initialize(xmlResource);
- this.converterClass = calculateConverterClass();
- }
-
- public void update() {
- super.update();
- setConverterClass_(calculateConverterClass());
- }
-
- protected String calculateConverterClass() {
- return getXmlResource().getConverter();
- }
-
-
- // **************** validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- 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/EclipseLinkOrmTypeConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmTypeConverter.java
deleted file mode 100644
index 721650ac72..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmTypeConverter.java
+++ /dev/null
@@ -1,101 +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.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.TypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTypeConverter;
-
-public class EclipseLinkOrmTypeConverter extends EclipseLinkOrmConverter
- implements TypeConverter
-{
- private String dataType;
-
- private String objectType;
-
-
- public EclipseLinkOrmTypeConverter(XmlContextNode parent, XmlTypeConverter xmlResource) {
- super(parent, xmlResource);
- }
-
-
- public String getType() {
- return EclipseLinkConverter.TYPE_CONVERTER;
- }
-
- @Override
- protected XmlTypeConverter getXmlResource() {
- return (XmlTypeConverter) super.getXmlResource();
- }
-
-
- // **************** 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 ***********************************
-
- protected void initialize(XmlTypeConverter xmlResource) {
- super.initialize(xmlResource);
- this.dataType = calculateDataType();
- this.objectType = calculateObjectType();
- }
-
- public void update() {
- super.update();
- setDataType_(calculateDataType());
- setObjectType_(calculateObjectType());
- }
-
- protected String calculateDataType() {
- return getXmlResource().getDataType();
- }
-
- protected String calculateObjectType() {
- return getXmlResource().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/EclipseLinkOrmVersionMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmVersionMapping.java
deleted file mode 100644
index 103ad77c76..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmVersionMapping.java
+++ /dev/null
@@ -1,94 +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.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.GenericOrmVersionMapping;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.context.Convert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkVersionMapping;
-import org.eclipse.jpt.eclipselink.core.context.Mutable;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlMutable;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlVersion;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkOrmVersionMapping extends GenericOrmVersionMapping
- implements EclipseLinkVersionMapping
-{
- protected EclipseLinkOrmMutable mutable;
-
-
- public EclipseLinkOrmVersionMapping(OrmPersistentAttribute parent) {
- super(parent);
- this.mutable = new EclipseLinkOrmMutable(this);
- }
-
-
- public Mutable getMutable() {
- return this.mutable;
- }
-
- @Override
- protected OrmConverter buildSpecifiedConverter(String converterType) {
- OrmConverter ormConverter = super.buildSpecifiedConverter(converterType);
- if (ormConverter != null) {
- return ormConverter;
- }
- if (converterType == Convert.ECLIPSE_LINK_CONVERTER) {
- return new EclipseLinkOrmConvert(this, (XmlVersion) this.resourceAttributeMapping);
- }
- return null;
- }
-
- @Override
- protected String specifiedConverterType() {
- //check @Convert first, this is the order that EclipseLink searches
- if (((XmlVersion) this.resourceAttributeMapping).getConvert() != null) {
- return Convert.ECLIPSE_LINK_CONVERTER;
- }
- return super.specifiedConverterType();
- }
-
- // **************** resource-context interaction ***************************
-
- @Override
- public XmlVersion addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlVersion version = EclipseLinkOrmFactory.eINSTANCE.createXmlVersionImpl();
- getPersistentAttribute().initialize(version);
- typeMapping.getAttributes().getVersions().add(version);
- return version;
- }
-
- @Override
- public void initialize(XmlAttributeMapping attributeMapping) {
- super.initialize(attributeMapping);
- this.mutable.initialize((XmlMutable) this.resourceAttributeMapping);
- }
-
- @Override
- public void update() {
- super.update();
- this.mutable.update();
- }
-
-
- // **************** validation **************************************
-
- @Override
- public void validate(List<IMessage> messages) {
- super.validate(messages);
- // TODO - mutable validation
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmXml.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmXml.java
deleted file mode 100644
index f10d1fdcf4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmXml.java
+++ /dev/null
@@ -1,28 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.core.internal.context.orm.OrmXmlImpl;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmResource;
-
-public class EclipseLinkOrmXml extends OrmXmlImpl
-{
- public EclipseLinkOrmXml(MappingFileRef parent, EclipseLinkOrmResource ormResource) {
- super(parent, ormResource);
- }
-
- @Override
- protected XmlEntityMappings buildEntityMappingsResource() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlEntityMappings();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlBasic.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlBasic.java
deleted file mode 100644
index b8212e8131..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlBasic.java
+++ /dev/null
@@ -1,140 +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.internal.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.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.Convert;
-import org.eclipse.jpt.eclipselink.core.context.CustomConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkBasicMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.context.ObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.StructConverter;
-import org.eclipse.jpt.eclipselink.core.context.TypeConverter;
-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.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 EclipseLinkVirtualXmlBasic extends VirtualXmlBasic implements XmlBasic
-{
-
- public EclipseLinkVirtualXmlBasic(OrmTypeMapping ormTypeMapping, JavaBasicMapping javaBasicMapping) {
- super(ormTypeMapping, javaBasicMapping);
- }
-
- public Boolean getMutable() {
- if (isOrmMetadataComplete()) {
- return Boolean.valueOf(((EclipseLinkBasicMapping) this.javaAttributeMapping).getMutable().isDefaultMutable());
- }
- return Boolean.valueOf(((EclipseLinkBasicMapping) this.javaAttributeMapping).getMutable().isMutable());
- }
-
- public void setMutable(@SuppressWarnings("unused") Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getConvert() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- if (this.javaAttributeMapping.getConverter().getType() == Convert.ECLIPSE_LINK_CONVERTER) {
- return ((Convert) this.javaAttributeMapping.getConverter()).getConverterName();
- }
- return null;
- }
-
- public void setConvert(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public TextRange getMutableTextRange() {
- return null;
- }
-
- public TextRange getConvertTextRange() {
- return null;
- }
-
- public XmlConverter getConverter() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- if (this.javaAttributeMapping.getConverter().getType() == Convert.ECLIPSE_LINK_CONVERTER) {
- EclipseLinkConverter converter = ((Convert) this.javaAttributeMapping.getConverter()).getConverter();
- if (converter != null && converter.getType() == EclipseLinkConverter.CUSTOM_CONVERTER) {
- return new EclipseLinkVirtualXmlConverter(this.ormTypeMapping, (CustomConverter) ((Convert) this.javaAttributeMapping.getConverter()).getConverter());
- }
- }
- return null;
- }
-
- public void setConverter(@SuppressWarnings("unused") XmlConverter value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public XmlObjectTypeConverter getObjectTypeConverter() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- if (this.javaAttributeMapping.getConverter().getType() == Convert.ECLIPSE_LINK_CONVERTER) {
- EclipseLinkConverter converter = ((Convert) this.javaAttributeMapping.getConverter()).getConverter();
- if (converter != null && converter.getType() == EclipseLinkConverter.OBJECT_TYPE_CONVERTER) {
- return new EclipseLinkVirtualXmlObjectTypeConverter(this.ormTypeMapping, (ObjectTypeConverter) ((Convert) this.javaAttributeMapping.getConverter()).getConverter());
- }
- }
- return null;
- }
-
- public void setObjectTypeConverter(@SuppressWarnings("unused") XmlObjectTypeConverter value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public XmlStructConverter getStructConverter() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- if (this.javaAttributeMapping.getConverter().getType() == Convert.ECLIPSE_LINK_CONVERTER) {
- EclipseLinkConverter converter = ((Convert) this.javaAttributeMapping.getConverter()).getConverter();
- if (converter != null && converter.getType() == EclipseLinkConverter.STRUCT_CONVERTER) {
- return new EclipseLinkVirtualXmlStructConverter(this.ormTypeMapping, (StructConverter) ((Convert) this.javaAttributeMapping.getConverter()).getConverter());
- }
- }
- return null;
- }
-
- public void setStructConverter(@SuppressWarnings("unused") XmlStructConverter value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public XmlTypeConverter getTypeConverter() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- if (this.javaAttributeMapping.getConverter().getType() == Convert.ECLIPSE_LINK_CONVERTER) {
- EclipseLinkConverter converter = ((Convert) this.javaAttributeMapping.getConverter()).getConverter();
- if (converter != null && converter.getType() == EclipseLinkConverter.TYPE_CONVERTER) {
- return new EclipseLinkVirtualXmlTypeConverter(this.ormTypeMapping, (TypeConverter) ((Convert) this.javaAttributeMapping.getConverter()).getConverter());
- }
- }
- return null;
- }
-
- public void setTypeConverter(@SuppressWarnings("unused") XmlTypeConverter 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/EclipseLinkVirtualXmlConversionValue.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlConversionValue.java
deleted file mode 100644
index 38675d53fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlConversionValue.java
+++ /dev/null
@@ -1,67 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.ConversionValue;
-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 EclipseLinkVirtualXmlConversionValue extends AbstractJpaEObject implements XmlConversionValue
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected ConversionValue javaConversionValue;
-
- public EclipseLinkVirtualXmlConversionValue(OrmTypeMapping ormTypeMapping, ConversionValue javaConversionValue) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaConversionValue = javaConversionValue;
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- public String getDataValue() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConversionValue.getDataValue();
- }
-
- public void setDataValue(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getObjectValue() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConversionValue.getObjectValue();
- }
-
- public void setObjectValue(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public TextRange getDataValueTextRange() {
- return null;
- }
-
- public TextRange getObjectValueTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlConverter.java
deleted file mode 100644
index d0a0f047af..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlConverter.java
+++ /dev/null
@@ -1,58 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.eclipselink.core.context.CustomConverter;
-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 EclipseLinkVirtualXmlConverter extends AbstractJpaEObject implements XmlConverter
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected CustomConverter javaConverter;
-
- public EclipseLinkVirtualXmlConverter(OrmTypeMapping ormTypeMapping, CustomConverter javaConverter) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaConverter = javaConverter;
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- public String getClassName() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConverter.getConverterClass();
- }
-
- public void setClassName(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getName() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConverter.getName();
- }
-
- public void setName(@SuppressWarnings("unused") 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/EclipseLinkVirtualXmlId.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlId.java
deleted file mode 100644
index e79810c929..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlId.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.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.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.Convert;
-import org.eclipse.jpt.eclipselink.core.context.CustomConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkIdMapping;
-import org.eclipse.jpt.eclipselink.core.context.ObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.StructConverter;
-import org.eclipse.jpt.eclipselink.core.context.TypeConverter;
-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.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 EclipseLinkVirtualXmlId extends VirtualXmlId implements XmlId
-{
-
- public EclipseLinkVirtualXmlId(OrmTypeMapping ormTypeMapping, JavaIdMapping javaIdMapping) {
- super(ormTypeMapping, javaIdMapping);
- }
-
- public Boolean getMutable() {
- //don't need isOrmMetadataComplete() check because there is no default Id mapping
- return Boolean.valueOf(((EclipseLinkIdMapping) this.javaAttributeMapping).getMutable().isMutable());
- }
-
- public void setMutable(@SuppressWarnings("unused") Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getConvert() {
- //don't need isOrmMetadataComplete() check because there is no default Id mapping
- if (this.javaAttributeMapping.getConverter().getType() == Convert.ECLIPSE_LINK_CONVERTER) {
- return ((Convert) this.javaAttributeMapping.getConverter()).getConverterName();
- }
- return null;
- }
-
- public void setConvert(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public XmlConverter getConverter() {
- //don't need isOrmMetadataComplete() check because there is no default Id mapping
- if (this.javaAttributeMapping.getConverter().getType() == Convert.ECLIPSE_LINK_CONVERTER) {
- EclipseLinkConverter converter = ((Convert) this.javaAttributeMapping.getConverter()).getConverter();
- if (converter != null && converter.getType() == EclipseLinkConverter.CUSTOM_CONVERTER) {
- return new EclipseLinkVirtualXmlConverter(this.ormTypeMapping, (CustomConverter) ((Convert) this.javaAttributeMapping.getConverter()).getConverter());
- }
- }
- return null;
- }
-
- public void setConverter(@SuppressWarnings("unused") XmlConverter value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public XmlObjectTypeConverter getObjectTypeConverter() {
- //don't need isOrmMetadataComplete() check because there is no default Id mapping
- if (this.javaAttributeMapping.getConverter().getType() == Convert.ECLIPSE_LINK_CONVERTER) {
- EclipseLinkConverter converter = ((Convert) this.javaAttributeMapping.getConverter()).getConverter();
- if (converter != null && converter.getType() == EclipseLinkConverter.OBJECT_TYPE_CONVERTER) {
- return new EclipseLinkVirtualXmlObjectTypeConverter(this.ormTypeMapping, (ObjectTypeConverter) ((Convert) this.javaAttributeMapping.getConverter()).getConverter());
- }
- }
- return null;
- }
-
- public void setObjectTypeConverter(@SuppressWarnings("unused") XmlObjectTypeConverter value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public XmlStructConverter getStructConverter() {
- //don't need isOrmMetadataComplete() check because there is no default Id mapping
- if (this.javaAttributeMapping.getConverter().getType() == Convert.ECLIPSE_LINK_CONVERTER) {
- EclipseLinkConverter converter = ((Convert) this.javaAttributeMapping.getConverter()).getConverter();
- if (converter != null && converter.getType() == EclipseLinkConverter.STRUCT_CONVERTER) {
- return new EclipseLinkVirtualXmlStructConverter(this.ormTypeMapping, (StructConverter) ((Convert) this.javaAttributeMapping.getConverter()).getConverter());
- }
- }
- return null;
- }
-
- public void setStructConverter(@SuppressWarnings("unused") XmlStructConverter value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public XmlTypeConverter getTypeConverter() {
- //don't need isOrmMetadataComplete() check because there is no default Id mapping
- if (this.javaAttributeMapping.getConverter().getType() == Convert.ECLIPSE_LINK_CONVERTER) {
- EclipseLinkConverter converter = ((Convert) this.javaAttributeMapping.getConverter()).getConverter();
- if (converter != null && converter.getType() == EclipseLinkConverter.TYPE_CONVERTER) {
- return new EclipseLinkVirtualXmlTypeConverter(this.ormTypeMapping, (TypeConverter) ((Convert) this.javaAttributeMapping.getConverter()).getConverter());
- }
- }
- return null;
- }
-
- public void setTypeConverter(@SuppressWarnings("unused") XmlTypeConverter value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-
- public TextRange getMutableTextRange() {
- return null;
- }
-
- public TextRange getConvertTextRange() {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlManyToMany.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlManyToMany.java
deleted file mode 100644
index db318f3bcf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlManyToMany.java
+++ /dev/null
@@ -1,47 +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.internal.context.orm;
-
-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.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.JoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.JoinFetchType;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaManyToManyMappingImpl;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToMany;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class EclipseLinkVirtualXmlManyToMany extends VirtualXmlManyToMany implements XmlManyToMany
-{
-
- public EclipseLinkVirtualXmlManyToMany(OrmTypeMapping ormTypeMapping, JavaManyToManyMapping javaManyToManyMapping) {
- super(ormTypeMapping, javaManyToManyMapping);
- }
-
- public XmlJoinFetchType getJoinFetch() {
- if (isOrmMetadataComplete()) {
- return JoinFetchType.toOrmResourceModel(JoinFetch.DEFAULT_VALUE);
- }
- return JoinFetchType.toOrmResourceModel(((EclipseLinkJavaManyToManyMappingImpl) this.javaAttributeMapping).getJoinFetch().getValue());
- }
-
- public void setJoinFetch(@SuppressWarnings("unused") XmlJoinFetchType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public TextRange getJoinFetchTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlManyToOne.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlManyToOne.java
deleted file mode 100644
index ea91a20723..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlManyToOne.java
+++ /dev/null
@@ -1,47 +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.internal.context.orm;
-
-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.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.JoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.JoinFetchType;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaManyToOneMappingImpl;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToOne;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class EclipseLinkVirtualXmlManyToOne extends VirtualXmlManyToOne implements XmlManyToOne
-{
-
- public EclipseLinkVirtualXmlManyToOne(OrmTypeMapping ormTypeMapping, JavaManyToOneMapping javaManyToOneMapping) {
- super(ormTypeMapping, javaManyToOneMapping);
- }
-
- public XmlJoinFetchType getJoinFetch() {
- if (isOrmMetadataComplete()) {
- return JoinFetchType.toOrmResourceModel(JoinFetch.DEFAULT_VALUE);
- }
- return JoinFetchType.toOrmResourceModel(((EclipseLinkJavaManyToOneMappingImpl) this.javaAttributeMapping).getJoinFetch().getValue());
- }
-
- public void setJoinFetch(@SuppressWarnings("unused") XmlJoinFetchType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public TextRange getJoinFetchTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlObjectTypeConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlObjectTypeConverter.java
deleted file mode 100644
index 902c4599c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlObjectTypeConverter.java
+++ /dev/null
@@ -1,99 +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.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.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.eclipselink.core.context.ConversionValue;
-import org.eclipse.jpt.eclipselink.core.context.ObjectTypeConverter;
-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 EclipseLinkVirtualXmlObjectTypeConverter extends AbstractJpaEObject implements XmlObjectTypeConverter
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected ObjectTypeConverter javaConverter;
-
- public EclipseLinkVirtualXmlObjectTypeConverter(OrmTypeMapping ormTypeMapping, ObjectTypeConverter javaConverter) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaConverter = javaConverter;
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- public String getName() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConverter.getName();
- }
-
- public void setName(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getDataType() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConverter.getDataType();
- }
-
- public void setDataType(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getObjectType() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConverter.getObjectType();
- }
-
- public void setObjectType(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getDefaultObjectValue() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConverter.getDefaultObjectValue();
- }
-
- public void setDefaultObjectValue(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- 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 (ConversionValue javaConversionValue : CollectionTools.iterable(this.javaConverter.conversionValues())) {
- XmlConversionValue xmlConversionValue = new EclipseLinkVirtualXmlConversionValue(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/EclipseLinkVirtualXmlOneToMany.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlOneToMany.java
deleted file mode 100644
index de32d62548..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlOneToMany.java
+++ /dev/null
@@ -1,62 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlOneToMany;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.JoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.JoinFetchType;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaOneToManyMappingImpl;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToMany;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class EclipseLinkVirtualXmlOneToMany extends VirtualXmlOneToMany implements XmlOneToMany
-{
-
- public EclipseLinkVirtualXmlOneToMany(OrmTypeMapping ormTypeMapping, JavaOneToManyMapping javaOneToManyMapping) {
- super(ormTypeMapping, javaOneToManyMapping);
- }
-
- public XmlJoinFetchType getJoinFetch() {
- if (isOrmMetadataComplete()) {
- return JoinFetchType.toOrmResourceModel(JoinFetch.DEFAULT_VALUE);
- }
- return JoinFetchType.toOrmResourceModel(((EclipseLinkJavaOneToManyMappingImpl) this.javaAttributeMapping).getJoinFetch().getValue());
- }
-
- public void setJoinFetch(@SuppressWarnings("unused") XmlJoinFetchType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public boolean isPrivateOwned() {
- if (isOrmMetadataComplete()) {
- return false;
- }
- return ((EclipseLinkJavaOneToManyMappingImpl) this.javaAttributeMapping).getPrivateOwned().isPrivateOwned();
- }
-
- public void setPrivateOwned(@SuppressWarnings("unused") boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public TextRange getJoinFetchTextRange() {
- return null;
- }
-
- public TextRange getPrivateOwnedTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlOneToOne.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlOneToOne.java
deleted file mode 100644
index 016e602b15..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlOneToOne.java
+++ /dev/null
@@ -1,62 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlOneToOne;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.JoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.JoinFetchType;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaOneToOneMappingImpl;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToOne;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class EclipseLinkVirtualXmlOneToOne extends VirtualXmlOneToOne implements XmlOneToOne
-{
-
- public EclipseLinkVirtualXmlOneToOne(OrmTypeMapping ormTypeMapping, JavaOneToOneMapping javaOneToOneMapping) {
- super(ormTypeMapping, javaOneToOneMapping);
- }
-
- public XmlJoinFetchType getJoinFetch() {
- if (isOrmMetadataComplete()) {
- return JoinFetchType.toOrmResourceModel(JoinFetch.DEFAULT_VALUE);
- }
- return JoinFetchType.toOrmResourceModel(((EclipseLinkJavaOneToOneMappingImpl) this.javaAttributeMapping).getJoinFetch().getValue());
- }
-
- public void setJoinFetch(@SuppressWarnings("unused") XmlJoinFetchType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public boolean isPrivateOwned() {
- if (isOrmMetadataComplete()) {
- return false;
- }
- return ((EclipseLinkJavaOneToOneMappingImpl) this.javaAttributeMapping).getPrivateOwned().isPrivateOwned();
- }
-
- public void setPrivateOwned(@SuppressWarnings("unused") boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public TextRange getJoinFetchTextRange() {
- return null;
- }
-
- public TextRange getPrivateOwnedTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlStructConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlStructConverter.java
deleted file mode 100644
index 037bb746c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlStructConverter.java
+++ /dev/null
@@ -1,58 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.eclipselink.core.context.StructConverter;
-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 EclipseLinkVirtualXmlStructConverter extends AbstractJpaEObject implements XmlStructConverter
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected StructConverter javaConverter;
-
- public EclipseLinkVirtualXmlStructConverter(OrmTypeMapping ormTypeMapping, StructConverter javaConverter) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaConverter = javaConverter;
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- public String getConverter() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConverter.getConverterClass();
- }
-
- public void setConverter(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getName() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConverter.getName();
- }
-
- public void setName(@SuppressWarnings("unused") 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/EclipseLinkVirtualXmlTypeConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlTypeConverter.java
deleted file mode 100644
index f7ec01a1a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlTypeConverter.java
+++ /dev/null
@@ -1,69 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.eclipselink.core.context.TypeConverter;
-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 EclipseLinkVirtualXmlTypeConverter extends AbstractJpaEObject implements XmlTypeConverter
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected TypeConverter javaConverter;
-
- public EclipseLinkVirtualXmlTypeConverter(OrmTypeMapping ormTypeMapping, TypeConverter javaConverter) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaConverter = javaConverter;
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- public String getName() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConverter.getName();
- }
-
- public void setName(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getDataType() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConverter.getDataType();
- }
-
- public void setDataType(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getObjectType() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConverter.getObjectType();
- }
-
- public void setObjectType(@SuppressWarnings("unused") 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/EclipseLinkVirtualXmlVersion.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlVersion.java
deleted file mode 100644
index 02532e6aec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkVirtualXmlVersion.java
+++ /dev/null
@@ -1,128 +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.internal.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.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.Convert;
-import org.eclipse.jpt.eclipselink.core.context.CustomConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkVersionMapping;
-import org.eclipse.jpt.eclipselink.core.context.ObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.StructConverter;
-import org.eclipse.jpt.eclipselink.core.context.TypeConverter;
-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.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 EclipseLinkVirtualXmlVersion extends VirtualXmlVersion implements XmlVersion
-{
-
- public EclipseLinkVirtualXmlVersion(OrmTypeMapping ormTypeMapping, JavaVersionMapping javaVersionMapping) {
- super(ormTypeMapping, javaVersionMapping);
- }
-
- public Boolean getMutable() {
- //don't need isOrmMetadataComplete() check because there is no default Id mapping
- return Boolean.valueOf(((EclipseLinkVersionMapping) this.javaAttributeMapping).getMutable().isMutable());
- }
-
- public void setMutable(@SuppressWarnings("unused") Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public String getConvert() {
- //don't need isOrmMetadataComplete() check because there is no default Id mapping
- if (this.javaAttributeMapping.getConverter().getType() == Convert.ECLIPSE_LINK_CONVERTER) {
- return ((Convert) this.javaAttributeMapping.getConverter()).getConverterName();
- }
- return null;
- }
-
- public void setConvert(@SuppressWarnings("unused") String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public TextRange getMutableTextRange() {
- return null;
- }
-
- public TextRange getConvertTextRange() {
- return null;
- }
-
- public XmlConverter getConverter() {
- //don't need isOrmMetadataComplete() check because there is no default Id mapping
- if (this.javaAttributeMapping.getConverter().getType() == Convert.ECLIPSE_LINK_CONVERTER) {
- EclipseLinkConverter converter = ((Convert) this.javaAttributeMapping.getConverter()).getConverter();
- if (converter != null && converter.getType() == EclipseLinkConverter.CUSTOM_CONVERTER) {
- return new EclipseLinkVirtualXmlConverter(this.ormTypeMapping, (CustomConverter) ((Convert) this.javaAttributeMapping.getConverter()).getConverter());
- }
- }
- return null;
- }
-
- public void setConverter(@SuppressWarnings("unused") XmlConverter value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public XmlObjectTypeConverter getObjectTypeConverter() {
- //don't need isOrmMetadataComplete() check because there is no default Id mapping
- if (this.javaAttributeMapping.getConverter().getType() == Convert.ECLIPSE_LINK_CONVERTER) {
- EclipseLinkConverter converter = ((Convert) this.javaAttributeMapping.getConverter()).getConverter();
- if (converter != null && converter.getType() == EclipseLinkConverter.OBJECT_TYPE_CONVERTER) {
- return new EclipseLinkVirtualXmlObjectTypeConverter(this.ormTypeMapping, (ObjectTypeConverter) ((Convert) this.javaAttributeMapping.getConverter()).getConverter());
- }
- }
- return null;
- }
-
- public void setObjectTypeConverter(@SuppressWarnings("unused") XmlObjectTypeConverter value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public XmlStructConverter getStructConverter() {
- //don't need isOrmMetadataComplete() check because there is no default Id mapping
- if (this.javaAttributeMapping.getConverter().getType() == Convert.ECLIPSE_LINK_CONVERTER) {
- EclipseLinkConverter converter = ((Convert) this.javaAttributeMapping.getConverter()).getConverter();
- if (converter != null && converter.getType() == EclipseLinkConverter.STRUCT_CONVERTER) {
- return new EclipseLinkVirtualXmlStructConverter(this.ormTypeMapping, (StructConverter) ((Convert) this.javaAttributeMapping.getConverter()).getConverter());
- }
- }
- return null;
- }
-
- public void setStructConverter(@SuppressWarnings("unused") XmlStructConverter value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public XmlTypeConverter getTypeConverter() {
- //don't need isOrmMetadataComplete() check because there is no default Id mapping
- if (this.javaAttributeMapping.getConverter().getType() == Convert.ECLIPSE_LINK_CONVERTER) {
- EclipseLinkConverter converter = ((Convert) this.javaAttributeMapping.getConverter()).getConverter();
- if (converter != null && converter.getType() == EclipseLinkConverter.TYPE_CONVERTER) {
- return new EclipseLinkVirtualXmlTypeConverter(this.ormTypeMapping, (TypeConverter) ((Convert) this.javaAttributeMapping.getConverter()).getConverter());
- }
- }
- return null;
- }
-
- public void setTypeConverter(@SuppressWarnings("unused") XmlTypeConverter 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/OrmBasicCollectionMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicCollectionMapping.java
deleted file mode 100644
index 3d7a588765..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicCollectionMapping.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.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.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.context.BasicCollectionMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.Attributes;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollection;
-
-public class OrmBasicCollectionMapping extends AbstractOrmAttributeMapping<XmlBasicCollection> implements BasicCollectionMapping
-{
-
- public OrmBasicCollectionMapping(OrmPersistentAttribute parent) {
- super(parent);
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmAttributeMapping(this);
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlBasicCollection addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlBasicCollection basicCollection = EclipseLinkOrmFactory.eINSTANCE.createXmlBasicCollectionImpl();
- getPersistentAttribute().initialize(basicCollection);
- ((Attributes) typeMapping.getAttributes()).getBasicCollections().add(basicCollection);
- return basicCollection;
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- ((Attributes) typeMapping.getAttributes()).getBasicCollections().remove(this.resourceAttributeMapping);
- }
-
- public int getXmlSequence() {
- return 23;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicCollectionMappingProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicCollectionMappingProvider.java
deleted file mode 100644
index 69f3f638cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicCollectionMappingProvider.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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaBasicCollectionMapping;
-
-public class OrmBasicCollectionMappingProvider
- implements OrmAttributeMappingProvider
-{
-
- // singleton
- private static final OrmBasicCollectionMappingProvider INSTANCE = new OrmBasicCollectionMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private OrmBasicCollectionMappingProvider() {
- super();
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public OrmAttributeMapping buildMapping(OrmPersistentAttribute parent, JpaFactory factory) {
- return ((EclipseLinkJpaFactory) factory).buildOrmBasicCollectionMapping(parent);
- }
-
- public XmlAttributeMapping buildVirtualResourceMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping, JpaFactory factory) {
- return ((EclipseLinkJpaFactory) factory).buildVirtualXmlBasicCollection(ormTypeMapping, (JavaBasicCollectionMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicMapMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicMapMapping.java
deleted file mode 100644
index 6294f48e81..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicMapMapping.java
+++ /dev/null
@@ -1,52 +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.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.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.context.BasicMapMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.Attributes;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMap;
-
-public class OrmBasicMapMapping extends AbstractOrmAttributeMapping<XmlBasicMap> implements BasicMapMapping
-{
-
- public OrmBasicMapMapping(OrmPersistentAttribute parent) {
- super(parent);
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmAttributeMapping(this);
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlBasicMap addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlBasicMap basicMap = EclipseLinkOrmFactory.eINSTANCE.createXmlBasicMapImpl();
- getPersistentAttribute().initialize(basicMap);
- ((Attributes) typeMapping.getAttributes()).getBasicMaps().add(basicMap);
- return basicMap;
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- ((Attributes) typeMapping.getAttributes()).getBasicMaps().remove(this.resourceAttributeMapping);
- }
-
-
- public int getXmlSequence() {
- return 27;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicMapMappingProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicMapMappingProvider.java
deleted file mode 100644
index 087f5c9cfc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicMapMappingProvider.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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaBasicMapMapping;
-
-public class OrmBasicMapMappingProvider
- implements OrmAttributeMappingProvider
-{
-
- // singleton
- private static final OrmBasicMapMappingProvider INSTANCE = new OrmBasicMapMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private OrmBasicMapMappingProvider() {
- super();
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY;
- }
-
- public OrmAttributeMapping buildMapping(OrmPersistentAttribute parent, JpaFactory factory) {
- return ((EclipseLinkJpaFactory) factory).buildOrmBasicMapMapping(parent);
- }
-
- public XmlAttributeMapping buildVirtualResourceMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping, JpaFactory factory) {
- return ((EclipseLinkJpaFactory) factory).buildVirtualXmlBasicMap(ormTypeMapping, (JavaBasicMapMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmTransformationMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmTransformationMapping.java
deleted file mode 100644
index 9c37b0bed5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmTransformationMapping.java
+++ /dev/null
@@ -1,52 +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.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.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.context.TransformationMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.Attributes;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformation;
-
-public class OrmTransformationMapping extends AbstractOrmAttributeMapping<XmlTransformation> implements TransformationMapping
-{
-
- public OrmTransformationMapping(OrmPersistentAttribute parent) {
- super(parent);
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmAttributeMapping(this);
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlTransformation addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlTransformation transformation = EclipseLinkOrmFactory.eINSTANCE.createXmlTransformationImpl();
- getPersistentAttribute().initialize(transformation);
- ((Attributes) typeMapping.getAttributes()).getTransformations().add(transformation);
- return transformation;
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- ((Attributes) typeMapping.getAttributes()).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/OrmTransformationMappingProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmTransformationMappingProvider.java
deleted file mode 100644
index f156c2ca37..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmTransformationMappingProvider.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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaTransformationMapping;
-
-public class OrmTransformationMappingProvider
- implements OrmAttributeMappingProvider
-{
-
- // singleton
- private static final OrmTransformationMappingProvider INSTANCE = new OrmTransformationMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private OrmTransformationMappingProvider() {
- super();
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public OrmAttributeMapping buildMapping(OrmPersistentAttribute parent, JpaFactory factory) {
- return ((EclipseLinkJpaFactory) factory).buildOrmTransformationMapping(parent);
- }
-
- public XmlAttributeMapping buildVirtualResourceMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping, JpaFactory factory) {
- return ((EclipseLinkJpaFactory) factory).buildVirtualXmlTransformation(ormTypeMapping, (JavaTransformationMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualXmlBasicCollection.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualXmlBasicCollection.java
deleted file mode 100644
index 65eded5257..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualXmlBasicCollection.java
+++ /dev/null
@@ -1,27 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaBasicCollectionMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollection;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualXmlBasicCollection extends VirtualXmlAttributeMapping<JavaBasicCollectionMapping> implements XmlBasicCollection
-{
-
- public VirtualXmlBasicCollection(OrmTypeMapping ormTypeMapping, JavaBasicCollectionMapping javaBasicCollectionMapping) {
- super(ormTypeMapping, javaBasicCollectionMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualXmlBasicMap.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualXmlBasicMap.java
deleted file mode 100644
index 34abe15de7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualXmlBasicMap.java
+++ /dev/null
@@ -1,27 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaBasicMapMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMap;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualXmlBasicMap extends VirtualXmlAttributeMapping<JavaBasicMapMapping> implements XmlBasicMap
-{
-
- public VirtualXmlBasicMap(OrmTypeMapping ormTypeMapping, JavaBasicMapMapping javaBasicMapMappingg) {
- super(ormTypeMapping, javaBasicMapMappingg);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualXmlTransformation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualXmlTransformation.java
deleted file mode 100644
index db4ae6ecb0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualXmlTransformation.java
+++ /dev/null
@@ -1,27 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaTransformationMapping;
-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 VirtualXmlTransformation extends VirtualXmlAttributeMapping<JavaTransformationMapping> implements XmlTransformation
-{
-
- public VirtualXmlTransformation(OrmTypeMapping ormTypeMapping, JavaTransformationMapping javaTransformationMapping) {
- super(ormTypeMapping, javaTransformationMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkImpliedMappingFileRef.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkImpliedMappingFileRef.java
deleted file mode 100644
index 93566046e8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkImpliedMappingFileRef.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.context.persistence;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.internal.context.persistence.GenericMappingFileRef;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-
-/**
- * Currently, this class is only used for implied eclipselink mapping files
- */
-public class EclipseLinkImpliedMappingFileRef extends GenericMappingFileRef
-{
- public EclipseLinkImpliedMappingFileRef(PersistenceUnit parent) {
- super(parent, null);
- }
-
-
- @Override
- protected void initializeFileName() {
- fileName = JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH;
- }
-
- @Override
- protected void updateFileName() {
- setFileName_(JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH);
- }
-}
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 be189b4576..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceUnit.java
+++ /dev/null
@@ -1,337 +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.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.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.Property;
-import org.eclipse.jpt.core.internal.context.persistence.AbstractPersistenceUnit;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.caching.Caching;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.caching.EclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.connection.EclipseLinkConnection;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.customization.Customization;
-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.general.GeneralProperties;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.logging.EclipseLinkLogging;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.logging.Logging;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.options.EclipseLinkOptions;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.options.Options;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.schema.generation.EclipseLinkSchemaGeneration;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.schema.generation.SchemaGeneration;
-import org.eclipse.jpt.eclipselink.core.internal.resource.orm.EclipseLinkOrmResourceModelProvider;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmResource;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyCompositeListIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-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.model.value.ListValueModel;
-
-/**
- * EclipseLinkPersistenceUnit
- */
-public class EclipseLinkPersistenceUnit extends AbstractPersistenceUnit
-{
- protected MappingFileRef impliedEclipseLinkMappingFileRef;
-
- private final GeneralProperties generalProperties;
- private final Connection connection;
- private final Customization customization;
- private final Caching caching;
- private final Logging logging;
- private final Options options;
- private final SchemaGeneration schemaGeneration;
-
- private final ListValueModel<Property> propertiesAdapter;
- private final ListValueModel<Property> propertyListAdapter;
-
- /* global converter definitions, defined elsewhere in model */
- protected final List<EclipseLinkConverter> converters = new ArrayList<EclipseLinkConverter>();
-
-
- public EclipseLinkPersistenceUnit(Persistence parent, XmlPersistenceUnit persistenceUnit) {
- super(parent);
- this.propertiesAdapter = this.buildPropertiesAdapter();
- this.propertyListAdapter = this.buildPropertyListAdapter(this.propertiesAdapter);
- this.generalProperties = new EclipseLinkGeneralProperties(this, this.propertyListAdapter);
- this.connection = new EclipseLinkConnection(this, this.propertyListAdapter);
- this.customization = new EclipseLinkCustomization(this, this.propertyListAdapter);
- this.caching = new EclipseLinkCaching(this, this.propertyListAdapter);
- this.logging = new EclipseLinkLogging(this, this.propertyListAdapter);
- this.options = new EclipseLinkOptions(this, this.propertyListAdapter);
- this.schemaGeneration = new EclipseLinkSchemaGeneration(this, this.propertyListAdapter);
- this.initialize(persistenceUnit);
- }
-
- // ********** internal methods **********
-
- private ListValueModel<Property> buildPropertyListAdapter(ListValueModel<Property> propertiesAdapter) {
- return new ItemPropertyListValueModelAdapter<Property>(propertiesAdapter, Property.VALUE_PROPERTY);
- }
-
- private ListValueModel<Property> buildPropertiesAdapter() {
- return new ListAspectAdapter<PersistenceUnit, Property>(new SimplePropertyValueModel<PersistenceUnit>(this), PersistenceUnit.PROPERTIES_LIST) {
- @Override
- protected ListIterator<Property> listIterator_() {
- return this.subject.properties();
- }
-
- @Override
- protected int size_() {
- return this.subject.propertiesSize();
- }
- };
- }
-
- @Override
- protected void addNonUpdateAspectNamesTo(Set<String> nonUpdateAspectNames) {
- super.addNonUpdateAspectNamesTo(nonUpdateAspectNames);
- nonUpdateAspectNames.add(CONVERTERS_LIST);
- }
-
-
- // **************** mapping file refs **************************************
-
- @Override
- public ListIterator<MappingFileRef> mappingFileRefs() {
- if (impliedEclipseLinkMappingFileRef == null) {
- return super.mappingFileRefs();
- }
- return new ReadOnlyCompositeListIterator<MappingFileRef>(
- super.mappingFileRefs(), impliedEclipseLinkMappingFileRef);
- }
-
- @Override
- public int mappingFileRefsSize() {
- if (impliedEclipseLinkMappingFileRef == null) {
- return super.mappingFileRefsSize();
- }
- return 1 + super.mappingFileRefsSize();
- }
-
-
- // **************** 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 impliedEclipseLinkMappingFileRef;
- }
-
- protected MappingFileRef setImpliedEclipseLinkMappingFileRef() {
- if (impliedEclipseLinkMappingFileRef != null) {
- throw new IllegalStateException("The implied eclipselink mapping file ref is already set."); //$NON-NLS-1$
- }
- MappingFileRef mappingFileRef = new EclipseLinkImpliedMappingFileRef(this);
- impliedEclipseLinkMappingFileRef = mappingFileRef;
- firePropertyChanged(IMPLIED_ECLIPSELINK_MAPPING_FILE_REF_PROPERTY, null, mappingFileRef);
- return mappingFileRef;
- }
-
- protected void unsetImpliedEclipseLinkMappingFileRef() {
- if (impliedEclipseLinkMappingFileRef == null) {
- throw new IllegalStateException("The implied eclipselink mapping file ref is already unset."); //$NON-NLS-1$
- }
- MappingFileRef mappingFileRef = impliedEclipseLinkMappingFileRef;
- impliedEclipseLinkMappingFileRef.dispose();
- impliedEclipseLinkMappingFileRef = null;
- firePropertyChanged(IMPLIED_ECLIPSELINK_MAPPING_FILE_REF_PROPERTY, mappingFileRef, null);
- }
-
-
- // **************** properties *********************************************
-
- public GeneralProperties getGeneralProperties() {
- return this.generalProperties;
- }
-
- public Connection getConnection() {
- return this.connection;
- }
-
- public Customization getCustomization() {
- return this.customization;
- }
-
- public Caching getCaching() {
- return this.caching;
- }
-
- public Logging getLogging() {
- return this.logging;
- }
-
- public Options getOptions() {
- return this.options;
- }
-
- public SchemaGeneration getSchemaGeneration() {
- return this.schemaGeneration;
- }
-
-
- public ListValueModel<Property> getPropertiesAdapter() {
- return this.propertiesAdapter;
- }
-
- public ListValueModel<Property> getPropertyListAdapter() {
- return this.propertyListAdapter;
- }
-
-
- // **************** 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);
- }
-
- /**
- * 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, 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
- protected void initializeMappingFileRefs(XmlPersistenceUnit xpu) {
- super.initializeMappingFileRefs(xpu);
-
- // 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()) {
-
- impliedEclipseLinkMappingFileRef = new EclipseLinkImpliedMappingFileRef(this);
- }
- }
-
- @Override
- protected void updateMappingFileRefs(XmlPersistenceUnit persistenceUnit) {
- super.updateMappingFileRefs(persistenceUnit);
-
- // 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 (impliedEclipseLinkMappingFileRef == null) {
- setImpliedEclipseLinkMappingFileRef();
- }
- getImpliedEclipseLinkMappingFileRef().update(null);
- }
- else if (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;
- }
-
- protected boolean impliedEclipseLinkMappingFileExists() {
- EclipseLinkOrmResourceModelProvider modelProvider =
- EclipseLinkOrmResourceModelProvider.getDefaultModelProvider(getJpaProject().getProject());
- EclipseLinkOrmResource resource = modelProvider.getResource();
- return resource != null && resource.exists();
- }
-
- // This is called after the persistence unit has been updated to ensure
- // we catch all added converters
- protected void convertersUpdated() {
- fireListChanged(CONVERTERS_LIST);
- }
-} \ 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/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 f760941f26..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceUnitProperties.java
+++ /dev/null
@@ -1,469 +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.internal.context.persistence;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.Property;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * EclipseLinkPersistenceUnitProperties
- *
- * Listens to the propertyListAdapter
- */
-public abstract class EclipseLinkPersistenceUnitProperties extends AbstractModel
- implements PersistenceUnitProperties
-{
- private PersistenceUnit persistenceUnit;
-
- private PersistenceUnitPropertyListListener propertyListListener;
-
- // key = EclipseLink property key; value = property id
- private Map<String, String> propertyNames;
-
- private static final long serialVersionUID = 1L;
-
- // ********** constructors / initialization **********
- protected EclipseLinkPersistenceUnitProperties(
- PersistenceUnit parent,
- ListValueModel<Property> propertyListAdapter) {
- super();
- this.initialize(parent, propertyListAdapter);
- }
-
- protected void initialize(
- PersistenceUnit parent,
- ListValueModel<Property> propertyListAdapter) {
- this.persistenceUnit = parent;
-
- this.propertyListListener = new PersistenceUnitPropertyListListener(this);
- propertyListAdapter.addListChangeListener(ListValueModel.LIST_VALUES, this.propertyListListener);
-
- this.initializePropertyNames();
- this.initializeProperties();
- }
-
- protected void initializePropertyNames() {
- this.propertyNames = new HashMap<String, String>();
- this.addPropertyNames(this.propertyNames);
- }
-
- /**
- * Initializes properties with values from the persistence unit.
- */
- protected abstract void initializeProperties();
-
- // ********** behavior **********
- public PersistenceUnit getPersistenceUnit() {
- return this.persistenceUnit;
- }
-
- public JpaProject getJpaProject() {
- return this.persistenceUnit.getJpaProject();
- }
-
- public PersistenceUnitPropertyListListener propertyListListener() {
- return this.propertyListListener;
- }
-
- private Map<String, String> propertyNames() {
- return this.propertyNames;
- }
-
- /**
- * Adds property names key/value pairs, used by the methods: itemIsProperty
- * and propertyIdFor.
- *
- * key = EclipseLink property key; value = property id
- */
- protected abstract void addPropertyNames(Map<String, String> propertyNames);
-
- /**
- * Method used for identifying the given property.
- */
- public boolean itemIsProperty(Property item) {
- if (item == null) {
- throw new IllegalArgumentException("Property is null");
- }
- return this.propertyNames().keySet().contains(item.getName());
- }
-
- /**
- * Returns the property name used for change notification of the given
- * property.
- */
- public String propertyIdFor(Property property) {
- String propertyId = this.propertyNames().get(property.getName());
- if (propertyId == null) {
- throw new IllegalArgumentException("Illegal property: " + property.toString());
- }
- return propertyId;
- }
-
- protected String eclipseLinkKeyFor(String propertyId) {
- for (String eclipseLinkKey : this.propertyNames().keySet()) {
- if (this.propertyNames().get(eclipseLinkKey).equals(propertyId)) {
- return eclipseLinkKey;
- }
- }
- throw new IllegalArgumentException("Illegal property: " + propertyId);
- }
-
- // ****** get/set String convenience methods *******
- /**
- * Returns the String value of the given Property from the PersistenceXml.
- */
- protected String getStringValue(String elKey) {
- return this.getStringValue(elKey, null);
- }
-
- protected String getStringValue(String key, String keySuffix) {
- String elKey = (keySuffix == null) ? key : key + keySuffix;
- if (this.getPersistenceUnit().containsProperty(elKey)) {
- // TOREVIEW - handle incorrect String in persistence.xml
- return this.getPersistenceUnit().getProperty(elKey).getValue();
- }
- return null;
- }
-
- /**
- * Put the given String value into the PersistenceXml.
- * @param key -
- * EclipseLink 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
- * EclipseLink 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
- * EclipseLink 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) {
- String elKey = (keySuffix == null) ? key : key + keySuffix;
- if (newValue == null) {
- this.getPersistenceUnit().removeProperty(elKey);
- }
- else {
- this.getPersistenceUnit().putProperty(elKey, newValue, allowDuplicate);
- }
- }
-
- // ****** Integer convenience methods *******
- /**
- * Returns the Integer value of the given Property from the PersistenceXml.
- */
- protected Integer getIntegerValue(String elKey) {
- return this.getIntegerValue(elKey, null);
- }
-
- protected Integer getIntegerValue(String key, String keySuffix) {
- String elKey = (keySuffix == null) ? key : key + keySuffix;
- if (this.getPersistenceUnit().containsProperty(elKey)) {
- String eclipseLinkValue = this.getPersistenceUnit().getProperty(elKey).getValue();
- // TOREVIEW - handle incorrect eclipseLinkValue String in
- // persistence.xml
- return getIntegerValueOf(eclipseLinkValue);
- }
- return null;
- }
-
- /**
- * Put the given Integer value into the PersistenceXml.
- * @param key -
- * EclipseLink 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
- * EclipseLink 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
- * EclipseLink 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) {
- String elKey = (keySuffix == null) ? key : key + keySuffix;
- if (newValue == null) {
- this.getPersistenceUnit().removeProperty(elKey);
- }
- else {
- this.getPersistenceUnit().putProperty(elKey, newValue.toString(), allowDuplicate);
- }
- }
-
- // ****** Boolean convenience methods *******
- /**
- * Returns the Boolean value of the given Property from the PersistenceXml.
- */
- protected Boolean getBooleanValue(String elKey) {
- return this.getBooleanValue(elKey, null);
- }
-
- /**
- * Returns the Boolean value of the given Property from the PersistenceXml.
- */
- protected Boolean getBooleanValue(String key, String keySuffix) {
- String elKey = (keySuffix == null) ? key : key + keySuffix;
- if (this.getPersistenceUnit().containsProperty(elKey)) {
- String eclipseLinkValue = this.getPersistenceUnit().getProperty(elKey).getValue();
- // TOREVIEW - handle incorrect eclipseLinkValue String in
- // persistence.xml
- return getBooleanValueOf(eclipseLinkValue);
- }
- return null;
- }
-
- /**
- * Put the given Boolean value into the PersistenceXml.
- * @param key
- * EclipseLink 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
- * EclipseLink 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
- * EclipseLink 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) {
- String elKey = (keySuffix == null) ? key : key + keySuffix;
- if (newValue == null) {
- this.getPersistenceUnit().removeProperty(elKey);
- }
- else {
- this.getPersistenceUnit().putProperty(elKey, newValue.toString(), allowDuplicate);
- }
- }
-
- // ****** Enum convenience methods *******
- /**
- * Returns the Enum value of the given Property from the PersistenceXml.
- */
- protected <T extends Enum<T>> T getEnumValue(String elKey, T[] enumValues) {
- return getEnumValue(elKey, null, enumValues);
- }
-
- protected <T extends Enum<T>> T getEnumValue(String key, String keySuffix, T[] enumValues) {
- String elKey = (keySuffix == null) ? key : key + keySuffix;
- if (this.getPersistenceUnit().containsProperty(elKey)) {
- String elStringValue = this.getPersistenceUnit().getProperty(elKey).getValue();
- // TOREVIEW - handle incorrect eclipseLinkValue String in persistence.xml
- return getEnumValueOf(elStringValue, enumValues);
- }
- return null;
- }
-
- /**
- * Put the given Enum value into the PersistenceXml.
- *
- * @param key -
- * EclipseLink 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) {
- String elKey = (keySuffix == null) ? key : key + keySuffix;
- if (newValue == null) {
- this.getPersistenceUnit().removeProperty(elKey);
- }
- else {
- this.getPersistenceUnit().putProperty(elKey, getEclipseLinkStringValueOf(newValue), allowDuplicate);
- }
- }
-
- // ******** Convenience methods ********
- /**
- * Put into persistenceUnit properties.
- *
- * @param key -
- * property name
- * @param value -
- * property value
- */
- protected void putProperty(String key, Object value) {
- putProperty(key, value, false);
- }
-
- @SuppressWarnings("unchecked")
- protected void putProperty(String key, Object value, boolean allowDuplicates) {
- String elKey = this.eclipseLinkKeyFor(key);
- if (value == null)
- this.removeEclipseLinkProperty(elKey);
- else if (value.getClass().isEnum())
- this.putEnumValue(elKey, (Enum) value, allowDuplicates);
- else
- this.putEclipseLinkProperty(elKey, value, allowDuplicates);
- }
-
- private void putEclipseLinkProperty(String key, Object value, boolean allowDuplicates) {
- this.getPersistenceUnit().putProperty(key, value.toString(), allowDuplicates);
- }
-
- /**
- * Removes a property with the given EclipseLink key.
- *
- * @param elKey -
- * EclipseLink key
- */
- private void removeEclipseLinkProperty(String elKey) {
- this.getPersistenceUnit().removeProperty(elKey);
- }
-
- /**
- * Removes a persistenceUnit property.
- *
- * @param key -
- * property name
- * @param value -
- * property value
- */
- protected void removeProperty(String key, String value) {
- String elKey = this.eclipseLinkKeyFor(key);
-
- this.getPersistenceUnit().removeProperty(elKey, value);
- }
-
- protected Set<Property> getPropertiesSetWithPrefix(String keyPrefix) {
- return CollectionTools.set(this.getPersistenceUnit().propertiesWithPrefix(keyPrefix));
- }
-
- /**
- * Extracts the entityName of the specified property name. If the property name
- * has no suffix, return an empty string.
- */
- protected String getEntityName(Property property) {
- return getEntityName(property.getName());
- }
-
- /**
- * Extracts the entityName of the specified string. If the string
- * has no suffix, return an empty string.
- */
- protected String getEntityName(String propertyName) {
- int index = propertyName.lastIndexOf('.');
- if (index == -1) {
- return "";
- }
- return propertyName.substring(index + 1);
- }
-
- // ****** Static methods *******
- /**
- * Returns the EclipseLink string value for the given property value.
- */
- public static String getEclipseLinkStringValueOf(Object value) {
-
- if (value.getClass().isEnum()) {
- return (String) ClassTools.staticFieldValue(value.getClass(), value.toString().toUpperCase());
- }
- return value.toString();
- }
-
- /**
- * Returns the enum constant of the specified enum type with the specified
- * EclipseLink value string.
- */
- public static <T extends Enum<T>> T getEnumValueOf(String elStringValue, T[] enumValues) {
- for (T enumValue : enumValues) {
- if (getEclipseLinkStringValueOf(enumValue).equals(elStringValue)) {
- return enumValue;
- }
- }
- return null;
- }
-
- public static Boolean getBooleanValueOf(String elStringValue) {
- if (elStringValue == null) {
- return null;
- }
- return Boolean.valueOf(elStringValue);
- }
-
- public static Integer getIntegerValueOf(String elStringValue) {
- if (elStringValue == null) {
- return null;
- }
- return Integer.valueOf(elStringValue);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/PersistenceUnitProperties.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/PersistenceUnitProperties.java
deleted file mode 100644
index 14078bc7a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/PersistenceUnitProperties.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.eclipselink.core.internal.context.persistence;
-
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.Property;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-
-/**
- * PersistenceUnitProperties
- */
-public interface PersistenceUnitProperties extends Model, PropertyChangeListener
-{
- /**
- * Method used for identifying the given property.
- */
- boolean itemIsProperty(Property item);
-
- /**
- * Returns the property name used for change notification of the given property.
- */
- String propertyIdFor(Property property);
-
- /**
- * Return the PersistenceUnit of this Properties.
- */
- PersistenceUnit getPersistenceUnit();
-
- /**
- * Return the JPA project the PersistenceUnit belongs to.
- */
- JpaProject getJpaProject();
-} \ 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/PersistenceUnitPropertyListListener.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/PersistenceUnitPropertyListListener.java
deleted file mode 100644
index 6e744c4dc3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/PersistenceUnitPropertyListListener.java
+++ /dev/null
@@ -1,111 +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.internal.context.persistence;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.persistence.Property;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-
-/**
- * PersistenceUnitPropertyListListener Notifies the given parent when a change
- * occured in JPT PersistenceUnit properties
- */
-public class PersistenceUnitPropertyListListener implements ListChangeListener
-{
- private PersistenceUnitProperties parent;
-
- // ********** constructors / initialization **********
- public PersistenceUnitPropertyListListener(PersistenceUnitProperties parent) {
- this.parent = parent;
- }
-
- // ********** Behavior **********
- protected boolean add(Property newItem, Model source) {
- if (this.model().itemIsProperty(newItem)) {
- String propertyName = this.model().propertyIdFor(newItem);
- this.model().propertyChanged(
- new PropertyChangeEvent(source, propertyName, null, newItem));
- return true;
- }
- return false;
- }
-
- protected boolean remove(Property item, Model source) {
- if (this.model().itemIsProperty(item)) {
- String propertyName = this.model().propertyIdFor(item);
- this.model().propertyChanged(
- new PropertyChangeEvent(source, propertyName, item, null)); // oldItem is the removed property
- return true;
- }
- return false;
- }
-
- // replace
- protected Property set(Property newItem, Model source) {
- if (this.model().itemIsProperty(newItem)) {
- String propertyName = this.model().propertyIdFor(newItem);
- this.model().propertyChanged(
- new PropertyChangeEvent(source, propertyName, null, newItem)); // oldItem unknown
- return newItem;
- }
- return null;
- }
-
- // ********** ListChangeListener implementation **********
- public void itemsAdded(ListChangeEvent e) {
- for (Iterator<Property> stream = this.items(e); stream.hasNext();) {
- this.add(stream.next(), e.getSource());
- }
- }
-
- public void itemsRemoved(ListChangeEvent e) {
- for (Iterator<Property> stream = this.items(e); stream.hasNext();) {
- this.remove(stream.next(), e.getSource());
- }
- }
-
- public void itemsReplaced(ListChangeEvent e) {
- // ItemAspectListValueModelAdapter(270) does not provide old value
- for (Iterator<Property> newStream = this.items(e); newStream.hasNext();) {
- this.set(newStream.next(), e.getSource());
- }
- }
-
- public void itemsMoved(ListChangeEvent e) {
- throw new UnsupportedOperationException("source: " + e.getSource() + " - aspect: " + e.getAspectName());
- }
-
- public void listCleared(ListChangeEvent e) {
- throw new UnsupportedOperationException("source: " + e.getSource() + " - aspect: " + e.getAspectName());
- }
-
- public void listChanged(ListChangeEvent e) {
- throw new UnsupportedOperationException("source: " + e.getSource() + " - aspect: " + e.getAspectName());
- }
-
- // ********** standard methods **********
- @Override
- public String toString() {
- return this.getClass().getSimpleName() + "( " + this.model().getClass().getSimpleName() + ")";
- }
-
- // ********** internal methods **********
- private PersistenceUnitProperties model() {
- return this.parent;
- }
-
- @SuppressWarnings("unchecked")
- private Iterator<Property> items(ListChangeEvent event) {
- return (Iterator<Property>) event.items();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/CacheProperties.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/CacheProperties.java
deleted file mode 100644
index c06dec92e8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/CacheProperties.java
+++ /dev/null
@@ -1,115 +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.internal.context.persistence.caching;
-
-import java.io.Serializable;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * CacheProperties
- */
-public class CacheProperties implements Cloneable, Serializable
-{
- private String entityName;
-
- // ********** EclipseLink properties **********
- private CacheType type;
- private Integer size;
- private Boolean isShared;
-
- private static final long serialVersionUID = 1L;
-
- // ********** constructors **********
- public CacheProperties(String entityName) {
- this.entityName = entityName;
- }
-
- // ********** behaviors **********
- @Override
- public boolean equals(Object o) {
- if(o == null) {
- return false;
- }
- CacheProperties cache = (CacheProperties) o;
- return (
- (this.type == null ?
- cache.type == null : this.type.equals(cache.type)) &&
- (this.isShared == null ?
- cache.isShared == null : this.isShared.equals(cache.isShared)) &&
- (this.size == null ?
- cache.size == null : this.size.equals(cache.size)));
- }
-
- @Override
- public synchronized CacheProperties clone() {
- try {
- return (CacheProperties)super.clone();
- }
- catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- public boolean isEmpty() {
- return (this.type == null) &&
- (this.size == null) &&
- (this.isShared == null);
- }
-
- // ********** getter/setter **********
- public String getEntityName() {
- return entityName;
- }
-
- public CacheType getType() {
- return this.type;
- }
-
- public void setType(CacheType cacheType) {
- this.type = cacheType;
- }
-
- public Integer getSize() {
- return this.size;
- }
-
- public void setSize(Integer cacheSize) {
- this.size = cacheSize;
- }
-
- public Boolean isShared() {
- return this.isShared;
- }
-
- public void setShared(Boolean isShared) {
- this.isShared = isShared;
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- StringTools.buildSimpleToStringOn(this, sb);
- sb.append(" (");
- this.toString(sb);
- sb.append(')');
- return sb.toString();
- }
-
- public void toString(StringBuilder sb) {
- sb.append("type: ");
- sb.append(this.type);
- sb.append(", size: ");
- sb.append(this.size);
- sb.append(", isShared: ");
- sb.append(this.isShared);
- sb.append(", entityName: ");
- sb.append(this.entityName);
- }
-} \ 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/caching/CacheType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/CacheType.java
deleted file mode 100644
index 0c66da4968..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/CacheType.java
+++ /dev/null
@@ -1,30 +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.internal.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/internal/context/persistence/caching/Caching.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/Caching.java
deleted file mode 100644
index 1c4cac45ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/Caching.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.context.persistence.caching;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.PersistenceUnitProperties;
-
-/**
- * Caching
- */
-public interface Caching extends PersistenceUnitProperties
-{
- CacheType getDefaultCacheTypeDefault();
- CacheType getCacheTypeDefault();
- void setCacheTypeDefault(CacheType cacheTypeDefault);
- static final String CACHE_TYPE_DEFAULT_PROPERTY = "cacheTypeDefaultProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_CACHE_TYPE_DEFAULT = "eclipselink.cache.type.default";
- 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 = "cacheSizeDefaultProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_CACHE_SIZE_DEFAULT = "eclipselink.cache.size.default";
- 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 = "sharedCacheDefaultProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_CACHE_SHARED_DEFAULT = "eclipselink.cache.shared.default";
- static final Boolean DEFAULT_SHARED_CACHE_DEFAULT = Boolean.TRUE;
-
-
- CacheType getDefaultCacheType();
- CacheType getCacheType(String entityName);
- void setCacheType(CacheType cacheType, String entityName);
- static final String CACHE_TYPE_PROPERTY = "cacheTypeProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_CACHE_TYPE = "eclipselink.cache.type.";
- static final CacheType DEFAULT_CACHE_TYPE = CacheType.soft_weak;
-
- Integer getDefaultCacheSize();
- Integer getCacheSize(String entityName);
- void setCacheSize(Integer cacheSize, String entityName);
- static final String CACHE_SIZE_PROPERTY = "cacheSizeProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_CACHE_SIZE = "eclipselink.cache.size.";
- static final Integer DEFAULT_CACHE_SIZE = Integer.valueOf(100);
-
- Boolean getDefaultSharedCache();
- Boolean getSharedCache(String entityName);
- void setSharedCache(Boolean sharedCache, String entityName);
- static final String SHARED_CACHE_PROPERTY = "sharedCacheProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_SHARED_CACHE = "eclipselink.cache.shared.";
- static final Boolean DEFAULT_SHARED_CACHE = Boolean.TRUE;
-
-
- ListIterator<String> entities();
- int entitiesSize();
- boolean entityExists(String entity);
- String addEntity(String entity);
- void removeEntity(String entity);
- String ENTITIES_LIST_PROPERTY = "entitiesListProperty";
-
-}
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 1252760ab1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/EclipseLinkCaching.java
+++ /dev/null
@@ -1,492 +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.internal.context.persistence.caching;
-
-import java.util.HashMap;
-import java.util.ListIterator;
-import java.util.Map;
-import java.util.Set;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.Property;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnitProperties;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * EclipseLinkCaching encapsulates EclipseLink Caching properties.
- */
-public class EclipseLinkCaching extends EclipseLinkPersistenceUnitProperties
- implements Caching
-{
- // ********** EclipseLink properties **********
- private CacheType cacheTypeDefault;
- private Integer cacheSizeDefault;
- private Boolean sharedCacheDefault;
-
- // key = Entity name ; value = Cache properties
- private Map<String, CacheProperties> entitiesCacheProperties;
-
- private static final long serialVersionUID = 1L;
-
- // ********** constructors **********
- public EclipseLinkCaching(PersistenceUnit parent, ListValueModel<Property> propertyListAdapter) {
- super(parent, propertyListAdapter);
- }
-
- // ********** initialization **********
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
- // TOREVIEW - handle incorrect String in persistence.xml
- this.entitiesCacheProperties =
- new HashMap<String, CacheProperties>();
- 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);
-
- Set<Property> cacheTypeProperties =
- this.getPropertiesSetWithPrefix(ECLIPSELINK_CACHE_TYPE);
- Set<Property> cacheSizeProperties =
- this.getPropertiesSetWithPrefix(ECLIPSELINK_CACHE_SIZE);
- Set<Property> sharedCacheProperties =
- this.getPropertiesSetWithPrefix(ECLIPSELINK_SHARED_CACHE);
-
- this.initializeEntitiesCacheType(cacheTypeProperties);
- this.initializeEntitiesCacheSize(cacheSizeProperties);
- this.initializeEntitiesSharedCache(sharedCacheProperties);
- }
-
- private void initializeEntitiesCacheType(Set<Property> properties) {
- for (Property property : properties) {
- String entityName = this.getEntityName(property);
- CacheType cacheType = getEnumValueOf(property.getValue(), CacheType.values());
- this.setCacheType_(cacheType, entityName);
- }
- }
-
- private void initializeEntitiesCacheSize(Set<Property> properties) {
- for (Property property : properties) {
- String entityName = this.getEntityName(property);
- this.setCacheSize_(property, entityName);
- }
- }
-
- private void initializeEntitiesSharedCache(Set<Property> properties) {
- for (Property property : properties) {
- String entityName = this.getEntityName(property);
- this.setSharedCache_(property, entityName);
- }
- }
-
- // ********** behavior **********
- /**
- * 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);
-
- // Don't need to initialize propertyNames for:
- // cacheType, sharedCache, cacheSize
- }
-
- /**
- * Method used for identifying the given property.
- */
- @Override
- public boolean itemIsProperty(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 propertyIdFor(Property property) {
- try {
- return super.propertyIdFor(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 void propertyChanged(PropertyChangeEvent event) {
- String aspectName = event.getAspectName();
- if (aspectName.equals(CACHE_TYPE_DEFAULT_PROPERTY)) {
- this.cacheTypeDefaultChanged(event);
- }
- else if (aspectName.equals(CACHE_SIZE_DEFAULT_PROPERTY)) {
- this.cacheSizeDefaultChanged(event);
- }
- else if (aspectName.equals(SHARED_CACHE_DEFAULT_PROPERTY)) {
- this.sharedCacheDefaultChanged(event);
- }
- else if (aspectName.equals(CACHE_TYPE_PROPERTY)) {
- this.cacheTypeChanged(event);
- }
- else if (aspectName.equals(CACHE_SIZE_PROPERTY)) {
- this.cacheSizeChanged(event);
- }
- else if (aspectName.equals(SHARED_CACHE_PROPERTY)) {
- this.sharedCacheChanged(event);
- }
- else {
- throw new IllegalArgumentException("Illegal event received - property not applicable: " + aspectName);
- }
- return;
- }
-
- // ********** CacheType **********
- public CacheType getCacheType(String entityName) {
- CacheProperties cache = this.cachePropertiesOf(entityName);
- return (cache == null) ? null : cache.getType();
- }
-
- public void setCacheType(CacheType newCacheType, String entityName) {
- CacheProperties old = this.setCacheType_(newCacheType, entityName);
- this.putEnumValue(ECLIPSELINK_CACHE_TYPE, entityName, newCacheType, false);
- this.firePropertyChanged(CACHE_TYPE_PROPERTY, old, this.cachePropertiesOf(entityName));
- }
-
- private void cacheTypeChanged(PropertyChangeEvent event) {
- Property property = (Property) event.getNewValue();
- // property == null when removed
- String entityName = (property == null) ? this.getEntityName((Property) event.getOldValue()) : this.getEntityName(property);
- CacheProperties old = this.setCacheType_(property, entityName);
- this.firePropertyChanged(event.getAspectName(), old, this.cachePropertiesOf(entityName));
- }
-
- public CacheType getDefaultCacheType() {
- return (this.cacheTypeDefault == null) ? DEFAULT_CACHE_TYPE : this.cacheTypeDefault;
- }
-
- // ********** CacheSize **********
- public Integer getCacheSize(String entityName) {
- CacheProperties cache = this.cachePropertiesOf(entityName);
- return (cache == null) ? null : cache.getSize();
- }
-
- public void setCacheSize(Integer newCacheSize, String entityName) {
- CacheProperties old = this.setCacheSize_(newCacheSize, entityName);
- this.putIntegerValue(ECLIPSELINK_CACHE_SIZE + entityName, newCacheSize);
- this.firePropertyChanged(CACHE_SIZE_PROPERTY, old, this.cachePropertiesOf(entityName));
- }
-
- private void cacheSizeChanged(PropertyChangeEvent event) {
- Property property = (Property) event.getNewValue();
- // property == null when removed
- String entityName = (property == null) ? this.getEntityName((Property) event.getOldValue()) : this.getEntityName(property);
- CacheProperties old = this.setCacheSize_(property, entityName);
- this.firePropertyChanged(event.getAspectName(), old, this.cachePropertiesOf(entityName));
- }
-
- public Integer getDefaultCacheSize() {
- return (this.cacheSizeDefault == null) ? DEFAULT_CACHE_SIZE : this.cacheSizeDefault;
- }
-
- // ********** SharedCache **********
- public Boolean getSharedCache(String entityName) {
- CacheProperties cache = this.cachePropertiesOf(entityName);
- return (cache == null) ? null : cache.isShared();
- }
-
- public void setSharedCache(Boolean newSharedCache, String entityName) {
- CacheProperties old = this.setSharedCache_(newSharedCache, entityName);
- this.putBooleanValue(ECLIPSELINK_SHARED_CACHE, entityName, newSharedCache, false);
- this.firePropertyChanged(SHARED_CACHE_PROPERTY, old, this.cachePropertiesOf(entityName));
- }
-
- private void sharedCacheChanged(PropertyChangeEvent event) {
- String entityName;
- Property newProperty = (Property) event.getNewValue();
- // property == null when removed
- entityName = (newProperty == null) ?
- this.getEntityName((Property) event.getOldValue()) : this.getEntityName(newProperty);
- CacheProperties old = this.setSharedCache_(newProperty, entityName);
- this.firePropertyChanged(event.getAspectName(), old, this.cachePropertiesOf(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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- CacheType newValue = getEnumValueOf(stringValue, CacheType.values());
- CacheType old = this.cacheTypeDefault;
- this.cacheTypeDefault = newValue;
- this.firePropertyChanged(event.getAspectName(), 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Integer newValue = getIntegerValueOf(stringValue);
- Integer old = this.cacheSizeDefault;
- this.cacheSizeDefault = newValue;
- this.firePropertyChanged(event.getAspectName(), 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.sharedCacheDefault;
- this.sharedCacheDefault = newValue;
- this.firePropertyChanged(event.getAspectName(), old, newValue);
- }
-
- public Boolean getDefaultSharedCacheDefault() {
- return DEFAULT_SHARED_CACHE_DEFAULT;
- }
-
- // ****** CacheProperties *******
- /**
- * Convenience method to update the CacheType in entitiesCache map. Returns
- * the old value of CacheProperties
- */
- private CacheProperties setCacheType_(Property newProperty, String entityName) {
- String stringValue = (newProperty == null) ? null : newProperty.getValue();
- CacheType newValue = getEnumValueOf(stringValue, CacheType.values());
- return this.setCacheType_(newValue, entityName);
- }
-
- private CacheProperties setCacheType_(CacheType newValue, String entityName) {
- CacheProperties properties = this.cachePropertiesOf(entityName);
- CacheProperties old = properties.clone();
- properties.setType(newValue);
- this.putEntityCacheProperties(entityName, properties);
- return old;
- }
-
- /**
- * Convenience method to update the CacheSize in entitiesCache map. Returns
- * the old value of CacheProperties
- */
- private CacheProperties setCacheSize_(Property newProperty, String entityName) {
- String stringValue = (newProperty == null) ? null : newProperty.getValue();
- Integer newValue = getIntegerValueOf(stringValue);
- return this.setCacheSize_(newValue, entityName);
- }
-
- private CacheProperties setCacheSize_(Integer newValue, String entityName) {
- CacheProperties properties = this.cachePropertiesOf(entityName);
- CacheProperties old = properties.clone();
- properties.setSize(newValue);
- this.putEntityCacheProperties(entityName, properties);
- return old;
- }
-
- /**
- * Convenience method to update the SharedCache in entitiesCacheProperties map.
- * Returns the old value of CacheProperties
- */
- private CacheProperties setSharedCache_(Property newProperty, String entityName) {
- String newValue = (newProperty == null) ? null : newProperty.getValue();
- return this.setSharedCache_(newValue, entityName);
- }
-
- private CacheProperties setSharedCache_(String newString, String entityName) {
- Boolean newValue = getBooleanValueOf(newString);
- return setSharedCache_(newValue, entityName);
- }
-
- private CacheProperties setSharedCache_(Boolean newValue, String entityName) {
- CacheProperties properties = this.cachePropertiesOf(entityName);
- CacheProperties old = properties.clone();
- properties.setShared(newValue);
- this.putEntityCacheProperties(entityName, properties);
- return old;
- }
-
- /**
- * Returns the CacheProperties of the Entity with the given name.
- */
- private CacheProperties cachePropertiesOf(String entityName) {
- CacheProperties properties = this.entitiesCacheProperties.get(entityName);
- if (properties == null) {
- properties = new CacheProperties(entityName);
- }
- return properties;
- }
-
- /**
- * Set all CacheProperties to default.
- */
- private void clearCacheProperties(String entityName) {
- this.setCacheType(null, entityName);
- this.setCacheSize(null, entityName);
- this.setSharedCache(null, entityName);
- }
-
- // ****** convenience methods *******
-
- /**
- * Put the given Entity CacheProperties in this entitiesCacheProperties map.
- * @param entityName - Entity name. The entity may be a new or an existing entity.
- * @param properties - Entity CacheProperties
- */
- private void putEntityCacheProperties(String entityName, CacheProperties properties) {
- this.addOrReplacePropertiesForEntity(entityName, properties);
- }
-
- // ****** entities list *******
-
- public ListIterator<String> entities() {
- return CollectionTools.list(this.entitiesCacheProperties.keySet()).listIterator();
- }
-
- public int entitiesSize() {
- return this.entitiesCacheProperties.size();
- }
-
- /*
- * Verifies if this entitiesCacheProperties map contains the given Entity.
- */
- public boolean entityExists(String entity) {
- return this.entitiesCacheProperties.containsKey(entity);
- }
-
- public String addEntity(String entity) {
- if (entityExists(entity)) {
- throw new IllegalStateException("Entity " + entity + " already exist.");
- }
- return this.addOrReplacePropertiesForEntity(entity, new CacheProperties(entity));
- }
-
- /**
- * Adds or replaces the given Entity CacheProperties in this
- * entitiesCacheProperties map.
- * If the specified Entity exists and the given CacheProperties is empty
- * (i.e. all properties are null) the mapping will be removed from the map.
- *
- * @param entity - Entity name
- * @param properties - Entity CacheProperties
- * @return Entity name added
- */
- private String addOrReplacePropertiesForEntity(String entity, CacheProperties properties) {
- if (this.entityExists(entity)) {
- this.replaceEntity_(entity, properties);
- return null;
- }
- this.entitiesCacheProperties.put(entity, properties);
- this.fireListChanged(ENTITIES_LIST_PROPERTY);
- return entity;
- }
-
- /**
- * Replaces the given Entity CacheProperties in this
- * entitiesCacheProperties map.
- * If the given Entity CacheProperties is empty (i.e. all properties are null) the
- * mapping will be removed from the map.
- * @param entity - Entity name
- * @param properties - Entity CacheProperties
- * @return Entity name replaced
- */
- private CacheProperties replaceEntity_(String entity, CacheProperties properties) {
- CacheProperties old = this.entitiesCacheProperties.get(entity);
- if (properties.isEmpty()) {
- this.entitiesCacheProperties.remove(entity);
- this.fireListChanged(ENTITIES_LIST_PROPERTY);
- }
- else {
- this.entitiesCacheProperties.put(entity, properties);
- }
- return old;
- }
-
- public void removeEntity(String entity) {
- if ( ! this.entityExists(entity)) {
- return;
- }
- this.clearCacheProperties(entity);
- this.entitiesCacheProperties.remove(entity);
- this.fireListChanged(ENTITIES_LIST_PROPERTY);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/connection/BatchWriting.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/connection/BatchWriting.java
deleted file mode 100644
index 5494a1a31f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/connection/BatchWriting.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.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/internal/context/persistence/connection/Connection.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/connection/Connection.java
deleted file mode 100644
index d53e6028f2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/connection/Connection.java
+++ /dev/null
@@ -1,152 +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.internal.context.persistence.connection;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitTransactionType;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.PersistenceUnitProperties;
-
-/**
- * Connection
- */
-public interface Connection extends PersistenceUnitProperties
-{
- PersistenceUnitTransactionType getDefaultTransactionType();
- PersistenceUnitTransactionType getTransactionType();
- void setTransactionType(PersistenceUnitTransactionType newTransactionType);
- // PersistenceUnit property
- static final String TRANSACTION_TYPE_PROPERTY = "transactionTypeProperty";
- static final PersistenceUnitTransactionType DEFAULT_TRANSACTION_TYPE = PersistenceUnitTransactionType.JTA;
-
- String getDefaultJtaDataSource();
- String getJtaDataSource();
- void setJtaDataSource(String newJtaDataSource);
- // PersistenceUnit property
- static final String JTA_DATA_SOURCE_PROPERTY = "jtaDataSourceProperty";
- static final String DEFAULT_JTA_DATA_SOURCE = "";
-
- String getDefaultNonJtaDataSource();
- String getNonJtaDataSource();
- void setNonJtaDataSource(String newNonJtaDataSource);
- // PersistenceUnit property
- static final String NON_JTA_DATA_SOURCE_PROPERTY = "nonJtaDataSourceProperty";
- static final String DEFAULT_NON_JTA_DATA_SOURCE = "";
-
- Boolean getDefaultNativeSql();
- Boolean getNativeSql();
- void setNativeSql(Boolean newNativeSql);
- static final String NATIVE_SQL_PROPERTY = "nativeSqlProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_NATIVE_SQL = "eclipselink.jdbc.native-sql";
- static final Boolean DEFAULT_NATIVE_SQL = Boolean.FALSE;
-
- BatchWriting getDefaultBatchWriting();
- BatchWriting getBatchWriting();
- void setBatchWriting(BatchWriting newBatchWriting);
- static final String BATCH_WRITING_PROPERTY = "batchWritingProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_BATCH_WRITING = "eclipselink.jdbc.batch-writing";
- static final BatchWriting DEFAULT_BATCH_WRITING = BatchWriting.none;
-
- Boolean getDefaultCacheStatements();
- Boolean getCacheStatements();
- void setCacheStatements(Boolean newCacheStatements);
- static final String CACHE_STATEMENTS_PROPERTY = "cacheStatementsProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_CACHE_STATEMENTS = "eclipselink.jdbc.cache-statements";
- static final Boolean DEFAULT_CACHE_STATEMENTS = Boolean.FALSE;
-
- Integer getDefaultCacheStatementsSize();
- Integer getCacheStatementsSize();
- void setCacheStatementsSize(Integer newCacheStatementsSize);
- static final String CACHE_STATEMENTS_SIZE_PROPERTY = "cacheStatementsSizeProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_CACHE_STATEMENTS_SIZE = "eclipselink.jdbc.cache-statements.size";
- static final Integer DEFAULT_CACHE_STATEMENTS_SIZE = 50;
-
- String getDefaultDriver();
- String getDriver();
- void setDriver(String newDriver);
- static final String DRIVER_PROPERTY = "driverProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_DRIVER = "eclipselink.jdbc.driver";
- static final String DEFAULT_DRIVER = "";
-
- String getDefaultUrl();
- String getUrl();
- void setUrl(String newUrl);
- static final String URL_PROPERTY = "urlProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_URL = "eclipselink.jdbc.url";
- static final String DEFAULT_URL = "";
-
- String getDefaultUser();
- String getUser();
- void setUser(String newUser);
- static final String USER_PROPERTY = "userProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_USER = "eclipselink.jdbc.user";
- static final String DEFAULT_USER = "";
-
- String getDefaultPassword();
- String getPassword();
- void setPassword(String newPassword);
- static final String PASSWORD_PROPERTY = "passwordProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_PASSWORD = "eclipselink.jdbc.password";
- static final String DEFAULT_PASSWORD = "";
-
- Boolean getDefaultBindParameters();
- Boolean getBindParameters();
- void setBindParameters(Boolean newBindParameters);
- static final String BIND_PARAMETERS_PROPERTY = "bindParametersProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_BIND_PARAMETERS = "eclipselink.jdbc.bind-parameters";
- static final Boolean DEFAULT_BIND_PARAMETERS = Boolean.TRUE;
-
- Boolean getDefaultReadConnectionsShared();
- Boolean getReadConnectionsShared();
- void setReadConnectionsShared(Boolean newReadConnectionsShared);
- static final String READ_CONNECTIONS_SHARED_PROPERTY = "readConnectionsSharedProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_READ_CONNECTIONS_SHARED = "eclipselink.jdbc.read-connections.shared";
- static final Boolean DEFAULT_READ_CONNECTIONS_SHARED = Boolean.FALSE;
-
- Integer getDefaultReadConnectionsMin();
- Integer getReadConnectionsMin();
- void setReadConnectionsMin(Integer newReadConnectionsMin);
- static final String READ_CONNECTIONS_MIN_PROPERTY = "readConnectionsMinProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_READ_CONNECTIONS_MIN = "eclipselink.jdbc.read-connections.min";
- static final Integer DEFAULT_READ_CONNECTIONS_MIN = 2;
-
- Integer getDefaultReadConnectionsMax();
- Integer getReadConnectionsMax();
- void setReadConnectionsMax(Integer newReadConnectionsMax);
- static final String READ_CONNECTIONS_MAX_PROPERTY = "readConnectionsMaxProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_READ_CONNECTIONS_MAX = "eclipselink.jdbc.read-connections.max";
- static final Integer DEFAULT_READ_CONNECTIONS_MAX = 2;
-
- Integer getDefaultWriteConnectionsMin();
- Integer getWriteConnectionsMin();
- void setWriteConnectionsMin(Integer newWriteConnectionsMin);
- static final String WRITE_CONNECTIONS_MIN_PROPERTY = "writeConnectionsMinProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_WRITE_CONNECTIONS_MIN = "eclipselink.jdbc.write-connections.min";
- static final Integer DEFAULT_WRITE_CONNECTIONS_MIN = 5;
-
- Integer getDefaultWriteConnectionsMax();
- Integer getWriteConnectionsMax();
- void setWriteConnectionsMax(Integer newWriteConnectionsMax);
- static final String WRITE_CONNECTIONS_MAX_PROPERTY = "writeConnectionsMaxProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_WRITE_CONNECTIONS_MAX = "eclipselink.jdbc.write-connections.max";
- static final Integer DEFAULT_WRITE_CONNECTIONS_MAX = 10;
-}
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 e7c686e209..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/connection/EclipseLinkConnection.java
+++ /dev/null
@@ -1,655 +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.internal.context.persistence.connection;
-
-import java.util.Map;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitTransactionType;
-import org.eclipse.jpt.core.context.persistence.Property;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnitProperties;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * EclipseLinkConnection
- */
-public class EclipseLinkConnection extends EclipseLinkPersistenceUnitProperties
- implements Connection
-{
- // ********** PersistenceUnit properties **********
- private PersistenceUnitTransactionType transactionType;
- private String jtaDataSource;
- private String nonJtaDataSource;
-
- // ********** EclipseLink properties **********
- private BatchWriting batchWriting;
- private Boolean nativeSql;
- private Boolean cacheStatements;
- private Integer cacheStatementsSize;
- private String driver;
- private String url;
- private String user;
- private String password;
- private Boolean bindParameters;
- private Boolean readConnectionsShared;
- private Integer readConnectionsMin;
- private Integer readConnectionsMax;
- private Integer writeConnectionsMin;
- private Integer writeConnectionsMax;
-
-
- // ********** constructors **********
- public EclipseLinkConnection(PersistenceUnit parent, ListValueModel<Property> propertyListAdapter) {
- super(parent, propertyListAdapter);
- }
-
- // ********** initialization **********
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
- // TOREVIEW - handle incorrect String in persistence.xml
- this.transactionType =
- this.getPersistenceUnit().getSpecifiedTransactionType();
- this.jtaDataSource =
- this.getPersistenceUnit().getJtaDataSource();
- this.nonJtaDataSource =
- this.getPersistenceUnit().getNonJtaDataSource();
- 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.driver =
- this.getStringValue(ECLIPSELINK_DRIVER);
- this.url =
- this.getStringValue(ECLIPSELINK_URL);
- this.user =
- this.getStringValue(ECLIPSELINK_USER);
- this.password =
- this.getStringValue(ECLIPSELINK_PASSWORD);
- 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);
-
- }
-
- /**
- * Initialize and add listeners to the persistence unit.
- */
- @Override
- protected void initialize(PersistenceUnit parent, ListValueModel<Property> propertyListAdapter) {
- super.initialize(parent, propertyListAdapter);
-
- this.getPersistenceUnit().addPropertyChangeListener(
- PersistenceUnit.SPECIFIED_TRANSACTION_TYPE_PROPERTY,
- this.buildTransactionTypeChangeListener());
- this.getPersistenceUnit().addPropertyChangeListener(
- PersistenceUnit.JTA_DATA_SOURCE_PROPERTY,
- this.buildJtaDataSourceChangeListener());
- this.getPersistenceUnit().addPropertyChangeListener(
- PersistenceUnit.NON_JTA_DATA_SOURCE_PROPERTY,
- this.buildNonJtaDataSourceChangeListener());
- }
-
- // ********** behavior **********
- /**
- * 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_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_DRIVER,
- DRIVER_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_URL,
- URL_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_USER,
- USER_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_PASSWORD,
- PASSWORD_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);
- }
-
- public void propertyChanged(PropertyChangeEvent event) {
- String aspectName = event.getAspectName();
- if (aspectName.equals(NATIVE_SQL_PROPERTY)) {
- this.nativeSqlChanged(event);
- }
- else if (aspectName.equals(BATCH_WRITING_PROPERTY)) {
- this.batchWritingChanged(event);
- }
- else if (aspectName.equals(CACHE_STATEMENTS_PROPERTY)) {
- this.cacheStatementsChanged(event);
- }
- else if (aspectName.equals(DRIVER_PROPERTY)) {
- this.driverChanged(event);
- }
- else if (aspectName.equals(URL_PROPERTY)) {
- this.urlChanged(event);
- }
- else if (aspectName.equals(USER_PROPERTY)) {
- this.userChanged(event);
- }
- else if (aspectName.equals(PASSWORD_PROPERTY)) {
- this.passwordChanged(event);
- }
- else if (aspectName.equals(BIND_PARAMETERS_PROPERTY)) {
- this.bindParametersChanged(event);
- }
- else if (aspectName.equals(READ_CONNECTIONS_SHARED_PROPERTY)) {
- this.readConnectionsSharedChanged(event);
- }
- else if (aspectName.equals(CACHE_STATEMENTS_SIZE_PROPERTY)) {
- this.cacheStatementsSizeChanged(event);
- }
- else if (aspectName.equals(READ_CONNECTIONS_MIN_PROPERTY)) {
- this.readConnectionsMinChanged(event);
- }
- else if (aspectName.equals(READ_CONNECTIONS_MAX_PROPERTY)) {
- this.readConnectionsMaxChanged(event);
- }
- else if (aspectName.equals(WRITE_CONNECTIONS_MIN_PROPERTY)) {
- this.writeConnectionsMinChanged(event);
- }
- else if (aspectName.equals(WRITE_CONNECTIONS_MAX_PROPERTY)) {
- this.writeConnectionsMaxChanged(event);
- }
- }
-
- // ********** TransactionType **********
-
- public PersistenceUnitTransactionType getTransactionType() {
- return this.transactionType;
- }
-
- public void setTransactionType(PersistenceUnitTransactionType newTransactionType) {
- PersistenceUnitTransactionType old = this.transactionType;
- this.transactionType = newTransactionType;
-
- this.getPersistenceUnit().setSpecifiedTransactionType( newTransactionType);
- this.firePropertyChanged(TRANSACTION_TYPE_PROPERTY, old, newTransactionType);
- }
-
- private void transactionTypeChanged(PropertyChangeEvent event) {
- PersistenceUnitTransactionType newValue = (PersistenceUnitTransactionType) event.getNewValue();
- PersistenceUnitTransactionType old = this.transactionType;
- this.transactionType = newValue;
- this.firePropertyChanged(TRANSACTION_TYPE_PROPERTY, old, newValue);
- }
-
- public PersistenceUnitTransactionType getDefaultTransactionType() {
- return DEFAULT_TRANSACTION_TYPE;
- }
-
- protected PropertyChangeListener buildTransactionTypeChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- EclipseLinkConnection.this.transactionTypeChanged(event);
- }
- };
- }
-
- // ********** JtaDataSource **********
-
- public String getJtaDataSource() {
- return this.jtaDataSource;
- }
-
- public void setJtaDataSource(String newJtaDataSource) {
- String old = this.jtaDataSource;
- this.jtaDataSource = newJtaDataSource;
-
- this.getPersistenceUnit().setJtaDataSource( newJtaDataSource);
- this.firePropertyChanged(JTA_DATA_SOURCE_PROPERTY, old, newJtaDataSource);
- }
-
- private void jtaDataSourceChanged(PropertyChangeEvent event) {
- String newValue = (String) event.getNewValue();
- String old = this.jtaDataSource;
- this.jtaDataSource = newValue;
- this.firePropertyChanged(JTA_DATA_SOURCE_PROPERTY, old, newValue);
- }
-
- public String getDefaultJtaDataSource() {
- return DEFAULT_JTA_DATA_SOURCE;
- }
-
- protected PropertyChangeListener buildJtaDataSourceChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- EclipseLinkConnection.this.jtaDataSourceChanged(event);
- }
- };
- }
-
- // ********** NonJtaDataSource **********
-
- public String getNonJtaDataSource() {
- return this.nonJtaDataSource;
- }
-
- public void setNonJtaDataSource(String newNonJtaDataSource) {
- String old = this.nonJtaDataSource;
- this.nonJtaDataSource = newNonJtaDataSource;
-
- this.getPersistenceUnit().setNonJtaDataSource( newNonJtaDataSource);
- this.firePropertyChanged(NON_JTA_DATA_SOURCE_PROPERTY, old, newNonJtaDataSource);
- }
-
- private void nonJtaDataSourceChanged(PropertyChangeEvent event) {
- String newValue = (String) event.getNewValue();
- String old = this.nonJtaDataSource;
- this.nonJtaDataSource = newValue;
- this.firePropertyChanged(NON_JTA_DATA_SOURCE_PROPERTY, old, newValue);
- }
-
- public String getDefaultNonJtaDataSource() {
- return DEFAULT_NON_JTA_DATA_SOURCE;
- }
-
- protected PropertyChangeListener buildNonJtaDataSourceChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- EclipseLinkConnection.this.nonJtaDataSourceChanged(event);
- }
- };
- }
-
- // ********** NativeSql **********
- public Boolean getNativeSql() {
- return this.nativeSql;
- }
-
- public void setNativeSql(Boolean newNativeSql) {
- Boolean old = this.nativeSql;
- this.nativeSql = newNativeSql;
- this.putProperty(NATIVE_SQL_PROPERTY, newNativeSql);
- this.firePropertyChanged(NATIVE_SQL_PROPERTY, old, newNativeSql);
- }
-
- private void nativeSqlChanged(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.nativeSql;
- this.nativeSql = newValue;
- this.firePropertyChanged(event.getAspectName(), old, newValue);
- }
-
- public Boolean getDefaultNativeSql() {
- return DEFAULT_NATIVE_SQL;
- }
-
- // ********** BatchWriting **********
-
- public BatchWriting getBatchWriting() {
- return this.batchWriting;
- }
-
- public void setBatchWriting(BatchWriting newBatchWriting) {
- BatchWriting old = this.batchWriting;
- this.batchWriting = newBatchWriting;
- this.putProperty(BATCH_WRITING_PROPERTY, newBatchWriting);
- this.firePropertyChanged(BATCH_WRITING_PROPERTY, old, newBatchWriting);
- }
-
- private void batchWritingChanged(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- BatchWriting newValue = getEnumValueOf(stringValue, BatchWriting.values());
- BatchWriting old = this.batchWriting;
- this.batchWriting = newValue;
- this.firePropertyChanged(event.getAspectName(), old, newValue);
- }
-
- public BatchWriting getDefaultBatchWriting() {
- return DEFAULT_BATCH_WRITING;
- }
-
- // ********** CacheStatements **********
- public Boolean getCacheStatements() {
- return this.cacheStatements;
- }
-
- public void setCacheStatements(Boolean newCacheStatements) {
- Boolean old = this.cacheStatements;
- this.cacheStatements = newCacheStatements;
- this.putProperty(CACHE_STATEMENTS_PROPERTY, newCacheStatements);
- this.firePropertyChanged(CACHE_STATEMENTS_PROPERTY, old, newCacheStatements);
- }
-
- private void cacheStatementsChanged(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.cacheStatements;
- this.cacheStatements = newValue;
- this.firePropertyChanged(event.getAspectName(), old, newValue);
- }
-
- public Boolean getDefaultCacheStatements() {
- return DEFAULT_CACHE_STATEMENTS;
- }
-
- // ********** CacheStatementsSize **********
- public Integer getCacheStatementsSize() {
- return this.cacheStatementsSize;
- }
-
- public void setCacheStatementsSize(Integer newCacheStatementsSize) {
- 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Integer newValue = getIntegerValueOf(stringValue);
-
- Integer old = this.cacheStatementsSize;
- this.cacheStatementsSize = newValue;
- this.firePropertyChanged(event.getAspectName(), old, newValue);
- }
-
- public Integer getDefaultCacheStatementsSize() {
- return DEFAULT_CACHE_STATEMENTS_SIZE;
- }
-
- // ********** 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(PropertyChangeEvent event) {
- String newValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- String old = this.driver;
- this.driver = newValue;
- this.firePropertyChanged(event.getAspectName(), old, newValue);
- }
-
- public String getDefaultDriver() {
- return DEFAULT_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(PropertyChangeEvent event) {
- String newValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- String old = this.url;
- this.url = newValue;
- this.firePropertyChanged(event.getAspectName(), old, newValue);
- }
-
- public String getDefaultUrl() {
- return DEFAULT_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(PropertyChangeEvent event) {
- String newValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- String old = this.user;
- this.user = newValue;
- this.firePropertyChanged(event.getAspectName(), old, newValue);
- }
-
- public String getDefaultUser() {
- return DEFAULT_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(PropertyChangeEvent event) {
- String newValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- String old = this.password;
- this.password = newValue;
- this.firePropertyChanged(event.getAspectName(), old, newValue);
- }
-
- public String getDefaultPassword() {
- return DEFAULT_PASSWORD;
- }
-
- // ********** BindParameters **********
- public Boolean getBindParameters() {
- return this.bindParameters;
- }
-
- public void setBindParameters(Boolean newBindParameters) {
- Boolean old = this.bindParameters;
- this.bindParameters = newBindParameters;
- this.putProperty(BIND_PARAMETERS_PROPERTY, newBindParameters);
- this.firePropertyChanged(BIND_PARAMETERS_PROPERTY, old, newBindParameters);
- }
-
- private void bindParametersChanged(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.bindParameters;
- this.bindParameters = newValue;
- this.firePropertyChanged(event.getAspectName(), old, newValue);
- }
-
- public Boolean getDefaultBindParameters() {
- return DEFAULT_BIND_PARAMETERS;
- }
-
- // ********** ReadConnectionsShared **********
- public Boolean getReadConnectionsShared() {
- return this.readConnectionsShared;
- }
-
- public void setReadConnectionsShared(Boolean newReadConnectionsShared) {
- 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.readConnectionsShared;
- this.readConnectionsShared = newValue;
- this.firePropertyChanged(event.getAspectName(), old, newValue);
- }
-
- public Boolean getDefaultReadConnectionsShared() {
- return DEFAULT_READ_CONNECTIONS_SHARED;
- }
-
- // ********** ReadConnectionsMin **********
- public Integer getReadConnectionsMin() {
- return this.readConnectionsMin;
- }
-
- public void setReadConnectionsMin(Integer newReadConnectionsMin) {
- 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Integer newValue = getIntegerValueOf(stringValue);
-
- Integer old = this.readConnectionsMin;
- this.readConnectionsMin = newValue;
- this.firePropertyChanged(event.getAspectName(), old, newValue);
- }
-
- public Integer getDefaultReadConnectionsMin() {
- return DEFAULT_READ_CONNECTIONS_MIN;
- }
-
- // ********** ReadConnectionsMax **********
- public Integer getReadConnectionsMax() {
- return this.readConnectionsMax;
- }
-
- public void setReadConnectionsMax(Integer newReadConnectionsMax) {
- 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Integer newValue = getIntegerValueOf(stringValue);
-
- Integer old = this.readConnectionsMax;
- this.readConnectionsMax = newValue;
- this.firePropertyChanged(event.getAspectName(), old, newValue);
- }
-
- public Integer getDefaultReadConnectionsMax() {
- return DEFAULT_READ_CONNECTIONS_MAX;
- }
-
- // ********** WriteConnectionsMin **********
- public Integer getWriteConnectionsMin() {
- return this.writeConnectionsMin;
- }
-
- public void setWriteConnectionsMin(Integer newWriteConnectionsMin) {
- 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Integer newValue = getIntegerValueOf(stringValue);
-
- Integer old = this.writeConnectionsMin;
- this.writeConnectionsMin = newValue;
- this.firePropertyChanged(event.getAspectName(), old, newValue);
- }
-
- public Integer getDefaultWriteConnectionsMin() {
- return DEFAULT_WRITE_CONNECTIONS_MIN;
- }
-
- // ********** WriteConnectionsMax **********
- public Integer getWriteConnectionsMax() {
- return this.writeConnectionsMax;
- }
-
- public void setWriteConnectionsMax(Integer newWriteConnectionsMax) {
- 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Integer newValue = getIntegerValueOf(stringValue);
-
- Integer old = this.writeConnectionsMax;
- this.writeConnectionsMax = newValue;
- this.firePropertyChanged(event.getAspectName(), old, newValue);
- }
-
- public Integer getDefaultWriteConnectionsMax() {
- return DEFAULT_WRITE_CONNECTIONS_MAX;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/Customization.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/Customization.java
deleted file mode 100644
index 238f411d7f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/Customization.java
+++ /dev/null
@@ -1,113 +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.internal.context.persistence.customization;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnitProperties;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.PersistenceUnitProperties;
-
-/**
- * Customization
- */
-public interface Customization extends PersistenceUnitProperties
-{
- Boolean getDefaultThrowExceptions();
- Boolean getThrowExceptions();
- void setThrowExceptions(Boolean newThrowExceptions);
- static final String THROW_EXCEPTIONS_PROPERTY = "throwExceptionsProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_THROW_EXCEPTIONS = "eclipselink.orm.throw.exceptions";
- static final Boolean DEFAULT_THROW_EXCEPTIONS = Boolean.TRUE;
-
- Weaving getDefaultWeaving();
- Weaving getWeaving();
- void setWeaving(Weaving newWeaving);
- static final String WEAVING_PROPERTY = "weavingProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_WEAVING = "eclipselink.weaving";
- static final Weaving DEFAULT_WEAVING = Weaving.true_;
-
- Boolean getDefaultWeavingLazy();
- Boolean getWeavingLazy();
- void setWeavingLazy(Boolean newWeavingLazy);
- static final String WEAVING_LAZY_PROPERTY = "weavingLazyProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_WEAVING_LAZY = "eclipselink.weaving.lazy";
- static final Boolean DEFAULT_WEAVING_LAZY = Boolean.TRUE;
-
- Boolean getDefaultWeavingChangeTracking();
- Boolean getWeavingChangeTracking();
- void setWeavingChangeTracking(Boolean newWeavingChangeTracking);
- static final String WEAVING_CHANGE_TRACKING_PROPERTY = "weavingChangeTrackingProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_WEAVING_CHANGE_TRACKING = "eclipselink.weaving.changetracking";
- static final Boolean DEFAULT_WEAVING_CHANGE_TRACKING = Boolean.TRUE;
-
- Boolean getDefaultWeavingFetchGroups();
- Boolean getWeavingFetchGroups();
- void setWeavingFetchGroups(Boolean newWeavingFetchGroups);
- static final String WEAVING_FETCH_GROUPS_PROPERTY = "weavingFetchGroupsProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_WEAVING_FETCH_GROUPS = "eclipselink.weaving.fetchgroups";
- static final Boolean DEFAULT_WEAVING_FETCH_GROUPS = Boolean.TRUE;
-
- Boolean getDefaultWeavingInternal();
- Boolean getWeavingInternal();
- void setWeavingInternal(Boolean newWeavingInternal);
- static final String WEAVING_INTERNAL_PROPERTY = "weavingInternalProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_WEAVING_INTERNAL = "eclipselink.weaving.internal";
- static final Boolean DEFAULT_WEAVING_INTERNAL = Boolean.TRUE;
-
- Boolean getDefaultWeavingEager();
- Boolean getWeavingEager();
- void setWeavingEager(Boolean newWeavingEager);
- static final String WEAVING_EAGER_PROPERTY = "weavingEagerProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_WEAVING_EAGER = "eclipselink.weaving.eager";
- static final Boolean DEFAULT_WEAVING_EAGER = Boolean.FALSE;
-
- String getDefaultDescriptorCustomizer();
- String getDescriptorCustomizer(String entityName);
- void setDescriptorCustomizer(String newDescriptorCustomizer, String entityName);
- static final String DESCRIPTOR_CUSTOMIZER_PROPERTY = "descriptorCustomizerProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_DESCRIPTOR_CUSTOMIZER = "eclipselink.descriptor.customizer.";
- static final String DEFAULT_DESCRIPTOR_CUSTOMIZER = null; // no default
-
- ListIterator<ClassRef> sessionCustomizers();
- int sessionCustomizersSize();
- boolean sessionCustomizerExists(String sessionCustomizerClassName);
- ClassRef addSessionCustomizer(String newSessionCustomizerClassName);
- void removeSessionCustomizer(ClassRef classRef);
- static final String SESSION_CUSTOMIZER_LIST_PROPERTY = "sessionCustomizerListProperty";
- static final String SESSION_CUSTOMIZER_PROPERTY = "sessionCustomizerProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_SESSION_CUSTOMIZER = "eclipselink.session.customizer";
-
- ListIterator<String> entities();
- int entitiesSize();
- boolean entityExists(String entity);
- String addEntity(String entity);
- void removeEntity(String entity);
- static final String ENTITIES_LIST_PROPERTY = "entitiesListProperty";
-
- String getDefaultProfiler();
- String getProfiler();
- void setProfiler(String newProfiler);
- void setProfiler(Profiler newProfiler);
- static final String PROFILER_PROPERTY = "profilerProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_PROFILER = "eclipselink.profiler";
- static final String DEFAULT_PROFILER =
- EclipseLinkPersistenceUnitProperties.getEclipseLinkStringValueOf(Profiler.no_profiler);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/CustomizerProperties.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/CustomizerProperties.java
deleted file mode 100644
index def82d949d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/CustomizerProperties.java
+++ /dev/null
@@ -1,87 +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.internal.context.persistence.customization;
-
-import java.io.Serializable;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * CustomizerProperties
- */
-public class CustomizerProperties implements Cloneable, Serializable
-{
- private String entityName;
-
- // ********** EclipseLink properties **********
- private String className;
-
- private static final long serialVersionUID = 1L;
-
- // ********** constructors **********
- public CustomizerProperties(String entityName) {
- this.entityName = entityName;
- }
-
- // ********** behaviors **********
- @Override
- public boolean equals(Object o) {
- if(o == null) {
- return false;
- }
- CustomizerProperties customizer = (CustomizerProperties) o;
- return (
- (this.className == null ?
- customizer.className == null : this.className.equals(customizer.className)));
- }
-
- @Override
- public synchronized CustomizerProperties clone() {
- try {
- return (CustomizerProperties)super.clone();
- }
- catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- public boolean isEmpty() {
- return this.className == null;
- }
-
- // ********** getter/setter **********
- public String getEntityName() {
- return this.entityName;
- }
-
- public String getClassName() {
- return this.className;
- }
-
- public void setClassName(String newClassName) {
- this.className = newClassName;
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- StringTools.buildSimpleToStringOn(this, sb);
- sb.append(" (");
- this.toString(sb);
- sb.append(')');
- return sb.toString();
- }
-
- public void toString(StringBuilder sb) {
- sb.append(" class: ");
- sb.append(this.className);
- sb.append(", entityName: ");
- sb.append(this.entityName);
- }
-} \ 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/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 6a7ca4c363..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/EclipseLinkCustomization.java
+++ /dev/null
@@ -1,696 +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.internal.context.persistence.customization;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.ListIterator;
-import java.util.Map;
-import java.util.Set;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.Property;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnitProperties;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * 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 ArrayList<ClassRef> sessionCustomizers;
- private String profiler; // storing EclipseLinkStringValue since value can be Profiler or custom class
-
- // key = Entity name ; value = Customizer properties
- private Map<String, CustomizerProperties> entitiesCustomizerProperties;
-
- private static final long serialVersionUID = 1L;
-
- // ********** constructors **********
- public EclipseLinkCustomization(PersistenceUnit parent, ListValueModel<Property> propertyListAdapter) {
- super(parent, propertyListAdapter);
- }
-
- // ********** initialization **********
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
- // TOREVIEW - handle incorrect String in persistence.xml
- this.entitiesCustomizerProperties =
- new HashMap<String, CustomizerProperties>();
-
- 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.initializeSessionCustomizersFromPersistenceUnit();
-
- Set<Property> properties =
- this.getPropertiesSetWithPrefix(ECLIPSELINK_DESCRIPTOR_CUSTOMIZER);
- this.initializeEntitiesCustomizerClass(properties);
-
- this.profiler = this.getProfilerProtertyValue();
- }
-
- private void initializeSessionCustomizersFromPersistenceUnit() {
- Set<Property> properties =
- this.getPropertiesSetWithPrefix(ECLIPSELINK_SESSION_CUSTOMIZER);
-
- this.sessionCustomizers = new ArrayList<ClassRef>(properties.size());
- this.initializeSessionCustomizersWith(properties);
- }
-
- private void initializeSessionCustomizersWith(Set<Property> properties) {
- for (Property property : properties) {
- String className = property.getValue();
- try {
- IType sessionCustomizerClass = this.getJpaProject().getJavaProject().findType(className);
- if(sessionCustomizerClass == null) {
- throw new RuntimeException("could not find: \"" + className + "\" in project's classpath");
- }
- ClassRef classRef =
- this.getJpaProject().getJpaPlatform().getJpaFactory().buildClassRef(
- this.getPersistenceUnit(), sessionCustomizerClass.getFullyQualifiedName());
- this.sessionCustomizers.add(classRef);
- }
- catch (Exception e) {
- JptEclipseLinkCorePlugin.log(e);
- }
- }
- }
-
- private void initializeEntitiesCustomizerClass(Set<Property> properties) {
- for (Property property : properties) {
- String entityName = this.getEntityName(property);
- this.setCustomizerClass_(property, entityName);
- }
- }
-
- /**
- * Gets the Profiler property from the persistence unit.
- */
- private String getProfilerProtertyValue() {
-
- Profiler standardProfiler = this.getEnumValue(ECLIPSELINK_PROFILER, Profiler.values());
- if( ! this.getPersistenceUnit().containsProperty(ECLIPSELINK_PROFILER)) {
- return null; // no property found
- }
- else if(standardProfiler == null) {
- return this.getStringValue(ECLIPSELINK_PROFILER); // custom profiler
- }
- else {
- return getEclipseLinkStringValueOf(standardProfiler); // a Profiler
- }
- }
-
- // ********** behavior **********
- /**
- * 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_SESSION_CUSTOMIZER,
- SESSION_CUSTOMIZER_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_PROFILER,
- PROFILER_PROPERTY);
-
- // Don't need to initialize propertyNames for:
- // descriptorCustomizerProperty
- }
-
- /**
- * Method used for identifying the given property.
- */
- @Override
- public boolean itemIsProperty(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 propertyIdFor(Property property) {
- try {
- return super.propertyIdFor(property);
- }
- catch (IllegalArgumentException e) {
- if (property.getName().startsWith(ECLIPSELINK_DESCRIPTOR_CUSTOMIZER)) {
- return DESCRIPTOR_CUSTOMIZER_PROPERTY;
- }
- }
- throw new IllegalArgumentException("Illegal property: " + property.toString());
- }
-
- public void propertyChanged(PropertyChangeEvent event) {
- String aspectName = event.getAspectName();
- if (aspectName.equals(THROW_EXCEPTIONS_PROPERTY)) {
- this.throwExceptionsChanged(event);
- }
- else if (aspectName.equals(WEAVING_PROPERTY)) {
- this.weavingChanged(event);
- }
- else if (aspectName.equals(WEAVING_LAZY_PROPERTY)) {
- this.weavingLazyChanged(event);
- }
- else if (aspectName.equals(WEAVING_CHANGE_TRACKING_PROPERTY)) {
- this.weavingChangeTrackingChanged(event);
- }
- else if (aspectName.equals(WEAVING_FETCH_GROUPS_PROPERTY)) {
- this.weavingFetchGroupsChanged(event);
- }
- else if (aspectName.equals(WEAVING_INTERNAL_PROPERTY)) {
- this.weavingInternalChanged(event);
- }
- else if (aspectName.equals(WEAVING_EAGER_PROPERTY)) {
- this.weavingEagerChanged(event);
- }
- else if (aspectName.equals(SESSION_CUSTOMIZER_PROPERTY)) {
- this.sessionCustomizersChanged(event);
- }
- else if (aspectName.equals(DESCRIPTOR_CUSTOMIZER_PROPERTY)) {
- this.descriptorCustomizerChanged(event);
- }
- else if (aspectName.equals(PROFILER_PROPERTY)) {
- this.profilerChanged(event);
- }
- else {
- throw new IllegalArgumentException("Illegal event received - property not applicable: " + aspectName);
- }
- return;
- }
-
-
- // ********** 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.throwExceptions;
- this.throwExceptions = newValue;
- this.firePropertyChanged(event.getAspectName(), 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.weavingLazy;
- this.weavingLazy = newValue;
- this.firePropertyChanged(event.getAspectName(), 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.weavingChangeTracking;
- this.weavingChangeTracking = newValue;
- this.firePropertyChanged(event.getAspectName(), 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.weavingFetchGroups;
- this.weavingFetchGroups = newValue;
- this.firePropertyChanged(event.getAspectName(), 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.weavingInternal;
- this.weavingInternal = newValue;
- this.firePropertyChanged(event.getAspectName(), 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.weavingEager;
- this.weavingEager = newValue;
- this.firePropertyChanged(event.getAspectName(), old, newValue);
- }
-
- public Boolean getDefaultWeavingEager() {
- return DEFAULT_WEAVING_EAGER;
- }
-
- // ********** SessionCustomizers **********
- public ListIterator<ClassRef> sessionCustomizers(){
- return new CloneListIterator<ClassRef>(this.sessionCustomizers);
- }
-
- public int sessionCustomizersSize(){
- return this.sessionCustomizers.size();
- }
-
- public boolean sessionCustomizerExists(String sessionCustomizerClassName) {
-
- for (ClassRef sessionCustomizer : this.sessionCustomizers) {
- if(sessionCustomizer.getClassName().equals(sessionCustomizerClassName)) {
- return true;
- }
- }
- return false;
- }
-
- public ClassRef addSessionCustomizer(String newSessionCustomizerClassName){
-
- if( ! this.sessionCustomizerExists(newSessionCustomizerClassName)) {
- ClassRef classRef =
- this.getJpaProject().getJpaPlatform().getJpaFactory().buildClassRef(
- this.getPersistenceUnit(), newSessionCustomizerClassName);
- this.sessionCustomizers.add(classRef);
- this.putProperty(SESSION_CUSTOMIZER_PROPERTY, classRef.getClassName(), true);
- this.fireListChanged(SESSION_CUSTOMIZER_LIST_PROPERTY);
- return classRef;
- }
- return null;
- }
-
- public void removeSessionCustomizer(ClassRef classRef){
-
- if(this.removeSessionCustomizer(classRef.getClassName()) != null) {
- this.removeProperty(SESSION_CUSTOMIZER_PROPERTY, classRef.getClassName());
- this.fireListChanged(SESSION_CUSTOMIZER_LIST_PROPERTY);
- }
- }
-
- private ClassRef removeSessionCustomizer(String sessionCustomizerClassName){
-
- for ( ListIterator<ClassRef> i = this.sessionCustomizers(); i.hasNext();) {
- ClassRef classRef = i.next();
- if(classRef.getClassName().equals(sessionCustomizerClassName)) {
- this.sessionCustomizers.remove(classRef);
- return classRef;
- }
- }
- return null;
- }
-
- private void sessionCustomizersChanged(PropertyChangeEvent event) {
-
- this.initializeSessionCustomizersFromPersistenceUnit();
- this.fireListChanged(SESSION_CUSTOMIZER_LIST_PROPERTY);
- }
-
- // ********** 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Weaving newValue = getEnumValueOf(stringValue, Weaving.values());
- Weaving old = this.weaving;
- this.weaving = newValue;
- this.firePropertyChanged(event.getAspectName(), old, newValue);
- }
-
- public Weaving getDefaultWeaving() {
- return DEFAULT_WEAVING;
- }
-
- // ********** DescriptorCustomizer **********
-
- public String getDescriptorCustomizer(String entityName) {
- CustomizerProperties customizer = this.customizerPropertiesOf(entityName);
- return (customizer == null) ? null : customizer.getClassName();
- }
-
- public void setDescriptorCustomizer(String newDescriptorCustomizer, String entityName) {
- CustomizerProperties old = this.setCustomizerClass_(newDescriptorCustomizer, entityName);
- this.putStringValue(ECLIPSELINK_DESCRIPTOR_CUSTOMIZER, entityName, newDescriptorCustomizer, false);
- this.firePropertyChanged(DESCRIPTOR_CUSTOMIZER_PROPERTY, old, this.customizerPropertiesOf(entityName));
- }
-
- private void descriptorCustomizerChanged(PropertyChangeEvent event) {
- String entityName;
- Property newProperty = (Property) event.getNewValue();
- // property == null when removed
- entityName = (newProperty == null) ?
- this.getEntityName((Property) event.getOldValue()) : this.getEntityName(newProperty);
- CustomizerProperties old = this.setCustomizerClass_(newProperty, entityName);
- this.firePropertyChanged(event.getAspectName(), old, this.customizerPropertiesOf(entityName));
- }
-
- public String getDefaultDescriptorCustomizer() {
- return DEFAULT_DESCRIPTOR_CUSTOMIZER;
- }
-
-
- // ****** CustomizerProperties *******
-
- /**
- * Convenience method to update the CustomizerClass in entitiesCustomizerProperties map.
- * Returns the old value of CustomizerProperties
- */
- private CustomizerProperties setCustomizerClass_(Property newProperty, String entityName) {
- String newValue = (newProperty == null) ? null : newProperty.getValue();
- return this.setCustomizerClass_(newValue, entityName);
- }
-
- private CustomizerProperties setCustomizerClass_(String newValue, String entityName) {
- CustomizerProperties properties = this.customizerPropertiesOf(entityName);
- CustomizerProperties old = properties.clone();
- properties.setClassName(newValue);
- this.putEntityCustomizerProperties(entityName, properties);
- return old;
- }
-
- /**
- * Returns the CustomizerProperties of the Entity with the given name.
- */
- private CustomizerProperties customizerPropertiesOf(String entityName) {
- CustomizerProperties properties = this.entitiesCustomizerProperties.get(entityName);
- if (properties == null) {
- properties = new CustomizerProperties(entityName);
- }
- return properties;
- }
-
- /**
- * Set all CustomizerProperties to default.
- */
- private void clearCustomizerProperties(String entityName) {
- this.setDescriptorCustomizer(null, entityName);
- }
-
- // ****** convenience methods *******
- /**
- * Put the given Entity CustomizerProperties in this entitiesCustomizerProperties map.
- * @param entityName - Entity name. The entity may be a new or an existing entity.
- * @param properties - Entity CustomizerProperties
- */
- private void putEntityCustomizerProperties(String entityName, CustomizerProperties properties) {
- this.addOrReplacePropertiesForEntity(entityName, properties);
- }
-
-
-
- // ****** entities list *******
-
- public ListIterator<String> entities() {
- return CollectionTools.list(this.entitiesCustomizerProperties.keySet()).listIterator();
- }
-
- public int entitiesSize() {
- return this.entitiesCustomizerProperties.size();
- }
-
- /*
- * Verifies if this entitiesCacheProperties map contains the given Entity.
- */
- public boolean entityExists(String entity) {
- return this.entitiesCustomizerProperties.containsKey(entity);
- }
-
- public String addEntity(String entity) {
- if (entityExists(entity)) {
- throw new IllegalStateException("Entity " + entity + " already exist.");
- }
- return this.addOrReplacePropertiesForEntity(entity, new CustomizerProperties(entity));
- }
-
- /**
- * Adds or Replaces the given Entity CustomizerProperties in
- * this entitiesCustomizerProperties map.
- * If the specified Entity exists and the given CustomizerProperties is empty
- * (i.e. all properties are null) the mapping will be removed from the map.
- * @param entity - Entity name
- * @param properties - Entity CustomizerProperties
- * @return
- */
- private String addOrReplacePropertiesForEntity(String entity, CustomizerProperties properties) {
- if (entityExists(entity)) {
- this.replaceEntity_(entity, properties);
- return null;
- }
- this.entitiesCustomizerProperties.put(entity, properties);
- this.fireListChanged(ENTITIES_LIST_PROPERTY);
- return entity;
- }
-
- /**
- * Replaces the given Entity CustomizerProperties in this
- * entitiesCustomizerProperties map.
- * If the Entity CustomizerProperties is empty (i.e. all properties is null) the
- * mapping will be removed from the map.
- * @param entity - Entity name
- * @param properties - Entity CustomizerProperties
- * @return
- */
- private CustomizerProperties replaceEntity_(String entity, CustomizerProperties properties) {
- CustomizerProperties old = this.entitiesCustomizerProperties.get(entity);
- if (properties.isEmpty()) {
- this.entitiesCustomizerProperties.remove(entity);
- this.fireListChanged(ENTITIES_LIST_PROPERTY);
- }
- else {
- this.entitiesCustomizerProperties.put(entity, properties);
- }
- return old;
- }
-
- public void removeEntity(String entity) {
- if ( ! entityExists(entity)) {
- return;
- }
- this.clearCustomizerProperties(entity);
- this.entitiesCustomizerProperties.remove(entity);
- this.fireListChanged(ENTITIES_LIST_PROPERTY);
- }
-
- // ********** 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_(getEclipseLinkStringValueOf(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 profiler = Profiler.getProfilerFor(newProfiler);
- if(profiler == null) { // custom profiler class
- this.setProfiler_(newProfiler);
- }
- else {
- this.setProfiler(profiler);
- }
- }
-
- 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(PropertyChangeEvent event) {
- String newValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- String old = this.profiler;
- this.profiler = newValue;
- this.firePropertyChanged(event.getAspectName(), old, newValue);
- }
-
- public String getDefaultProfiler() {
- return DEFAULT_PROFILER;
- }
-
-} \ 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/customization/Profiler.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/Profiler.java
deleted file mode 100644
index b3d82956c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/Profiler.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.eclipselink.core.internal.context.persistence.customization;
-
-/**
- * Profiler
- */
-public enum Profiler {
- performance_profiler,
- query_monitor,
- no_profiler;
-
- // EclipseLink value string
- public static final String PERFORMANCE_PROFILER = "PerformanceProfiler";
- public static final String QUERY_MONITOR = "QueryMonitor";
- public static final String NO_PROFILER = "NoProfiler";
-
- /**
- * 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;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/Weaving.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/Weaving.java
deleted file mode 100644
index 0ecfedfdd2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/Weaving.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.eclipselink.core.internal.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/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 836fc91c1d..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 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and 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.core.context.persistence.Property;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnitProperties;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * EclipseLinkGeneralProperties
- */
-public class EclipseLinkGeneralProperties extends EclipseLinkPersistenceUnitProperties
- implements GeneralProperties
-{
- // ********** EclipseLink properties **********
- private Boolean excludeEclipselinkOrm;
-
- // ********** constructors **********
- public EclipseLinkGeneralProperties(PersistenceUnit parent, ListValueModel<Property> propertyListAdapter) {
- super(parent, propertyListAdapter);
- }
-
- // ********** initialization **********
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
-
- this.excludeEclipselinkOrm =
- this.getBooleanValue(ECLIPSELINK_EXCLUDE_ECLIPSELINK_ORM);
- }
-
-
- // ********** behavior **********
- /**
- * 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);
- }
-
- public void propertyChanged(PropertyChangeEvent event) {
- String aspectName = event.getAspectName();
- if (aspectName.equals(EXCLUDE_ECLIPSELINK_ORM_PROPERTY)) {
- this.excludeEclipselinkOrmChanged(event);
- }
- else {
- throw new IllegalArgumentException("Illegal event received - property not applicable: " + aspectName); //$NON-NLS-1$
- }
- return;
- }
-
-
- // ********** 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.excludeEclipselinkOrm;
- this.excludeEclipselinkOrm = newValue;
- this.firePropertyChanged(event.getAspectName(), 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/general/GeneralProperties.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/general/GeneralProperties.java
deleted file mode 100644
index 6092ac03fc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/general/GeneralProperties.java
+++ /dev/null
@@ -1,28 +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.internal.context.persistence.general;
-
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.PersistenceUnitProperties;
-
-/**
- * GeneralProperties
- */
-public interface GeneralProperties extends PersistenceUnitProperties
-{
-
- Boolean getDefaultExcludeEclipselinkOrm();
- Boolean getExcludeEclipselinkOrm();
- void setExcludeEclipselinkOrm(Boolean newExcludeEclipselinkOrm);
- static final String EXCLUDE_ECLIPSELINK_ORM_PROPERTY = "excludeEclipselinkOrmProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_EXCLUDE_ECLIPSELINK_ORM = "eclipselink.exclude-eclipselink-orm";
- 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/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 1f50d82e9c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/logging/EclipseLinkLogging.java
+++ /dev/null
@@ -1,349 +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.internal.context.persistence.logging;
-
-import java.util.Map;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.Property;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnitProperties;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * 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, ListValueModel<Property> propertyListAdapter) {
- super(parent, propertyListAdapter);
- }
-
- // ********** 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() {
-
- Logger standardLogger = this.getEnumValue(ECLIPSELINK_LOGGER, Logger.values());
- if( ! this.getPersistenceUnit().containsProperty(ECLIPSELINK_LOGGER)) {
- return null; // no property found
- }
- else if(standardLogger == null) {
- return this.getStringValue(ECLIPSELINK_LOGGER); // custom logger
- }
- else {
- return getEclipseLinkStringValueOf(standardLogger); // a Logger
- }
- }
-
- // ********** behavior **********
- /**
- * 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);
- }
-
- public void propertyChanged(PropertyChangeEvent event) {
- String aspectName = event.getAspectName();
- if (aspectName.equals(LEVEL_PROPERTY)) {
- this.levelChanged(event);
- }
- else if (aspectName.equals(TIMESTAMP_PROPERTY)) {
- this.timestampChanged(event);
- }
- else if (aspectName.equals(THREAD_PROPERTY)) {
- this.threadChanged(event);
- }
- else if (aspectName.equals(SESSION_PROPERTY)) {
- this.sessionChanged(event);
- }
- else if (aspectName.equals(EXCEPTIONS_PROPERTY)) {
- this.exceptionsChanged(event);
- }
- else if (aspectName.equals(LOG_FILE_LOCATION_PROPERTY)) {
- this.logFileLocationChanged(event);
- }
- else if (aspectName.equals(LOGGER_PROPERTY)) {
- this.loggerChanged(event);
- }
- else {
- throw new IllegalArgumentException("Illegal event received - property not applicable: " + aspectName);
- }
- return;
- }
-
- // ********** 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- LoggingLevel newValue = getEnumValueOf(stringValue, LoggingLevel.values());
- LoggingLevel old = this.level;
- this.level = newValue;
- this.firePropertyChanged(event.getAspectName(), 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.timestamp;
- this.timestamp = newValue;
- this.firePropertyChanged(event.getAspectName(), 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.thread;
- this.thread = newValue;
- this.firePropertyChanged(event.getAspectName(), 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.session;
- this.session = newValue;
- this.firePropertyChanged(event.getAspectName(), 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.exceptions;
- this.exceptions = newValue;
- this.firePropertyChanged(event.getAspectName(), 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 = newLogFileLocation;
- this.putProperty(LOG_FILE_LOCATION_PROPERTY, newLogFileLocation);
- this.firePropertyChanged(LOG_FILE_LOCATION_PROPERTY, old, newLogFileLocation);
- }
-
- private void logFileLocationChanged(PropertyChangeEvent event) {
- String newValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- String old = this.logFileLocation;
- this.logFileLocation = newValue;
- this.firePropertyChanged(event.getAspectName(), 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_(getEclipseLinkStringValueOf(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_((String) null);
- return;
- }
- Logger logger = Logger.getLoggerFor(newLogger);
- if(logger == null) { // custom Logger class
- this.setLogger_(newLogger);
- }
- else {
- this.setLogger(logger);
- }
- }
-
- 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(PropertyChangeEvent event) {
- String newValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- String old = this.logger;
- this.logger = newValue;
- this.firePropertyChanged(event.getAspectName(), 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/logging/Logger.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/logging/Logger.java
deleted file mode 100644
index 30aabea987..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/logging/Logger.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.eclipselink.core.internal.context.persistence.logging;
-
-/**
- * Logger
- */
-public enum Logger {
- default_logger,
- java_logger,
- server_logger;
-
- // EclipseLink value string
- public static final String DEFAULT_LOGGER = "DefaultLogger";
- public static final String JAVA_LOGGER = "JavaLogger";
- public static final String SERVER_LOGGER = "ServerLogger";
-
- /**
- * 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;
- }
-} \ 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/logging/Logging.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/logging/Logging.java
deleted file mode 100644
index 25590109ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/logging/Logging.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.eclipselink.core.internal.context.persistence.logging;
-
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnitProperties;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.PersistenceUnitProperties;
-
-/**
- * Logging
- */
-public interface Logging extends PersistenceUnitProperties
-{
- LoggingLevel getDefaultLevel();
- LoggingLevel getLevel();
- void setLevel(LoggingLevel level);
- static final String LEVEL_PROPERTY = "levelProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_LEVEL = "eclipselink.logging.level";
- static final LoggingLevel DEFAULT_LEVEL = LoggingLevel.info;
-
- Boolean getDefaultTimestamp();
- Boolean getTimestamp();
- void setTimestamp(Boolean timestamp);
- static final String TIMESTAMP_PROPERTY = "timestampProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_TIMESTAMP = "eclipselink.logging.timestamp";
- static final Boolean DEFAULT_TIMESTAMP = Boolean.TRUE;
-
- Boolean getDefaultThread();
- Boolean getThread();
- void setThread(Boolean thread);
- static final String THREAD_PROPERTY = "threadProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_THREAD = "eclipselink.logging.thread";
- static final Boolean DEFAULT_THREAD = Boolean.TRUE;
-
- Boolean getDefaultSession();
- Boolean getSession();
- void setSession(Boolean session);
- static final String SESSION_PROPERTY = "sessionProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_SESSION = "eclipselink.logging.session";
- static final Boolean DEFAULT_SESSION = Boolean.TRUE;
-
- Boolean getDefaultExceptions();
- Boolean getExceptions();
- void setExceptions(Boolean exceptions);
- static final String EXCEPTIONS_PROPERTY = "exceptionsProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_EXCEPTIONS = "eclipselink.logging.exceptions";
- static final Boolean DEFAULT_EXCEPTIONS = Boolean.FALSE;
-
- String getDefaultLogFileLocation();
- String getLogFileLocation();
- void setLogFileLocation(String newLogFileLocation);
- static final String LOG_FILE_LOCATION_PROPERTY = "logFileLocationProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_LOG_FILE_LOCATION = "eclipselink.logging.file";
- 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 = "loggerProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_LOGGER = "eclipselink.logging.logger";
- static final String DEFAULT_LOGGER =
- EclipseLinkPersistenceUnitProperties.getEclipseLinkStringValueOf(Logger.default_logger);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/logging/LoggingLevel.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/logging/LoggingLevel.java
deleted file mode 100644
index 156404464c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/logging/LoggingLevel.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.core.internal.context.persistence.logging;
-
-/**
- * LoggingLevel
- */
-public enum LoggingLevel {
- off,
- severe,
- warning,
- info,
- config,
- fine,
- finer,
- finest;
-
- // 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";
-}
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 658c0447bf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/options/EclipseLinkOptions.java
+++ /dev/null
@@ -1,393 +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.internal.context.persistence.options;
-
-import java.util.Map;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.Property;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnitProperties;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * 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, ListValueModel<Property> propertyListAdapter) {
- super(parent, propertyListAdapter);
- }
-
- // ********** 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() {
-
- TargetDatabase standardTargetDatabase = this.getEnumValue(ECLIPSELINK_TARGET_DATABASE, TargetDatabase.values());
- if( ! this.getPersistenceUnit().containsProperty(ECLIPSELINK_TARGET_DATABASE)) {
- return(null);
- }
- else if(standardTargetDatabase == null) {
- return(this.getStringValue(ECLIPSELINK_TARGET_DATABASE)); // custom targetDatabase
- }
- else {
- return(getEclipseLinkStringValueOf(standardTargetDatabase));
- }
- }
-
- protected String getTargetServerFromPersistenceXml() {
-
- TargetServer standardTargetServer = this.getEnumValue(ECLIPSELINK_TARGET_SERVER, TargetServer.values());
- if( ! this.getPersistenceUnit().containsProperty(ECLIPSELINK_TARGET_SERVER)) {
- return(null);
- }
- else if(standardTargetServer == null) {
- return(this.getStringValue(ECLIPSELINK_TARGET_SERVER)); // custom targetServer
- }
- else {
- return(getEclipseLinkStringValueOf(standardTargetServer));
- }
- }
-
- // ********** behavior **********
- /**
- * 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);
- }
-
- public void propertyChanged(PropertyChangeEvent event) {
- String aspectName = event.getAspectName();
- if (aspectName.equals(SESSION_NAME_PROPERTY)) {
- this.sessionNameChanged(event);
- }
- else if (aspectName.equals(SESSIONS_XML_PROPERTY)) {
- this.sessionsXmlChanged(event);
- }
- else if (aspectName.equals(TARGET_DATABASE_PROPERTY)) {
- this.targetDatabaseChanged(event);
- }
- else if (aspectName.equals(TARGET_SERVER_PROPERTY)) {
- this.targetServerChanged(event);
- }
- else if (aspectName.equals(SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY)) {
- this.includeDescriptorQueriesChanged(event);
- }
- else if (aspectName.equals(SESSION_EVENT_LISTENER_PROPERTY)) {
- this.eventListenerChanged(event);
- }
- else if (aspectName.equals(TEMPORAL_MUTABLE_PROPERTY)) {
- this.temporalMutableChanged(event);
- }
- else {
- throw new IllegalArgumentException("Illegal event received - property not applicable: " + aspectName);
- }
- return;
- }
-
- // ********** 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(PropertyChangeEvent event) {
- String newValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- String old = this.sessionName;
- this.sessionName = newValue;
- this.firePropertyChanged(event.getAspectName(), 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(PropertyChangeEvent event) {
- String newValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- String old = this.sessionsXml;
- this.sessionsXml = newValue;
- this.firePropertyChanged(event.getAspectName(), 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.includeDescriptorQueries;
- this.includeDescriptorQueries = newValue;
- this.firePropertyChanged(event.getAspectName(), 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_(getEclipseLinkStringValueOf(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(PropertyChangeEvent event) {
- String newValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- String old = this.targetDatabase;
- this.targetDatabase = newValue;
- this.firePropertyChanged(event.getAspectName(), 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_(getEclipseLinkStringValueOf(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(PropertyChangeEvent event) {
- String newValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- String old = this.targetServer;
- this.targetServer = newValue;
- this.firePropertyChanged(event.getAspectName(), 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(PropertyChangeEvent event) {
- String newValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- String old = this.eventListener;
- this.eventListener = newValue;
- this.firePropertyChanged(event.getAspectName(), 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.temporalMutable;
- this.temporalMutable = newValue;
- this.firePropertyChanged(event.getAspectName(), 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/options/Options.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/options/Options.java
deleted file mode 100644
index 4c39623c52..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/options/Options.java
+++ /dev/null
@@ -1,81 +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.internal.context.persistence.options;
-
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnitProperties;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.PersistenceUnitProperties;
-
-/**
- * Session Options
- */
-public interface Options extends PersistenceUnitProperties
-{
- String getDefaultSessionName();
- String getSessionName();
- void setSessionName(String newSessionName);
- static final String SESSION_NAME_PROPERTY = "sessionNameProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_SESSION_NAME = "eclipselink.session-name";
- static final String DEFAULT_SESSION_NAME = ""; // no default
-
- String getDefaultSessionsXml();
- String getSessionsXml();
- void setSessionsXml(String newSessionsXml);
- static final String SESSIONS_XML_PROPERTY = "sessionsXmlProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_SESSIONS_XML = "eclipselink.sessions-xml";
- static final String DEFAULT_SESSIONS_XML = ""; // no default
-
- Boolean getDefaultIncludeDescriptorQueries();
- Boolean getIncludeDescriptorQueries();
- void setIncludeDescriptorQueries(Boolean newIncludeDescriptorQueries);
- static final String SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY = "includeDescriptorQueriesProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_SESSION_INCLUDE_DESCRIPTOR_QUERIES = "eclipselink.session.include.descriptor.queries";
- 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 = "targetDatabaseProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_TARGET_DATABASE = "eclipselink.target-database";
- static final String DEFAULT_TARGET_DATABASE =
- EclipseLinkPersistenceUnitProperties.getEclipseLinkStringValueOf(TargetDatabase.auto);
-
- String getDefaultTargetServer();
- String getTargetServer();
- void setTargetServer(String newTargetServer);
- void setTargetServer(TargetServer newTargetServer);
- static final String TARGET_SERVER_PROPERTY = "targetServerProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_TARGET_SERVER = "eclipselink.target-server";
- static final String DEFAULT_TARGET_SERVER =
- EclipseLinkPersistenceUnitProperties.getEclipseLinkStringValueOf(TargetServer.none);
-
- String getDefaultEventListener();
- String getEventListener();
- void setEventListener(String newEventListener);
- static final String SESSION_EVENT_LISTENER_PROPERTY = "eventListenerProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_SESSION_EVENT_LISTENER = "eclipselink.session-event-listener";
- static final String DEFAULT_SESSION_EVENT_LISTENER = null; // no default
-
-
- Boolean getDefaultTemporalMutable();
- Boolean getTemporalMutable();
- void setTemporalMutable(Boolean temporalMutable);
- static final String TEMPORAL_MUTABLE_PROPERTY = "temporalMutableProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_TEMPORAL_MUTABLE = "eclipselink.temporal.mutable";
- static final Boolean DEFAULT_TEMPORAL_MUTABLE = Boolean.FALSE;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/options/TargetDatabase.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/options/TargetDatabase.java
deleted file mode 100644
index 6317d9a8cc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/options/TargetDatabase.java
+++ /dev/null
@@ -1,69 +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.internal.context.persistence.options;
-
-/**
- * TargetDatabase
- */
-public enum TargetDatabase {
- attunity,
- auto,
- cloudscape,
- database,
- db2,
- db2mainframe,
- dbase,
- derby,
- hsql,
- informix,
- javadb,
- mysqlplatform,
- oracle,
- 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 MYSQLPLATFORM = "MySQLPlatform";
- static final String ORACLE = "Oracle";
- 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/internal/context/persistence/options/TargetServer.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/options/TargetServer.java
deleted file mode 100644
index e0ea2a033d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/options/TargetServer.java
+++ /dev/null
@@ -1,49 +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.internal.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/internal/context/persistence/schema/generation/DdlGenerationType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/schema/generation/DdlGenerationType.java
deleted file mode 100644
index 6abdfc3f83..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/schema/generation/DdlGenerationType.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.eclipselink.core.internal.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/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 4817223992..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,221 +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.internal.context.persistence.schema.generation;
-
-import java.util.Map;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.Property;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnitProperties;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * 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, ListValueModel<Property> propertyListAdapter) {
- super(parent, propertyListAdapter);
- }
-
- /**
- * 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 propertyChanged(PropertyChangeEvent event) {
- String aspectName = event.getAspectName();
-
- if (aspectName.equals(OUTPUT_MODE_PROPERTY)) {
- this.outputModeChanged(event);
- }
- else if (aspectName.equals(DDL_GENERATION_TYPE_PROPERTY)) {
- this.ddlGenerationTypeChanged(event);
- }
- else if (aspectName.equals(CREATE_FILE_NAME_PROPERTY)) {
- this.createFileNameChanged(event);
- }
- else if (aspectName.equals(DROP_FILE_NAME_PROPERTY)) {
- this.dropFileNameChanged(event);
- }
- else if (aspectName.equals(APPLICATION_LOCATION_PROPERTY)) {
- this.applicationLocationChanged(event);
- }
- else {
- throw new IllegalArgumentException("Illegal event received - property not applicable: " + aspectName);
- }
- return;
- }
-
- // ********** 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- DdlGenerationType newValue = getEnumValueOf(stringValue, DdlGenerationType.values());
- DdlGenerationType old = this.ddlGenerationType;
- this.ddlGenerationType = newValue;
- this.firePropertyChanged(event.getAspectName(), 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(PropertyChangeEvent event) {
- String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- OutputMode newValue = getEnumValueOf(stringValue, OutputMode.values());
- OutputMode old = this.outputMode;
- this.outputMode = newValue;
- this.firePropertyChanged(event.getAspectName(), 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(PropertyChangeEvent event) {
- String newValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- String old = this.createFileName;
- this.createFileName = newValue;
- this.firePropertyChanged(event.getAspectName(), 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(PropertyChangeEvent event) {
- String newValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- String old = this.dropFileName;
- this.dropFileName = newValue;
- this.firePropertyChanged(event.getAspectName(), 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 = newApplicationLocation;
- this.putProperty(APPLICATION_LOCATION_PROPERTY, newApplicationLocation);
- this.firePropertyChanged(APPLICATION_LOCATION_PROPERTY, old, newApplicationLocation);
- }
-
- private void applicationLocationChanged(PropertyChangeEvent event) {
- String newValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
- String old = this.applicationLocation;
- this.applicationLocation = newValue;
- this.firePropertyChanged(event.getAspectName(), 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/context/persistence/schema/generation/OutputMode.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/schema/generation/OutputMode.java
deleted file mode 100644
index a8617da839..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/schema/generation/OutputMode.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.eclipselink.core.internal.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/internal/context/persistence/schema/generation/SchemaGeneration.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/schema/generation/SchemaGeneration.java
deleted file mode 100644
index ef0766a746..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/schema/generation/SchemaGeneration.java
+++ /dev/null
@@ -1,59 +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.internal.context.persistence.schema.generation;
-
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.PersistenceUnitProperties;
-
-/**
- * SchemaGeneration
- */
-public interface SchemaGeneration extends PersistenceUnitProperties
-{
- DdlGenerationType getDefaultDdlGenerationType();
- DdlGenerationType getDdlGenerationType();
- void setDdlGenerationType(DdlGenerationType ddlGenerationType);
- static final String DDL_GENERATION_TYPE_PROPERTY = "ddlGenerationTypeProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_DDL_GENERATION_TYPE = "eclipselink.ddl-generation";
- 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 = "outputModeProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE = "eclipselink.ddl-generation.output-mode";
- 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 = "createFileNameProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_CREATE_FILE_NAME = "eclipselink.create-ddl-jdbc-file-name";
- static final String DEFAULT_SCHEMA_GENERATION_CREATE_FILE_NAME = "createDDL.jdbc";
-
- String getDefaultDropFileName();
- String getDropFileName();
- void setDropFileName(String dropFileName);
- static final String DROP_FILE_NAME_PROPERTY = "dropFileNameProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_DROP_FILE_NAME = "eclipselink.drop-ddl-jdbc-file-name";
- static final String DEFAULT_SCHEMA_GENERATION_DROP_FILE_NAME = "dropDDL.jdbc";
-
- String getDefaultApplicationLocation();
- String getApplicationLocation();
- void setApplicationLocation(String applicationLocation);
- static final String APPLICATION_LOCATION_PROPERTY = "applicationLocationProperty";
- // EclipseLink key string
- static final String ECLIPSELINK_APPLICATION_LOCATION = "eclipselink.application-location";
- static final String 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 37f00f3f40..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/ddlgen/EclipseLinkDDLGenerator.java
+++ /dev/null
@@ -1,469 +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.internal.ddlgen;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.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.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.core.JpaPlatform;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.internal.validation.JpaHelper;
-import org.eclipse.jpt.core.internal.validation.JpaValidator;
-import org.eclipse.jpt.db.ConnectionProfile;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.logging.Logging;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.logging.LoggingLevel;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.schema.generation.DdlGenerationType;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.schema.generation.OutputMode;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.schema.generation.SchemaGeneration;
-import org.eclipse.wst.validation.internal.operations.ValidatorJob;
-
-/**
- * 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:
- * 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 PROPERTIES_FILE_NAME = "login.properties"; //$NON-NLS-1$
- static public String ECLIPSE_HOME = "ECLIPSE_HOME"; //$NON-NLS-1$
- static public String PLUGINS_DIR = "plugins"; //$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();
- }
-
- private EclipseLinkDDLGenerator(String puName, JpaProject jpaProject, String projectLocation, IProgressMonitor monitor) {
- super();
- this.puName = puName;
- this.jpaProject = jpaProject;
- this.projectLocation = projectLocation;
- this.initialize();
- }
-
- // ********** Queries **********
-
- protected JpaPlatform getPlatform() {
- return this.jpaProject.getJpaPlatform();
- }
-
- protected ILaunch getLaunch() {
- return this.launch;
- }
-
- protected ILaunchManager getLaunchManager() {
- return DebugPlugin.getDefault().getLaunchManager();
- }
-
- private IVMInstall getProjectJRE() throws CoreException {
-
- return JavaRuntime.getVMInstall(this.jpaProject.getJavaProject());
- }
-
- // ********** 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;
- try {
- this.initializeLaunchConfiguration(this.projectLocation, propertiesFile);
-
- this.saveLoginProperties(this.projectLocation, propertiesFile);
-
- this.launch = this.saveAndLaunchConfig();
- this.addLaunchListener();
- }
- catch (CoreException e) {
- throw new RuntimeException(e);
- }
- }
-
- private void initializeLaunchConfiguration(String projectLocation, String propertiesFile) throws CoreException {
-
- this.specifyJRE(this.jre.getName(), this.jre.getVMInstallType().getId());
-
- this.specifyProject(this.jpaProject.getProject().getName());
- this.specifyMainType(ECLIPSELINK_DDL_GEN_CLASS);
-
- this.specifyProgramArguments(this.puName, propertiesFile);
- this.specifyWorkingDir(projectLocation);
-
- this.specifyClasspathProperties(this.jpaProject, this.buildJdbcJarPath(), this.buildBootstrapJarPath());
- }
-
- private void addLaunchListener() {
-
- this.getLaunchManager().addLaunchListener(this.buildLaunchListener());
- }
-
- protected void preGenerate() {
- ConnectionProfile cp = this.jpaProject.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);
- }
- ConnectionProfile cp = this.jpaProject.getConnectionProfile();
- if (cp != null) {
- cp.connect();
- }
-
- this.validateProject();
- }
-
- protected void validateProject() {
- JpaValidator validator = new JpaValidator();
- IProject project = this.jpaProject.getProject();
- JpaHelper helper = new JpaHelper();
- helper.setProject(project);
-
- ValidatorJob validatorJob = new ValidatorJob(validator, "JPA Validator", "", project, helper);
- validatorJob.setRule(ResourcesPlugin.getWorkspace().getRoot());
- validatorJob.setUser(true);
- validatorJob.schedule();
- }
-
- private IPath buildJdbcJarPath() {
- return new Path(this.getJpaProjectConnectionDriverJarList());
- }
-
- private String getJpaProjectConnectionDriverJarList() {
- ConnectionProfile cp = this.jpaProject.getConnectionProfile();
- return (cp == null) ? "" : cp.getDriverJarList(); //$NON-NLS-1$
- }
-
- private IPath buildBootstrapJarPath() {
-
- IPath path = JavaCore.getClasspathVariable(ECLIPSE_HOME).append(PLUGINS_DIR);
- File eclipseHome = path.toFile();
-
- List<File> result = new ArrayList<File>();
- this.findFile(ECLIPSELINK_DDL_GEN_JAR, eclipseHome, result);
-
- File ddlGenJarFile = result.get(0);
- try {
- 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) {
- for (File file : directory.listFiles()) {
- if (file.getName().startsWith(fileName)) {
- list.add(file);
- }
- if (file.isDirectory()) {
- findFile(fileName, file, list);
- }
- }
- }
-
- 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
- }
- };
- }
-
- // ********** 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.buildPropertiesPathArgument(propertiesPath));
- programArguments.append(this.buildDebugArgument());
-
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, programArguments.toString());
- }
-
- private void specifyClasspathProperties(JpaProject project, IPath jdbcJar, IPath bootstrapJar) throws CoreException {
- // DDL_GEN jar
- IRuntimeClasspathEntry bootstrapEntry = JavaRuntime.newArchiveRuntimeClasspathEntry(bootstrapJar);
- bootstrapEntry.setClasspathProperty(IRuntimeClasspathEntry.USER_CLASSES);
- // Default Project classpath
- IRuntimeClasspathEntry defaultEntry = JavaRuntime.newDefaultProjectClasspathEntry(project.getJavaProject());
- defaultEntry.setClasspathProperty(IRuntimeClasspathEntry.USER_CLASSES);
- // JDBC jar
- IRuntimeClasspathEntry jdbcEntry = JavaRuntime.newArchiveRuntimeClasspathEntry(jdbcJar);
- jdbcEntry.setClasspathProperty(IRuntimeClasspathEntry.USER_CLASSES);
- // System Library
- IPath systemLibsPath = new Path(JavaRuntime.JRE_CONTAINER);
- IRuntimeClasspathEntry systemLibsEntry = JavaRuntime.newRuntimeContainerClasspathEntry(systemLibsPath, IRuntimeClasspathEntry.STANDARD_CLASSES);
-
- List<String> classpath = new ArrayList<String>();
- classpath.add(bootstrapEntry.getMemento());
- classpath.add(defaultEntry.getMemento());
- classpath.add(jdbcEntry.getMemento());
- classpath.add(systemLibsEntry.getMemento());
-
- 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());
- }
-
- private ILaunch saveAndLaunchConfig() throws CoreException {
- ILaunchConfiguration configuration = this.launchConfig.doSave();
-
- return configuration.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor());
- }
-
- 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);
- }
-
- private void buildConnectionProperties(Properties properties) {
- ConnectionProfile cp = this.jpaProject.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");
- }
-
- private void buildCustomizationProperties(Properties properties) {
- this.putProperty(properties,
- Customization.ECLIPSELINK_THROW_EXCEPTIONS,
- "true");
- }
-
- private void putProperty(Properties properties, String key, String value) {
- properties.put(key, (value == null) ? "" : value);
- }
-
- private void saveLoginProperties(String projectLocation, String propertiesFile) {
- Properties elProperties = new Properties();
-
- this.buildConnectionProperties(elProperties);
-
- this.buildConnectionPoolingProperties(elProperties);
-
- this.buildLoggingProperties(elProperties);
-
- this.buildCustomizationProperties(elProperties);
-
- this.buildDDLModeProperties(elProperties);
-
- this.buildProjectLocationProperty(elProperties, projectLocation);
- try {
- File file = new File(propertiesFile);
- file.createNewFile();
- 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 + "\"";
- }
-
- private String buildPropertiesPathArgument(String propertiesFile) {
- return " -p \"" + propertiesFile + "\"";
- }
-
- private String buildDebugArgument() {
- return (this.isDebug) ? " -debug" : "";
- }
-}
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 cd886ee95d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationDataModelProvider.java
+++ /dev/null
@@ -1,69 +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.internal.operations;
-
-import java.util.Iterator;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-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.operations.OrmFileCreationDataModelProvider;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaPlatform;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
-import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
-
-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 Iterator<IProject> jpaIProjects() {
- return new FilteringIterator<IProject, IProject>(CollectionTools.iterator(ProjectUtilities.getAllProjects())) {
- @Override
- protected boolean accept(IProject project) {
- try {
- if (FacetedProjectFramework.hasProjectFacet(project, JptCorePlugin.FACET_ID)) {
- JpaProject jpaProject = JptCorePlugin.getJpaProject(project);
- return jpaProject != null && jpaProject.getJpaPlatform().getId().equals(EclipseLinkJpaPlatform.ID);
- }
- return false;
- }
- catch (CoreException ce) {
- return false;
- }
- }
- };
- }
-}
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 313a52e930..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationOperation.java
+++ /dev/null
@@ -1,60 +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.internal.operations;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.core.internal.operations.OrmFileCreationOperation;
-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.resource.orm.EclipseLinkOrmResourceModelProvider;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmResource;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntityMappings;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class EclipseLinkOrmFileCreationOperation extends OrmFileCreationOperation
-{
- public EclipseLinkOrmFileCreationOperation(IDataModel dataModel) {
- super(dataModel);
- }
-
-
- @Override
- protected void createMappingFile(IFolder folder) {
- String filePath = getDataModel().getStringProperty(FILE_PATH);
- IFile file = folder.getFile(new Path(filePath));
- final EclipseLinkOrmResourceModelProvider modelProvider =
- EclipseLinkOrmResourceModelProvider.getModelProvider(file);
-
- modelProvider.modify(new Runnable() {
- public void run() {
- EclipseLinkOrmResource ormResource = modelProvider.getResource();
-
- XmlEntityMappings entityMappings = EclipseLinkOrmFactory.eINSTANCE.createXmlEntityMappings();
- entityMappings.setVersion("1.0"); //$NON-NLS-1$
- ormResource.getContents().add(entityMappings);
-
- AccessType defaultAccess = (AccessType) getDataModel().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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/BasicCollectionImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/BasicCollectionImpl.java
deleted file mode 100644
index 7c1b219557..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/BasicCollectionImpl.java
+++ /dev/null
@@ -1,75 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.AbstractResourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-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.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.eclipselink.core.resource.java.BasicCollectionAnnotation;
-
-
-public class BasicCollectionImpl extends AbstractResourceAnnotation<Attribute> implements BasicCollectionAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- protected BasicCollectionImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void update(CompilationUnit astRoot) {
- }
-
- public static class BasicCollectionAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final BasicCollectionAnnotationDefinition INSTANCE = new BasicCollectionAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static BasicCollectionAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private BasicCollectionAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new BasicCollectionImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- 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/BasicMapImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/BasicMapImpl.java
deleted file mode 100644
index 3fd7d631ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/BasicMapImpl.java
+++ /dev/null
@@ -1,75 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.AbstractResourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-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.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.eclipselink.core.resource.java.BasicMapAnnotation;
-
-
-public class BasicMapImpl extends AbstractResourceAnnotation<Attribute> implements BasicMapAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- protected BasicMapImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void update(CompilationUnit astRoot) {
- }
-
- public static class BasicMapAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final BasicMapAnnotationDefinition INSTANCE = new BasicMapAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static BasicMapAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private BasicMapAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new BasicMapImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- 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/CacheImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/CacheImpl.java
deleted file mode 100644
index 9347356538..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/CacheImpl.java
+++ /dev/null
@@ -1,423 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.AbstractResourceAnnotation;
-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.NestedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NumberIntegerExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-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.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;
-import org.eclipse.jpt.eclipselink.core.resource.java.CacheAnnotation;
-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.EclipseLinkJPA;
-import org.eclipse.jpt.eclipselink.core.resource.java.TimeOfDayAnnotation;
-
-
-public class CacheImpl extends AbstractResourceAnnotation<Type> implements CacheAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final AnnotationElementAdapter<String> typeAdapter;
- private final AnnotationElementAdapter<Integer> sizeAdapter;
- private final AnnotationElementAdapter<Boolean> sharedAdapter;
- private final AnnotationElementAdapter<Integer> expiryAdapter;
- private final AnnotationElementAdapter<Boolean> alwaysRefreshAdapter;
- private final AnnotationElementAdapter<Boolean> refreshOnlyIfNewerAdapter;
- private final AnnotationElementAdapter<Boolean> disableHitsAdapter;
- private final AnnotationElementAdapter<String> coordinationTypeAdapter;
- private final MemberAnnotationAdapter expiryTimeOfDayAdapter;
-
- private static final DeclarationAnnotationElementAdapter<String> TYPE_ADAPTER = buildTypeAdapter();
- private static final DeclarationAnnotationElementAdapter<Integer> SIZE_ADAPTER = buildSizeAdapter();
- private static final DeclarationAnnotationElementAdapter<Boolean> SHARED_ADAPTER = buildSharedAdapter();
- private static final DeclarationAnnotationElementAdapter<Integer> EXPIRY_ADAPTER = buildExpiryAdapter();
- private static final DeclarationAnnotationElementAdapter<Boolean> ALWAYS_REFRESH_ADAPTER = buildAlwaysRefreshAdapter();
- private static final DeclarationAnnotationElementAdapter<Boolean> REFRESH_ONLY_IF_NEWER_ADAPTER = buildRefreshOnlyIfNewerAdapter();
- private static final DeclarationAnnotationElementAdapter<Boolean> DISABLE_HITS_ADAPTER = buildDisableHitsAdapter();
- private static final DeclarationAnnotationElementAdapter<String> COORDINATION_TYPE_ADAPTER = buildCoordinationTypeAdapter();
- private static final NestedDeclarationAnnotationAdapter EXPIRY_TIME_OF_DAY_ADAPTER = buildExpiryTimeOfDayAnnotationAdapter();
-
-
- private CacheType type;
- private Integer size;
- private Boolean shared;
- private Integer expiry;
- private TimeOfDayAnnotation expiryTimeOfDay;
- private Boolean alwaysRefresh;
- private Boolean refreshOnlyIfNewer;
- private Boolean disableHits;
- private CacheCoordinationType coordinationType;
-
- protected CacheImpl(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.typeAdapter = new ShortCircuitAnnotationElementAdapter<String>(type, TYPE_ADAPTER);
- this.sizeAdapter = new ShortCircuitAnnotationElementAdapter<Integer>(type, SIZE_ADAPTER);
- this.sharedAdapter = new ShortCircuitAnnotationElementAdapter<Boolean>(type, SHARED_ADAPTER);
- this.expiryAdapter = new ShortCircuitAnnotationElementAdapter<Integer>(type, EXPIRY_ADAPTER);
- this.alwaysRefreshAdapter = new ShortCircuitAnnotationElementAdapter<Boolean>(type, ALWAYS_REFRESH_ADAPTER);
- this.refreshOnlyIfNewerAdapter = new ShortCircuitAnnotationElementAdapter<Boolean>(type, REFRESH_ONLY_IF_NEWER_ADAPTER);
- this.disableHitsAdapter = new ShortCircuitAnnotationElementAdapter<Boolean>(type, DISABLE_HITS_ADAPTER);
- this.coordinationTypeAdapter = new ShortCircuitAnnotationElementAdapter<String>(type, COORDINATION_TYPE_ADAPTER);
- this.expiryTimeOfDayAdapter = new MemberAnnotationAdapter(type, EXPIRY_TIME_OF_DAY_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- //*************** CacheAnnotation implementation ****************
-
- public CacheType getType() {
- return this.type;
- }
-
- public void setType(CacheType newType) {
- if (attributeValueHasNotChanged(this.type, newType)) {
- return;
- }
- CacheType oldType = this.type;
- this.type = newType;
- this.typeAdapter.setValue(CacheType.toJavaAnnotationValue(newType));
- firePropertyChanged(TYPE_PROPERTY, oldType, newType);
- }
-
- public Integer getSize() {
- return this.size;
- }
-
- public void setSize(Integer newSize) {
- if (attributeValueHasNotChanged(this.size, newSize)) {
- return;
- }
- Integer oldSize = this.size;
- this.size = newSize;
- this.sizeAdapter.setValue(newSize);
- firePropertyChanged(SIZE_PROPERTY, oldSize, newSize);
- }
-
- public Boolean getShared() {
- return this.shared;
- }
-
- public void setShared(Boolean newShared) {
- if (attributeValueHasNotChanged(this.shared, newShared)) {
- return;
- }
- Boolean oldShared = this.shared;
- this.shared = newShared;
- this.sharedAdapter.setValue(newShared);
- firePropertyChanged(SHARED_PROPERTY, oldShared, newShared);
- }
-
- public Integer getExpiry() {
- return this.expiry;
- }
-
- public void setExpiry(Integer newExpiry) {
- if (attributeValueHasNotChanged(this.expiry, newExpiry)) {
- return;
- }
- Integer oldExpiry = this.expiry;
- this.expiry = newExpiry;
- this.expiryAdapter.setValue(newExpiry);
- firePropertyChanged(EXPIRY_PROPERTY, oldExpiry, newExpiry);
- }
-
- public TimeOfDayAnnotation getExpiryTimeOfDay() {
- return this.expiryTimeOfDay;
- }
-
- public TimeOfDayAnnotation addExpiryTimeOfDay() {
- if (this.expiryTimeOfDay != null) {
- throw new IllegalStateException("ExpiryTimeOfDay element already exists"); //$NON-NLS-1$
- }
- this.expiryTimeOfDay = createTimeOfDayAnnotation();
- this.expiryTimeOfDayAdapter.newMarkerAnnotation();
- firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, null, this.expiryTimeOfDay);
- return this.expiryTimeOfDay;
- }
-
- public void removeExpiryTimeOfDay() {
- if (this.expiryTimeOfDay == null) {
- throw new IllegalStateException("No expiryTimeOfDay element exists"); //$NON-NLS-1$
- }
- this.expiryTimeOfDay = null;
- this.expiryTimeOfDayAdapter.removeAnnotation();
- firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, this.expiryTimeOfDay, null);
- }
-
- protected void setExpiryTimeOfDay(TimeOfDayAnnotation newExpiryTimeOfDay) {
- TimeOfDayAnnotation oldExpiryTimeOfDay = this.expiryTimeOfDay;
- this.expiryTimeOfDay = newExpiryTimeOfDay;
- firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, oldExpiryTimeOfDay, newExpiryTimeOfDay);
- }
-
- public Boolean getAlwaysRefresh() {
- return this.alwaysRefresh;
- }
-
- public void setAlwaysRefresh(Boolean newAlwaysRefresh) {
- if (attributeValueHasNotChanged(this.alwaysRefresh, newAlwaysRefresh)) {
- return;
- }
- Boolean oldAlwaysRefresh = this.alwaysRefresh;
- this.alwaysRefresh = newAlwaysRefresh;
- this.alwaysRefreshAdapter.setValue(newAlwaysRefresh);
- firePropertyChanged(ALWAYS_REFRESH_PROPERTY, oldAlwaysRefresh, newAlwaysRefresh);
- }
-
- public Boolean getRefreshOnlyIfNewer() {
- return this.refreshOnlyIfNewer;
- }
-
- public void setRefreshOnlyIfNewer(Boolean newRefreshOnlyIfNewer) {
- if (attributeValueHasNotChanged(this.refreshOnlyIfNewer, newRefreshOnlyIfNewer)) {
- return;
- }
- Boolean oldRefreshOnlyIfNewer = this.refreshOnlyIfNewer;
- this.refreshOnlyIfNewer = newRefreshOnlyIfNewer;
- this.refreshOnlyIfNewerAdapter.setValue(newRefreshOnlyIfNewer);
- firePropertyChanged(REFRESH_ONLY_IF_NEWER_PROPERTY, oldRefreshOnlyIfNewer, newRefreshOnlyIfNewer);
- }
-
- public Boolean getDisableHits() {
- return this.disableHits;
- }
-
- public void setDisableHits(Boolean newDisableHits) {
- if (attributeValueHasNotChanged(this.disableHits, newDisableHits)) {
- return;
- }
- Boolean oldDisableHits = this.disableHits;
- this.disableHits = newDisableHits;
- this.disableHitsAdapter.setValue(newDisableHits);
- firePropertyChanged(DISABLE_HITS_PROPERTY, oldDisableHits, newDisableHits);
- }
-
- public CacheCoordinationType getCoordinationType() {
- return this.coordinationType;
- }
-
- public void setCoordinationType(CacheCoordinationType newCoordinationType) {
- if (attributeValueHasNotChanged(this.coordinationType, newCoordinationType)) {
- return;
- }
- CacheCoordinationType oldCoordinationType = this.coordinationType;
- this.coordinationType = newCoordinationType;
- this.coordinationTypeAdapter.setValue(CacheCoordinationType.toJavaAnnotationValue(newCoordinationType));
- firePropertyChanged(TYPE_PROPERTY, oldCoordinationType, newCoordinationType);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(TYPE_ADAPTER, astRoot);
- }
-
- public TextRange getSizeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(SIZE_ADAPTER, astRoot);
- }
-
- public TextRange getSharedTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(SHARED_ADAPTER, astRoot);
- }
-
- public TextRange getExpiryTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(EXPIRY_ADAPTER, astRoot);
- }
-
- public TextRange getExpiryTimeOfDayTextRange(CompilationUnit astRoot) {
- return null;//TODO return this.getElementTextRange(EXPIRY_TIME_OF_DAY_ADAPTER, astRoot);
- }
-
- public TextRange getAlwaysRefreshTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(ALWAYS_REFRESH_ADAPTER, astRoot);
- }
-
- public TextRange getRefreshOnlyIfNewerTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(REFRESH_ONLY_IF_NEWER_ADAPTER, astRoot);
- }
-
- public TextRange getDisablesHitsTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(DISABLE_HITS_ADAPTER, astRoot);
- }
-
- public TextRange getCoordinationTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(COORDINATION_TYPE_ADAPTER, astRoot);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.type = this.type(astRoot);
- this.size = this.size(astRoot);
- this.shared = this.shared(astRoot);
- this.expiry = this.expiry(astRoot);
- this.initializeExpiryTimeOfDay(astRoot);
- this.alwaysRefresh = this.alwaysRefresh(astRoot);
- this.refreshOnlyIfNewer = this.refreshOnlyIfNewer(astRoot);
- this.disableHits = this.disableHits(astRoot);
- this.coordinationType = this.coordinationType(astRoot);
- }
-
- protected void initializeExpiryTimeOfDay(CompilationUnit astRoot) {
- if (this.expiryTimeOfDayAdapter.getAnnotation(astRoot) != null) {
- this.expiryTimeOfDay = createTimeOfDayAnnotation();
- this.expiryTimeOfDay.initialize(astRoot);
- }
- }
-
- public void update(CompilationUnit astRoot) {
- this.setType(this.type(astRoot));
- this.setSize(this.size(astRoot));
- this.setShared(this.shared(astRoot));
- this.setExpiry(this.expiry(astRoot));
- this.updateExpiryTimeOfDay(astRoot);
- this.setAlwaysRefresh(this.alwaysRefresh(astRoot));
- this.setRefreshOnlyIfNewer(this.refreshOnlyIfNewer(astRoot));
- this.setDisableHits(this.disableHits(astRoot));
- this.setCoordinationType(this.coordinationType(astRoot));
- }
-
- protected void updateExpiryTimeOfDay(CompilationUnit astRoot) {
- if (this.expiryTimeOfDayAdapter.getAnnotation(astRoot) == null) {
- this.setExpiryTimeOfDay(null);
- }
- else {
- if (getExpiryTimeOfDay() != null) {
- getExpiryTimeOfDay().update(astRoot);
- }
- else {
- TimeOfDayAnnotation expiryTimeOfDay = createTimeOfDayAnnotation();
- expiryTimeOfDay.initialize(astRoot);
- setExpiryTimeOfDay(expiryTimeOfDay);
- }
- }
- }
-
- protected CacheType type(CompilationUnit astRoot) {
- return CacheType.fromJavaAnnotationValue(this.typeAdapter.getValue(astRoot));
- }
-
- protected Integer size(CompilationUnit astRoot) {
- return this.sizeAdapter.getValue(astRoot);
- }
-
- protected Boolean shared(CompilationUnit astRoot) {
- return this.sharedAdapter.getValue(astRoot);
- }
-
- protected Integer expiry(CompilationUnit astRoot) {
- return this.expiryAdapter.getValue(astRoot);
- }
-
- protected TimeOfDayAnnotation createTimeOfDayAnnotation() {
- return new TimeOfDayImpl(this, getMember(), EXPIRY_TIME_OF_DAY_ADAPTER);
- }
-
- protected Boolean alwaysRefresh(CompilationUnit astRoot) {
- return this.alwaysRefreshAdapter.getValue(astRoot);
- }
-
- protected Boolean refreshOnlyIfNewer(CompilationUnit astRoot) {
- return this.refreshOnlyIfNewerAdapter.getValue(astRoot);
- }
-
- protected Boolean disableHits(CompilationUnit astRoot) {
- return this.disableHitsAdapter.getValue(astRoot);
- }
-
- protected CacheCoordinationType coordinationType(CompilationUnit astRoot) {
- return CacheCoordinationType.fromJavaAnnotationValue(this.coordinationTypeAdapter.getValue(astRoot));
- }
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildTypeAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.CACHE__TYPE);
- }
-
- private static DeclarationAnnotationElementAdapter<Integer> buildSizeAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.CACHE__SIZE, NumberIntegerExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildSharedAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.CACHE__SHARED, BooleanExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Integer> buildExpiryAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.CACHE__EXPIRY, NumberIntegerExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildAlwaysRefreshAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.CACHE__ALWAYS_REFRESH, BooleanExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildRefreshOnlyIfNewerAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.CACHE__REFRESH_ONLY_IF_NEWER, BooleanExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildDisableHitsAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.CACHE__DISABLE_HITS, BooleanExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildCoordinationTypeAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.CACHE__COORDINATION_TYPE);
- }
-
- private static NestedDeclarationAnnotationAdapter buildExpiryTimeOfDayAnnotationAdapter() {
- return new NestedDeclarationAnnotationAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.CACHE__EXPIRY_TIME_OF_DAY, EclipseLinkJPA.TIME_OF_DAY);
- }
-
- public static class CacheAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final CacheAnnotationDefinition INSTANCE = new CacheAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static CacheAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private CacheAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new CacheImpl((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullCacheAnnotation((JavaResourcePersistentType) parent);
- }
-
- 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/ChangeTrackingImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ChangeTrackingImpl.java
deleted file mode 100644
index 8a17d8eed4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ChangeTrackingImpl.java
+++ /dev/null
@@ -1,123 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.AbstractResourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-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.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;
-import org.eclipse.jpt.eclipselink.core.resource.java.ChangeTrackingAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.ChangeTrackingType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJPA;
-
-
-public class ChangeTrackingImpl extends AbstractResourceAnnotation<Type> implements ChangeTrackingAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final AnnotationElementAdapter<String> valueAdapter;
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
-
-
- private ChangeTrackingType value;
-
- protected ChangeTrackingImpl(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new ShortCircuitAnnotationElementAdapter<String>(type, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- //*************** CacheAnnotation implementation ****************
-
- public ChangeTrackingType getValue() {
- return this.value;
- }
-
- public void setValue(ChangeTrackingType newValue) {
- if (attributeValueHasNotChanged(this.value, newValue)) {
- return;
- }
- ChangeTrackingType oldValue = this.value;
- this.value = newValue;
- this.valueAdapter.setValue(ChangeTrackingType.toJavaAnnotationValue(newValue));
- firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
- }
-
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.value(astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setValue(this.value(astRoot));
- }
-
- protected ChangeTrackingType value(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, EclipseLinkJPA.CHANGE_TRACKING__VALUE, false);
- }
-
- public static class ChangeTrackingAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final ChangeTrackingAnnotationDefinition INSTANCE = new ChangeTrackingAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static ChangeTrackingAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private ChangeTrackingAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new ChangeTrackingImpl((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- 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/ConversionValueImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ConversionValueImpl.java
deleted file mode 100644
index fb09fb8f15..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ConversionValueImpl.java
+++ /dev/null
@@ -1,152 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.AbstractResourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-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.ShortCircuitAnnotationElementAdapter;
-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.ConversionValueAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJPA;
-import org.eclipse.jpt.eclipselink.core.resource.java.NestableConversionValue;
-import org.eclipse.jpt.eclipselink.core.resource.java.ObjectTypeConverterAnnotation;
-
-
-public class ConversionValueImpl extends AbstractResourceAnnotation<Member> implements ConversionValueAnnotation, NestableConversionValue
-{
- // hold this so we can get the 'dataValue' text range
- private final DeclarationAnnotationElementAdapter<String> dataValueDeclarationAdapter;
- // hold this so we can get the 'objectValue' text range
- private final DeclarationAnnotationElementAdapter<String> objectValueDeclarationAdapter;
-
- private final AnnotationElementAdapter<String> dataValueAdapter;
- private final AnnotationElementAdapter<String> objectValueAdapter;
-
-
- private String dataValue;
- private String objectValue;
-
- public ConversionValueImpl(ObjectTypeConverterAnnotation parent, Member member, IndexedDeclarationAnnotationAdapter idaa) {
- super(parent, member, idaa, new MemberIndexedAnnotationAdapter(member, idaa));
- this.dataValueDeclarationAdapter = this.dataValueAdapter(idaa);
- this.dataValueAdapter = this.buildAdapter(this.dataValueDeclarationAdapter);
- this.objectValueDeclarationAdapter = this.objectValueAdapter(idaa);
- this.objectValueAdapter = this.buildAdapter(this.objectValueDeclarationAdapter);
- }
-
- // ********** initialization **********
- protected AnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new ShortCircuitAnnotationElementAdapter<String>(getMember(), daea);
- }
-
- protected DeclarationAnnotationElementAdapter<String> dataValueAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, EclipseLinkJPA.CONVERSION_VALUE__DATA_VALUE, false);
- }
-
- protected DeclarationAnnotationElementAdapter<String> objectValueAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, EclipseLinkJPA.CONVERSION_VALUE__OBJECT_VALUE, false);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.dataValue = this.dataValue(astRoot);
- this.objectValue = this.objectValue(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public IndexedAnnotationAdapter getAnnotationAdapter() {
- return (IndexedAnnotationAdapter) super.getAnnotationAdapter();
- }
-
- //*************** ConversionValue implementation ****************
- public String getDataValue() {
- return this.dataValue;
- }
-
- public void setDataValue(String newDataValue) {
- if (attributeValueHasNotChanged(this.dataValue, newDataValue)) {
- return;
- }
- String oldDataValue = this.dataValue;
- this.dataValue = newDataValue;
- this.dataValueAdapter.setValue(newDataValue);
- firePropertyChanged(DATA_VALUE_PROPERTY, oldDataValue, newDataValue);
- }
-
- public String getObjectValue() {
- return this.objectValue;
- }
-
- public void setObjectValue(String newObjectValue) {
- if (attributeValueHasNotChanged(this.objectValue, newObjectValue)) {
- return;
- }
- String oldObjectValue = this.objectValue;
- this.objectValue = newObjectValue;
- this.objectValueAdapter.setValue(newObjectValue);
- firePropertyChanged(OBJECT_VALUE_PROPERTY, oldObjectValue, newObjectValue);
- }
-
- public TextRange getDataValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.dataValueDeclarationAdapter, astRoot);
- }
-
- public TextRange getObjectValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.objectValueDeclarationAdapter, astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setDataValue(this.dataValue(astRoot));
- this.setObjectValue(this.objectValue(astRoot));
- }
-
- protected String dataValue(CompilationUnit astRoot) {
- return this.dataValueAdapter.getValue(astRoot);
- }
-
- protected String objectValue(CompilationUnit astRoot) {
- return this.objectValueAdapter.getValue(astRoot);
- }
-
- //************ NestableAnnotation implementation
- public void moveAnnotation(int newIndex) {
- getAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- ConversionValueAnnotation oldConversionValue = (ConversionValueAnnotation) oldAnnotation;
- setDataValue(oldConversionValue.getDataValue());
- setObjectValue(oldConversionValue.getObjectValue());
- }
-
- // ********** static methods **********
-
- static ConversionValueImpl createConversionValue(ObjectTypeConverterAnnotation parent, Member member, DeclarationAnnotationAdapter daa, int index) {
- return new ConversionValueImpl(parent, member, buildConversionValueAnnotationAdapter(daa, index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildConversionValueAnnotationAdapter(DeclarationAnnotationAdapter daa, int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(daa, EclipseLinkJPA.OBJECT_TYPE_CONVERTER__CONVERSION_VALUES, index, EclipseLinkJPA.CONVERSION_VALUE, false);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ConvertImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ConvertImpl.java
deleted file mode 100644
index 0d146c8486..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ConvertImpl.java
+++ /dev/null
@@ -1,121 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.AbstractResourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-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.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.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;
-import org.eclipse.jpt.eclipselink.core.resource.java.ConvertAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJPA;
-
-
-public class ConvertImpl extends AbstractResourceAnnotation<Attribute> implements ConvertAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final AnnotationElementAdapter<String> valueAdapter;
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
-
-
- private String value;
-
- protected ConvertImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new ShortCircuitAnnotationElementAdapter<String>(attribute, VALUE_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.value(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- //*************** Convert implementation ****************
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String newValue) {
- if (attributeValueHasNotChanged(this.value, newValue)) {
- return;
- }
- String oldValue = this.value;
- this.value = newValue;
- this.valueAdapter.setValue(newValue);
- firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setValue(this.value(astRoot));
- }
-
- protected String value(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.CONVERT__VALUE, false, StringExpressionConverter.instance());
- }
-
-
- public static class ConvertAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final ConvertAnnotationDefinition INSTANCE = new ConvertAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static ConvertAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private ConvertAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new ConvertImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- 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/ConverterImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ConverterImpl.java
deleted file mode 100644
index b16e7e65b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ConverterImpl.java
+++ /dev/null
@@ -1,177 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.AbstractResourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.JDTTools;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.StringExpressionConverter;
-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.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.ConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJPA;
-
-
-public class ConverterImpl extends AbstractResourceAnnotation<Member> implements ConverterAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final AnnotationElementAdapter<String> nameAdapter;
- private final AnnotationElementAdapter<String> converterClassAdapter;
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildNameAdapter();
- private static final DeclarationAnnotationElementAdapter<String> CONVERTER_CLASS_ADAPTER = buildConverterClassAdapter();
-
-
- private String name;
- private String converterClass;
- private boolean implementsConverter;
-
- protected ConverterImpl(JavaResourcePersistentMember parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.nameAdapter = new ShortCircuitAnnotationElementAdapter<String>(member, NAME_ADAPTER);
- this.converterClassAdapter = new ShortCircuitAnnotationElementAdapter<String>(member, CONVERTER_CLASS_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.name(astRoot);
- this.converterClass = this.converterClass(astRoot);
- this.implementsConverter = this.implementsConverter(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- //*************** CustomConverter implementation ****************
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- if (attributeValueHasNotChanged(this.name, newName)) {
- return;
- }
- String oldName = this.name;
- this.name = newName;
- this.nameAdapter.setValue(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public String getConverterClass() {
- return this.converterClass;
- }
-
- public void setConverterClass(String newConverterClass) {
- if (attributeValueHasNotChanged(this.converterClass, newConverterClass)) {
- return;
- }
- String oldConverterClass = this.converterClass;
- this.converterClass = newConverterClass;
- this.converterClassAdapter.setValue(newConverterClass);
- firePropertyChanged(CONVERTER_CLASS_PROPERTY, oldConverterClass, newConverterClass);
- }
-
- public boolean implementsConverter() {
- return this.implementsConverter;
- }
-
- protected void setImplementsConverter(boolean newImplementsConverter) {
- boolean oldImplementsConverter = this.implementsConverter;
- this.implementsConverter = newImplementsConverter;
- firePropertyChanged(IMPLEMENTS_CONVERTER_PROPERTY, oldImplementsConverter, newImplementsConverter);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(NAME_ADAPTER, astRoot);
- }
-
- public TextRange getConverterClassTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(CONVERTER_CLASS_ADAPTER, astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setName(this.name(astRoot));
- this.setConverterClass(this.converterClass(astRoot));
- this.setImplementsConverter(this.implementsConverter(astRoot));
- }
-
- protected String name(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- protected String converterClass(CompilationUnit astRoot) {
- return this.converterClassAdapter.getValue(astRoot);
- }
-
- private boolean implementsConverter(CompilationUnit astRoot) {
- if (this.converterClass == null) {
- return false;
- }
- return JDTTools.findTypeInHierarchy(this.converterClassAdapter.getExpression(astRoot), ECLIPSELINK_CONVERTER_CLASS_NAME) != null;
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<String> buildNameAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.CONVERTER__NAME, false, StringExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildConverterClassAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.CONVERTER__CONVERTER_CLASS, false, SimpleTypeStringExpressionConverter.instance());
- }
-
- public static class ConverterAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final ConverterAnnotationDefinition INSTANCE = new ConverterAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static ConverterAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private ConverterAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new ConverterImpl(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- 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/CustomizerImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/CustomizerImpl.java
deleted file mode 100644
index 20b89f0c89..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/CustomizerImpl.java
+++ /dev/null
@@ -1,142 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.AbstractResourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.JDTTools;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-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.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-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.core.utility.jdt.Type;
-import org.eclipse.jpt.eclipselink.core.resource.java.CustomizerAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJPA;
-
-
-public class CustomizerImpl extends AbstractResourceAnnotation<Type> implements CustomizerAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final AnnotationElementAdapter<String> valueAdapter;
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
-
-
- private String value;
- private boolean implementsDescriptorCustomizer;
-
- protected CustomizerImpl(JavaResourcePersistentMember parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new ShortCircuitAnnotationElementAdapter<String>(type, VALUE_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.value(astRoot);
- this.implementsDescriptorCustomizer = this.implementsDescriptorCustomizer(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- //*************** Customizer implementation ****************
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String newValue) {
- if (attributeValueHasNotChanged(this.value, newValue)) {
- return;
- }
- String oldValue = this.value;
- this.value = newValue;
- this.valueAdapter.setValue(newValue);
- firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
- }
-
- public boolean implementsDescriptorCustomizer() {
- return this.implementsDescriptorCustomizer;
- }
-
- protected void setImplementsDescriptorCustomizer(boolean newImplementsDescriptorCustomizer) {
- boolean oldImplementsDescriptorCustomizer = this.implementsDescriptorCustomizer;
- this.implementsDescriptorCustomizer = newImplementsDescriptorCustomizer;
- firePropertyChanged(IMPLEMENTS_DESCRIPTOR_CUSTOMIZER_PROPERTY, oldImplementsDescriptorCustomizer, newImplementsDescriptorCustomizer);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setValue(this.value(astRoot));
- this.setImplementsDescriptorCustomizer(this.implementsDescriptorCustomizer(astRoot));
- }
-
- protected String value(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- private boolean implementsDescriptorCustomizer(CompilationUnit astRoot) {
- if (this.value == null) {
- return false;
- }
- return JDTTools.findTypeInHierarchy(this.valueAdapter.getExpression(astRoot), ECLIPSELINK_DESCRIPTOR_CUSTOMIZER_CLASS_NAME) != null;
- }
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.CUSTOMIZER__VALUE, false, SimpleTypeStringExpressionConverter.instance());
- }
-
- public static class CustomizerAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final CustomizerAnnotationDefinition INSTANCE = new CustomizerAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static CustomizerAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private CustomizerAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new CustomizerImpl(parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- 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/ExistenceCheckingImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ExistenceCheckingImpl.java
deleted file mode 100644
index 546e54b400..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ExistenceCheckingImpl.java
+++ /dev/null
@@ -1,123 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.AbstractResourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-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.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;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJPA;
-import org.eclipse.jpt.eclipselink.core.resource.java.ExistenceCheckingAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.ExistenceType;
-
-
-public class ExistenceCheckingImpl extends AbstractResourceAnnotation<Type> implements ExistenceCheckingAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final AnnotationElementAdapter<String> valueAdapter;
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
-
-
- private ExistenceType value;
-
- protected ExistenceCheckingImpl(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new ShortCircuitAnnotationElementAdapter<String>(type, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- //*************** CacheAnnotation implementation ****************
-
- public ExistenceType getValue() {
- return this.value;
- }
-
- public void setValue(ExistenceType newValue) {
- if (attributeValueHasNotChanged(this.value, newValue)) {
- return;
- }
- ExistenceType oldValue = this.value;
- this.value = newValue;
- this.valueAdapter.setValue(ExistenceType.toJavaAnnotationValue(newValue));
- firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
- }
-
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.value(astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setValue(this.value(astRoot));
- }
-
- protected ExistenceType value(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, EclipseLinkJPA.EXISTENCE_CHECKING__VALUE, false);
- }
-
- public static class ExistenceCheckingAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final ExistenceCheckingAnnotationDefinition INSTANCE = new ExistenceCheckingAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static ExistenceCheckingAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private ExistenceCheckingAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new ExistenceCheckingImpl((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- 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/JoinFetchImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/JoinFetchImpl.java
deleted file mode 100644
index eb1f2d5f79..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/JoinFetchImpl.java
+++ /dev/null
@@ -1,123 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.AbstractResourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-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.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;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJPA;
-import org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchType;
-
-
-public class JoinFetchImpl extends AbstractResourceAnnotation<Attribute> implements JoinFetchAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final AnnotationElementAdapter<String> valueAdapter;
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
-
-
- private JoinFetchType value;
-
- protected JoinFetchImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new ShortCircuitAnnotationElementAdapter<String>(attribute, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- //*************** CacheAnnotation implementation ****************
-
- public JoinFetchType getValue() {
- return this.value;
- }
-
- public void setValue(JoinFetchType newValue) {
- if (attributeValueHasNotChanged(this.value, newValue)) {
- return;
- }
- JoinFetchType oldValue = this.value;
- this.value = newValue;
- this.valueAdapter.setValue(JoinFetchType.toJavaAnnotationValue(newValue));
- firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
- }
-
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.value(astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setValue(this.value(astRoot));
- }
-
- protected JoinFetchType value(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, EclipseLinkJPA.JOIN_FETCH_VALUE, false);
- }
-
- public static class JoinFetchAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final JoinFetchAnnotationDefinition INSTANCE = new JoinFetchAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static JoinFetchAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JoinFetchAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new JoinFetchImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullJoinFetchAnnotation((JavaResourcePersistentAttribute) parent);
- }
-
- 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/MutableImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/MutableImpl.java
deleted file mode 100644
index 1759c4944b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/MutableImpl.java
+++ /dev/null
@@ -1,121 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.AbstractResourceAnnotation;
-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.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-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.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;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJPA;
-import org.eclipse.jpt.eclipselink.core.resource.java.MutableAnnotation;
-
-
-public class MutableImpl extends AbstractResourceAnnotation<Attribute> implements MutableAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final AnnotationElementAdapter<Boolean> valueAdapter;
-
- private static final DeclarationAnnotationElementAdapter<Boolean> VALUE_ADAPTER = buildValueAdapter();
-
-
- private Boolean value;
-
- protected MutableImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new ShortCircuitAnnotationElementAdapter<Boolean>(attribute, VALUE_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.value(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- //*************** Mutable implementation ****************
- public Boolean getValue() {
- return this.value;
- }
-
- public void setValue(Boolean newValue) {
- if (attributeValueHasNotChanged(this.value, newValue)) {
- return;
- }
- Boolean oldValue = this.value;
- this.value = newValue;
- this.valueAdapter.setValue(newValue);
- firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setValue(this.value(astRoot));
- }
-
- protected Boolean value(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<Boolean> buildValueAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.MUTABLE__VALUE, false, BooleanExpressionConverter.instance());
- }
-
-
- public static class MutableAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final MutableAnnotationDefinition INSTANCE = new MutableAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static MutableAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private MutableAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new MutableImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- 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/NullCacheAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullCacheAnnotation.java
deleted file mode 100644
index fb68500af7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullCacheAnnotation.java
+++ /dev/null
@@ -1,193 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.AbstractJavaResourceNode;
-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.eclipselink.core.resource.java.CacheAnnotation;
-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.TimeOfDayAnnotation;
-
-public class NullCacheAnnotation extends AbstractJavaResourceNode implements CacheAnnotation, Annotation
-{
- protected NullCacheAnnotation(JavaResourcePersistentType parent) {
- super(parent);
- }
-
- @Override
- public JavaResourcePersistentType getParent() {
- return (JavaResourcePersistentType) super.getParent();
- }
-
- public String getAnnotationName() {
- return CacheAnnotation.ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation getJdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- protected CacheAnnotation createCacheResource() {
- return (CacheAnnotation) getParent().addSupportingAnnotation(getAnnotationName());
- }
-
- public CacheType getType() {
- return null;
- }
-
- public void setType(CacheType type) {
- if (type != null) {
- createCacheResource().setType(type);
- }
- }
-
- public Integer getSize() {
- return null;
- }
-
- public void setSize(Integer size) {
- if (size != null) {
- createCacheResource().setSize(size);
- }
- }
-
- public Boolean getShared() {
- return null;
- }
-
- public void setShared(Boolean shared) {
- if (shared != null) {
- createCacheResource().setShared(shared);
- }
- }
-
- public Integer getExpiry() {
- return null;
- }
-
- public void setExpiry(Integer expiry) {
- if (expiry != null) {
- createCacheResource().setExpiry(expiry);
- }
- }
-
- public TimeOfDayAnnotation getExpiryTimeOfDay() {
- return null;
- }
-
- public TimeOfDayAnnotation addExpiryTimeOfDay() {
- return createCacheResource().addExpiryTimeOfDay();
- }
-
- public void removeExpiryTimeOfDay() {
-
- }
-
- public Boolean getAlwaysRefresh() {
- return null;
- }
-
- public void setAlwaysRefresh(Boolean alwaysRefresh) {
- if (alwaysRefresh != null) {
- createCacheResource().setAlwaysRefresh(alwaysRefresh);
- }
- }
-
- public Boolean getRefreshOnlyIfNewer() {
- return null;
- }
-
- public void setRefreshOnlyIfNewer(Boolean refreshOnlyIfNewer) {
- if (refreshOnlyIfNewer != null) {
- createCacheResource().setRefreshOnlyIfNewer(refreshOnlyIfNewer);
- }
- }
-
- public Boolean getDisableHits() {
- return null;
- }
-
- public void setDisableHits(Boolean disableHits) {
- if (disableHits != null) {
- createCacheResource().setDisableHits(disableHits);
- }
- }
-
- public CacheCoordinationType getCoordinationType() {
- return null;
- }
-
- public void setCoordinationType(CacheCoordinationType coordinationType) {
- if (coordinationType != null) {
- createCacheResource().setCoordinationType(coordinationType);
- }
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getSizeTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getSharedTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getExpiryTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getExpiryTimeOfDayTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getAlwaysRefreshTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getRefreshOnlyIfNewerTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getDisablesHitsTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getCoordinationTypeTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public void update(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullJoinFetchAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullJoinFetchAnnotation.java
deleted file mode 100644
index 53da2c52df..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullJoinFetchAnnotation.java
+++ /dev/null
@@ -1,79 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.AbstractJavaResourceNode;
-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.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.java.ExistenceCheckingAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchType;
-
-public class NullJoinFetchAnnotation extends AbstractJavaResourceNode implements JoinFetchAnnotation, Annotation
-{
- protected NullJoinFetchAnnotation(JavaResourcePersistentAttribute parent) {
- super(parent);
- }
-
- @Override
- public JavaResourcePersistentType getParent() {
- return (JavaResourcePersistentType) super.getParent();
- }
-
- public String getAnnotationName() {
- return ExistenceCheckingAnnotation.ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation getJdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- protected JoinFetchAnnotation createJoinFetchAnnotation() {
- return (JoinFetchAnnotation) getParent().addSupportingAnnotation(getAnnotationName());
- }
-
- public JoinFetchType getValue() {
- return null;
- }
-
- public void setValue(JoinFetchType value) {
- if (value != null) {
- createJoinFetchAnnotation().setValue(value);
- }
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public void update(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullTransformation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullTransformation.java
deleted file mode 100644
index cd04bf925d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullTransformation.java
+++ /dev/null
@@ -1,93 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.AbstractJavaResourceNode;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.core.resource.java.FetchType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.java.TransformationAnnotation;
-
-
-public class NullTransformation extends AbstractJavaResourceNode implements BasicAnnotation, Annotation
-{
- protected NullTransformation(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation getJdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public String getAnnotationName() {
- return TransformationAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- public JavaResourcePersistentMember getParent() {
- return (JavaResourcePersistentMember) super.getParent();
- }
-
- protected TransformationAnnotation createTransformationResource() {
- getParent().setMappingAnnotation(getAnnotationName());
- return (TransformationAnnotation) getParent().getMappingAnnotation();
- }
-
- public FetchType getFetch() {
- return null;
- }
-
- public void setFetch(FetchType fetch) {
- if (fetch != null) {
- createTransformationResource().setFetch(fetch);
- }
- }
-
- public Boolean getOptional() {
- return null;
- }
-
- public void setOptional(Boolean optional) {
- if (optional != null) {
- createTransformationResource().setOptional(optional);
- }
- }
-
- public void update(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getFetchTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- 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/NullWriteTransformerColumn.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullWriteTransformerColumn.java
deleted file mode 100644
index 4b88b4cb4b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullWriteTransformerColumn.java
+++ /dev/null
@@ -1,81 +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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.NullBaseColumn;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.java.WriteTransformerAnnotation;
-
-
-public class NullWriteTransformerColumn extends NullBaseColumn implements ColumnAnnotation, Annotation
-{
- public NullWriteTransformerColumn(WriteTransformerAnnotation parent) {
- super(parent);
- }
-
- @Override
- public WriteTransformerAnnotation getParent() {
- return (WriteTransformerAnnotation) super.getParent();
- }
-
- public String getAnnotationName() {
- return ColumnAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected ColumnAnnotation createResourceColumn() {
- return getParent().addColumn();
- }
-
- public Integer getLength() {
- return null;
- }
-
- public void setLength(Integer length) {
- if (length != null) {
- createResourceColumn().setLength(length);
- }
- }
-
- public Integer getScale() {
- return null;
- }
-
- public void setScale(Integer scale) {
- if (scale != null) {
- createResourceColumn().setScale(scale);
- }
- }
-
- public Integer getPrecision() {
- return null;
- }
-
- public void setPrecision(Integer precision) {
- if (precision != null) {
- createResourceColumn().setPrecision(precision);
- }
- }
-
- public TextRange getScaleTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getLengthTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getPrecisionTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ObjectTypeConverterImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ObjectTypeConverterImpl.java
deleted file mode 100644
index a149ae9fa1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ObjectTypeConverterImpl.java
+++ /dev/null
@@ -1,392 +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.internal.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.AbstractJavaResourceNode;
-import org.eclipse.jpt.core.internal.resource.java.AbstractResourceAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.ContainerAnnotationTools;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.StringExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.TypeStringExpressionConverter;
-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.ContainerAnnotation;
-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.ConversionValueAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJPA;
-import org.eclipse.jpt.eclipselink.core.resource.java.NestableConversionValue;
-import org.eclipse.jpt.eclipselink.core.resource.java.ObjectTypeConverterAnnotation;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-
-public class ObjectTypeConverterImpl extends AbstractResourceAnnotation<Member> implements ObjectTypeConverterAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final AnnotationElementAdapter<String> nameAdapter;
- private final AnnotationElementAdapter<String> dataTypeAdapter;
- private final AnnotationElementAdapter<String> objectTypeAdapter;
- private final AnnotationElementAdapter<String> defaultObjectValueAdapter;
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildNameAdapter();
- private static final DeclarationAnnotationElementAdapter<String> DATA_TYPE_ADAPTER = buildDataTypeAdapter();
- private static final DeclarationAnnotationElementAdapter<String> OBJECT_TYPE_ADAPTER = buildObjectTypeAdapter();
- private static final DeclarationAnnotationElementAdapter<String> DEFAULT_OBJECT_VALUE_ADAPTER = buildDefaultObjectValueAdapter();
-
-
- private String name;
- private String dataType;
- private String objectType;
- private String defaultObjectValue;
-
- protected final List<NestableConversionValue> conversionValues;
- private final ConversionValuesContainerAnnotation conversionValuesContainerAnnotation;
-
- protected ObjectTypeConverterImpl(JavaResourcePersistentMember parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.nameAdapter = new ShortCircuitAnnotationElementAdapter<String>(member, NAME_ADAPTER);
- this.dataTypeAdapter = new ShortCircuitAnnotationElementAdapter<String>(member, DATA_TYPE_ADAPTER);
- this.objectTypeAdapter = new ShortCircuitAnnotationElementAdapter<String>(member, OBJECT_TYPE_ADAPTER);
- this.defaultObjectValueAdapter = new ShortCircuitAnnotationElementAdapter<String>(member, DEFAULT_OBJECT_VALUE_ADAPTER);
- this.conversionValues = new ArrayList<NestableConversionValue>();
- this.conversionValuesContainerAnnotation = new ConversionValuesContainerAnnotation();
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.name(astRoot);
- this.dataType = this.dataType(astRoot);
- this.objectType = this.objectType(astRoot);
- this.defaultObjectValue = this.defaultObjectValue(astRoot);
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this.conversionValuesContainerAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- //*************** ObjectTypeConverter implementation ****************
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- if (attributeValueHasNotChanged(this.name, newName)) {
- return;
- }
- String oldName = this.name;
- this.name = newName;
- this.nameAdapter.setValue(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public String getDataType() {
- return this.dataType;
- }
-
- public void setDataType(String newDataType) {
- if (attributeValueHasNotChanged(this.dataType, newDataType)) {
- return;
- }
- String oldDataType = this.dataType;
- this.dataType = newDataType;
- this.dataTypeAdapter.setValue(newDataType);
- firePropertyChanged(DATA_TYPE_PROPERTY, oldDataType, newDataType);
- }
-
- public String getObjectType() {
- return this.objectType;
- }
-
- public void setObjectType(String newObjectType) {
- if (attributeValueHasNotChanged(this.objectType, newObjectType)) {
- return;
- }
- String oldObjectType = this.objectType;
- this.objectType = newObjectType;
- this.objectTypeAdapter.setValue(newObjectType);
- firePropertyChanged(OBJECT_TYPE_PROPERTY, oldObjectType, newObjectType);
- }
-
- public String getDefaultObjectValue() {
- return this.defaultObjectValue;
- }
-
- public void setDefaultObjectValue(String newDefaultObjectValue) {
- if (attributeValueHasNotChanged(this.defaultObjectValue, newDefaultObjectValue)) {
- return;
- }
- String oldDefaultObjectValue = this.defaultObjectValue;
- this.defaultObjectValue = newDefaultObjectValue;
- this.defaultObjectValueAdapter.setValue(newDefaultObjectValue);
- firePropertyChanged(DEFAULT_OBJECT_VALUE_PROPERTY, oldDefaultObjectValue, newDefaultObjectValue);
- }
-
- public ListIterator<ConversionValueAnnotation> conversionValues() {
- return new CloneListIterator<ConversionValueAnnotation>(this.conversionValues);
- }
-
- public int conversionValuesSize() {
- return this.conversionValues.size();
- }
-
- public NestableConversionValue conversionValueAt(int index) {
- return this.conversionValues.get(index);
- }
-
- public int indexOfConversionValue(ConversionValueAnnotation conversionValue) {
- return this.conversionValues.indexOf(conversionValue);
- }
-
- public NestableConversionValue addConversionValue(int index) {
- NestableConversionValue conversionValue = (NestableConversionValue) ContainerAnnotationTools.addNestedAnnotation(index, this.conversionValuesContainerAnnotation);
- fireItemAdded(AssociationOverrideAnnotation.JOIN_COLUMNS_LIST, index, conversionValue);
- return conversionValue;
- }
-
- protected void addConversionValue(int index, NestableConversionValue conversionValue) {
- addItemToList(index, conversionValue, this.conversionValues, AssociationOverrideAnnotation.JOIN_COLUMNS_LIST);
- }
-
- public void removeConversionValue(int index) {
- NestableConversionValue conversionValue = this.conversionValues.get(index);
- removeConversionValue(conversionValue);
- conversionValue.removeAnnotation();
- ContainerAnnotationTools.synchAnnotationsAfterRemove(index, this.conversionValuesContainerAnnotation);
- }
-
- protected void removeConversionValue(NestableConversionValue conversionValue) {
- removeItemFromList(conversionValue, this.conversionValues, AssociationOverrideAnnotation.JOIN_COLUMNS_LIST);
- }
-
- public void moveConversionValue(int targetIndex, int sourceIndex) {
- moveConversionValueInternal(targetIndex, sourceIndex);
- ContainerAnnotationTools.synchAnnotationsAfterMove(targetIndex, sourceIndex, this.conversionValuesContainerAnnotation);
- fireItemMoved(AssociationOverrideAnnotation.JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- protected void moveConversionValueInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.conversionValues, targetIndex, sourceIndex);
- }
-
- protected NestableConversionValue createConversionValue(int index) {
- return ConversionValueImpl.createConversionValue(this, getMember(), getDeclarationAnnotationAdapter(), index);
- }
-
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(NAME_ADAPTER, astRoot);
- }
-
- public TextRange getDataTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(DATA_TYPE_ADAPTER, astRoot);
- }
-
- public TextRange getObjectTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(OBJECT_TYPE_ADAPTER, astRoot);
- }
-
- public TextRange getDefaultObjectValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(DEFAULT_OBJECT_VALUE_ADAPTER, astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setName(this.name(astRoot));
- this.setDataType(this.dataType(astRoot));
- this.setObjectType(this.objectType(astRoot));
- this.setDefaultObjectValue(this.defaultObjectValue(astRoot));
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this.conversionValuesContainerAnnotation);
- }
-
- protected String name(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- protected String dataType(CompilationUnit astRoot) {
- return this.dataTypeAdapter.getValue(astRoot);
- }
-
- protected String objectType(CompilationUnit astRoot) {
- return this.objectTypeAdapter.getValue(astRoot);
- }
-
- protected String defaultObjectValue(CompilationUnit astRoot) {
- return this.defaultObjectValueAdapter.getValue(astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<String> buildNameAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.OBJECT_TYPE_CONVERTER__NAME, false, StringExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildDataTypeAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.OBJECT_TYPE_CONVERTER__DATE_TYPE, false, TypeStringExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildObjectTypeAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.OBJECT_TYPE_CONVERTER__OBJECT_TYPE, false, TypeStringExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildDefaultObjectValueAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE, false, StringExpressionConverter.instance());
- }
-
- public static class ObjectTypeConverterAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final ObjectTypeConverterAnnotationDefinition INSTANCE = new ObjectTypeConverterAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static ObjectTypeConverterAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private ObjectTypeConverterAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new ObjectTypeConverterImpl(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
- private class ConversionValuesContainerAnnotation extends AbstractJavaResourceNode
- implements ContainerAnnotation<NestableConversionValue>
- {
- public ConversionValuesContainerAnnotation() {
- super(ObjectTypeConverterImpl.this);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public NestableConversionValue addInternal(int index) {
- NestableConversionValue conversionValue = ObjectTypeConverterImpl.this.createConversionValue(index);
- ObjectTypeConverterImpl.this.conversionValues.add(index, conversionValue);
- return conversionValue;
- }
-
- public NestableConversionValue add(int index) {
- NestableConversionValue conversionValue = ObjectTypeConverterImpl.this.createConversionValue(index);
- ObjectTypeConverterImpl.this.addConversionValue(index, conversionValue);
- return conversionValue;
- }
-
- public int indexOf(NestableConversionValue conversionValue) {
- return ObjectTypeConverterImpl.this.indexOfConversionValue(conversionValue);
- }
-
- public void move(int targetIndex, int sourceIndex) {
- ObjectTypeConverterImpl.this.moveConversionValue(targetIndex, sourceIndex);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- ObjectTypeConverterImpl.this.moveConversionValueInternal(targetIndex, sourceIndex);
- }
-
- public NestableConversionValue nestedAnnotationAt(int index) {
- return ObjectTypeConverterImpl.this.conversionValueAt(index);
- }
-
- public ListIterator<NestableConversionValue> nestedAnnotations() {
- return new CloneListIterator<NestableConversionValue>(ObjectTypeConverterImpl.this.conversionValues);
- }
-
- public int nestedAnnotationsSize() {
- return conversionValuesSize();
- }
-
- public void remove(int index) {
- this.remove(nestedAnnotationAt(index));
- }
-
- public void remove(NestableConversionValue conversionValue) {
- ObjectTypeConverterImpl.this.removeConversionValue(conversionValue);
- }
-
- public String getAnnotationName() {
- return ObjectTypeConverterImpl.this.getAnnotationName();
- }
-
- public String getNestableAnnotationName() {
- return EclipseLinkJPA.CONVERSION_VALUE;
- }
-
- public NestableConversionValue nestedAnnotationFor(org.eclipse.jdt.core.dom.Annotation jdtAnnotation) {
- for (NestableConversionValue conversionValue : CollectionTools.iterable(nestedAnnotations())) {
- if (jdtAnnotation == conversionValue.getJdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return conversionValue;
- }
- }
- return null;
- }
-
- public org.eclipse.jdt.core.dom.Annotation getJdtAnnotation(CompilationUnit astRoot) {
- return ObjectTypeConverterImpl.this.getJdtAnnotation(astRoot);
- }
-
- public void newAnnotation() {
- ObjectTypeConverterImpl.this.newAnnotation();
- }
-
- public void removeAnnotation() {
- ObjectTypeConverterImpl.this.removeAnnotation();
- }
-
- public void update(CompilationUnit astRoot) {
- ObjectTypeConverterImpl.this.update(astRoot);
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return ObjectTypeConverterImpl.this.getTextRange(astRoot);
- }
-
- public String getElementName() {
- return EclipseLinkJPA.OBJECT_TYPE_CONVERTER__CONVERSION_VALUES;
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getAnnotationName());
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/PrivateOwnedImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/PrivateOwnedImpl.java
deleted file mode 100644
index 2ecaeb2c56..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/PrivateOwnedImpl.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.AbstractResourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-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.resource.java.PrivateOwnedAnnotation;
-
-
-public class PrivateOwnedImpl extends AbstractResourceAnnotation<Attribute> implements PrivateOwnedAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- protected PrivateOwnedImpl(JavaResourceNode parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public void update(CompilationUnit astRoot) {
- //nothing to update
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- public static class PrivateOwnedAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final PrivateOwnedAnnotationDefinition INSTANCE = new PrivateOwnedAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private PrivateOwnedAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new PrivateOwnedImpl(parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- 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/ReadOnlyImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ReadOnlyImpl.java
deleted file mode 100644
index 7a6057ced3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ReadOnlyImpl.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.AbstractResourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-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.core.utility.jdt.Type;
-import org.eclipse.jpt.eclipselink.core.resource.java.ReadOnlyAnnotation;
-
-
-public class ReadOnlyImpl extends AbstractResourceAnnotation<Type> implements ReadOnlyAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- protected ReadOnlyImpl(JavaResourceNode parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public void update(CompilationUnit astRoot) {
- //nothing to update
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- public static class ReadOnlyAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final ReadOnlyAnnotationDefinition INSTANCE = new ReadOnlyAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private ReadOnlyAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new ReadOnlyImpl(parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- 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/ReadTransformerImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ReadTransformerImpl.java
deleted file mode 100644
index 20a66c1ebf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/ReadTransformerImpl.java
+++ /dev/null
@@ -1,152 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.AbstractResourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-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.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.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;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJPA;
-import org.eclipse.jpt.eclipselink.core.resource.java.ReadTransformerAnnotation;
-
-
-public class ReadTransformerImpl extends AbstractResourceAnnotation<Attribute> implements ReadTransformerAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final AnnotationElementAdapter<String> transformerClassAdapter;
- private final AnnotationElementAdapter<String> methodAdapter;
-
- private static final DeclarationAnnotationElementAdapter<String> TRANSFORMER_CLASS_ADAPTER = buildTransformerClassAdapter();
- private static final DeclarationAnnotationElementAdapter<String> METHOD_ADAPTER = buildMethodAdapter();
-
-
- private String transformerClass;
- private String method;
-
- protected ReadTransformerImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.transformerClassAdapter = new ShortCircuitAnnotationElementAdapter<String>(attribute, TRANSFORMER_CLASS_ADAPTER);
- this.methodAdapter = new ShortCircuitAnnotationElementAdapter<String>(attribute, METHOD_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.transformerClass = this.transformerClass(astRoot);
- this.method = this.method(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- //*************** ReadTransformer implementation ****************
- public String getTransformerClass() {
- return this.transformerClass;
- }
-
- public void setTransformerClass(String newTransformerClass) {
- if (attributeValueHasNotChanged(this.transformerClass, newTransformerClass)) {
- return;
- }
- String oldTransformerClass = this.transformerClass;
- this.transformerClass = newTransformerClass;
- this.transformerClassAdapter.setValue(newTransformerClass);
- firePropertyChanged(TRANSFORMER_CLASS_PROPERTY, oldTransformerClass, newTransformerClass);
- }
-
- public String getMethod() {
- return this.method;
- }
-
- public void setMethod(String newMethod) {
- if (attributeValueHasNotChanged(this.method, newMethod)) {
- return;
- }
- String oldMethod = this.method;
- this.method = newMethod;
- this.methodAdapter.setValue(newMethod);
- firePropertyChanged(METHOD_PROPERTY, oldMethod, newMethod);
- }
-
- public TextRange getTransformerClassTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(TRANSFORMER_CLASS_ADAPTER, astRoot);
- }
-
- public TextRange getMethodTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(METHOD_ADAPTER, astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setTransformerClass(this.transformerClass(astRoot));
- this.setMethod(this.method(astRoot));
- }
-
- protected String transformerClass(CompilationUnit astRoot) {
- return this.transformerClassAdapter.getValue(astRoot);
- }
-
- protected String method(CompilationUnit astRoot) {
- return this.methodAdapter.getValue(astRoot);
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<String> buildTransformerClassAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.READ_TRANSFORMER__TRANSFORMER_CLASS, false, SimpleTypeStringExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildMethodAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.READ_TRANSFORMER__METHOD, false);
- }
-
- public static class ReadTransformerAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final ReadTransformerAnnotationDefinition INSTANCE = new ReadTransformerAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static ReadTransformerAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private ReadTransformerAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new ReadTransformerImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- 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/StructConverterImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/StructConverterImpl.java
deleted file mode 100644
index 3f08cdcf6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/StructConverterImpl.java
+++ /dev/null
@@ -1,155 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.AbstractResourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-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.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-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.EclipseLinkJPA;
-import org.eclipse.jpt.eclipselink.core.resource.java.StructConverterAnnotation;
-
-
-public class StructConverterImpl extends AbstractResourceAnnotation<Member> implements StructConverterAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final AnnotationElementAdapter<String> nameAdapter;
- private final AnnotationElementAdapter<String> converterAdapter;
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildNameAdapter();
- private static final DeclarationAnnotationElementAdapter<String> CONVERTER_ADAPTER = buildConverterAdapter();
-
-
- private String name;
- private String converter;
-
- protected StructConverterImpl(JavaResourcePersistentMember parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.nameAdapter = new ShortCircuitAnnotationElementAdapter<String>(member, NAME_ADAPTER);
- this.converterAdapter = new ShortCircuitAnnotationElementAdapter<String>(member, CONVERTER_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.name(astRoot);
- this.converter = this.converter(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- //*************** CustomConverter implementation ****************
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- if (attributeValueHasNotChanged(this.name, newName)) {
- return;
- }
- String oldName = this.name;
- this.name = newName;
- this.nameAdapter.setValue(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public String getConverter() {
- return this.converter;
- }
-
- public void setConverter(String newConverter) {
- if (attributeValueHasNotChanged(this.converter, newConverter)) {
- return;
- }
- String oldConverter = this.converter;
- this.converter = newConverter;
- this.converterAdapter.setValue(newConverter);
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(NAME_ADAPTER, astRoot);
- }
-
- public TextRange getConverterTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(CONVERTER_ADAPTER, astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setName(this.name(astRoot));
- this.setConverter(this.converter(astRoot));
- }
-
- protected String name(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- protected String converter(CompilationUnit astRoot) {
- return this.converterAdapter.getValue(astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<String> buildNameAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.STRUCT_CONVERTER__NAME, false, StringExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildConverterAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.STRUCT_CONVERTER__CONVERTER, false, StringExpressionConverter.instance());
- }
-
- public static class StructConverterAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final StructConverterAnnotationDefinition INSTANCE = new StructConverterAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static StructConverterAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private StructConverterAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new StructConverterImpl(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- 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/TimeOfDayImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/TimeOfDayImpl.java
deleted file mode 100644
index 080e85d7b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/TimeOfDayImpl.java
+++ /dev/null
@@ -1,183 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.AbstractResourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NumberIntegerExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-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.EclipseLinkJPA;
-import org.eclipse.jpt.eclipselink.core.resource.java.TimeOfDayAnnotation;
-
-
-public class TimeOfDayImpl extends AbstractResourceAnnotation<Type> implements TimeOfDayAnnotation
-{
- private final AnnotationElementAdapter<Integer> hourAdapter;
- private final AnnotationElementAdapter<Integer> minuteAdapter;
- private final AnnotationElementAdapter<Integer> secondAdapter;
- private final AnnotationElementAdapter<Integer> millisecondAdapter;
-
- private final DeclarationAnnotationElementAdapter<Integer> hourDeclarationAdapter;
- private final DeclarationAnnotationElementAdapter<Integer> minuteDeclarationAdapter;
- private final DeclarationAnnotationElementAdapter<Integer> secondDeclarationAdapter;
- private final DeclarationAnnotationElementAdapter<Integer> millisecondDeclarationAdapter;
-
-
- private Integer hour;
- private Integer minute;
- private Integer second;
- private Integer millisecond;
-
- protected TimeOfDayImpl(JavaResourceNode parent, Type type, DeclarationAnnotationAdapter daa) {
- super(parent, type, daa);
- this.hourDeclarationAdapter = buildHourAdapter(daa);
- this.hourAdapter = new ShortCircuitAnnotationElementAdapter<Integer>(type, this.hourDeclarationAdapter);
- this.minuteDeclarationAdapter = buildMinuteAdapter(daa);
- this.minuteAdapter = new ShortCircuitAnnotationElementAdapter<Integer>(type, this.minuteDeclarationAdapter);
- this.secondDeclarationAdapter = buildSecondAdapter(daa);
- this.secondAdapter = new ShortCircuitAnnotationElementAdapter<Integer>(type, this.secondDeclarationAdapter);
- this.millisecondDeclarationAdapter = buildMillisecondAdapter(daa);
- this.millisecondAdapter = new ShortCircuitAnnotationElementAdapter<Integer>(type, this.millisecondDeclarationAdapter);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- //*************** TimeOfDayAnnotation implementation ****************
-
- public Integer getHour() {
- return this.hour;
- }
-
- public void setHour(Integer newHour) {
- if (attributeValueHasNotChanged(this.hour, newHour)) {
- return;
- }
- Integer oldHour = this.hour;
- this.hour = newHour;
- this.hourAdapter.setValue(newHour);
- firePropertyChanged(HOUR_PROPERTY, oldHour, newHour);
- }
-
- public Integer getMinute() {
- return this.minute;
- }
-
- public void setMinute(Integer newMinute) {
- if (attributeValueHasNotChanged(this.minute, newMinute)) {
- return;
- }
- Integer oldMinute = this.minute;
- this.minute = newMinute;
- this.minuteAdapter.setValue(newMinute);
- firePropertyChanged(MINUTE_PROPERTY, oldMinute, newMinute);
- }
-
- public Integer getSecond() {
- return this.second;
- }
-
- public void setSecond(Integer newSecond) {
- if (attributeValueHasNotChanged(this.second, newSecond)) {
- return;
- }
- Integer oldSecond = this.second;
- this.second = newSecond;
- this.secondAdapter.setValue(newSecond);
- firePropertyChanged(SECOND_PROPERTY, oldSecond, newSecond);
- }
-
- public Integer getMillisecond() {
- return this.millisecond;
- }
-
- public void setMillisecond(Integer newMillisecond) {
- if (attributeValueHasNotChanged(this.millisecond, newMillisecond)) {
- return;
- }
- Integer oldMillisecond = this.millisecond;
- this.millisecond = newMillisecond;
- this.millisecondAdapter.setValue(newMillisecond);
- firePropertyChanged(MILLISECOND_PROPERTY, oldMillisecond, newMillisecond);
- }
-
- public TextRange getHourTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.hourDeclarationAdapter, astRoot);
- }
-
- public TextRange getMinuteTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.minuteDeclarationAdapter, astRoot);
- }
-
- public TextRange getSecondTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.secondDeclarationAdapter, astRoot);
- }
-
- public TextRange getMillisecondTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.millisecondDeclarationAdapter, astRoot);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.hour = this.hour(astRoot);
- this.minute = this.minute(astRoot);
- this.second = this.second(astRoot);
- this.millisecond = this.millisecond(astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setHour(this.hour(astRoot));
- this.setMinute(this.minute(astRoot));
- this.setSecond(this.second(astRoot));
- this.setMillisecond(this.millisecond(astRoot));
- }
-
- protected Integer hour(CompilationUnit astRoot) {
- return this.hourAdapter.getValue(astRoot);
- }
-
- protected Integer minute(CompilationUnit astRoot) {
- return this.minuteAdapter.getValue(astRoot);
- }
-
- protected Integer second(CompilationUnit astRoot) {
- return this.secondAdapter.getValue(astRoot);
- }
-
- protected Integer millisecond(CompilationUnit astRoot) {
- return this.millisecondAdapter.getValue(astRoot);
- }
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<Integer> buildHourAdapter(DeclarationAnnotationAdapter daa) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(daa, EclipseLinkJPA.TIME_OF_DAY__HOUR, false, NumberIntegerExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Integer> buildMinuteAdapter(DeclarationAnnotationAdapter daa) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(daa, EclipseLinkJPA.TIME_OF_DAY__MINUTE, false, NumberIntegerExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Integer> buildSecondAdapter(DeclarationAnnotationAdapter daa) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(daa, EclipseLinkJPA.TIME_OF_DAY__SECOND, false, NumberIntegerExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Integer> buildMillisecondAdapter(DeclarationAnnotationAdapter daa) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(daa, EclipseLinkJPA.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/TransformationImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/TransformationImpl.java
deleted file mode 100644
index b5b4f85571..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/TransformationImpl.java
+++ /dev/null
@@ -1,156 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.AbstractResourceAnnotation;
-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.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.FetchType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-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.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;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJPA;
-import org.eclipse.jpt.eclipselink.core.resource.java.TransformationAnnotation;
-
-
-public class TransformationImpl extends AbstractResourceAnnotation<Attribute> implements TransformationAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final AnnotationElementAdapter<Boolean> optionalAdapter;
-
- private final AnnotationElementAdapter<String> fetchAdapter;
-
- private static final DeclarationAnnotationElementAdapter<Boolean> OPTIONAL_ADAPTER = buildOptionalAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter();
-
- private Boolean optional;
-
- private FetchType fetch;
-
- protected TransformationImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.optionalAdapter = new ShortCircuitAnnotationElementAdapter<Boolean>(attribute, OPTIONAL_ADAPTER);
- this.fetchAdapter = new ShortCircuitAnnotationElementAdapter<String>(attribute, FETCH_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.optional = this.optional(astRoot);
- this.fetch = this.fetch(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- //*************** Transformation implementation ****************
- public Boolean getOptional() {
- return this.optional;
- }
-
- public void setOptional(Boolean newOptional) {
- if (attributeValueHasNotChanged(this.optional, newOptional)) {
- return;
- }
- Boolean oldOptional = this.optional;
- this.optional = newOptional;
- this.optionalAdapter.setValue(newOptional);
- firePropertyChanged(OPTIONAL_PROPERTY, oldOptional, newOptional);
- }
-
- public FetchType getFetch() {
- return this.fetch;
- }
-
- public void setFetch(FetchType newFetch) {
- if (attributeValueHasNotChanged(this.fetch, newFetch)) {
- return;
- }
- FetchType oldFetch = this.fetch;
- this.fetch = newFetch;
- this.fetchAdapter.setValue(FetchType.toJavaAnnotationValue(newFetch));
- firePropertyChanged(FETCH_PROPERTY, oldFetch, newFetch);
- }
-
- public TextRange getFetchTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(FETCH_ADAPTER, astRoot);
- }
-
- public TextRange getOptionalTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(OPTIONAL_ADAPTER, astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setOptional(this.optional(astRoot));
- this.setFetch(this.fetch(astRoot));
- }
-
- protected FetchType fetch(CompilationUnit astRoot) {
- return FetchType.fromJavaAnnotationValue(this.fetchAdapter.getValue(astRoot));
- }
-
- protected Boolean optional(CompilationUnit astRoot) {
- return this.optionalAdapter.getValue(astRoot);
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<Boolean> buildOptionalAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.TRANSFORMATION__OPTIONAL, false, BooleanExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildFetchAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.TRANSFORMATION__FETCH, false);
- }
-
- public static class TransformationAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final TransformationAnnotationDefinition INSTANCE = new TransformationAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static TransformationAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private TransformationAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new TransformationImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullTransformation(parent);
- }
-
- 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/TypeConverterImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/TypeConverterImpl.java
deleted file mode 100644
index 5431b88800..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/TypeConverterImpl.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.AbstractResourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.StringExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.TypeStringExpressionConverter;
-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.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.EclipseLinkJPA;
-import org.eclipse.jpt.eclipselink.core.resource.java.TypeConverterAnnotation;
-
-
-public class TypeConverterImpl extends AbstractResourceAnnotation<Member> implements TypeConverterAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final AnnotationElementAdapter<String> nameAdapter;
- private final AnnotationElementAdapter<String> dataTypeAdapter;
- private final AnnotationElementAdapter<String> objectTypeAdapter;
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildNameAdapter();
- private static final DeclarationAnnotationElementAdapter<String> DATA_TYPE_ADAPTER = buildDataTypeAdapter();
- private static final DeclarationAnnotationElementAdapter<String> OBJECT_TYPE_ADAPTER = buildObjectTypeAdapter();
-
-
- private String name;
- private String dataType;
- private String objectType;
-
- protected TypeConverterImpl(JavaResourcePersistentMember parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.nameAdapter = new ShortCircuitAnnotationElementAdapter<String>(member, NAME_ADAPTER);
- this.dataTypeAdapter = new ShortCircuitAnnotationElementAdapter<String>(member, DATA_TYPE_ADAPTER);
- this.objectTypeAdapter = new ShortCircuitAnnotationElementAdapter<String>(member, OBJECT_TYPE_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.name(astRoot);
- this.dataType = this.dataType(astRoot);
- this.objectType = this.objectType(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- //*************** TypeConverter implementation ****************
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- if (attributeValueHasNotChanged(this.name, newName)) {
- return;
- }
- String oldName = this.name;
- this.name = newName;
- this.nameAdapter.setValue(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public String getDataType() {
- return this.dataType;
- }
-
- public void setDataType(String newDataType) {
- if (attributeValueHasNotChanged(this.dataType, newDataType)) {
- return;
- }
- String oldDataType = this.dataType;
- this.dataType = newDataType;
- this.dataTypeAdapter.setValue(newDataType);
- firePropertyChanged(DATA_TYPE_PROPERTY, oldDataType, newDataType);
- }
-
- public String getObjectType() {
- return this.objectType;
- }
-
- public void setObjectType(String newObjectType) {
- if (attributeValueHasNotChanged(this.objectType, newObjectType)) {
- return;
- }
- String oldObjectType = this.objectType;
- this.objectType = newObjectType;
- this.objectTypeAdapter.setValue(newObjectType);
- firePropertyChanged(OBJECT_TYPE_PROPERTY, oldObjectType, newObjectType);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(NAME_ADAPTER, astRoot);
- }
-
- public TextRange getDataTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(DATA_TYPE_ADAPTER, astRoot);
- }
-
- public TextRange getObjectTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(OBJECT_TYPE_ADAPTER, astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setName(this.name(astRoot));
- this.setDataType(this.dataType(astRoot));
- this.setObjectType(this.objectType(astRoot));
- }
-
- protected String name(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- protected String dataType(CompilationUnit astRoot) {
- return this.dataTypeAdapter.getValue(astRoot);
- }
-
- protected String objectType(CompilationUnit astRoot) {
- return this.objectTypeAdapter.getValue(astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<String> buildNameAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.TYPE_CONVERTER__NAME, false, StringExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildDataTypeAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.TYPE_CONVERTER__DATE_TYPE, false, TypeStringExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildObjectTypeAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.TYPE_CONVERTER__OBJECT_TYPE, false, TypeStringExpressionConverter.instance());
- }
-
- public static class TypeConverterAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final TypeConverterAnnotationDefinition INSTANCE = new TypeConverterAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static TypeConverterAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private TypeConverterAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new TypeConverterImpl(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- 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/WriteTransformerImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/WriteTransformerImpl.java
deleted file mode 100644
index d841323cf8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/WriteTransformerImpl.java
+++ /dev/null
@@ -1,220 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.AbstractResourceAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.ColumnImpl;
-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.NestedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
-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.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-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.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.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;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJPA;
-import org.eclipse.jpt.eclipselink.core.resource.java.WriteTransformerAnnotation;
-
-
-public class WriteTransformerImpl extends AbstractResourceAnnotation<Attribute> implements WriteTransformerAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final AnnotationElementAdapter<String> transformerClassAdapter;
- private final AnnotationElementAdapter<String> methodAdapter;
- private final MemberAnnotationAdapter columnAdapter;
-
- private static final DeclarationAnnotationElementAdapter<String> TRANSFORMER_CLASS_ADAPTER = buildTransformerClassAdapter();
- private static final DeclarationAnnotationElementAdapter<String> METHOD_ADAPTER = buildMethodAdapter();
-
- private String transformerClass;
- private String method;
- private ColumnImpl column;
-
-
- protected WriteTransformerImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.transformerClassAdapter = new ShortCircuitAnnotationElementAdapter<String>(attribute, TRANSFORMER_CLASS_ADAPTER);
- this.methodAdapter = new ShortCircuitAnnotationElementAdapter<String>(attribute, METHOD_ADAPTER);
- this.columnAdapter = new MemberAnnotationAdapter(getMember(), buildColumnAnnotationAdapter(getDeclarationAnnotationAdapter()));
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.transformerClass = this.transformerClass(astRoot);
- this.method = this.method(astRoot);
- if (this.columnAdapter.getAnnotation(astRoot) != null) {
- this.column = createColumn(this, getMember(), getDeclarationAnnotationAdapter());
- this.column.initialize(astRoot);
- }
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- //*************** WriteTransformer implementation ****************
- public String getTransformerClass() {
- return this.transformerClass;
- }
-
- public void setTransformerClass(String newTransformerClass) {
- if (attributeValueHasNotChanged(this.transformerClass, newTransformerClass)) {
- return;
- }
- String oldTransformerClass = this.transformerClass;
- this.transformerClass = newTransformerClass;
- this.transformerClassAdapter.setValue(newTransformerClass);
- firePropertyChanged(TRANSFORMER_CLASS_PROPERTY, oldTransformerClass, newTransformerClass);
- }
-
- public String getMethod() {
- return this.method;
- }
-
- public void setMethod(String newMethod) {
- if (attributeValueHasNotChanged(this.method, newMethod)) {
- return;
- }
- String oldMethod = this.method;
- this.method = newMethod;
- this.methodAdapter.setValue(newMethod);
- firePropertyChanged(METHOD_PROPERTY, oldMethod, newMethod);
- }
-
- public ColumnAnnotation getNonNullColumn() {
- return (getColumn() != null) ? getColumn() : new NullWriteTransformerColumn(this);
- }
-
- public ColumnAnnotation getColumn() {
- return this.column;
- }
-
- public ColumnAnnotation addColumn() {
- ColumnImpl column = createColumn(this, getMember(), getDeclarationAnnotationAdapter());
- column.newAnnotation();
- setColumn(column);
- return column;
- }
-
- public void removeColumn() {
- this.column.removeAnnotation();
- setColumn(null);
- }
-
- protected void setColumn(ColumnImpl newColumn) {
- ColumnImpl oldColumn = this.column;
- this.column = newColumn;
- firePropertyChanged(WriteTransformerAnnotation.COLUMN_PROPERTY, oldColumn, newColumn);
- }
-
-
- public TextRange getTransformerClassTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(TRANSFORMER_CLASS_ADAPTER, astRoot);
- }
-
- public TextRange getMethodTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(METHOD_ADAPTER, astRoot);
- }
-
- public TextRange getColumnTextRange(CompilationUnit astRoot) {
- if (this.column != null) {
- return this.column.getTextRange(astRoot);
- }
- return getTextRange(astRoot);
- }
-
- public void update(CompilationUnit astRoot) {
- this.setTransformerClass(this.transformerClass(astRoot));
- this.setMethod(this.method(astRoot));
- if (this.columnAdapter.getAnnotation(astRoot) == null) {
- this.setColumn(null);
- }
- else {
- if (getColumn() != null) {
- getColumn().update(astRoot);
- }
- else {
- ColumnImpl column = createColumn(this, getMember(), getDeclarationAnnotationAdapter());
- column.initialize(astRoot);
- this.setColumn(column);
- }
- }
- }
-
- protected String transformerClass(CompilationUnit astRoot) {
- return this.transformerClassAdapter.getValue(astRoot);
- }
-
- protected String method(CompilationUnit astRoot) {
- return this.methodAdapter.getValue(astRoot);
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<String> buildTransformerClassAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.WRITE_TRANSFORMER__TRANSFORMER_CLASS, false, SimpleTypeStringExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildMethodAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, EclipseLinkJPA.WRITE_TRANSFORMER__METHOD, false);
- }
-
- private static DeclarationAnnotationAdapter buildColumnAnnotationAdapter(DeclarationAnnotationAdapter writeTransformerAnnotationAdapter) {
- return new NestedDeclarationAnnotationAdapter(writeTransformerAnnotationAdapter, EclipseLinkJPA.WRITE_TRANSFORMER__COLUMN, JPA.COLUMN, false);
- }
-
- private static ColumnImpl createColumn(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter writeTransformerAnnotationAdapter) {
- return new ColumnImpl(parent, member, buildColumnAnnotationAdapter(writeTransformerAnnotationAdapter));
- }
-
- public static class WriteTransformerAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final WriteTransformerAnnotationDefinition INSTANCE = new WriteTransformerAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static WriteTransformerAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private WriteTransformerAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new WriteTransformerImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/EclipseLinkOrmResourceModelProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/EclipseLinkOrmResourceModelProvider.java
deleted file mode 100644
index 94cd0f7e8f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/EclipseLinkOrmResourceModelProvider.java
+++ /dev/null
@@ -1,89 +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.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.emf.ecore.resource.Resource;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.resource.JpaResourceModelProviderManager;
-import org.eclipse.jpt.core.resource.AbstractResourceModelProvider;
-import org.eclipse.jpt.core.resource.common.JpaXmlResource;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkConstants;
-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.EclipseLinkOrmResource;
-
-public class EclipseLinkOrmResourceModelProvider
- extends AbstractResourceModelProvider<EclipseLinkOrmResource>
-{
- /**
- * (Convenience method) Returns an EclipseLink ORM resource model provider for
- * the given file.
- */
- public static EclipseLinkOrmResourceModelProvider getModelProvider(IFile file) {
- return getModelProvider_(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 EclipseLinkOrmResourceModelProvider getModelProvider(IProject project, String deployLocation) {
- return getModelProvider_(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 EclipseLinkOrmResourceModelProvider getDefaultModelProvider(IProject project) {
- return getModelProvider(project, JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH);
- }
-
- private static EclipseLinkOrmResourceModelProvider getModelProvider_(IProject project, String location) {
- return (EclipseLinkOrmResourceModelProvider) JpaResourceModelProviderManager.instance().getModelProvider(
- project,
- new Path(location),
- JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE);
- }
-
-
- public EclipseLinkOrmResourceModelProvider(IProject project) {
- this(project, new Path(JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH));
- }
-
- public EclipseLinkOrmResourceModelProvider(IProject project, IPath filePath) {
- super(project, filePath);
- }
-
-
- @Override
- protected String getContentTypeDescriber() {
- return JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE;
- }
-
- @Override
- protected void populateRoot(JpaXmlResource resource) {
- XmlEntityMappings entityMappings = EclipseLinkOrmFactory.eINSTANCE.createXmlEntityMappings();
- entityMappings.setVersion(EclipseLinkConstants.VERSION_1_0_TEXT);
- getResourceContents(resource).add(entityMappings);
- }
-
- @Override
- protected EclipseLinkOrmResource ensureCorrectType(Resource resource) throws ClassCastException {
- return (EclipseLinkOrmResource) resource;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/EclipseLinkOrmResourceModelProviderFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/EclipseLinkOrmResourceModelProviderFactory.java
deleted file mode 100644
index 9e29beb5f4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/EclipseLinkOrmResourceModelProviderFactory.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.eclipselink.core.internal.resource.orm;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jpt.core.resource.JpaResourceModelProvider;
-import org.eclipse.jpt.core.resource.JpaResourceModelProviderFactory;
-
-public class EclipseLinkOrmResourceModelProviderFactory
- implements JpaResourceModelProviderFactory
-{
- public JpaResourceModelProvider create(IProject project, IPath filePath) {
- return new EclipseLinkOrmResourceModelProvider(project, filePath);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/BasicCollectionTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/BasicCollectionTranslator.java
deleted file mode 100644
index b18deca31a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/BasicCollectionTranslator.java
+++ /dev/null
@@ -1,49 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class BasicCollectionTranslator extends Translator
- implements EclipseLinkOrmXmlMapper
-{
- private Translator[] children;
-
- public BasicCollectionTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlBasicCollectionImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator()
- };
- }
-
- protected Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/BasicMapTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/BasicMapTranslator.java
deleted file mode 100644
index 3c244c1c84..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/BasicMapTranslator.java
+++ /dev/null
@@ -1,52 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.orm.translators.BasicTranslator;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class BasicMapTranslator extends BasicTranslator
- implements EclipseLinkOrmXmlMapper
-{
- private Translator[] children;
-
- public BasicMapTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlBasicMapImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- @Override
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator()
- };
- }
-
- @Override
- protected Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/CacheTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/CacheTranslator.java
deleted file mode 100644
index 5e058f1962..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/CacheTranslator.java
+++ /dev/null
@@ -1,81 +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.internal.resource.orm.translators;
-
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class CacheTranslator extends Translator
- implements EclipseLinkOrmXmlMapper
-{
- private Translator[] children;
-
-
- public CacheTranslator() {
- super(CACHE, ECLIPSELINK_ORM_PKG.getXmlCacheHolder_Cache());
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createExpiryTranslator(),
- createExpiryTimeOfDayTranslator(),
- createSizeTranslator(),
- createSharedTranslator(),
- createTypeTranslator(),
- createAlwaysRefreshTranslator(),
- createRefreshOnlyIfNewerTranslator(),
- createDisableHitsTranslator(),
- createCoordinationTypeTranslator(),
- };
- }
-
- protected Translator createExpiryTranslator() {
- return new Translator(CACHE__EXPIRY, ECLIPSELINK_ORM_PKG.getXmlCache_Expiry());
- }
-
- protected Translator createExpiryTimeOfDayTranslator() {
- return new ExpiryTimeOfDayTranslator();
- }
-
- protected Translator createSizeTranslator() {
- return new Translator(CACHE__SIZE, ECLIPSELINK_ORM_PKG.getXmlCache_Size(), DOM_ATTRIBUTE);
- }
-
- protected Translator createSharedTranslator() {
- return new Translator(CACHE__SHARED, ECLIPSELINK_ORM_PKG.getXmlCache_Shared(), DOM_ATTRIBUTE);
- }
-
- protected Translator createTypeTranslator() {
- return new Translator(CACHE__TYPE, ECLIPSELINK_ORM_PKG.getXmlCache_Type(), DOM_ATTRIBUTE);
- }
-
- protected Translator createAlwaysRefreshTranslator() {
- return new Translator(CACHE__ALWAYS_REFRESH, ECLIPSELINK_ORM_PKG.getXmlCache_AlwaysRefresh(), DOM_ATTRIBUTE);
- }
-
- protected Translator createRefreshOnlyIfNewerTranslator() {
- return new Translator(CACHE__REFRESH_ONLY_IF_NEWER, ECLIPSELINK_ORM_PKG.getXmlCache_RefreshOnlyIfNewer(), DOM_ATTRIBUTE);
- }
-
- protected Translator createDisableHitsTranslator() {
- return new Translator(CACHE__DISABLE_HITS, ECLIPSELINK_ORM_PKG.getXmlCache_DisableHits(), DOM_ATTRIBUTE);
- }
-
- protected Translator createCoordinationTypeTranslator() {
- return new Translator(CACHE__COORDINATION_TYPE, ECLIPSELINK_ORM_PKG.getXmlCache_CoordinationType(), DOM_ATTRIBUTE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/ConversionValueTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/ConversionValueTranslator.java
deleted file mode 100644
index 45f04b91ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/ConversionValueTranslator.java
+++ /dev/null
@@ -1,52 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class ConversionValueTranslator extends Translator
- implements EclipseLinkOrmXmlMapper
-{
- private Translator[] children;
-
-
- public ConversionValueTranslator() {
- super(CONVERSION_VALUE, ECLIPSELINK_ORM_PKG.getXmlObjectTypeConverter_ConversionValues(), END_TAG_NO_INDENT);
- }
-
- @Override
- public EObject createEMFObject(@SuppressWarnings("unused") String nodeName, @SuppressWarnings("unused") String readAheadName) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlConversionValueImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createDataValueTranslator(),
- createObjectValueTranslator(),
- };
- }
-
- protected Translator createDataValueTranslator() {
- return new Translator(CONVERSION_VALUE__DATA_VALUE, ECLIPSELINK_ORM_PKG.getXmlConversionValue_DataValue(), DOM_ATTRIBUTE);
- }
-
- protected Translator createObjectValueTranslator() {
- return new Translator(CONVERSION_VALUE__OBJECT_VALUE, ECLIPSELINK_ORM_PKG.getXmlConversionValue_ObjectValue(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/ConverterTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/ConverterTranslator.java
deleted file mode 100644
index 024478cb13..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/ConverterTranslator.java
+++ /dev/null
@@ -1,53 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class ConverterTranslator extends Translator
- implements EclipseLinkOrmXmlMapper
-{
- private Translator[] children;
-
-
- public ConverterTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- public EObject createEMFObject(@SuppressWarnings("unused") String nodeName, @SuppressWarnings("unused") String readAheadName) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlConverterImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createClassTranslator(),
- };
- }
-
- protected Translator createNameTranslator() {
- return new Translator(CONVERTER__NAME, ECLIPSELINK_ORM_PKG.getXmlNamedConverter_Name(), DOM_ATTRIBUTE);
- }
-
- protected Translator createClassTranslator() {
- return new Translator(CONVERTER__CLASS, ECLIPSELINK_ORM_PKG.getXmlConverter_ClassName(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/CustomizerTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/CustomizerTranslator.java
deleted file mode 100644
index e3eca6372f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/CustomizerTranslator.java
+++ /dev/null
@@ -1,41 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class CustomizerTranslator extends Translator
- implements EclipseLinkOrmXmlMapper
-{
- private Translator[] children;
-
-
- public CustomizerTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createClassTranslator()
- };
- }
-
- protected Translator createClassTranslator() {
- return new Translator(CLASS, ECLIPSELINK_ORM_PKG.getXmlCustomizer_CustomizerClassName(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkAttributesTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkAttributesTranslator.java
deleted file mode 100644
index 2f61bd9b85..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkAttributesTranslator.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.orm.translators.AttributesTranslator;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EclipseLinkAttributesTranslator extends AttributesTranslator
- implements EclipseLinkOrmXmlMapper
-{
- public EclipseLinkAttributesTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return EclipseLinkOrmFactory.eINSTANCE.createAttributes();
-
- }
- @Override
- protected Translator[] createChildren() {
- return new Translator[] {
- createIdTranslator(),
- createEmbeddedIdTranslator(),
- createBasicTranslator(),
- createBasicCollectionTranslator(),
- createBasicMapTranslator(),
- createVersionTranslator(),
- createManyToOneTranslator(),
- createOneToManyTranslator(),
- createOneToOneTranslator(),
- createManyToManyTranslator(),
- createEmbeddedTranslator(),
- createTransformationTranslator(),
- createTransientTranslator()
- };
- }
-
- @Override
- protected Translator createIdTranslator() {
- return new EclipseLinkIdTranslator(ID, ORM_PKG.getAttributes_Ids());
- }
-
-// protected Translator createEmbeddedIdTranslator() {
-// return new EmbeddedIdTranslator(EMBEDDED_ID, ORM_PKG.getAttributes_EmbeddedIds());
-// }
-
- @Override
- protected Translator createBasicTranslator() {
- return new EclipseLinkBasicTranslator(BASIC, ORM_PKG.getAttributes_Basics());
- }
-
- @Override
- protected Translator createVersionTranslator() {
- return new EclipseLinkVersionTranslator(VERSION, ORM_PKG.getAttributes_Versions());
- }
-
- @Override
- protected Translator createManyToOneTranslator() {
- return new EclipseLinkManyToOneTranslator(MANY_TO_ONE, ORM_PKG.getAttributes_ManyToOnes());
- }
-
- @Override
- protected Translator createOneToOneTranslator() {
- return new EclipseLinkOneToOneTranslator(ONE_TO_ONE, ORM_PKG.getAttributes_OneToOnes());
- }
-
- @Override
- protected Translator createOneToManyTranslator() {
- return new EclipseLinkOneToManyTranslator(ONE_TO_MANY, ORM_PKG.getAttributes_OneToManys());
- }
-
- @Override
- protected Translator createManyToManyTranslator() {
- return new EclipseLinkManyToManyTranslator(MANY_TO_MANY, ORM_PKG.getAttributes_ManyToManys());
- }
-
-// protected Translator createEmbeddedTranslator() {
-// return new EmbeddedTranslator(EMBEDDED, ORM_PKG.getAttributes_Embeddeds());
-// }
-//
-// protected Translator createTransientTranslator() {
-// return new TransientTranslator(TRANSIENT, ORM_PKG.getAttributes_Transients());
-// }
-
-
- protected Translator createBasicCollectionTranslator() {
- return new BasicCollectionTranslator(BASIC_COLLECTION, ECLIPSELINK_ORM_PKG.getAttributes_BasicCollections());
- }
-
- protected Translator createBasicMapTranslator() {
- return new BasicMapTranslator(BASIC_MAP, ECLIPSELINK_ORM_PKG.getAttributes_BasicMaps());
- }
-
- protected Translator createTransformationTranslator() {
- return new TransformationTranslator(TRANSFORMATION, ECLIPSELINK_ORM_PKG.getAttributes_Transformations());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkBasicTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkBasicTranslator.java
deleted file mode 100644
index 3f20b681af..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkBasicTranslator.java
+++ /dev/null
@@ -1,75 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.orm.translators.BasicTranslator;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EclipseLinkBasicTranslator extends BasicTranslator
- implements EclipseLinkOrmXmlMapper
-{
- public EclipseLinkBasicTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlBasicImpl();
- }
-
- @Override
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createFetchTranslator(),
- createOptionalTranslator(),
- createMutableTranslator(),
- createColumnTranslator(),
- createLobTranslator(),
- createTemporalTranslator(),
- createEnumeratedTranslator(),
- createConvertTranslator(),
- createConverterTranslator(),
- createTypeConverterTranslator(),
- createObjectTypeConverterTranslator(),
- createStructConverterTranslator(),
-
- };
- }
-
- protected Translator createMutableTranslator() {
- return new Translator(MUTABLE, ECLIPSELINK_ORM_PKG.getXmlMutable_Mutable(), DOM_ATTRIBUTE);
- }
-
- protected Translator createConvertTranslator() {
- return new Translator(CONVERT, ECLIPSELINK_ORM_PKG.getXmlConvertibleMapping_Convert());
- }
-
- protected Translator createConverterTranslator() {
- return new ConverterTranslator(CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConverterHolder_Converter());
- }
-
- protected Translator createTypeConverterTranslator() {
- return new TypeConverterTranslator(TYPE_CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConverterHolder_TypeConverter());
- }
-
- protected Translator createObjectTypeConverterTranslator() {
- return new ObjectTypeConverterTranslator(OBJECT_TYPE_CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConverterHolder_ObjectTypeConverter());
- }
-
- protected Translator createStructConverterTranslator() {
- return new StructConverterTranslator(STRUCT_CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConverterHolder_StructConverter());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkChangeTrackingTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkChangeTrackingTranslator.java
deleted file mode 100644
index 12a70b1060..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkChangeTrackingTranslator.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.eclipselink.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EclipseLinkChangeTrackingTranslator extends Translator
- implements EclipseLinkOrmXmlMapper
-{
- private Translator[] children;
-
-
- public EclipseLinkChangeTrackingTranslator(String domNameAndPath, EStructuralFeature aFeature, int style) {
- super(domNameAndPath, aFeature, style);
- }
-
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createTypeTranslator()
- };
- }
-
- protected Translator createTypeTranslator() {
- return new Translator(TYPE, ECLIPSELINK_ORM_PKG.getXmlChangeTracking_Type(), Translator.DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkEmbeddableTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkEmbeddableTranslator.java
deleted file mode 100644
index 4c11deb5ba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkEmbeddableTranslator.java
+++ /dev/null
@@ -1,76 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.orm.translators.EmbeddableTranslator;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EclipseLinkEmbeddableTranslator extends EmbeddableTranslator
- implements EclipseLinkOrmXmlMapper
-{
- public EclipseLinkEmbeddableTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlEmbeddable();
- }
-
-
- @Override
- protected Translator[] createChildren() {
- return new Translator[] {
- createClassTranslator(),
- createAccessTranslator(),
- createMetadataCompleteTranslator(),
- createDescriptionTranslator(),
- createCustomizerTranslator(),
- createChangeTrackingTranslator(),
- createConverterTranslator(),
- createTypeConverterTranslator(),
- createObjectTypeConverterTranslator(),
- createStructConverterTranslator(),
- createAttributesTranslator()
- };
- }
-
- protected Translator createCustomizerTranslator() {
- return new CustomizerTranslator(CUSTOMIZER, ECLIPSELINK_ORM_PKG.getXmlCustomizerHolder_Customizer());
- }
-
- protected Translator createChangeTrackingTranslator() {
- return new EclipseLinkChangeTrackingTranslator(CHANGE_TRACKING, ECLIPSELINK_ORM_PKG.getXmlChangeTrackingHolder_ChangeTracking(), END_TAG_NO_INDENT);
- }
-
- protected Translator createConverterTranslator() {
- return new ConverterTranslator(CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConvertersHolder_Converters());
- }
-
- protected Translator createTypeConverterTranslator() {
- return new TypeConverterTranslator(TYPE_CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConvertersHolder_TypeConverters());
- }
-
- protected Translator createObjectTypeConverterTranslator() {
- return new ObjectTypeConverterTranslator(OBJECT_TYPE_CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConvertersHolder_ObjectTypeConverters());
- }
-
- protected Translator createStructConverterTranslator() {
- return new StructConverterTranslator(STRUCT_CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConvertersHolder_StructConverters());
- }
-
- @Override
- protected Translator createAttributesTranslator() {
- return new EclipseLinkAttributesTranslator(ATTRIBUTES, ORM_PKG.getAbstractXmlTypeMapping_Attributes());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkEntityMappingsTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkEntityMappingsTranslator.java
deleted file mode 100644
index d24606e6d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkEntityMappingsTranslator.java
+++ /dev/null
@@ -1,94 +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.internal.resource.orm.translators;
-
-import org.eclipse.jpt.core.internal.resource.orm.translators.EntityMappingsTranslator;
-import org.eclipse.wst.common.internal.emf.resource.ConstantAttributeTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EclipseLinkEntityMappingsTranslator extends EntityMappingsTranslator
- implements EclipseLinkOrmXmlMapper
-{
- public static EclipseLinkEntityMappingsTranslator INSTANCE = new EclipseLinkEntityMappingsTranslator();
-
-
- public EclipseLinkEntityMappingsTranslator() {
- super(ENTITY_MAPPINGS, ECLIPSELINK_ORM_PKG.getXmlEntityMappings());
- }
-
- @Override
- protected Translator[] createChildren() {
- return new Translator[] {
- createVersionTranslator(),
- createNamespaceTranslator(),
- createSchemaNamespaceTranslator(),
- createSchemaLocationTranslator(),
- createDescriptionTranslator(),
- createPersistenceUnitMetadataTranslator(),
- createPackageTranslator(),
- createSchemaTranslator(),
- createCatalogTranslator(),
- createAccessTranslator(),
- createConverterTranslator(),
- createTypeConverterTranslator(),
- createObjectTypeConverterTranslator(),
- createStructConverterTranslator(),
- createSequenceGeneratorTranslator(),
- createTableGeneratorTranslator(),
- createNamedQueryTranslator(),
- createNamedNativeQueryTranslator(),
- createSqlResultSetMappingTranslator(),
- createMappedSuperclassTranslator(),
- createEntityTranslator(),
- createEmbeddableTranslator()
- };
- }
-
- @Override
- protected Translator createNamespaceTranslator() {
- return new ConstantAttributeTranslator(XML_NS, ECLIPSELINK_ORM_NS_URL);
- }
-
- @Override
- protected Translator createSchemaLocationTranslator() {
- return new ConstantAttributeTranslator(XSI_SCHEMA_LOCATION, ECLIPSELINK_ORM_NS_URL + ' ' + ECLIPSELINK_ORM_SCHEMA_LOC_1_0);
- }
-
- @Override
- protected Translator createEmbeddableTranslator() {
- return new EclipseLinkEmbeddableTranslator(EMBEDDABLE, ORM_PKG.getXmlEntityMappings_Embeddables());
- }
-
- @Override
- protected Translator createEntityTranslator() {
- return new EclipseLinkEntityTranslator(ENTITY, ORM_PKG.getXmlEntityMappings_Entities());
- }
-
- @Override
- protected Translator createMappedSuperclassTranslator() {
- return new EclipseLinkMappedSuperclassTranslator(MAPPED_SUPERCLASS, ORM_PKG.getXmlEntityMappings_MappedSuperclasses());
- }
-
-
- protected Translator createConverterTranslator() {
- return new ConverterTranslator(CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConvertersHolder_Converters());
- }
-
- protected Translator createTypeConverterTranslator() {
- return new TypeConverterTranslator(TYPE_CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConvertersHolder_TypeConverters());
- }
-
- protected Translator createObjectTypeConverterTranslator() {
- return new ObjectTypeConverterTranslator(OBJECT_TYPE_CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConvertersHolder_ObjectTypeConverters());
- }
-
- protected Translator createStructConverterTranslator() {
- return new StructConverterTranslator(STRUCT_CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConvertersHolder_StructConverters());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkEntityTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkEntityTranslator.java
deleted file mode 100644
index 14aed038a3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkEntityTranslator.java
+++ /dev/null
@@ -1,116 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.orm.translators.EntityTranslator;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EclipseLinkEntityTranslator extends EntityTranslator
- implements EclipseLinkOrmXmlMapper
-{
- public EclipseLinkEntityTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlEntity();
- }
-
- @Override
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createClassTranslator(),
- createAccessTranslator(),
- createMetadataCompleteTranslator(),
- createReadOnlyTranslator(),
- createExistenceCheckingTranslator(),
- createDescriptionTranslator(),
- createCustomizerTranslator(),
- createChangeTrackingTranslator(),
- createTableTranslator(),
- createSecondaryTableTranslator(),
- createPrimaryKeyJoinColumnTranslator(),
- createIdClassTranslator(),
- createInheritanceTranslator(),
- createDiscriminatorValueTranslator(),
- createDiscriminatorColumnTranslator(),
- createCacheTranslator(),
- createConverterTranslator(),
- createTypeConverterTranslator(),
- createObjectTypeConverterTranslator(),
- createStructConverterTranslator(),
- createSequenceGeneratorTranslator(),
- createTableGeneratorTranslator(),
- createNamedQueryTranslator(),
- createNamedNativeQueryTranslator(),
- createSqlResultSetMappingTranslator(),
- createExcludeDefaultListenersTranslator(),
- createExcludeSuperclassListenersTranslator(),
- createEntityListenersTranslator(),
- createPrePersistTranslator(),
- createPostPersistTranslator(),
- createPreRemoveTranslator(),
- createPostRemoveTranslator(),
- createPreUpdateTranslator(),
- createPostUpdateTranslator(),
- createPostLoadTranslator(),
- createAttributeOverrideTranslator(),
- createAssociationOverrideTranslator(),
- createAttributesTranslator()
- };
- }
-
- protected Translator createReadOnlyTranslator() {
- return new Translator(READ_ONLY, ECLIPSELINK_ORM_PKG.getXmlReadOnly_ReadOnly(), DOM_ATTRIBUTE);
- }
-
- protected Translator createExistenceCheckingTranslator() {
- return new Translator(EXISTENCE_CHECKING, ECLIPSELINK_ORM_PKG.getXmlCacheHolder_ExistenceChecking(), DOM_ATTRIBUTE);
- }
-
- protected Translator createCustomizerTranslator() {
- return new CustomizerTranslator(CUSTOMIZER, ECLIPSELINK_ORM_PKG.getXmlCustomizerHolder_Customizer());
- }
-
- protected Translator createChangeTrackingTranslator() {
- return new EclipseLinkChangeTrackingTranslator(CHANGE_TRACKING, ECLIPSELINK_ORM_PKG.getXmlChangeTrackingHolder_ChangeTracking(), END_TAG_NO_INDENT);
- }
-
- protected Translator createCacheTranslator() {
- return new CacheTranslator();
- }
-
- protected Translator createConverterTranslator() {
- return new ConverterTranslator(CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConvertersHolder_Converters());
- }
-
- protected Translator createTypeConverterTranslator() {
- return new TypeConverterTranslator(TYPE_CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConvertersHolder_TypeConverters());
- }
-
- protected Translator createObjectTypeConverterTranslator() {
- return new ObjectTypeConverterTranslator(OBJECT_TYPE_CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConvertersHolder_ObjectTypeConverters());
- }
-
- protected Translator createStructConverterTranslator() {
- return new StructConverterTranslator(STRUCT_CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConvertersHolder_StructConverters());
- }
-
- @Override
- protected Translator createAttributesTranslator() {
- return new EclipseLinkAttributesTranslator(ATTRIBUTES, ORM_PKG.getAbstractXmlTypeMapping_Attributes());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkIdTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkIdTranslator.java
deleted file mode 100644
index d43d3d2e2f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkIdTranslator.java
+++ /dev/null
@@ -1,72 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.orm.translators.IdTranslator;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EclipseLinkIdTranslator extends IdTranslator
- implements EclipseLinkOrmXmlMapper
-{
- public EclipseLinkIdTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlIdImpl();
- }
-
- @Override
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createMutableTranslator(),
- createColumnTranslator(),
- createGeneratedValueTranslator(),
- createTemporalTranslator(),
- createConvertTranslator(),
- createConverterTranslator(),
- createTypeConverterTranslator(),
- createObjectTypeConverterTranslator(),
- createStructConverterTranslator(),
- createTableGeneratorTranslator(),
- createSequenceGeneratorTranslator()
- };
- }
-
- protected Translator createMutableTranslator() {
- return new Translator(MUTABLE, ECLIPSELINK_ORM_PKG.getXmlMutable_Mutable(), DOM_ATTRIBUTE);
- }
-
- protected Translator createConvertTranslator() {
- return new Translator(CONVERT, ECLIPSELINK_ORM_PKG.getXmlConvertibleMapping_Convert());
- }
-
- protected Translator createConverterTranslator() {
- return new ConverterTranslator(CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConverterHolder_Converter());
- }
-
- protected Translator createTypeConverterTranslator() {
- return new TypeConverterTranslator(TYPE_CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConverterHolder_TypeConverter());
- }
-
- protected Translator createObjectTypeConverterTranslator() {
- return new ObjectTypeConverterTranslator(OBJECT_TYPE_CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConverterHolder_ObjectTypeConverter());
- }
-
- protected Translator createStructConverterTranslator() {
- return new StructConverterTranslator(STRUCT_CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConverterHolder_StructConverter());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkManyToManyTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkManyToManyTranslator.java
deleted file mode 100644
index 382f18123d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkManyToManyTranslator.java
+++ /dev/null
@@ -1,50 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.orm.translators.ManyToManyTranslator;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EclipseLinkManyToManyTranslator extends ManyToManyTranslator
- implements EclipseLinkOrmXmlMapper
-{
- public EclipseLinkManyToManyTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlManyToManyImpl();
- }
-
- @Override
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createTargetEntityTranslator(),
- createFetchTranslator(),
- createMappedByTranslator(),
- createOrderByTranslator(),
- createMapKeyTranslator(),
- createJoinTableTranslator(),
- createCascadeTranslator(),
- createJoinFetchTranslator()
- };
- }
-
- protected Translator createJoinFetchTranslator() {
- return new Translator(JOIN_FETCH, ECLIPSELINK_ORM_PKG.getXmlJoinFetch_JoinFetch());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkManyToOneTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkManyToOneTranslator.java
deleted file mode 100644
index 02e173d926..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkManyToOneTranslator.java
+++ /dev/null
@@ -1,49 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.orm.translators.ManyToOneTranslator;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EclipseLinkManyToOneTranslator extends ManyToOneTranslator
- implements EclipseLinkOrmXmlMapper
-{
- public EclipseLinkManyToOneTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlManyToOneImpl();
- }
-
- @Override
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createTargetEntityTranslator(),
- createFetchTranslator(),
- createOptionalTranslator(),
- createJoinColumnTranslator(),
- createJoinTableTranslator(),
- createCascadeTranslator(),
- createJoinFetchTranslator()
- };
- }
-
- protected Translator createJoinFetchTranslator() {
- return new Translator(JOIN_FETCH, ECLIPSELINK_ORM_PKG.getXmlJoinFetch_JoinFetch());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkMappedSuperclassTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkMappedSuperclassTranslator.java
deleted file mode 100644
index 0046eb0ffb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkMappedSuperclassTranslator.java
+++ /dev/null
@@ -1,104 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.orm.translators.MappedSuperclassTranslator;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EclipseLinkMappedSuperclassTranslator extends MappedSuperclassTranslator
- implements EclipseLinkOrmXmlMapper
-{
- public EclipseLinkMappedSuperclassTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlMappedSuperclass();
- }
-
-
- @Override
- protected Translator[] createChildren() {
- return new Translator[] {
- createClassTranslator(),
- createAccessTranslator(),
- createMetadataCompleteTranslator(),
- createReadOnlyTranslator(),
- createExistenceCheckingTranslator(),
- createDescriptionTranslator(),
- createCustomizerTranslator(),
- createChangeTrackingTranslator(),
- createIdClassTranslator(),
- createCacheTranslator(),
- createConverterTranslator(),
- createTypeConverterTranslator(),
- createObjectTypeConverterTranslator(),
- createStructConverterTranslator(),
- createExcludeDefaultListenersTranslator(),
- createExcludeSuperclassListenersTranslator(),
- createEntityListenersTranslator(),
- createPrePersistTranslator(),
- createPostPersistTranslator(),
- createPreRemoveTranslator(),
- createPostRemoveTranslator(),
- createPreUpdateTranslator(),
- createPostUpdateTranslator(),
- createPostLoadTranslator(),
- createAttributesTranslator()
- };
- }
-
- protected Translator createReadOnlyTranslator() {
- return new Translator(READ_ONLY, ECLIPSELINK_ORM_PKG.getXmlReadOnly_ReadOnly(), DOM_ATTRIBUTE);
- }
-
- protected Translator createExistenceCheckingTranslator() {
- return new Translator(EXISTENCE_CHECKING, ECLIPSELINK_ORM_PKG.getXmlCacheHolder_ExistenceChecking(), DOM_ATTRIBUTE);
- }
-
- protected Translator createCustomizerTranslator() {
- return new CustomizerTranslator(CUSTOMIZER, ECLIPSELINK_ORM_PKG.getXmlCustomizerHolder_Customizer());
- }
-
- protected Translator createChangeTrackingTranslator() {
- return new EclipseLinkChangeTrackingTranslator(CHANGE_TRACKING, ECLIPSELINK_ORM_PKG.getXmlChangeTrackingHolder_ChangeTracking(), END_TAG_NO_INDENT);
- }
-
- protected Translator createCacheTranslator() {
- return new CacheTranslator();
- }
-
- protected Translator createConverterTranslator() {
- return new ConverterTranslator(CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConvertersHolder_Converters());
- }
-
- protected Translator createTypeConverterTranslator() {
- return new TypeConverterTranslator(TYPE_CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConvertersHolder_TypeConverters());
- }
-
- protected Translator createObjectTypeConverterTranslator() {
- return new ObjectTypeConverterTranslator(OBJECT_TYPE_CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConvertersHolder_ObjectTypeConverters());
- }
-
- protected Translator createStructConverterTranslator() {
- return new StructConverterTranslator(STRUCT_CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConvertersHolder_StructConverters());
- }
-
- @Override
- protected Translator createAttributesTranslator() {
- return new EclipseLinkAttributesTranslator(ATTRIBUTES, ORM_PKG.getAbstractXmlTypeMapping_Attributes());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkOneToManyTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkOneToManyTranslator.java
deleted file mode 100644
index e15fcdf481..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkOneToManyTranslator.java
+++ /dev/null
@@ -1,57 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.common.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.core.internal.resource.orm.translators.OneToManyTranslator;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EclipseLinkOneToManyTranslator extends OneToManyTranslator
- implements EclipseLinkOrmXmlMapper
-{
- public EclipseLinkOneToManyTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlOneToManyImpl();
- }
-
- @Override
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createTargetEntityTranslator(),
- createFetchTranslator(),
- createMappedByTranslator(),
- createOrderByTranslator(),
- createMapKeyTranslator(),
- createJoinTableTranslator(),
- createJoinColumnTranslator(),
- createCascadeTranslator(),
- createPrivateOwnedTranslator(),
- createJoinFetchTranslator()
- };
- }
-
- protected Translator createPrivateOwnedTranslator() {
- return new EmptyTagBooleanTranslator(PRIVATE_OWNED, ECLIPSELINK_ORM_PKG.getXmlPrivateOwned_PrivateOwned());
- }
-
- protected Translator createJoinFetchTranslator() {
- return new Translator(JOIN_FETCH, ECLIPSELINK_ORM_PKG.getXmlJoinFetch_JoinFetch());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkOneToOneTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkOneToOneTranslator.java
deleted file mode 100644
index f355f0fc7d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkOneToOneTranslator.java
+++ /dev/null
@@ -1,57 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.common.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.core.internal.resource.orm.translators.OneToOneTranslator;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EclipseLinkOneToOneTranslator extends OneToOneTranslator
- implements EclipseLinkOrmXmlMapper
-{
- public EclipseLinkOneToOneTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlOneToOneImpl();
- }
-
- @Override
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createTargetEntityTranslator(),
- createFetchTranslator(),
- createOptionalTranslator(),
- createMappedByTranslator(),
- createPrimaryKeyJoinColumnTranslator(),
- createJoinColumnTranslator(),
- createJoinTableTranslator(),
- createCascadeTranslator(),
- createPrivateOwnedTranslator(),
- createJoinFetchTranslator()
- };
- }
-
- protected Translator createPrivateOwnedTranslator() {
- return new EmptyTagBooleanTranslator(PRIVATE_OWNED, ECLIPSELINK_ORM_PKG.getXmlPrivateOwned_PrivateOwned());
- }
-
- protected Translator createJoinFetchTranslator() {
- return new Translator(JOIN_FETCH, ECLIPSELINK_ORM_PKG.getXmlJoinFetch_JoinFetch());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkOrmXmlMapper.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkOrmXmlMapper.java
deleted file mode 100644
index c80fdc1792..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkOrmXmlMapper.java
+++ /dev/null
@@ -1,82 +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.internal.resource.orm.translators;
-
-import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkConstants;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-
-public interface EclipseLinkOrmXmlMapper
- extends OrmXmlMapper, EclipseLinkConstants
-{
- EclipseLinkOrmPackage ECLIPSELINK_ORM_PKG = EclipseLinkOrmPackage.eINSTANCE;
-
- 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 CUSTOMIZER = "customizer"; //$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 JOIN_FETCH = "join-fetch"; //$NON-NLS-1$
-
- String MUTABLE = "mutable"; //$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 PRIVATE_OWNED = "private-owned"; //$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$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkVersionTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkVersionTranslator.java
deleted file mode 100644
index b11028e897..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkVersionTranslator.java
+++ /dev/null
@@ -1,69 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.orm.translators.VersionTranslator;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EclipseLinkVersionTranslator extends VersionTranslator
- implements EclipseLinkOrmXmlMapper
-{
- public EclipseLinkVersionTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlVersionImpl();
- }
-
- @Override
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createMutableTranslator(),
- createColumnTranslator(),
- createTemporalTranslator(),
- createConvertTranslator(),
- createConverterTranslator(),
- createTypeConverterTranslator(),
- createObjectTypeConverterTranslator(),
- createStructConverterTranslator(),
- };
- }
-
- protected Translator createMutableTranslator() {
- return new Translator(MUTABLE, ECLIPSELINK_ORM_PKG.getXmlMutable_Mutable(), DOM_ATTRIBUTE);
- }
-
- protected Translator createConvertTranslator() {
- return new Translator(CONVERT, ECLIPSELINK_ORM_PKG.getXmlConvertibleMapping_Convert());
- }
-
- protected Translator createConverterTranslator() {
- return new ConverterTranslator(CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConverterHolder_Converter());
- }
-
- protected Translator createTypeConverterTranslator() {
- return new TypeConverterTranslator(TYPE_CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConverterHolder_TypeConverter());
- }
-
- protected Translator createObjectTypeConverterTranslator() {
- return new ObjectTypeConverterTranslator(OBJECT_TYPE_CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConverterHolder_ObjectTypeConverter());
- }
-
- protected Translator createStructConverterTranslator() {
- return new StructConverterTranslator(STRUCT_CONVERTER, ECLIPSELINK_ORM_PKG.getXmlConverterHolder_StructConverter());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/ExpiryTimeOfDayTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/ExpiryTimeOfDayTranslator.java
deleted file mode 100644
index 726abe3ef0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/ExpiryTimeOfDayTranslator.java
+++ /dev/null
@@ -1,54 +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.internal.resource.orm.translators;
-
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class ExpiryTimeOfDayTranslator extends Translator
- implements EclipseLinkOrmXmlMapper
-{
- private Translator[] children;
-
-
- public ExpiryTimeOfDayTranslator() {
- super(EXPIRY_TIME_OF_DAY, ECLIPSELINK_ORM_PKG.getXmlCache_ExpiryTimeOfDay());
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createHourTranslator(),
- createMinuteTranslator(),
- createSecondTranslator(),
- createMillisecondTranslator(),
- };
- }
- protected Translator createHourTranslator() {
- return new Translator(EXPIRY_TIME_OF_DAY__HOUR, ECLIPSELINK_ORM_PKG.getXmlTimeOfDay_Hour(), DOM_ATTRIBUTE);
- }
-
- protected Translator createMinuteTranslator() {
- return new Translator(EXPIRY_TIME_OF_DAY__MINUTE, ECLIPSELINK_ORM_PKG.getXmlTimeOfDay_Minute(), DOM_ATTRIBUTE);
- }
-
- protected Translator createSecondTranslator() {
- return new Translator(EXPIRY_TIME_OF_DAY__SECOND, ECLIPSELINK_ORM_PKG.getXmlTimeOfDay_Second(), DOM_ATTRIBUTE);
- }
-
- protected Translator createMillisecondTranslator() {
- return new Translator(EXPIRY_TIME_OF_DAY__MILLISECOND, ECLIPSELINK_ORM_PKG.getXmlTimeOfDay_Millisecond(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/ObjectTypeConverterTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/ObjectTypeConverterTranslator.java
deleted file mode 100644
index f85f67809a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/ObjectTypeConverterTranslator.java
+++ /dev/null
@@ -1,68 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class ObjectTypeConverterTranslator extends Translator
- implements EclipseLinkOrmXmlMapper
-{
- private Translator[] children;
-
-
- public ObjectTypeConverterTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(@SuppressWarnings("unused") String nodeName, @SuppressWarnings("unused") String readAheadName) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverterImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createConversionValueTranslator(),
- createDefaultObjectValueTranslator(),
- createNameTranslator(),
- createDataTypeTranslator(),
- createObjectTypeTranslator(),
- };
- }
-
- protected Translator createConversionValueTranslator() {
- return new ConversionValueTranslator();
- }
-
- protected Translator createDefaultObjectValueTranslator() {
- return new Translator(OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE, ECLIPSELINK_ORM_PKG.getXmlObjectTypeConverter_DefaultObjectValue());
- }
-
- protected Translator createNameTranslator() {
- return new Translator(OBJECT_TYPE_CONVERTER__NAME, ECLIPSELINK_ORM_PKG.getXmlNamedConverter_Name(), DOM_ATTRIBUTE);
- }
-
- protected Translator createDataTypeTranslator() {
- return new Translator(OBJECT_TYPE_CONVERTER__DATA_TYPE, ECLIPSELINK_ORM_PKG.getXmlObjectTypeConverter_DataType(), DOM_ATTRIBUTE);
- }
-
- protected Translator createObjectTypeTranslator() {
- return new Translator(OBJECT_TYPE_CONVERTER__OBJECT_TYPE, ECLIPSELINK_ORM_PKG.getXmlObjectTypeConverter_ObjectType(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/StructConverterTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/StructConverterTranslator.java
deleted file mode 100644
index 50eba69001..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/StructConverterTranslator.java
+++ /dev/null
@@ -1,54 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class StructConverterTranslator extends Translator
- implements EclipseLinkOrmXmlMapper
-{
- private Translator[] children;
-
-
- public StructConverterTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- public EObject createEMFObject(@SuppressWarnings("unused") String nodeName, @SuppressWarnings("unused") String readAheadName) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverterImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createConverterTranslator(),
- };
- }
-
- protected Translator createNameTranslator() {
- return new Translator(STRUCT_CONVERTER__NAME, ECLIPSELINK_ORM_PKG.getXmlNamedConverter_Name(), DOM_ATTRIBUTE);
- }
-
- protected Translator createConverterTranslator() {
- return new Translator(STRUCT_CONVERTER__CONVERTER, ECLIPSELINK_ORM_PKG.getXmlStructConverter_Converter(), DOM_ATTRIBUTE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/TransformationTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/TransformationTranslator.java
deleted file mode 100644
index b3a0623561..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/TransformationTranslator.java
+++ /dev/null
@@ -1,52 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.orm.translators.BasicTranslator;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class TransformationTranslator extends BasicTranslator
- implements EclipseLinkOrmXmlMapper
-{
- private Translator[] children;
-
- public TransformationTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlTransformationImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- @Override
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator()
- };
- }
-
- @Override
- protected Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/TypeConverterTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/TypeConverterTranslator.java
deleted file mode 100644
index 2601c2aa5a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/TypeConverterTranslator.java
+++ /dev/null
@@ -1,58 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class TypeConverterTranslator extends Translator
- implements EclipseLinkOrmXmlMapper
-{
- private Translator[] children;
-
-
- public TypeConverterTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- public EObject createEMFObject(@SuppressWarnings("unused") String nodeName, @SuppressWarnings("unused") String readAheadName) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverterImpl();
- }
-
- @Override
- protected Translator[] getChildren() {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createNameTranslator(),
- createDataTypeTranslator(),
- createObjectTypeTranslator(),
- };
- }
-
- protected Translator createNameTranslator() {
- return new Translator(TYPE_CONVERTER__NAME, ECLIPSELINK_ORM_PKG.getXmlNamedConverter_Name(), DOM_ATTRIBUTE);
- }
-
- protected Translator createDataTypeTranslator() {
- return new Translator(TYPE_CONVERTER__DATA_TYPE, ECLIPSELINK_ORM_PKG.getXmlTypeConverter_DataType(), DOM_ATTRIBUTE);
- }
-
- protected Translator createObjectTypeTranslator() {
- return new Translator(TYPE_CONVERTER__OBJECT_TYPE, ECLIPSELINK_ORM_PKG.getXmlTypeConverter_ObjectType(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/BasicCollectionAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/BasicCollectionAnnotation.java
deleted file mode 100644
index 5fa7bc7e0d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/BasicCollectionAnnotation.java
+++ /dev/null
@@ -1,30 +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.resource.java;
-
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-
-/**
- * Java resource model interface that 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 BasicCollectionAnnotation extends JavaResourceNode
-{
- String ANNOTATION_NAME = EclipseLinkJPA.BASIC_COLLECTION;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/BasicMapAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/BasicMapAnnotation.java
deleted file mode 100644
index 795c7c19ba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/BasicMapAnnotation.java
+++ /dev/null
@@ -1,30 +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.resource.java;
-
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-
-/**
- * Java resource model interface that 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 BasicMapAnnotation extends JavaResourceNode
-{
- String ANNOTATION_NAME = EclipseLinkJPA.BASIC_MAP;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/CacheAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/CacheAnnotation.java
deleted file mode 100644
index febd15af1a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/CacheAnnotation.java
+++ /dev/null
@@ -1,199 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Resource model interface that represents the
- * org.eclipse.persistence.annotations.Cache 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.1
- * @since 2.1
- */
-public interface CacheAnnotation extends JavaResourceNode
-{
-
- String ANNOTATION_NAME = EclipseLinkJPA.CACHE;
-
- /**
- * Corresponds to the type element of the Cache annotation.
- * Returns null if the type element does not exist in java.
- */
- CacheType getType();
-
- /**
- * Corresponds to the type element of the Cache annotation.
- * Set to null to remove the type element.
- */
- void setType(CacheType type);
- String TYPE_PROPERTY = "typeProperty"; //$NON-NLS-1$
-
- /**
- * Corresponds to the size element of the Cache annotation.
- * Returns null if the size valuePair does not exist in the annotation
- */
- Integer getSize();
-
- /**
- * Corresponds to the size element of the Cache annotation.
- * Set to null to remove the size valuePair from the annotation
- */
- void setSize(Integer size);
- String SIZE_PROPERTY = "sizeProperty"; //$NON-NLS-1$
-
- /**
- * Corresponds to the shared element of the Cache annotation.
- * Returns null if the shared element does not exist in java.
- */
- Boolean getShared();
-
- /**
- * Corresponds to the shared element of the Cache annotation.
- * Set to null to remove the shared element.
- */
- void setShared(Boolean shared);
- String SHARED_PROPERTY = "sharedProperty"; //$NON-NLS-1$
-
-
- /**
- * Corresponds to the expiry element of the Cache annotation.
- * Returns null if the expiry valuePair does not exist in the annotation
- */
- Integer getExpiry();
-
- /**
- * Corresponds to the expiry element of the Cache annotation.
- * Set to null to remove the expiry valuePair from the annotation
- */
- void setExpiry(Integer expiry);
- String EXPIRY_PROPERTY = "expiryProperty"; //$NON-NLS-1$
-
- TimeOfDayAnnotation addExpiryTimeOfDay();
- void removeExpiryTimeOfDay();
- TimeOfDayAnnotation getExpiryTimeOfDay();
- String EXPIRY_TIME_OF_DAY_PROPERTY = "expiryTimeOfDayProperty"; //$NON-NLS-1$
-
- /**
- * Corresponds to the alwaysRefresh element of the Cache annotation.
- * Returns null if the alwaysRefresh element does not exist in java.
- */
- Boolean getAlwaysRefresh();
-
- /**
- * Corresponds to the alwaysRefresh element of the Cache annotation.
- * Set to null to remove the alwaysRefresh element.
- */
- void setAlwaysRefresh(Boolean alwaysRefresh);
- String ALWAYS_REFRESH_PROPERTY = "alwaysRefreshProperty"; //$NON-NLS-1$
-
- /**
- * Corresponds to the refreshOnlyIfNewer element of the Cache annotation.
- * Returns null if the refreshOnlyIfNewer element does not exist in java.
- */
- Boolean getRefreshOnlyIfNewer();
-
- /**
- * Corresponds to the refreshOnlyIfNewer element of the Cache annotation.
- * Set to null to remove the refreshOnlyIfNewer element.
- */
- void setRefreshOnlyIfNewer(Boolean refreshOnlyIfNewer);
- String REFRESH_ONLY_IF_NEWER_PROPERTY = "refreshOnlyIfNewerProperty"; //$NON-NLS-1$
-
- /**
- * Corresponds to the disableHits element of the Cache annotation.
- * Returns null if the disableHits element does not exist in java.
- */
- Boolean getDisableHits();
-
- /**
- * Corresponds to the disableHits element of the Cache annotation.
- * Set to null to remove the disableHits element.
- */
- void setDisableHits(Boolean disableHits);
- String DISABLE_HITS_PROPERTY = "disableHitsProperty"; //$NON-NLS-1$
-
- /**
- * Corresponds to the type element of the Cache annotation.
- * Returns null if the type element does not exist in java.
- */
- CacheCoordinationType getCoordinationType();
-
- /**
- * Corresponds to the type element of the Cache annotation.
- * Set to null to remove the type element.
- */
- void setCoordinationType(CacheCoordinationType coordinationType);
- String COORDINATION_TYPE_PROPERTY = "coordinationTypeProperty"; //$NON-NLS-1$
-
-
- /**
- * Return the {@link TextRange} for the type element. If the type element
- * does not exist return the {@link TextRange} for the Cache annotation.
- */
- TextRange getTypeTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the shared element. If the shared element
- * does not exist return the {@link TextRange} for the Cache annotation.
- */
- TextRange getSizeTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the shared element. If the shared element
- * does not exist return the {@link TextRange} for the Cache annotation.
- */
- TextRange getSharedTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the expiry element. If the expiry element
- * does not exist return the {@link TextRange} for the Cache annotation.
- */
- TextRange getExpiryTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the expiryTimeOfDay element. If the expiryTimeOfDay element
- * does not exist return the {@link TextRange} for the Cache annotation.
- */
- TextRange getExpiryTimeOfDayTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the alwaysRefresh element. If the alwaysRefresh element
- * does not exist return the {@link TextRange} for the Cache annotation.
- */
- TextRange getAlwaysRefreshTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the refreshOnlyIfNewer element. If the refreshOnlyIfNewer element
- * does not exist return the {@link TextRange} for the Cache annotation.
- */
- TextRange getRefreshOnlyIfNewerTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the disableHits element. If the disableHits element
- * does not exist return the {@link TextRange} for the Cache annotation.
- */
- TextRange getDisablesHitsTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the coordinationType element. If the coordinationType 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/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 6a3ed5204c..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * 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;
-
-/**
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * 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,
- INVALIDATE_CHANGED_OBJECTS,
- SEND_NEW_OBJECTS_WITH_CHANGES,
- NONE;
-
- public static CacheCoordinationType fromJavaAnnotationValue(Object javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- return null;
- }
- if (javaAnnotationValue.equals(EclipseLinkJPA.CACHE_COORDINATION_TYPE__SEND_OBJECT_CHANGES)) {
- return SEND_OBJECT_CHANGES;
- }
- if (javaAnnotationValue.equals(EclipseLinkJPA.CACHE_COORDINATION_TYPE__INVALIDATE_CHANGED_OBJECTS)) {
- return INVALIDATE_CHANGED_OBJECTS;
- }
- if (javaAnnotationValue.equals(EclipseLinkJPA.CACHE_COORDINATION_TYPE__SEND_NEW_OBJECTS_WITH_CHANGES)) {
- return SEND_NEW_OBJECTS_WITH_CHANGES;
- }
- if (javaAnnotationValue.equals(EclipseLinkJPA.CACHE_COORDINATION_TYPE__NONE)) {
- return NONE;
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(CacheCoordinationType cacheCoordinationType) {
- if (cacheCoordinationType == null) {
- return null;
- }
- switch (cacheCoordinationType) {
- case SEND_OBJECT_CHANGES :
- return EclipseLinkJPA.CACHE_COORDINATION_TYPE__SEND_OBJECT_CHANGES;
- case INVALIDATE_CHANGED_OBJECTS :
- return EclipseLinkJPA.CACHE_COORDINATION_TYPE__INVALIDATE_CHANGED_OBJECTS;
- case SEND_NEW_OBJECTS_WITH_CHANGES :
- return EclipseLinkJPA.CACHE_COORDINATION_TYPE__SEND_NEW_OBJECTS_WITH_CHANGES;
- case NONE :
- return EclipseLinkJPA.CACHE_COORDINATION_TYPE__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/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 bf0e43708d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/CacheType.java
+++ /dev/null
@@ -1,85 +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.resource.java;
-
-/**
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public enum CacheType {
-
- FULL,
- WEAK,
- SOFT,
- SOFT_WEAK,
- HARD_WEAK,
- CACHE,
- NONE;
-
-
- public static CacheType fromJavaAnnotationValue(Object javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- return null;
- }
- if (javaAnnotationValue.equals(EclipseLinkJPA.CACHE_TYPE__FULL)) {
- return FULL;
- }
- if (javaAnnotationValue.equals(EclipseLinkJPA.CACHE_TYPE__WEAK)) {
- return WEAK;
- }
- if (javaAnnotationValue.equals(EclipseLinkJPA.CACHE_TYPE__SOFT)) {
- return SOFT;
- }
- if (javaAnnotationValue.equals(EclipseLinkJPA.CACHE_TYPE__SOFT_WEAK)) {
- return SOFT_WEAK;
- }
- if (javaAnnotationValue.equals(EclipseLinkJPA.CACHE_TYPE__HARD_WEAK)) {
- return HARD_WEAK;
- }
- if (javaAnnotationValue.equals(EclipseLinkJPA.CACHE_TYPE__CACHE)) {
- return CACHE;
- }
- if (javaAnnotationValue.equals(EclipseLinkJPA.CACHE_TYPE__NONE)) {
- return NONE;
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(CacheType cacheType) {
- if (cacheType == null) {
- return null;
- }
- switch (cacheType) {
- case FULL :
- return EclipseLinkJPA.CACHE_TYPE__FULL;
- case WEAK :
- return EclipseLinkJPA.CACHE_TYPE__WEAK;
- case SOFT :
- return EclipseLinkJPA.CACHE_TYPE__SOFT;
- case SOFT_WEAK :
- return EclipseLinkJPA.CACHE_TYPE__SOFT_WEAK;
- case HARD_WEAK :
- return EclipseLinkJPA.CACHE_TYPE__HARD_WEAK;
- case CACHE :
- return EclipseLinkJPA.CACHE_TYPE__CACHE;
- case NONE :
- return EclipseLinkJPA.CACHE_TYPE__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/resource/java/ChangeTrackingAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ChangeTrackingAnnotation.java
deleted file mode 100644
index e1ad12d788..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ChangeTrackingAnnotation.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.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Resource model interface that represents the
- * org.eclipse.persistence.annotations.ChangeTracking 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.1
- * @since 2.1
- */
-public interface ChangeTrackingAnnotation extends JavaResourceNode
-{
-
- String ANNOTATION_NAME = EclipseLinkJPA.CHANGE_TRACKING;
-
- /**
- * Corresponds to the value element of the ChangeTracking annotation.
- * Returns null if the value element does not exist in java.
- */
- ChangeTrackingType getValue();
-
- /**
- * Corresponds to the value element of the ChangeTracking annotation.
- * Set to null to remove the value element.
- */
- void setValue(ChangeTrackingType value);
- String VALUE_PROPERTY = "valueProperty"; //$NON-NLS-1$
-
-
- /**
- * Return the {@link TextRange} for the value element. If the value 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/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 749f7c2499..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ChangeTrackingType.java
+++ /dev/null
@@ -1,67 +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.resource.java;
-
-/**
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public enum ChangeTrackingType {
-
-
- ATTRIBUTE,
- OBJECT,
- DEFERRED,
- AUTO;
-
- public static ChangeTrackingType fromJavaAnnotationValue(Object javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- return null;
- }
- if (javaAnnotationValue.equals(EclipseLinkJPA.CHANGE_TRACKING_TYPE__ATTRIBUTE)) {
- return ATTRIBUTE;
- }
- if (javaAnnotationValue.equals(EclipseLinkJPA.CHANGE_TRACKING_TYPE__OBJECT)) {
- return OBJECT;
- }
- if (javaAnnotationValue.equals(EclipseLinkJPA.CHANGE_TRACKING_TYPE__DEFERRED)) {
- return DEFERRED;
- }
- if (javaAnnotationValue.equals(EclipseLinkJPA.CHANGE_TRACKING_TYPE__AUTO)) {
- return AUTO;
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(ChangeTrackingType changeTrackingType) {
- if (changeTrackingType == null) {
- return null;
- }
- switch (changeTrackingType) {
- case ATTRIBUTE :
- return EclipseLinkJPA.CHANGE_TRACKING_TYPE__ATTRIBUTE;
- case OBJECT :
- return EclipseLinkJPA.CHANGE_TRACKING_TYPE__OBJECT;
- case DEFERRED :
- return EclipseLinkJPA.CHANGE_TRACKING_TYPE__DEFERRED;
- case AUTO :
- return EclipseLinkJPA.CHANGE_TRACKING_TYPE__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/resource/java/ConversionValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ConversionValueAnnotation.java
deleted file mode 100644
index 5aa1075219..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ConversionValueAnnotation.java
+++ /dev/null
@@ -1,73 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Java resource model interface that 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 ConversionValueAnnotation extends JavaResourceNode
-{
-
- String ANNOTATION_NAME = EclipseLinkJPA.CONVERSION_VALUE;
-
-
- /**
- * Corresponds to the dataValue element of the ConversionValue annotation.
- * Returns null if the dataValue element does not exist in java.
- */
- String getDataValue();
-
- /**
- * Corresponds to the dataValue element of the ConversionValue annotation.
- * Set to null to remove the dataValue element.
- */
- void setDataValue(String dataValue);
- String DATA_VALUE_PROPERTY = "dataValueProperty"; //$NON-NLS-1$
-
- /**
- * Corresponds to the objectValue element of the ConversionValue annotation.
- * Returns null if the objectValue element does not exist in java.
- */
- String getObjectValue();
-
- /**
- * Corresponds to the objectValue element of the ConversionValue annotation.
- * Set to null to remove the objectValue element.
- */
- void setObjectValue(String objectValue);
- String OBJECT_VALUE_PROPERTY = "objectValueProperty"; //$NON-NLS-1$
-
- /**
- * Return the {@link TextRange} for the dataValue element. If the dataValue element
- * does not exist return the {@link TextRange} for the ConversionValue annotation.
- */
- TextRange getDataValueTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the objectValue element. If the objectValue 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/ConvertAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ConvertAnnotation.java
deleted file mode 100644
index f6ff736b25..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ConvertAnnotation.java
+++ /dev/null
@@ -1,54 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Java resource model interface that 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 ConvertAnnotation extends JavaResourceNode
-{
-
- String ANNOTATION_NAME = EclipseLinkJPA.CONVERT;
-
-
- /**
- * Corresponds to the value element of the Convert annotation.
- * Returns null if the value element does not exist in java.
- */
- String getValue();
-
- /**
- * Corresponds to the value element of the Convert annotation.
- * Set to null to remove the value element.
- */
- void setValue(String value);
- String VALUE_PROPERTY = "valueProperty"; //$NON-NLS-1$
-
- /**
- * Return the {@link TextRange} for the value element. If the value element
- * does not exist return the {@link TextRange} for the Convert annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ConverterAnnotation.java
deleted file mode 100644
index ec9a9d2af9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ConverterAnnotation.java
+++ /dev/null
@@ -1,59 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Java resource model interface that 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.1
- * @since 2.1
- */
-public interface ConverterAnnotation extends NamedConverterAnnotation
-{
- String ANNOTATION_NAME = EclipseLinkJPA.CONVERTER;
-
- /**
- * Corresponds to the converterClass element of the CustomConverter annotation.
- * Returns null if the converterClass element does not exist in java.
- */
- String getConverterClass();
-
- /**
- * Corresponds to the converterClass element of the CustomConverter annotation.
- * Set to null to remove the converterClass element.
- */
- void setConverterClass(String value);
- String CONVERTER_CLASS_PROPERTY = "converterClassProperty"; //$NON-NLS-1$
-
- /**
- * Return whether the converterClass implements the eclipselink Converter interface
- * @see ConverterAnnotation#ECLIPSELINK_CONVERTER_CLASS_NAME
- * @return
- */
- boolean implementsConverter();
- String IMPLEMENTS_CONVERTER_PROPERTY = "implementsConverterProperty"; //$NON-NLS-1$
- String ECLIPSELINK_CONVERTER_CLASS_NAME = "org.eclipse.persistence.mappings.converters.Converter"; //$NON-NLS-1$
-
- /**
- * Return the {@link TextRange} for the converterClass element. If the converterClass element
- * does not exist return the {@link TextRange} for the CustomConverter annotation.
- */
- TextRange getConverterClassTextRange(CompilationUnit astRoot);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/CustomizerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/CustomizerAnnotation.java
deleted file mode 100644
index c95400a5e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/CustomizerAnnotation.java
+++ /dev/null
@@ -1,62 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Java resource model interface that 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.1
- * @since 2.1
- */
-public interface CustomizerAnnotation extends JavaResourceNode
-{
-
- String ANNOTATION_NAME = EclipseLinkJPA.CUSTOMIZER;
-
- /**
- * Corresponds to the value element of the Customizer annotation.
- * Returns null if the value element does not exist in java.
- */
- String getValue();
-
- /**
- * Corresponds to the value element of the Customizer annotation.
- * Set to null to remove the value element.
- */
- void setValue(String value);
- String VALUE_PROPERTY = "valueProperty"; //$NON-NLS-1$
-
- /**
- * Return whether the value implements the eclipselink DescriptorCustomizer interface
- * @see CustomizerAnnotation#ECLIPSELINK_DESCRIPTOR_CUSTOMIZER_CLASS_NAME
- * @return
- */
- boolean implementsDescriptorCustomizer();
- String IMPLEMENTS_DESCRIPTOR_CUSTOMIZER_PROPERTY = "implementsDescriptorCustomizerProperty"; //$NON-NLS-1$
- String ECLIPSELINK_DESCRIPTOR_CUSTOMIZER_CLASS_NAME = "org.eclipse.persistence.config.DescriptorCustomizer"; //$NON-NLS-1$
-
- /**
- * Return the {@link TextRange} for the value element. If the value element
- * does not exist return the {@link TextRange} for the Customizer annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkJPA.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkJPA.java
deleted file mode 100644
index 99aa7f2d7f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkJPA.java
+++ /dev/null
@@ -1,155 +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.resource.java;
-
-
-/**
- * EclipseLink JPA 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 EclipseLinkJPA {
-
- // EclipseLink JPA package
- String PACKAGE = "org.eclipse.persistence.annotations"; //$NON-NLS-1$
- String PACKAGE_ = PACKAGE + ".";
-
-
- // ********** API **********
-
- // JPA 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 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 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 CHANGE_TRACKING = PACKAGE_ + "ChangeTracking";
- String CHANGE_TRACKING__VALUE = "value";
-
- 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 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 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 = PACKAGE_ + "JoinFetch";
- String JOIN_FETCH_VALUE = "value";
-
- 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";
-
- String MUTABLE = PACKAGE_ + "Mutable";
- String MUTABLE__VALUE = "value";
-
- String OBJECT_TYPE_CONVERTER = PACKAGE_ + "ObjectTypeConverter";
- String OBJECT_TYPE_CONVERTER__NAME = "name";
- String OBJECT_TYPE_CONVERTER__DATE_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 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__DATE_TYPE = "dataType";
- String TYPE_CONVERTER__OBJECT_TYPE = "objectType";
-
- 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";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ExistenceCheckingAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ExistenceCheckingAnnotation.java
deleted file mode 100644
index e57b17f093..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ExistenceCheckingAnnotation.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.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Resource model interface that represents the
- * org.eclipse.persistence.annotations.ExistenceChecking 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.1
- * @since 2.1
- */
-public interface ExistenceCheckingAnnotation extends JavaResourceNode
-{
-
- String ANNOTATION_NAME = EclipseLinkJPA.EXISTENCE_CHECKING;
-
- /**
- * Corresponds to the value element of the ExistenceChecking annotation.
- * Returns null if the value element does not exist in java.
- */
- ExistenceType getValue();
-
- /**
- * Corresponds to the value element of the ExistenceChecking annotation.
- * Set to null to remove the value element.
- */
- void setValue(ExistenceType value);
- String VALUE_PROPERTY = "valueProperty"; //$NON-NLS-1$
-
-
- /**
- * Return the {@link TextRange} for the value element. If the value 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/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 b466c2bf2d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ExistenceType.java
+++ /dev/null
@@ -1,67 +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.resource.java;
-
-/**
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public enum ExistenceType {
-
-
- CHECK_CACHE,
- CHECK_DATABASE,
- ASSUME_EXISTENCE,
- ASSUME_NON_EXISTENCE;
-
- public static ExistenceType fromJavaAnnotationValue(Object javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- return null;
- }
- if (javaAnnotationValue.equals(EclipseLinkJPA.EXISTENCE_TYPE__CHECK_CACHE)) {
- return CHECK_CACHE;
- }
- if (javaAnnotationValue.equals(EclipseLinkJPA.EXISTENCE_TYPE__CHECK_DATABASE)) {
- return CHECK_DATABASE;
- }
- if (javaAnnotationValue.equals(EclipseLinkJPA.EXISTENCE_TYPE__ASSUME_EXISTENCE)) {
- return ASSUME_EXISTENCE;
- }
- if (javaAnnotationValue.equals(EclipseLinkJPA.EXISTENCE_TYPE__ASSUME_NON_EXISTENCE)) {
- return ASSUME_NON_EXISTENCE;
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(ExistenceType existenceType) {
- if (existenceType == null) {
- return null;
- }
- switch (existenceType) {
- case CHECK_CACHE :
- return EclipseLinkJPA.EXISTENCE_TYPE__CHECK_CACHE;
- case CHECK_DATABASE :
- return EclipseLinkJPA.EXISTENCE_TYPE__CHECK_DATABASE;
- case ASSUME_EXISTENCE :
- return EclipseLinkJPA.EXISTENCE_TYPE__ASSUME_EXISTENCE;
- case ASSUME_NON_EXISTENCE :
- return EclipseLinkJPA.EXISTENCE_TYPE__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/resource/java/JoinFetchAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/JoinFetchAnnotation.java
deleted file mode 100644
index ffbb00211a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/JoinFetchAnnotation.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.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Resource model interface that represents the
- * org.eclipse.persistence.annotations.JoinFetch 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.1
- * @since 2.1
- */
-public interface JoinFetchAnnotation extends JavaResourceNode
-{
-
- String ANNOTATION_NAME = EclipseLinkJPA.JOIN_FETCH;
-
- /**
- * Corresponds to the value element of the JoinFetch annotation.
- * Returns null if the value element does not exist in java.
- */
- JoinFetchType getValue();
-
- /**
- * Corresponds to the value element of the JoinFetch annotation.
- * Set to null to remove the value element.
- */
- void setValue(JoinFetchType value);
- String VALUE_PROPERTY = "valueProperty"; //$NON-NLS-1$
-
-
- /**
- * Return the {@link TextRange} for the value element. If the value 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/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 c6d183ab28..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/JoinFetchType.java
+++ /dev/null
@@ -1,57 +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.resource.java;
-
-/**
- * Resource model interface that represents the
- * org.eclipse.persistence.annotations.JoinFetchType enum
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * 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,
- OUTER;
-
- public static JoinFetchType fromJavaAnnotationValue(Object javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- return null;
- }
- if (javaAnnotationValue.equals(EclipseLinkJPA.JOIN_FETCH_TYPE__INNER)) {
- return INNER;
- }
- if (javaAnnotationValue.equals(EclipseLinkJPA.JOIN_FETCH_TYPE__OUTER)) {
- return OUTER;
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(JoinFetchType joinFetchType) {
- if (joinFetchType == null) {
- return null;
- }
- switch (joinFetchType) {
- case INNER :
- return EclipseLinkJPA.JOIN_FETCH_TYPE__INNER;
- case OUTER :
- return EclipseLinkJPA.JOIN_FETCH_TYPE__OUTER;
- default :
- throw new IllegalArgumentException("unknown join fetch type: " + joinFetchType); //$NON-NLS-1$
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/MutableAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/MutableAnnotation.java
deleted file mode 100644
index f88be1ecf3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/MutableAnnotation.java
+++ /dev/null
@@ -1,54 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Java resource model interface that 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 MutableAnnotation extends JavaResourceNode
-{
-
- String ANNOTATION_NAME = EclipseLinkJPA.MUTABLE;
-
-
- /**
- * Corresponds to the value element of the Mutable annotation.
- * Returns null if the value element does not exist in java.
- */
- Boolean getValue();
-
- /**
- * Corresponds to the value element of the Mutable annotation.
- * Set to null to remove the value element.
- */
- void setValue(Boolean value);
- String VALUE_PROPERTY = "valueProperty"; //$NON-NLS-1$
-
- /**
- * Return the {@link TextRange} for the value element. If the value 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/NamedConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/NamedConverterAnnotation.java
deleted file mode 100644
index f4d0487147..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/NamedConverterAnnotation.java
+++ /dev/null
@@ -1,47 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-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.1
- */
-public interface NamedConverterAnnotation extends JavaResourceNode
-{
- /**
- * Corresponds to the name element of the CustomConverter annotation.
- * Returns null if the name element does not exist in java.
- */
- String getName();
-
- /**
- * Corresponds to the name element of the CustomConverter annotation.
- * Set to null to remove the name element.
- */
- void setName(String value);
- String NAME_PROPERTY = "nameProperty"; //$NON-NLS-1$
-
- /**
- * Return the {@link TextRange} for the name element. If the name 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/NestableConversionValue.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/NestableConversionValue.java
deleted file mode 100644
index 464a8e8b91..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/NestableConversionValue.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 NestableConversionValue extends ConversionValueAnnotation, NestableAnnotation
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ObjectTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ObjectTypeConverterAnnotation.java
deleted file mode 100644
index 7d8a279f55..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ObjectTypeConverterAnnotation.java
+++ /dev/null
@@ -1,71 +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.resource.java;
-
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Java resource model interface that 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 ObjectTypeConverterAnnotation extends TypeConverterAnnotation
-{
- String ANNOTATION_NAME = EclipseLinkJPA.OBJECT_TYPE_CONVERTER;
-
- /**
- * Corresponds to the conversionValues element of the ObjectTypeConverter annotation.
- * Returns an empty iterator if the conversionValues element does not exist in java.
- */
- ListIterator<ConversionValueAnnotation> conversionValues();
-
- ConversionValueAnnotation conversionValueAt(int index);
-
- int indexOfConversionValue(ConversionValueAnnotation conversionValue);
-
- int conversionValuesSize();
-
- ConversionValueAnnotation addConversionValue(int index);
-
- void removeConversionValue(int index);
-
- void moveConversionValue(int targetIndex, int sourceIndex);
-
- String CONVERSION_VALUES_LIST = "conversionValuesList"; //$NON-NLS-1$
-
- /**
- * Corresponds to the defaultObjectValue element of the ObjectTypeConverter annotation.
- * Returns null if the defaultObjectValue element does not exist in java.
- */
- String getDefaultObjectValue();
-
- /**
- * Corresponds to the defaultObjectValue element of the ObjectTypeConverter annotation.
- * Set to null to remove the defaultObjectValue element.
- */
- void setDefaultObjectValue(String value);
- String DEFAULT_OBJECT_VALUE_PROPERTY = "defaultObjectValueProperty"; //$NON-NLS-1$
-
- /**
- * Return the {@link TextRange} for the defaultObjectValue element. If the defaultObjectValue 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/PrivateOwnedAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/PrivateOwnedAnnotation.java
deleted file mode 100644
index a330c9dae1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/PrivateOwnedAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-
-/**
- * Resource model interface that represents the
- * org.eclipse.persistence.annotations.PrivateOwned 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.1
- * @since 2.1
- */
-public interface PrivateOwnedAnnotation extends JavaResourceNode
-{
- String ANNOTATION_NAME = EclipseLinkJPA.PRIVATE_OWNED;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ReadOnlyAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ReadOnlyAnnotation.java
deleted file mode 100644
index 80e8a5f822..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ReadOnlyAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-
-/**
- * Resource model interface that represents the
- * org.eclipse.persistence.annotations.PrivateOwned 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.1
- * @since 2.1
- */
-public interface ReadOnlyAnnotation extends JavaResourceNode
-{
- String ANNOTATION_NAME = EclipseLinkJPA.READ_ONLY;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ReadTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ReadTransformerAnnotation.java
deleted file mode 100644
index 900198ef6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ReadTransformerAnnotation.java
+++ /dev/null
@@ -1,30 +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.resource.java;
-
-/**
- * Java resource model interface that 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 ReadTransformerAnnotation extends TransformerAnnotation
-{
-
- String ANNOTATION_NAME = EclipseLinkJPA.READ_TRANSFORMER;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/StructConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/StructConverterAnnotation.java
deleted file mode 100644
index ff01803fee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/StructConverterAnnotation.java
+++ /dev/null
@@ -1,49 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Java resource model interface that 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 StructConverterAnnotation extends NamedConverterAnnotation
-{
- String ANNOTATION_NAME = EclipseLinkJPA.STRUCT_CONVERTER;
-
- /**
- * Corresponds to the converter element of the StructConverter annotation.
- * Returns null if the converter element does not exist in java.
- */
- String getConverter();
-
- /**
- * Corresponds to the converter element of the StructConverter annotation.
- * Set to null to remove the converter element.
- */
- void setConverter(String value);
- String CONVERTER_PROPERTY = "converterProperty"; //$NON-NLS-1$
- /**
- * Return the {@link TextRange} for the converter element. If the converter 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/TimeOfDayAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/TimeOfDayAnnotation.java
deleted file mode 100644
index aa3e008fc3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/TimeOfDayAnnotation.java
+++ /dev/null
@@ -1,113 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Resource model interface that represents the
- * org.eclipse.persistence.annotations.TimeOfDay 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.1
- * @since 2.1
- */
-public interface TimeOfDayAnnotation extends JavaResourceNode
-{
-
- String ANNOTATION_NAME = EclipseLinkJPA.TIME_OF_DAY;
-
- /**
- * Corresponds to the hour element of the TimeOfDay annotation.
- * Returns null if the hour valuePair does not exist in the annotation
- */
- Integer getHour();
-
- /**
- * Corresponds to the hour element of the TimeOfDay annotation.
- * Set to null to remove the hour valuePair from the annotation
- */
- void setHour(Integer hour);
- String HOUR_PROPERTY = "hourProperty"; //$NON-NLS-1$
-
- /**
- * Corresponds to the minute element of the TimeOfDay annotation.
- * Returns null if the minute valuePair does not exist in the annotation
- */
- Integer getMinute();
-
- /**
- * Corresponds to the minute element of the TimeOfDay annotation.
- * Set to null to remove the minute valuePair from the annotation
- */
- void setMinute(Integer minute);
- String MINUTE_PROPERTY = "minuteProperty"; //$NON-NLS-1$
-
- /**
- * Corresponds to the second element of the TimeOfDay annotation.
- * Returns null if the second valuePair does not exist in the annotation
- */
- Integer getSecond();
-
- /**
- * Corresponds to the second element of the TimeOfDay annotation.
- * Set to null to remove the second valuePair from the annotation
- */
- void setSecond(Integer second);
- String SECOND_PROPERTY = "secondProperty"; //$NON-NLS-1$
-
-
- /**
- * Corresponds to the millisecond element of the TimeOfDay annotation.
- * Returns null if the millisecond valuePair does not exist in the annotation
- */
- Integer getMillisecond();
-
- /**
- * Corresponds to the millisecond element of the TimeOfDay annotation.
- * Set to null to remove the millisecond valuePair from the annotation
- */
- void setMillisecond(Integer millisecond);
- String MILLISECOND_PROPERTY = "millisecondProperty"; //$NON-NLS-1$
-
-
- /**
- * Return the {@link TextRange} for the hour element. If the hour element
- * does not exist return the {@link TextRange} for the TimeOfDay annotation.
- */
- TextRange getHourTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the minute element. If the minute element
- * does not exist return the {@link TextRange} for the TimeOfDay annotation.
- */
- TextRange getMinuteTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the second element. If the second element
- * does not exist return the {@link TextRange} for the TimeOfDay annotation.
- */
- TextRange getSecondTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the millisecond element. If the millisecond 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/TransformationAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/TransformationAnnotation.java
deleted file mode 100644
index 767b30bc6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/TransformationAnnotation.java
+++ /dev/null
@@ -1,73 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.FetchType;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Java resource model interface that 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 TransformationAnnotation extends JavaResourceNode
-{
-
- String ANNOTATION_NAME = EclipseLinkJPA.TRANSFORMATION;
-
- /**
- * Corresponds to the fetch element of the Transformation annotation.
- * Returns null if the fetch element does not exist in java.
- */
- FetchType getFetch();
-
- /**
- * Corresponds to the fetch element of the Transformation annotation.
- * Set to null to remove the fetch element.
- */
- void setFetch(FetchType fetch);
- String FETCH_PROPERTY = "fetchProperty"; //$NON-NLS-1$
-
- /**
- * Corresponds to the optional element of the Transformation annotation.
- * Returns null if the optional element does not exist in java.
- */
- Boolean getOptional();
-
- /**
- * Corresponds to the optional element of the Transformation annotation.
- * Set to null to remove the optional element.
- */
- void setOptional(Boolean optional);
- String OPTIONAL_PROPERTY = "optionalProperty"; //$NON-NLS-1$
-
- /**
- * Return the {@link TextRange} for the fetch element. If the fetch element
- * does not exist return the {@link TextRange} for the Transformation annotation.
- */
- TextRange getFetchTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the optional element. If the optional 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/TransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/TransformerAnnotation.java
deleted file mode 100644
index 0e9952f891..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/TransformerAnnotation.java
+++ /dev/null
@@ -1,72 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-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.1
- */
-public interface TransformerAnnotation extends JavaResourceNode
-{
-
- /**
- * Corresponds to the transformerClass element of the *Transformer annotation.
- * Returns null if the transformerClass element does not exist in java.
- * Returns the portion of the transformerClass preceding the .class.
- * <p>
- * &#64;ReadTransformer(transformerClass=Employee.class)
- * </p>
- * will return "Employee"
- **/
- String getTransformerClass();
-
- /**
- * Corresponds to the transformerClass element of the *Transformer annotation.
- * Set to null to remove the transformerClass element.
- */
- void setTransformerClass(String transformerClass);
- String TRANSFORMER_CLASS_PROPERTY = "transformerClassProperty"; //$NON-NLS-1$
-
- /**
- * Corresponds to the method element of the *Transformer annotation.
- * Returns null if the method element does not exist in java.
- **/
- String getMethod();
-
- /**
- * Corresponds to the method element of the *Transformer annotation.
- * Set to null to remove the method element.
- */
- void setMethod(String method);
- String METHOD_PROPERTY = "methodProperty"; //$NON-NLS-1$
-
- /**
- * Return the {@link TextRange} for the transformerClass element. If the transformerClass element
- * does not exist return the {@link TextRange} for the *Transformer annotation.
- */
- TextRange getTransformerClassTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the method element. If the method 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/TypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/TypeConverterAnnotation.java
deleted file mode 100644
index 60aa8a78df..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/TypeConverterAnnotation.java
+++ /dev/null
@@ -1,69 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Java resource model interface that 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 TypeConverterAnnotation extends NamedConverterAnnotation
-{
- String ANNOTATION_NAME = EclipseLinkJPA.TYPE_CONVERTER;
-
- /**
- * Corresponds to the dataType element of the TypeConverter annotation.
- * Returns null if the dataType element does not exist in java.
- */
- String getDataType();
-
- /**
- * Corresponds to the dataType element of the TypeConverter annotation.
- * Set to null to remove the dataType element.
- */
- void setDataType(String value);
- String DATA_TYPE_PROPERTY = "dataTypeProperty"; //$NON-NLS-1$
-
- /**
- * Corresponds to the objectType element of the TypeConverter annotation.
- * Returns null if the objectType element does not exist in java.
- */
- String getObjectType();
-
- /**
- * Corresponds to the objectType element of the TypeConverter annotation.
- * Set to null to remove the objectType element.
- */
- void setObjectType(String value);
- String OBJECT_TYPE_PROPERTY = "objectTypeProperty"; //$NON-NLS-1$
-
- /**
- * Return the {@link TextRange} for the dataType element. If the dataType element
- * does not exist return the {@link TextRange} for the TypeConverter annotation.
- */
- TextRange getDataTypeTextRange(CompilationUnit astRoot);
-
- /**
- * Return the {@link TextRange} for the objectType element. If the objectType element
- * does not exist return the {@link TextRange} for the TypeConverter annotation.
- */
- TextRange getObjectTypeTextRange(CompilationUnit astRoot);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/WriteTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/WriteTransformerAnnotation.java
deleted file mode 100644
index 09f2dd96b6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/WriteTransformerAnnotation.java
+++ /dev/null
@@ -1,65 +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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Java resource model interface that 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 WriteTransformerAnnotation extends TransformerAnnotation
-{
-
- String ANNOTATION_NAME = EclipseLinkJPA.WRITE_TRANSFORMER;
-
- /**
- * Corresponds to the column element of the WriteTransformer annotation.
- * Returns null if the column element does not exist in java.
- */
- ColumnAnnotation getColumn();
-
- /**
- * Add the column element to the WriteTransformer annotation.
- */
- ColumnAnnotation addColumn();
-
- /**
- * Remove the column element from the WriteTransformer annotation.
- */
- void removeColumn();
-
- /**
- * 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();
-
- String COLUMN_PROPERTY = "columnProperty"; //$NON-NLS-1$
-
- /**
- * Return the {@link TextRange} for the column element. If the column 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/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 5497fe6f6c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/Attributes.java
+++ /dev/null
@@ -1,351 +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.resource.orm;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.ListIterator;
-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.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlBasic;
-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.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.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Attributes</b></em>'.
- * <!-- end-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.
- *
- * <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>
- * </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;
-
- /**
- * <!-- 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;
- }
-
- /**
- * <!-- 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);
- }
- 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();
- }
- 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;
- }
- 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;
- }
- 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();
- }
- return super.eIsSet(featureID);
- }
-
- @Override
- public List<XmlAttributeMapping> getAttributeMappings() {
- List<XmlAttributeMapping> attributeMappings = new ArrayList<XmlAttributeMapping>();
- ListIterator<XmlId> ids = new CloneListIterator<XmlId>(this.getIds());//prevent ConcurrentModificiationException
- for (XmlId mapping : CollectionTools.iterable(ids)) {
- attributeMappings.add(mapping);
- }
- ListIterator<XmlEmbeddedId> embeddedIds = new CloneListIterator<XmlEmbeddedId>(this.getEmbeddedIds());//prevent ConcurrentModificiationException
- for (XmlEmbeddedId mapping : CollectionTools.iterable(embeddedIds)) {
- attributeMappings.add(mapping);
- }
- ListIterator<XmlBasic> basics = new CloneListIterator<XmlBasic>(this.getBasics());//prevent ConcurrentModificiationException
- for (XmlBasic mapping : CollectionTools.iterable(basics)) {
- attributeMappings.add(mapping);
- }
- ListIterator<XmlBasicCollection> basicCollections = new CloneListIterator<XmlBasicCollection>(this.getBasicCollections());//prevent ConcurrentModificiationException
- for (XmlBasicCollection mapping : CollectionTools.iterable(basicCollections)) {
- attributeMappings.add(mapping);
- }
- ListIterator<XmlBasicMap> basicMaps = new CloneListIterator<XmlBasicMap>(this.getBasicMaps());//prevent ConcurrentModificiationException
- for (XmlBasicMap mapping : CollectionTools.iterable(basicMaps)) {
- attributeMappings.add(mapping);
- }
- ListIterator<XmlVersion> versions = new CloneListIterator<XmlVersion>(this.getVersions());//prevent ConcurrentModificiationException
- for (XmlVersion mapping : CollectionTools.iterable(versions)) {
- attributeMappings.add(mapping);
- }
- ListIterator<XmlManyToOne> manyToOnes = new CloneListIterator<XmlManyToOne>(this.getManyToOnes());//prevent ConcurrentModificiationException
- for (XmlManyToOne mapping : CollectionTools.iterable(manyToOnes)) {
- attributeMappings.add(mapping);
- }
- ListIterator<XmlOneToMany> oneToManys = new CloneListIterator<XmlOneToMany>(this.getOneToManys());//prevent ConcurrentModificiationException
- for (XmlOneToMany mapping : CollectionTools.iterable(oneToManys)) {
- attributeMappings.add(mapping);
- }
- ListIterator<XmlOneToOne> oneToOnes = new CloneListIterator<XmlOneToOne>(this.getOneToOnes());//prevent ConcurrentModificiationException
- for (XmlOneToOne mapping : CollectionTools.iterable(oneToOnes)) {
- attributeMappings.add(mapping);
- }
- ListIterator<XmlManyToMany> manyToManys = new CloneListIterator<XmlManyToMany>(this.getManyToManys());//prevent ConcurrentModificiationException
- for (XmlManyToMany mapping : CollectionTools.iterable(manyToManys)) {
- attributeMappings.add(mapping);
- }
- ListIterator<XmlEmbedded> embeddeds = new CloneListIterator<XmlEmbedded>(this.getEmbeddeds());//prevent ConcurrentModificiationException
- for (XmlEmbedded mapping : CollectionTools.iterable(embeddeds)) {
- attributeMappings.add(mapping);
- }
- ListIterator<XmlTransformation> transformations = new CloneListIterator<XmlTransformation>(this.getTransformations());//prevent ConcurrentModificiationException
- for (XmlTransformation mapping : CollectionTools.iterable(transformations)) {
- attributeMappings.add(mapping);
- }
- ListIterator<XmlTransient> transients = new CloneListIterator<XmlTransient>(this.getTransients());//prevent ConcurrentModificiationException
- for (XmlTransient mapping : CollectionTools.iterable(transients)) {
- attributeMappings.add(mapping);
- }
- return attributeMappings;
- }
-
-
-} // Attributes
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 67644746e9..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * 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 d5894b3753..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * 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/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 12a0232351..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmFactory.java
+++ /dev/null
@@ -1,565 +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.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 -->
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * 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
- * @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_CONVERTER_IMPL: return (EObject)createXmlConverterImpl();
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER_IMPL: return (EObject)createXmlTypeConverterImpl();
- case EclipseLinkOrmPackage.XML_CONVERSION_VALUE_IMPL: return (EObject)createXmlConversionValueImpl();
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER_IMPL: return (EObject)createXmlObjectTypeConverterImpl();
- case EclipseLinkOrmPackage.XML_STRUCT_CONVERTER_IMPL: return (EObject)createXmlStructConverterImpl();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS: return (EObject)createXmlEntityMappings();
- case EclipseLinkOrmPackage.XML_CUSTOMIZER: return (EObject)createXmlCustomizer();
- case EclipseLinkOrmPackage.XML_CHANGE_TRACKING: return (EObject)createXmlChangeTracking();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE: return (EObject)createXmlEmbeddable();
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY: return (EObject)createXmlTimeOfDay();
- case EclipseLinkOrmPackage.XML_CACHE: return (EObject)createXmlCache();
- case EclipseLinkOrmPackage.XML_ENTITY: return (EObject)createXmlEntity();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS: return (EObject)createXmlMappedSuperclass();
- case EclipseLinkOrmPackage.XML_ID_IMPL: return (EObject)createXmlIdImpl();
- case EclipseLinkOrmPackage.XML_BASIC_IMPL: return (EObject)createXmlBasicImpl();
- case EclipseLinkOrmPackage.XML_VERSION_IMPL: return (EObject)createXmlVersionImpl();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE_IMPL: return (EObject)createXmlOneToOneImpl();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY_IMPL: return (EObject)createXmlOneToManyImpl();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE_IMPL: return (EObject)createXmlManyToOneImpl();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY_IMPL: return (EObject)createXmlManyToManyImpl();
- case EclipseLinkOrmPackage.ATTRIBUTES: return (EObject)createAttributes();
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION_IMPL: return (EObject)createXmlBasicCollectionImpl();
- case EclipseLinkOrmPackage.XML_BASIC_MAP_IMPL: return (EObject)createXmlBasicMapImpl();
- case EclipseLinkOrmPackage.XML_TRANSFORMATION_IMPL: return (EObject)createXmlTransformationImpl();
- 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.XML_CHANGE_TRACKING_TYPE:
- return createXmlChangeTrackingTypeFromString(eDataType, initialValue);
- case EclipseLinkOrmPackage.CACHE_TYPE:
- return createCacheTypeFromString(eDataType, initialValue);
- case EclipseLinkOrmPackage.CACHE_COORDINATION_TYPE:
- return createCacheCoordinationTypeFromString(eDataType, initialValue);
- case EclipseLinkOrmPackage.EXISTENCE_TYPE:
- return createExistenceTypeFromString(eDataType, initialValue);
- case EclipseLinkOrmPackage.XML_JOIN_FETCH_TYPE:
- return createXmlJoinFetchTypeFromString(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.XML_CHANGE_TRACKING_TYPE:
- return convertXmlChangeTrackingTypeToString(eDataType, instanceValue);
- case EclipseLinkOrmPackage.CACHE_TYPE:
- return convertCacheTypeToString(eDataType, instanceValue);
- case EclipseLinkOrmPackage.CACHE_COORDINATION_TYPE:
- return convertCacheCoordinationTypeToString(eDataType, instanceValue);
- case EclipseLinkOrmPackage.EXISTENCE_TYPE:
- return convertExistenceTypeToString(eDataType, instanceValue);
- case EclipseLinkOrmPackage.XML_JOIN_FETCH_TYPE:
- return convertXmlJoinFetchTypeToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlEntityMappings createXmlEntityMappings()
- {
- XmlEntityMappings xmlEntityMappings = new XmlEntityMappings();
- return xmlEntityMappings;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlCustomizer createXmlCustomizer()
- {
- XmlCustomizer xmlCustomizer = new XmlCustomizer();
- return xmlCustomizer;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlChangeTracking createXmlChangeTracking()
- {
- XmlChangeTracking xmlChangeTracking = new XmlChangeTracking();
- return xmlChangeTracking;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlEmbeddable createXmlEmbeddable()
- {
- XmlEmbeddable xmlEmbeddable = new XmlEmbeddable();
- return xmlEmbeddable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlEntity createXmlEntity()
- {
- XmlEntity xmlEntity = new XmlEntity();
- return xmlEntity;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlMappedSuperclass createXmlMappedSuperclass()
- {
- XmlMappedSuperclass xmlMappedSuperclass = new XmlMappedSuperclass();
- return xmlMappedSuperclass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlConverterImpl createXmlConverterImpl()
- {
- XmlConverterImpl xmlConverterImpl = new XmlConverterImpl();
- return xmlConverterImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlTypeConverterImpl createXmlTypeConverterImpl()
- {
- XmlTypeConverterImpl xmlTypeConverterImpl = new XmlTypeConverterImpl();
- return xmlTypeConverterImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlConversionValueImpl createXmlConversionValueImpl()
- {
- XmlConversionValueImpl xmlConversionValueImpl = new XmlConversionValueImpl();
- return xmlConversionValueImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlObjectTypeConverterImpl createXmlObjectTypeConverterImpl()
- {
- XmlObjectTypeConverterImpl xmlObjectTypeConverterImpl = new XmlObjectTypeConverterImpl();
- return xmlObjectTypeConverterImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlStructConverterImpl createXmlStructConverterImpl()
- {
- XmlStructConverterImpl xmlStructConverterImpl = new XmlStructConverterImpl();
- return xmlStructConverterImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlIdImpl createXmlIdImpl()
- {
- XmlIdImpl xmlIdImpl = new XmlIdImpl();
- return xmlIdImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlBasicImpl createXmlBasicImpl()
- {
- XmlBasicImpl xmlBasicImpl = new XmlBasicImpl();
- return xmlBasicImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlVersionImpl createXmlVersionImpl()
- {
- XmlVersionImpl xmlVersionImpl = new XmlVersionImpl();
- return xmlVersionImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlOneToOneImpl createXmlOneToOneImpl()
- {
- XmlOneToOneImpl xmlOneToOneImpl = new XmlOneToOneImpl();
- return xmlOneToOneImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlOneToManyImpl createXmlOneToManyImpl()
- {
- XmlOneToManyImpl xmlOneToManyImpl = new XmlOneToManyImpl();
- return xmlOneToManyImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlManyToOneImpl createXmlManyToOneImpl()
- {
- XmlManyToOneImpl xmlManyToOneImpl = new XmlManyToOneImpl();
- return xmlManyToOneImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlManyToManyImpl createXmlManyToManyImpl()
- {
- XmlManyToManyImpl xmlManyToManyImpl = new XmlManyToManyImpl();
- return xmlManyToManyImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Attributes createAttributes()
- {
- Attributes attributes = new Attributes();
- return attributes;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlBasicCollectionImpl createXmlBasicCollectionImpl()
- {
- XmlBasicCollectionImpl xmlBasicCollectionImpl = new XmlBasicCollectionImpl();
- return xmlBasicCollectionImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlBasicMapImpl createXmlBasicMapImpl()
- {
- XmlBasicMapImpl xmlBasicMapImpl = new XmlBasicMapImpl();
- return xmlBasicMapImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlTransformationImpl createXmlTransformationImpl()
- {
- XmlTransformationImpl xmlTransformationImpl = new XmlTransformationImpl();
- return xmlTransformationImpl;
- }
-
- /**
- * <!-- 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 XmlTimeOfDay createXmlTimeOfDay()
- {
- XmlTimeOfDay xmlTimeOfDay = new XmlTimeOfDay();
- return xmlTimeOfDay;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlCache createXmlCache()
- {
- XmlCache xmlCache = new XmlCache();
- return xmlCache;
- }
-
- /**
- * <!-- 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 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 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 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 EclipseLinkOrmPackage getEclipseLinkOrmPackage()
- {
- return (EclipseLinkOrmPackage)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static EclipseLinkOrmPackage getPackage()
- {
- return EclipseLinkOrmPackage.eINSTANCE;
- }
-
-} //EclipseLinkOrmFactory
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 309db2551e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java
+++ /dev/null
@@ -1,7382 +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.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;
-
-/**
- * <!-- 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.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- 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.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 = 0;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_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.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 = 13;
-
- /**
- * 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 = 14;
-
- /**
- * 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 = 11;
-
- /**
- * 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 = 12;
-
- /**
- * 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 = 15;
-
- /**
- * 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 = 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 = 17;
-
- /**
- * 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 = 18;
-
- /**
- * 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 = 19;
-
- /**
- * 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 = 20;
-
- /**
- * 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 = 21;
-
- /**
- * 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 = 22;
-
- /**
- * 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 = 23;
-
- /**
- * 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 = 24;
-
- /**
- * 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 = 26;
-
- /**
- * 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 = 27;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlIdImpl <em>Xml Id Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlIdImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlIdImpl()
- * @generated
- */
- public static final int XML_ID_IMPL = 28;
-
- /**
- * 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 = 29;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicImpl <em>Xml Basic Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicImpl()
- * @generated
- */
- public static final int XML_BASIC_IMPL = 30;
-
- /**
- * 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 = 31;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlVersionImpl <em>Xml Version Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlVersionImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVersionImpl()
- * @generated
- */
- public static final int XML_VERSION_IMPL = 32;
-
- /**
- * 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 = 33;
-
- /**
- * 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 = 34;
-
- /**
- * 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 = 35;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToOneImpl <em>Xml One To One Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToOneImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToOneImpl()
- * @generated
- */
- public static final int XML_ONE_TO_ONE_IMPL = 36;
-
- /**
- * 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 = 37;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToManyImpl <em>Xml One To Many Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToManyImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToManyImpl()
- * @generated
- */
- public static final int XML_ONE_TO_MANY_IMPL = 38;
-
- /**
- * 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 = 39;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToOneImpl <em>Xml Many To One Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToOneImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToOneImpl()
- * @generated
- */
- public static final int XML_MANY_TO_ONE_IMPL = 40;
-
- /**
- * 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 = 41;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToManyImpl <em>Xml Many To Many Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToManyImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToManyImpl()
- * @generated
- */
- public static final int XML_MANY_TO_MANY_IMPL = 42;
-
- /**
- * 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 = 1;
-
- /**
- * 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 = 3;
-
- /**
- * 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 = 5;
-
- /**
- * 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 = 7;
-
- /**
- * 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 = 9;
-
- /**
- * 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 = 25;
-
- /**
- * 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.XmlConverterImpl <em>Xml Converter Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverterImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterImpl()
- * @generated
- */
- public static final int XML_CONVERTER_IMPL = 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_CONVERTER_IMPL__NAME = XML_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_IMPL__CLASS_NAME = XML_CONVERTER__CLASS_NAME;
-
- /**
- * The number of structural features of the '<em>Xml Converter Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTER_IMPL_FEATURE_COUNT = XML_CONVERTER_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_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.XmlTypeConverterImpl <em>Xml Type Converter Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlTypeConverterImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTypeConverterImpl()
- * @generated
- */
- public static final int XML_TYPE_CONVERTER_IMPL = 4;
-
- /**
- * 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_IMPL__NAME = XML_TYPE_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_IMPL__DATA_TYPE = XML_TYPE_CONVERTER__DATA_TYPE;
-
- /**
- * 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_IMPL__OBJECT_TYPE = XML_TYPE_CONVERTER__OBJECT_TYPE;
-
- /**
- * The number of structural features of the '<em>Xml Type Converter Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TYPE_CONVERTER_IMPL_FEATURE_COUNT = XML_TYPE_CONVERTER_FEATURE_COUNT + 0;
-
- /**
- * 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.XmlConversionValueImpl <em>Xml Conversion Value Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlConversionValueImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConversionValueImpl()
- * @generated
- */
- public static final int XML_CONVERSION_VALUE_IMPL = 6;
-
- /**
- * 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_IMPL__DATA_VALUE = XML_CONVERSION_VALUE__DATA_VALUE;
-
- /**
- * 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_IMPL__OBJECT_VALUE = XML_CONVERSION_VALUE__OBJECT_VALUE;
-
- /**
- * The number of structural features of the '<em>Xml Conversion Value Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERSION_VALUE_IMPL_FEATURE_COUNT = XML_CONVERSION_VALUE_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_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.XmlObjectTypeConverterImpl <em>Xml Object Type Converter Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverterImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlObjectTypeConverterImpl()
- * @generated
- */
- public static final int XML_OBJECT_TYPE_CONVERTER_IMPL = 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_OBJECT_TYPE_CONVERTER_IMPL__NAME = XML_OBJECT_TYPE_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_IMPL__DATA_TYPE = XML_OBJECT_TYPE_CONVERTER__DATA_TYPE;
-
- /**
- * 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_IMPL__OBJECT_TYPE = XML_OBJECT_TYPE_CONVERTER__OBJECT_TYPE;
-
- /**
- * 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_IMPL__CONVERSION_VALUES = XML_OBJECT_TYPE_CONVERTER__CONVERSION_VALUES;
-
- /**
- * 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_IMPL__DEFAULT_OBJECT_VALUE = XML_OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE;
-
- /**
- * The number of structural features of the '<em>Xml Object Type Converter Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_OBJECT_TYPE_CONVERTER_IMPL_FEATURE_COUNT = XML_OBJECT_TYPE_CONVERTER_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCT_CONVERTER__NAME = XML_NAMED_CONVERTER__NAME;
-
- /**
- * The feature id for the '<em><b>Converter</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCT_CONVERTER__CONVERTER = XML_NAMED_CONVERTER_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Struct Converter</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCT_CONVERTER_FEATURE_COUNT = XML_NAMED_CONVERTER_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlStructConverterImpl <em>Xml Struct Converter Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlStructConverterImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStructConverterImpl()
- * @generated
- */
- public static final int XML_STRUCT_CONVERTER_IMPL = 10;
-
- /**
- * 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_IMPL__NAME = XML_STRUCT_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_IMPL__CONVERTER = XML_STRUCT_CONVERTER__CONVERTER;
-
- /**
- * The number of structural features of the '<em>Xml Struct Converter Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCT_CONVERTER_IMPL_FEATURE_COUNT = XML_STRUCT_CONVERTER_FEATURE_COUNT + 0;
-
- /**
- * 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 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>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>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>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>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>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 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 + 4;
-
- /**
- * 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 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 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 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 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>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>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>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 + 0;
-
- /**
- * 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 + 1;
-
- /**
- * 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 + 2;
-
- /**
- * 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 + 3;
-
- /**
- * 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 + 4;
-
- /**
- * 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 + 5;
-
- /**
- * 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 + 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_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 feature id for the '<em><b>Hour</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TIME_OF_DAY__HOUR = 0;
-
- /**
- * The feature id for the '<em><b>Minute</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TIME_OF_DAY__MINUTE = 1;
-
- /**
- * The feature id for the '<em><b>Second</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TIME_OF_DAY__SECOND = 2;
-
- /**
- * The feature id for the '<em><b>Millisecond</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TIME_OF_DAY__MILLISECOND = 3;
-
- /**
- * The number of structural features of the '<em>Xml Time Of Day</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TIME_OF_DAY_FEATURE_COUNT = 4;
-
- /**
- * The feature id for the '<em><b>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 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 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>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>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>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>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>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>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>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>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>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>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 + 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_ENTITY__CUSTOMIZER = OrmPackage.XML_ENTITY_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_ENTITY__CHANGE_TRACKING = OrmPackage.XML_ENTITY_FEATURE_COUNT + 2;
-
- /**
- * 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 + 3;
-
- /**
- * 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 + 4;
-
- /**
- * 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 + 5;
-
- /**
- * 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 + 6;
-
- /**
- * 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 + 7;
-
- /**
- * 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 + 8;
-
- /**
- * 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 + 9;
-
- /**
- * 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>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>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>Pre Persist</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__PRE_PERSIST = OrmPackage.XML_MAPPED_SUPERCLASS__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_MAPPED_SUPERCLASS__POST_PERSIST = OrmPackage.XML_MAPPED_SUPERCLASS__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_MAPPED_SUPERCLASS__PRE_REMOVE = OrmPackage.XML_MAPPED_SUPERCLASS__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_MAPPED_SUPERCLASS__POST_REMOVE = OrmPackage.XML_MAPPED_SUPERCLASS__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_MAPPED_SUPERCLASS__PRE_UPDATE = OrmPackage.XML_MAPPED_SUPERCLASS__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_MAPPED_SUPERCLASS__POST_UPDATE = OrmPackage.XML_MAPPED_SUPERCLASS__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_MAPPED_SUPERCLASS__POST_LOAD = OrmPackage.XML_MAPPED_SUPERCLASS__POST_LOAD;
-
- /**
- * 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 + 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_MAPPED_SUPERCLASS__CUSTOMIZER = OrmPackage.XML_MAPPED_SUPERCLASS_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_MAPPED_SUPERCLASS__CHANGE_TRACKING = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 2;
-
- /**
- * 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 + 3;
-
- /**
- * 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 + 4;
-
- /**
- * 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 + 5;
-
- /**
- * 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 + 6;
-
- /**
- * 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 + 7;
-
- /**
- * 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 + 8;
-
- /**
- * 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 + 9;
-
- /**
- * The feature id for the '<em><b>Mutable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_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 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 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 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>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>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>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>Mutable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__MUTABLE = OrmPackage.XML_ID_FEATURE_COUNT + 0;
-
- /**
- * 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 + 1;
-
- /**
- * 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 + 2;
-
- /**
- * 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 + 3;
-
- /**
- * 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 + 4;
-
- /**
- * 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 + 5;
-
- /**
- * 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 + 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_ID_IMPL__NAME = OrmPackage.XML_ID_IMPL__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_IMPL__COLUMN = OrmPackage.XML_ID_IMPL__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_IMPL__LOB = OrmPackage.XML_ID_IMPL__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_IMPL__TEMPORAL = OrmPackage.XML_ID_IMPL__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_IMPL__ENUMERATED = OrmPackage.XML_ID_IMPL__ENUMERATED;
-
- /**
- * 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_IMPL__GENERATED_VALUE = OrmPackage.XML_ID_IMPL__GENERATED_VALUE;
-
- /**
- * 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_IMPL__TABLE_GENERATOR = OrmPackage.XML_ID_IMPL__TABLE_GENERATOR;
-
- /**
- * 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_IMPL__SEQUENCE_GENERATOR = OrmPackage.XML_ID_IMPL__SEQUENCE_GENERATOR;
-
- /**
- * 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_IMPL__MUTABLE = OrmPackage.XML_ID_IMPL_FEATURE_COUNT + 0;
-
- /**
- * 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_IMPL__CONVERTER = OrmPackage.XML_ID_IMPL_FEATURE_COUNT + 1;
-
- /**
- * 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_IMPL__TYPE_CONVERTER = OrmPackage.XML_ID_IMPL_FEATURE_COUNT + 2;
-
- /**
- * 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_IMPL__OBJECT_TYPE_CONVERTER = OrmPackage.XML_ID_IMPL_FEATURE_COUNT + 3;
-
- /**
- * 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_IMPL__STRUCT_CONVERTER = OrmPackage.XML_ID_IMPL_FEATURE_COUNT + 4;
-
- /**
- * 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_IMPL__CONVERT = OrmPackage.XML_ID_IMPL_FEATURE_COUNT + 5;
-
- /**
- * The number of structural features of the '<em>Xml Id Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID_IMPL_FEATURE_COUNT = OrmPackage.XML_ID_IMPL_FEATURE_COUNT + 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_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>Mutable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__MUTABLE = OrmPackage.XML_BASIC_FEATURE_COUNT + 0;
-
- /**
- * 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 + 1;
-
- /**
- * 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 + 2;
-
- /**
- * 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 + 3;
-
- /**
- * 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 + 4;
-
- /**
- * 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 + 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 = OrmPackage.XML_BASIC_FEATURE_COUNT + 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_BASIC_IMPL__NAME = OrmPackage.XML_BASIC_IMPL__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_IMPL__COLUMN = OrmPackage.XML_BASIC_IMPL__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_IMPL__LOB = OrmPackage.XML_BASIC_IMPL__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_IMPL__TEMPORAL = OrmPackage.XML_BASIC_IMPL__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_IMPL__ENUMERATED = OrmPackage.XML_BASIC_IMPL__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_IMPL__FETCH = OrmPackage.XML_BASIC_IMPL__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_IMPL__OPTIONAL = OrmPackage.XML_BASIC_IMPL__OPTIONAL;
-
- /**
- * 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_IMPL__MUTABLE = OrmPackage.XML_BASIC_IMPL_FEATURE_COUNT + 0;
-
- /**
- * 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_IMPL__CONVERTER = OrmPackage.XML_BASIC_IMPL_FEATURE_COUNT + 1;
-
- /**
- * 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_IMPL__TYPE_CONVERTER = OrmPackage.XML_BASIC_IMPL_FEATURE_COUNT + 2;
-
- /**
- * 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_IMPL__OBJECT_TYPE_CONVERTER = OrmPackage.XML_BASIC_IMPL_FEATURE_COUNT + 3;
-
- /**
- * 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_IMPL__STRUCT_CONVERTER = OrmPackage.XML_BASIC_IMPL_FEATURE_COUNT + 4;
-
- /**
- * 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_IMPL__CONVERT = OrmPackage.XML_BASIC_IMPL_FEATURE_COUNT + 5;
-
- /**
- * The number of structural features of the '<em>Xml Basic Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_IMPL_FEATURE_COUNT = OrmPackage.XML_BASIC_IMPL_FEATURE_COUNT + 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_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>Mutable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__MUTABLE = OrmPackage.XML_VERSION_FEATURE_COUNT + 0;
-
- /**
- * 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 + 1;
-
- /**
- * 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 + 2;
-
- /**
- * 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 + 3;
-
- /**
- * 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 + 4;
-
- /**
- * 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 + 5;
-
- /**
- * 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 + 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_VERSION_IMPL__NAME = OrmPackage.XML_VERSION_IMPL__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_IMPL__COLUMN = OrmPackage.XML_VERSION_IMPL__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_IMPL__LOB = OrmPackage.XML_VERSION_IMPL__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_IMPL__TEMPORAL = OrmPackage.XML_VERSION_IMPL__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_IMPL__ENUMERATED = OrmPackage.XML_VERSION_IMPL__ENUMERATED;
-
- /**
- * 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_IMPL__MUTABLE = OrmPackage.XML_VERSION_IMPL_FEATURE_COUNT + 0;
-
- /**
- * 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_IMPL__CONVERTER = OrmPackage.XML_VERSION_IMPL_FEATURE_COUNT + 1;
-
- /**
- * 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_IMPL__TYPE_CONVERTER = OrmPackage.XML_VERSION_IMPL_FEATURE_COUNT + 2;
-
- /**
- * 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_IMPL__OBJECT_TYPE_CONVERTER = OrmPackage.XML_VERSION_IMPL_FEATURE_COUNT + 3;
-
- /**
- * 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_IMPL__STRUCT_CONVERTER = OrmPackage.XML_VERSION_IMPL_FEATURE_COUNT + 4;
-
- /**
- * 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_IMPL__CONVERT = OrmPackage.XML_VERSION_IMPL_FEATURE_COUNT + 5;
-
- /**
- * The number of structural features of the '<em>Xml Version Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION_IMPL_FEATURE_COUNT = OrmPackage.XML_VERSION_IMPL_FEATURE_COUNT + 6;
-
- /**
- * The feature id for the '<em><b>Private Owned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIVATE_OWNED__PRIVATE_OWNED = 0;
-
- /**
- * The number of structural features of the '<em>Xml Private Owned</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIVATE_OWNED_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Join Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_FETCH__JOIN_FETCH = 0;
-
- /**
- * The number of structural features of the '<em>Xml Join Fetch</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_FETCH_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_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>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>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>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>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>Mapped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__MAPPED_BY = OrmPackage.XML_ONE_TO_ONE__MAPPED_BY;
-
- /**
- * The feature id for the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__PRIMARY_KEY_JOIN_COLUMNS = OrmPackage.XML_ONE_TO_ONE__PRIMARY_KEY_JOIN_COLUMNS;
-
- /**
- * The feature id for the '<em><b>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 + 0;
-
- /**
- * The feature id for the '<em><b>Join Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__JOIN_FETCH = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 1;
-
- /**
- * 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 + 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_ONE_TO_ONE_IMPL__NAME = OrmPackage.XML_ONE_TO_ONE_IMPL__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_IMPL__TARGET_ENTITY = OrmPackage.XML_ONE_TO_ONE_IMPL__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_IMPL__FETCH = OrmPackage.XML_ONE_TO_ONE_IMPL__FETCH;
-
- /**
- * 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_IMPL__JOIN_TABLE = OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_TABLE;
-
- /**
- * 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_IMPL__CASCADE = OrmPackage.XML_ONE_TO_ONE_IMPL__CASCADE;
-
- /**
- * 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_IMPL__OPTIONAL = OrmPackage.XML_ONE_TO_ONE_IMPL__OPTIONAL;
-
- /**
- * 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_IMPL__JOIN_COLUMNS = OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_COLUMNS;
-
- /**
- * 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_IMPL__MAPPED_BY = OrmPackage.XML_ONE_TO_ONE_IMPL__MAPPED_BY;
-
- /**
- * The feature id for the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_IMPL__PRIMARY_KEY_JOIN_COLUMNS = OrmPackage.XML_ONE_TO_ONE_IMPL__PRIMARY_KEY_JOIN_COLUMNS;
-
- /**
- * 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_IMPL__PRIVATE_OWNED = OrmPackage.XML_ONE_TO_ONE_IMPL_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Join Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_IMPL__JOIN_FETCH = OrmPackage.XML_ONE_TO_ONE_IMPL_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml One To One Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_IMPL_FEATURE_COUNT = OrmPackage.XML_ONE_TO_ONE_IMPL_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_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>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>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>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</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>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 + 0;
-
- /**
- * The feature id for the '<em><b>Join Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__JOIN_FETCH = OrmPackage.XML_ONE_TO_MANY_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 = OrmPackage.XML_ONE_TO_MANY_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_ONE_TO_MANY_IMPL__NAME = OrmPackage.XML_ONE_TO_MANY_IMPL__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_IMPL__TARGET_ENTITY = OrmPackage.XML_ONE_TO_MANY_IMPL__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_IMPL__FETCH = OrmPackage.XML_ONE_TO_MANY_IMPL__FETCH;
-
- /**
- * 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_IMPL__JOIN_TABLE = OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_TABLE;
-
- /**
- * 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_IMPL__CASCADE = OrmPackage.XML_ONE_TO_MANY_IMPL__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_IMPL__MAPPED_BY = OrmPackage.XML_ONE_TO_MANY_IMPL__MAPPED_BY;
-
- /**
- * 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_IMPL__ORDER_BY = OrmPackage.XML_ONE_TO_MANY_IMPL__ORDER_BY;
-
- /**
- * 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_IMPL__MAP_KEY = OrmPackage.XML_ONE_TO_MANY_IMPL__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_IMPL__JOIN_COLUMNS = OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_COLUMNS;
-
- /**
- * 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_IMPL__PRIVATE_OWNED = OrmPackage.XML_ONE_TO_MANY_IMPL_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Join Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_IMPL__JOIN_FETCH = OrmPackage.XML_ONE_TO_MANY_IMPL_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml One To Many Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_IMPL_FEATURE_COUNT = OrmPackage.XML_ONE_TO_MANY_IMPL_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_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>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>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>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>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>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 + 0;
-
- /**
- * 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 + 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_MANY_TO_ONE_IMPL__NAME = OrmPackage.XML_MANY_TO_ONE_IMPL__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_IMPL__TARGET_ENTITY = OrmPackage.XML_MANY_TO_ONE_IMPL__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_IMPL__FETCH = OrmPackage.XML_MANY_TO_ONE_IMPL__FETCH;
-
- /**
- * 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_IMPL__JOIN_TABLE = OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_TABLE;
-
- /**
- * 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_IMPL__CASCADE = OrmPackage.XML_MANY_TO_ONE_IMPL__CASCADE;
-
- /**
- * 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_IMPL__OPTIONAL = OrmPackage.XML_MANY_TO_ONE_IMPL__OPTIONAL;
-
- /**
- * 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_IMPL__JOIN_COLUMNS = OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_COLUMNS;
-
- /**
- * 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_IMPL__JOIN_FETCH = OrmPackage.XML_MANY_TO_ONE_IMPL_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Many To One Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_IMPL_FEATURE_COUNT = OrmPackage.XML_MANY_TO_ONE_IMPL_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_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>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>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>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</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>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 + 0;
-
- /**
- * 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 + 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_MANY_TO_MANY_IMPL__NAME = OrmPackage.XML_MANY_TO_MANY_IMPL__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_IMPL__TARGET_ENTITY = OrmPackage.XML_MANY_TO_MANY_IMPL__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_IMPL__FETCH = OrmPackage.XML_MANY_TO_MANY_IMPL__FETCH;
-
- /**
- * 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_IMPL__JOIN_TABLE = OrmPackage.XML_MANY_TO_MANY_IMPL__JOIN_TABLE;
-
- /**
- * 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_IMPL__CASCADE = OrmPackage.XML_MANY_TO_MANY_IMPL__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_IMPL__MAPPED_BY = OrmPackage.XML_MANY_TO_MANY_IMPL__MAPPED_BY;
-
- /**
- * 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_IMPL__ORDER_BY = OrmPackage.XML_MANY_TO_MANY_IMPL__ORDER_BY;
-
- /**
- * 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_IMPL__MAP_KEY = OrmPackage.XML_MANY_TO_MANY_IMPL__MAP_KEY;
-
- /**
- * 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_IMPL__JOIN_FETCH = OrmPackage.XML_MANY_TO_MANY_IMPL_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Many To Many Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_IMPL_FEATURE_COUNT = OrmPackage.XML_MANY_TO_MANY_IMPL_FEATURE_COUNT + 1;
-
- /**
- * 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 = 43;
-
- /**
- * 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 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 + 3;
-
- /**
- * 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 = 44;
-
- /**
- * 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.XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * 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.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollectionImpl <em>Xml Basic Collection Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollectionImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicCollectionImpl()
- * @generated
- */
- public static final int XML_BASIC_COLLECTION_IMPL = 45;
-
- /**
- * 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_IMPL__NAME = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The number of structural features of the '<em>Xml Basic Collection Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_COLLECTION_IMPL_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * 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 = 46;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_MAP__NAME = OrmPackage.XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * 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.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMapImpl <em>Xml Basic Map Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMapImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicMapImpl()
- * @generated
- */
- public static final int XML_BASIC_MAP_IMPL = 47;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_MAP_IMPL__NAME = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The number of structural features of the '<em>Xml Basic Map Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_MAP_IMPL_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * 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 = 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_TRANSFORMATION__NAME = OrmPackage.XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * 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.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformationImpl <em>Xml Transformation Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformationImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransformationImpl()
- * @generated
- */
- public static final int XML_TRANSFORMATION_IMPL = 49;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSFORMATION_IMPL__NAME = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The number of structural features of the '<em>Xml Transformation Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSFORMATION_IMPL_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * 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 = 50;
-
- /**
- * 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 = 51;
-
- /**
- * 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 = 52;
-
- /**
- * 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 = 54;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedConverterEClass = null;
-
- /**
- * 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 = 53;
-
- /**
- * <!-- 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 xmlChangeTrackingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlChangeTrackingHolderEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlConvertersHolderEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntityMappingsEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEmbeddableEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlReadOnlyEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTimeOfDayEClass = 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 xmlEntityEClass = 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 xmlConvertibleMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlIdEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlIdImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasicEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasicImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlVersionEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlVersionImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPrivateOwnedEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlJoinFetchEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToOneEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToOneImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToManyEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToManyImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToOneEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToOneImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToManyEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToManyImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass attributesEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasicCollectionEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasicCollectionImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasicMapEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasicMapImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTransformationEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTransformationImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum xmlChangeTrackingTypeEEnum = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlConverterEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlConverterImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTypeConverterEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTypeConverterImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlConversionValueEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlConversionValueImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlObjectTypeConverterEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlObjectTypeConverterImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlStructConverterEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlStructConverterImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlConverterHolderEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum cacheTypeEEnum = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum cacheCoordinationTypeEEnum = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum xmlJoinFetchTypeEEnum = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum existenceTypeEEnum = 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. Simple
- * dependencies are satisfied by calling this method on all
- * dependent packages before doing anything else. This method drives
- * initialization for interdependent packages directly, in parallel
- * with this package, itself.
- * <p>Of this package and its interdependencies, all packages which
- * have not yet been registered by their URI values are first created
- * and registered. The packages are then initialized in two steps:
- * meta-model objects for all of the packages are created before any
- * are initialized, since one package's meta-model objects may refer to
- * those of another.
- * <p>Invocation of this method will not affect any packages that have
- * already been initialized.
- * <!-- 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.getEPackage(eNS_URI) instanceof EclipseLinkOrmPackage ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new EclipseLinkOrmPackage());
-
- isInited = true;
-
- // Initialize simple dependencies
- OrmPackage.eINSTANCE.eClass();
- XMLTypePackage.eINSTANCE.eClass();
-
- // Create package meta-data objects
- theEclipseLinkOrmPackage.createPackageContents();
-
- // Initialize created meta-data
- theEclipseLinkOrmPackage.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theEclipseLinkOrmPackage.freeze();
-
- return theEclipseLinkOrmPackage;
- }
-
-
- /**
- * 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.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.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.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.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.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 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.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.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.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 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 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.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.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.XmlIdImpl <em>Xml Id Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Id Impl</em>'.
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlIdImpl
- * @generated
- */
- public EClass getXmlIdImpl()
- {
- return xmlIdImplEClass;
- }
-
-
- /**
- * 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.XmlBasicImpl <em>Xml Basic Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Basic Impl</em>'.
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicImpl
- * @generated
- */
- public EClass getXmlBasicImpl()
- {
- return xmlBasicImplEClass;
- }
-
-
- /**
- * 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 class '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlVersionImpl <em>Xml Version Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Version Impl</em>'.
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlVersionImpl
- * @generated
- */
- public EClass getXmlVersionImpl()
- {
- return xmlVersionImplEClass;
- }
-
-
- /**
- * 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.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.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.XmlOneToOneImpl <em>Xml One To One Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To One Impl</em>'.
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToOneImpl
- * @generated
- */
- public EClass getXmlOneToOneImpl()
- {
- return xmlOneToOneImplEClass;
- }
-
-
- /**
- * 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.XmlOneToManyImpl <em>Xml One To Many Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To Many Impl</em>'.
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToManyImpl
- * @generated
- */
- public EClass getXmlOneToManyImpl()
- {
- return xmlOneToManyImplEClass;
- }
-
-
- /**
- * 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.XmlManyToOneImpl <em>Xml Many To One Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Many To One Impl</em>'.
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToOneImpl
- * @generated
- */
- public EClass getXmlManyToOneImpl()
- {
- return xmlManyToOneImplEClass;
- }
-
-
- /**
- * 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.XmlManyToManyImpl <em>Xml Many To Many Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Many To Many Impl</em>'.
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToManyImpl
- * @generated
- */
- public EClass getXmlManyToManyImpl()
- {
- return xmlManyToManyImplEClass;
- }
-
-
- /**
- * 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 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.XmlBasicCollectionImpl <em>Xml Basic Collection Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Basic Collection Impl</em>'.
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollectionImpl
- * @generated
- */
- public EClass getXmlBasicCollectionImpl()
- {
- return xmlBasicCollectionImplEClass;
- }
-
-
- /**
- * 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.XmlBasicMapImpl <em>Xml Basic Map Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Basic Map Impl</em>'.
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMapImpl
- * @generated
- */
- public EClass getXmlBasicMapImpl()
- {
- return xmlBasicMapImplEClass;
- }
-
-
- /**
- * 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.XmlTransformationImpl <em>Xml Transformation Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Transformation Impl</em>'.
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformationImpl
- * @generated
- */
- public EClass getXmlTransformationImpl()
- {
- return xmlTransformationImplEClass;
- }
-
-
- /**
- * 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 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.XmlConverterImpl <em>Xml Converter Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Converter Impl</em>'.
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverterImpl
- * @generated
- */
- public EClass getXmlConverterImpl()
- {
- return xmlConverterImplEClass;
- }
-
-
- /**
- * 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.XmlTypeConverterImpl <em>Xml Type Converter Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Type Converter Impl</em>'.
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlTypeConverterImpl
- * @generated
- */
- public EClass getXmlTypeConverterImpl()
- {
- return xmlTypeConverterImplEClass;
- }
-
-
- /**
- * 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.XmlConversionValueImpl <em>Xml Conversion Value Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Conversion Value Impl</em>'.
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlConversionValueImpl
- * @generated
- */
- public EClass getXmlConversionValueImpl()
- {
- return xmlConversionValueImplEClass;
- }
-
-
- /**
- * 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 class '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverterImpl <em>Xml Object Type Converter Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Object Type Converter Impl</em>'.
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverterImpl
- * @generated
- */
- public EClass getXmlObjectTypeConverterImpl()
- {
- return xmlObjectTypeConverterImplEClass;
- }
-
-
- /**
- * 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.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.XmlStructConverterImpl <em>Xml Struct Converter Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Struct Converter Impl</em>'.
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlStructConverterImpl
- * @generated
- */
- public EClass getXmlStructConverterImpl()
- {
- return xmlStructConverterImplEClass;
- }
-
-
- /**
- * 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 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.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.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.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 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
- xmlNamedConverterEClass = createEClass(XML_NAMED_CONVERTER);
- createEAttribute(xmlNamedConverterEClass, XML_NAMED_CONVERTER__NAME);
-
- xmlConverterEClass = createEClass(XML_CONVERTER);
- createEAttribute(xmlConverterEClass, XML_CONVERTER__CLASS_NAME);
-
- xmlConverterImplEClass = createEClass(XML_CONVERTER_IMPL);
-
- xmlTypeConverterEClass = createEClass(XML_TYPE_CONVERTER);
- createEAttribute(xmlTypeConverterEClass, XML_TYPE_CONVERTER__DATA_TYPE);
- createEAttribute(xmlTypeConverterEClass, XML_TYPE_CONVERTER__OBJECT_TYPE);
-
- xmlTypeConverterImplEClass = createEClass(XML_TYPE_CONVERTER_IMPL);
-
- xmlConversionValueEClass = createEClass(XML_CONVERSION_VALUE);
- createEAttribute(xmlConversionValueEClass, XML_CONVERSION_VALUE__DATA_VALUE);
- createEAttribute(xmlConversionValueEClass, XML_CONVERSION_VALUE__OBJECT_VALUE);
-
- xmlConversionValueImplEClass = createEClass(XML_CONVERSION_VALUE_IMPL);
-
- 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);
-
- xmlObjectTypeConverterImplEClass = createEClass(XML_OBJECT_TYPE_CONVERTER_IMPL);
-
- xmlStructConverterEClass = createEClass(XML_STRUCT_CONVERTER);
- createEAttribute(xmlStructConverterEClass, XML_STRUCT_CONVERTER__CONVERTER);
-
- xmlStructConverterImplEClass = createEClass(XML_STRUCT_CONVERTER_IMPL);
-
- 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);
-
- xmlEntityMappingsEClass = createEClass(XML_ENTITY_MAPPINGS);
-
- xmlCustomizerEClass = createEClass(XML_CUSTOMIZER);
- createEAttribute(xmlCustomizerEClass, XML_CUSTOMIZER__CUSTOMIZER_CLASS_NAME);
-
- xmlCustomizerHolderEClass = createEClass(XML_CUSTOMIZER_HOLDER);
- createEReference(xmlCustomizerHolderEClass, XML_CUSTOMIZER_HOLDER__CUSTOMIZER);
-
- 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);
-
- xmlEmbeddableEClass = createEClass(XML_EMBEDDABLE);
-
- xmlReadOnlyEClass = createEClass(XML_READ_ONLY);
- createEAttribute(xmlReadOnlyEClass, XML_READ_ONLY__READ_ONLY);
-
- 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);
-
- 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);
-
- xmlEntityEClass = createEClass(XML_ENTITY);
-
- xmlMappedSuperclassEClass = createEClass(XML_MAPPED_SUPERCLASS);
-
- xmlMutableEClass = createEClass(XML_MUTABLE);
- createEAttribute(xmlMutableEClass, XML_MUTABLE__MUTABLE);
-
- 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);
-
- xmlConvertibleMappingEClass = createEClass(XML_CONVERTIBLE_MAPPING);
- createEAttribute(xmlConvertibleMappingEClass, XML_CONVERTIBLE_MAPPING__CONVERT);
-
- xmlIdEClass = createEClass(XML_ID);
-
- xmlIdImplEClass = createEClass(XML_ID_IMPL);
-
- xmlBasicEClass = createEClass(XML_BASIC);
-
- xmlBasicImplEClass = createEClass(XML_BASIC_IMPL);
-
- xmlVersionEClass = createEClass(XML_VERSION);
-
- xmlVersionImplEClass = createEClass(XML_VERSION_IMPL);
-
- xmlPrivateOwnedEClass = createEClass(XML_PRIVATE_OWNED);
- createEAttribute(xmlPrivateOwnedEClass, XML_PRIVATE_OWNED__PRIVATE_OWNED);
-
- xmlJoinFetchEClass = createEClass(XML_JOIN_FETCH);
- createEAttribute(xmlJoinFetchEClass, XML_JOIN_FETCH__JOIN_FETCH);
-
- xmlOneToOneEClass = createEClass(XML_ONE_TO_ONE);
-
- xmlOneToOneImplEClass = createEClass(XML_ONE_TO_ONE_IMPL);
-
- xmlOneToManyEClass = createEClass(XML_ONE_TO_MANY);
-
- xmlOneToManyImplEClass = createEClass(XML_ONE_TO_MANY_IMPL);
-
- xmlManyToOneEClass = createEClass(XML_MANY_TO_ONE);
-
- xmlManyToOneImplEClass = createEClass(XML_MANY_TO_ONE_IMPL);
-
- xmlManyToManyEClass = createEClass(XML_MANY_TO_MANY);
-
- xmlManyToManyImplEClass = createEClass(XML_MANY_TO_MANY_IMPL);
-
- attributesEClass = createEClass(ATTRIBUTES);
- createEReference(attributesEClass, ATTRIBUTES__BASIC_COLLECTIONS);
- createEReference(attributesEClass, ATTRIBUTES__BASIC_MAPS);
- createEReference(attributesEClass, ATTRIBUTES__TRANSFORMATIONS);
-
- xmlBasicCollectionEClass = createEClass(XML_BASIC_COLLECTION);
-
- xmlBasicCollectionImplEClass = createEClass(XML_BASIC_COLLECTION_IMPL);
-
- xmlBasicMapEClass = createEClass(XML_BASIC_MAP);
-
- xmlBasicMapImplEClass = createEClass(XML_BASIC_MAP_IMPL);
-
- xmlTransformationEClass = createEClass(XML_TRANSFORMATION);
-
- xmlTransformationImplEClass = createEClass(XML_TRANSFORMATION_IMPL);
-
- // Create enums
- xmlChangeTrackingTypeEEnum = createEEnum(XML_CHANGE_TRACKING_TYPE);
- cacheTypeEEnum = createEEnum(CACHE_TYPE);
- cacheCoordinationTypeEEnum = createEEnum(CACHE_COORDINATION_TYPE);
- existenceTypeEEnum = createEEnum(EXISTENCE_TYPE);
- xmlJoinFetchTypeEEnum = createEEnum(XML_JOIN_FETCH_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
- OrmPackage theOrmPackage = (OrmPackage)EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI);
- XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- xmlConverterEClass.getESuperTypes().add(this.getXmlNamedConverter());
- xmlConverterImplEClass.getESuperTypes().add(this.getXmlConverter());
- xmlTypeConverterEClass.getESuperTypes().add(this.getXmlNamedConverter());
- xmlTypeConverterImplEClass.getESuperTypes().add(this.getXmlTypeConverter());
- xmlConversionValueImplEClass.getESuperTypes().add(this.getXmlConversionValue());
- xmlObjectTypeConverterEClass.getESuperTypes().add(this.getXmlNamedConverter());
- xmlObjectTypeConverterImplEClass.getESuperTypes().add(this.getXmlObjectTypeConverter());
- xmlStructConverterEClass.getESuperTypes().add(this.getXmlNamedConverter());
- xmlStructConverterImplEClass.getESuperTypes().add(this.getXmlStructConverter());
- xmlEntityMappingsEClass.getESuperTypes().add(theOrmPackage.getXmlEntityMappings());
- xmlEntityMappingsEClass.getESuperTypes().add(this.getXmlConvertersHolder());
- xmlEmbeddableEClass.getESuperTypes().add(theOrmPackage.getXmlEmbeddable());
- xmlEmbeddableEClass.getESuperTypes().add(this.getXmlCustomizerHolder());
- xmlEmbeddableEClass.getESuperTypes().add(this.getXmlChangeTrackingHolder());
- xmlEmbeddableEClass.getESuperTypes().add(this.getXmlConvertersHolder());
- xmlEntityEClass.getESuperTypes().add(theOrmPackage.getXmlEntity());
- 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());
- xmlMappedSuperclassEClass.getESuperTypes().add(theOrmPackage.getXmlMappedSuperclass());
- 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());
- xmlConvertibleMappingEClass.getESuperTypes().add(theOrmPackage.getXmlConvertibleMapping());
- xmlConvertibleMappingEClass.getESuperTypes().add(this.getXmlConverterHolder());
- xmlIdEClass.getESuperTypes().add(theOrmPackage.getXmlId());
- xmlIdEClass.getESuperTypes().add(this.getXmlMutable());
- xmlIdEClass.getESuperTypes().add(this.getXmlConvertibleMapping());
- xmlIdImplEClass.getESuperTypes().add(theOrmPackage.getXmlIdImpl());
- xmlIdImplEClass.getESuperTypes().add(this.getXmlId());
- xmlBasicEClass.getESuperTypes().add(theOrmPackage.getXmlBasic());
- xmlBasicEClass.getESuperTypes().add(this.getXmlMutable());
- xmlBasicEClass.getESuperTypes().add(this.getXmlConvertibleMapping());
- xmlBasicImplEClass.getESuperTypes().add(theOrmPackage.getXmlBasicImpl());
- xmlBasicImplEClass.getESuperTypes().add(this.getXmlBasic());
- xmlVersionEClass.getESuperTypes().add(theOrmPackage.getXmlVersion());
- xmlVersionEClass.getESuperTypes().add(this.getXmlMutable());
- xmlVersionEClass.getESuperTypes().add(this.getXmlConvertibleMapping());
- xmlVersionImplEClass.getESuperTypes().add(theOrmPackage.getXmlVersionImpl());
- xmlVersionImplEClass.getESuperTypes().add(this.getXmlVersion());
- xmlOneToOneEClass.getESuperTypes().add(theOrmPackage.getXmlOneToOne());
- xmlOneToOneEClass.getESuperTypes().add(this.getXmlPrivateOwned());
- xmlOneToOneEClass.getESuperTypes().add(this.getXmlJoinFetch());
- xmlOneToOneImplEClass.getESuperTypes().add(theOrmPackage.getXmlOneToOneImpl());
- xmlOneToOneImplEClass.getESuperTypes().add(this.getXmlOneToOne());
- xmlOneToManyEClass.getESuperTypes().add(theOrmPackage.getXmlOneToMany());
- xmlOneToManyEClass.getESuperTypes().add(this.getXmlPrivateOwned());
- xmlOneToManyEClass.getESuperTypes().add(this.getXmlJoinFetch());
- xmlOneToManyImplEClass.getESuperTypes().add(theOrmPackage.getXmlOneToManyImpl());
- xmlOneToManyImplEClass.getESuperTypes().add(this.getXmlOneToMany());
- xmlManyToOneEClass.getESuperTypes().add(theOrmPackage.getXmlManyToOne());
- xmlManyToOneEClass.getESuperTypes().add(this.getXmlJoinFetch());
- xmlManyToOneImplEClass.getESuperTypes().add(theOrmPackage.getXmlManyToOneImpl());
- xmlManyToOneImplEClass.getESuperTypes().add(this.getXmlManyToOne());
- xmlManyToManyEClass.getESuperTypes().add(theOrmPackage.getXmlManyToMany());
- xmlManyToManyEClass.getESuperTypes().add(this.getXmlJoinFetch());
- xmlManyToManyImplEClass.getESuperTypes().add(theOrmPackage.getXmlManyToManyImpl());
- xmlManyToManyImplEClass.getESuperTypes().add(this.getXmlManyToMany());
- attributesEClass.getESuperTypes().add(theOrmPackage.getAttributes());
- xmlBasicCollectionEClass.getESuperTypes().add(theOrmPackage.getXmlAttributeMapping());
- xmlBasicCollectionImplEClass.getESuperTypes().add(theOrmPackage.getAbstractXmlAttributeMapping());
- xmlBasicCollectionImplEClass.getESuperTypes().add(this.getXmlBasicCollection());
- xmlBasicMapEClass.getESuperTypes().add(theOrmPackage.getXmlAttributeMapping());
- xmlBasicMapImplEClass.getESuperTypes().add(theOrmPackage.getAbstractXmlAttributeMapping());
- xmlBasicMapImplEClass.getESuperTypes().add(this.getXmlBasicMap());
- xmlTransformationEClass.getESuperTypes().add(theOrmPackage.getXmlAttributeMapping());
- xmlTransformationImplEClass.getESuperTypes().add(theOrmPackage.getAbstractXmlAttributeMapping());
- xmlTransformationImplEClass.getESuperTypes().add(this.getXmlTransformation());
-
- // Initialize classes and features; add operations and parameters
- 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(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(xmlConverterImplEClass, XmlConverterImpl.class, "XmlConverterImpl", !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(xmlTypeConverterImplEClass, XmlTypeConverterImpl.class, "XmlTypeConverterImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- 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(xmlConversionValueImplEClass, XmlConversionValueImpl.class, "XmlConversionValueImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- 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(xmlObjectTypeConverterImplEClass, XmlObjectTypeConverterImpl.class, "XmlObjectTypeConverterImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- 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(xmlStructConverterImplEClass, XmlStructConverterImpl.class, "XmlStructConverterImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- 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(xmlEntityMappingsEClass, XmlEntityMappings.class, "XmlEntityMappings", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- 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(), this.getXmlCustomizer(), 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(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(xmlEmbeddableEClass, XmlEmbeddable.class, "XmlEmbeddable", !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(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(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(xmlEntityEClass, XmlEntity.class, "XmlEntity", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlMappedSuperclassEClass, XmlMappedSuperclass.class, "XmlMappedSuperclass", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- 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(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(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(xmlIdEClass, XmlId.class, "XmlId", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlIdImplEClass, XmlIdImpl.class, "XmlIdImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlBasicEClass, XmlBasic.class, "XmlBasic", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlBasicImplEClass, XmlBasicImpl.class, "XmlBasicImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlVersionEClass, XmlVersion.class, "XmlVersion", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlVersionImplEClass, XmlVersionImpl.class, "XmlVersionImpl", !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(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(xmlOneToOneEClass, XmlOneToOne.class, "XmlOneToOne", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlOneToOneImplEClass, XmlOneToOneImpl.class, "XmlOneToOneImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlOneToManyEClass, XmlOneToMany.class, "XmlOneToMany", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlOneToManyImplEClass, XmlOneToManyImpl.class, "XmlOneToManyImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlManyToOneEClass, XmlManyToOne.class, "XmlManyToOne", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlManyToOneImplEClass, XmlManyToOneImpl.class, "XmlManyToOneImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlManyToManyEClass, XmlManyToMany.class, "XmlManyToMany", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlManyToManyImplEClass, XmlManyToManyImpl.class, "XmlManyToManyImpl", !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);
-
- initEClass(xmlBasicCollectionEClass, XmlBasicCollection.class, "XmlBasicCollection", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlBasicCollectionImplEClass, XmlBasicCollectionImpl.class, "XmlBasicCollectionImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlBasicMapEClass, XmlBasicMap.class, "XmlBasicMap", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlBasicMapImplEClass, XmlBasicMapImpl.class, "XmlBasicMapImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlTransformationEClass, XmlTransformation.class, "XmlTransformation", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlTransformationImplEClass, XmlTransformationImpl.class, "XmlTransformationImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- // Initialize enums and add enum literals
- initEEnum(xmlChangeTrackingTypeEEnum, XmlChangeTrackingType.class, "XmlChangeTrackingType");
- addEEnumLiteral(xmlChangeTrackingTypeEEnum, XmlChangeTrackingType.ATTRIBUTE);
- addEEnumLiteral(xmlChangeTrackingTypeEEnum, XmlChangeTrackingType.OBJECT);
- addEEnumLiteral(xmlChangeTrackingTypeEEnum, XmlChangeTrackingType.DEFERRED);
- addEEnumLiteral(xmlChangeTrackingTypeEEnum, XmlChangeTrackingType.AUTO);
-
- 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(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(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);
-
- // 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.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.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.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.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.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.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 '{@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.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.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.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 '{@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 '{@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.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.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.XmlIdImpl <em>Xml Id Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlIdImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlIdImpl()
- * @generated
- */
- public static final EClass XML_ID_IMPL = eINSTANCE.getXmlIdImpl();
-
- /**
- * 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.XmlBasicImpl <em>Xml Basic Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicImpl()
- * @generated
- */
- public static final EClass XML_BASIC_IMPL = eINSTANCE.getXmlBasicImpl();
-
- /**
- * 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.XmlVersionImpl <em>Xml Version Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlVersionImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVersionImpl()
- * @generated
- */
- public static final EClass XML_VERSION_IMPL = eINSTANCE.getXmlVersionImpl();
-
- /**
- * 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.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.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.XmlOneToOneImpl <em>Xml One To One Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToOneImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToOneImpl()
- * @generated
- */
- public static final EClass XML_ONE_TO_ONE_IMPL = eINSTANCE.getXmlOneToOneImpl();
-
- /**
- * 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.XmlOneToManyImpl <em>Xml One To Many Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToManyImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToManyImpl()
- * @generated
- */
- public static final EClass XML_ONE_TO_MANY_IMPL = eINSTANCE.getXmlOneToManyImpl();
-
- /**
- * 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.XmlManyToOneImpl <em>Xml Many To One Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToOneImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToOneImpl()
- * @generated
- */
- public static final EClass XML_MANY_TO_ONE_IMPL = eINSTANCE.getXmlManyToOneImpl();
-
- /**
- * 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.XmlManyToManyImpl <em>Xml Many To Many Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToManyImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToManyImpl()
- * @generated
- */
- public static final EClass XML_MANY_TO_MANY_IMPL = eINSTANCE.getXmlManyToManyImpl();
-
- /**
- * 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 '{@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.XmlBasicCollectionImpl <em>Xml Basic Collection Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollectionImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicCollectionImpl()
- * @generated
- */
- public static final EClass XML_BASIC_COLLECTION_IMPL = eINSTANCE.getXmlBasicCollectionImpl();
-
- /**
- * 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.XmlBasicMapImpl <em>Xml Basic Map Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMapImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicMapImpl()
- * @generated
- */
- public static final EClass XML_BASIC_MAP_IMPL = eINSTANCE.getXmlBasicMapImpl();
-
- /**
- * 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.XmlTransformationImpl <em>Xml Transformation Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformationImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransformationImpl()
- * @generated
- */
- public static final EClass XML_TRANSFORMATION_IMPL = eINSTANCE.getXmlTransformationImpl();
-
- /**
- * 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.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.XmlConverterImpl <em>Xml Converter Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverterImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterImpl()
- * @generated
- */
- public static final EClass XML_CONVERTER_IMPL = eINSTANCE.getXmlConverterImpl();
-
- /**
- * 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.XmlTypeConverterImpl <em>Xml Type Converter Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlTypeConverterImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTypeConverterImpl()
- * @generated
- */
- public static final EClass XML_TYPE_CONVERTER_IMPL = eINSTANCE.getXmlTypeConverterImpl();
-
- /**
- * 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.XmlConversionValueImpl <em>Xml Conversion Value Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlConversionValueImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConversionValueImpl()
- * @generated
- */
- public static final EClass XML_CONVERSION_VALUE_IMPL = eINSTANCE.getXmlConversionValueImpl();
-
- /**
- * 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 '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverterImpl <em>Xml Object Type Converter Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverterImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlObjectTypeConverterImpl()
- * @generated
- */
- public static final EClass XML_OBJECT_TYPE_CONVERTER_IMPL = eINSTANCE.getXmlObjectTypeConverterImpl();
-
- /**
- * 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.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.XmlStructConverterImpl <em>Xml Struct Converter Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlStructConverterImpl
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStructConverterImpl()
- * @generated
- */
- public static final EClass XML_STRUCT_CONVERTER_IMPL = eINSTANCE.getXmlStructConverterImpl();
-
- /**
- * 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.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.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.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.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();
-
- }
-
-} //EclipseLinkOrmPackage
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmResource.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmResource.java
deleted file mode 100644
index c9a22f1b55..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmResource.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.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jpt.core.resource.orm.OrmResource;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkJpaFile;
-import org.eclipse.jpt.eclipselink.core.internal.resource.orm.translators.EclipseLinkEntityMappingsTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Renderer;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * 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 EclipseLinkOrmResource
- extends OrmResource
-{
- public EclipseLinkOrmResource(URI uri, Renderer renderer) {
- super(uri, renderer);
- }
-
- @Override
- public XmlEntityMappings getEntityMappings() {
- return (XmlEntityMappings) super.getEntityMappings();
- }
-
- @Override
- public Translator getRootTranslator() {
- return EclipseLinkEntityMappingsTranslator.INSTANCE;
- }
-
- @Override
- public String getType() {
- return EclipseLinkJpaFile.ECLIPSELINK_ORM_RESOURCE_TYPE;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmResourceFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmResourceFactory.java
deleted file mode 100644
index 92204ac7bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmResourceFactory.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.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.util.URI;
-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 EclipseLinkOrmResourceFactory extends TranslatorResourceFactory
-{
- public EclipseLinkOrmResourceFactory() {
- this(RendererFactory.getDefaultRendererFactory());
- }
-
- public EclipseLinkOrmResourceFactory(RendererFactory aRendererFactory) {
- super(aRendererFactory);
- }
-
- public EclipseLinkOrmResourceFactory(RendererFactory aRendererFactory, boolean listeningForUpdates) {
- super(aRendererFactory, listeningForUpdates);
- }
-
-
- /**
- * @see TranslatorResourceFactory#createResource(URI, Renderer)
- */
- @Override
- protected TranslatorResource createResource(URI uri, Renderer renderer) {
- return new EclipseLinkOrmResource(uri, renderer);
- }
-}
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 d95bf76c82..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * 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/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 8666269243..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasic.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.resource.orm;
-
-
-/**
- * <!-- 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.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasic()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlBasic extends org.eclipse.jpt.core.resource.orm.XmlBasic, XmlMutable, XmlConvertibleMapping
-{
-} \ No newline at end of file
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 d35828bc92..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicCollection.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Basic Collection</b></em>'.
- * <!-- end-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. *
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicCollection()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlBasicCollection extends XmlAttributeMapping
-{
-} // XmlBasicCollection
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicCollectionImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicCollectionImpl.java
deleted file mode 100644
index 62720305d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicCollectionImpl.java
+++ /dev/null
@@ -1,58 +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.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-
-import org.eclipse.jpt.core.resource.orm.AbstractXmlAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Basic Collection Impl</b></em>'.
- * <!-- end-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. *
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicCollectionImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlBasicCollectionImpl extends AbstractXmlAttributeMapping implements XmlBasicCollection
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlBasicCollectionImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_BASIC_COLLECTION_IMPL;
- }
-
- public String getMappingKey() {
- return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-} // XmlBasicCollectionImpl
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicImpl.java
deleted file mode 100644
index ceb39c8d01..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicImpl.java
+++ /dev/null
@@ -1,701 +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.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.jpt.eclipselink.core.internal.resource.orm.translators.EclipseLinkOrmXmlMapper;
-
-/**
- * <!-- 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.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlBasicImpl extends org.eclipse.jpt.core.resource.orm.XmlBasicImpl implements XmlBasic
-{
- /**
- * 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 XmlBasicImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_BASIC_IMPL;
- }
-
- /**
- * 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.XmlBasicImpl#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_IMPL__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.XmlBasicImpl#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_IMPL__CONVERT, oldConvert, convert));
- }
-
- /**
- * 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_IMPL__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.XmlBasicImpl#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_IMPL__CONVERTER, null, msgs);
- if (newConverter != null)
- msgs = ((InternalEObject)newConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC_IMPL__CONVERTER, null, msgs);
- msgs = basicSetConverter(newConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC_IMPL__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_IMPL__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.XmlBasicImpl#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_IMPL__TYPE_CONVERTER, null, msgs);
- if (newTypeConverter != null)
- msgs = ((InternalEObject)newTypeConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC_IMPL__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_IMPL__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_IMPL__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.XmlBasicImpl#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_IMPL__OBJECT_TYPE_CONVERTER, null, msgs);
- if (newObjectTypeConverter != null)
- msgs = ((InternalEObject)newObjectTypeConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC_IMPL__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_IMPL__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_IMPL__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.XmlBasicImpl#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_IMPL__STRUCT_CONVERTER, null, msgs);
- if (newStructConverter != null)
- msgs = ((InternalEObject)newStructConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC_IMPL__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_IMPL__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_IMPL__CONVERTER:
- return basicSetConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__TYPE_CONVERTER:
- return basicSetTypeConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__OBJECT_TYPE_CONVERTER:
- return basicSetObjectTypeConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__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_IMPL__MUTABLE:
- return getMutable();
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__CONVERTER:
- return getConverter();
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__TYPE_CONVERTER:
- return getTypeConverter();
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__OBJECT_TYPE_CONVERTER:
- return getObjectTypeConverter();
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__STRUCT_CONVERTER:
- return getStructConverter();
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__CONVERT:
- return getConvert();
- }
- 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_BASIC_IMPL__MUTABLE:
- setMutable((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__CONVERTER:
- setConverter((XmlConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__TYPE_CONVERTER:
- setTypeConverter((XmlTypeConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__OBJECT_TYPE_CONVERTER:
- setObjectTypeConverter((XmlObjectTypeConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__STRUCT_CONVERTER:
- setStructConverter((XmlStructConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__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_IMPL__MUTABLE:
- setMutable(MUTABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__CONVERTER:
- setConverter((XmlConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__TYPE_CONVERTER:
- setTypeConverter((XmlTypeConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__OBJECT_TYPE_CONVERTER:
- setObjectTypeConverter((XmlObjectTypeConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__STRUCT_CONVERTER:
- setStructConverter((XmlStructConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__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_IMPL__MUTABLE:
- return MUTABLE_EDEFAULT == null ? mutable != null : !MUTABLE_EDEFAULT.equals(mutable);
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__CONVERTER:
- return converter != null;
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__TYPE_CONVERTER:
- return typeConverter != null;
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__OBJECT_TYPE_CONVERTER:
- return objectTypeConverter != null;
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__STRUCT_CONVERTER:
- return structConverter != null;
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__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 == XmlMutable.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__MUTABLE: return EclipseLinkOrmPackage.XML_MUTABLE__MUTABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__CONVERTER;
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__OBJECT_TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__OBJECT_TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__STRUCT_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__STRUCT_CONVERTER;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_IMPL__CONVERT: return EclipseLinkOrmPackage.XML_CONVERTIBLE_MAPPING__CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlBasic.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 == XmlMutable.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MUTABLE__MUTABLE: return EclipseLinkOrmPackage.XML_BASIC_IMPL__MUTABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__CONVERTER: return EclipseLinkOrmPackage.XML_BASIC_IMPL__CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_BASIC_IMPL__TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__OBJECT_TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_BASIC_IMPL__OBJECT_TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__STRUCT_CONVERTER: return EclipseLinkOrmPackage.XML_BASIC_IMPL__STRUCT_CONVERTER;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTIBLE_MAPPING__CONVERT: return EclipseLinkOrmPackage.XML_BASIC_IMPL__CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlBasic.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(" (mutable: ");
- result.append(mutable);
- result.append(", convert: ");
- result.append(convert);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getMutableTextRange() {
- return getAttributeTextRange(EclipseLinkOrmXmlMapper.MUTABLE);
- }
-
- public TextRange getConvertTextRange() {
- return getElementTextRange(EclipseLinkOrmXmlMapper.CONVERT);
- }
-}
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 4777c01676..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicMap.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Basic Map</b></em>'.
- * <!-- end-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. *
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicMap()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlBasicMap extends XmlAttributeMapping
-{
-} // XmlBasicMap
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicMapImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicMapImpl.java
deleted file mode 100644
index 3cbdcb520b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicMapImpl.java
+++ /dev/null
@@ -1,58 +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.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-
-import org.eclipse.jpt.core.resource.orm.AbstractXmlAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Basic Map Impl</b></em>'.
- * <!-- end-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. *
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicMapImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlBasicMapImpl extends AbstractXmlAttributeMapping implements XmlBasicMap
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlBasicMapImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_BASIC_MAP_IMPL;
- }
-
- public String getMappingKey() {
- return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY;
- }
-} // XmlBasicMapImpl
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 5c614f5a5a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCache.java
+++ /dev/null
@@ -1,781 +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.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.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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();
- }
-
-} // 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 97e9f48bec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCacheHolder.java
+++ /dev/null
@@ -1,101 +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.resource.orm;
-
-import org.eclipse.jpt.core.resource.common.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 8f7314586a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlChangeTracking.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: XmlChangeTracking.java,v 1.2 2008/11/03 16:58:54 pfullbright Exp $
- */
-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.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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();
- }
-
-} // 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 1b276e6149..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlChangeTrackingHolder.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: XmlChangeTrackingHolder.java,v 1.2 2008/11/03 16:58:54 pfullbright Exp $
- */
-package org.eclipse.jpt.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.common.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 177a3f688d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlChangeTrackingType.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: XmlChangeTrackingType.java,v 1.2 2008/11/03 16:58:54 pfullbright Exp $
- */
-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/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 ca5fe35e1a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConversionValue.java
+++ /dev/null
@@ -1,108 +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.resource.orm;
-
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlConversionValue extends JpaEObject
-{
- /**
- * 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
- */
- String getDataValue();
-
- /**
- * 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
- */
- void setDataValue(String value);
-
- /**
- * 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
- */
- String getObjectValue();
-
- /**
- * 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
- */
- void setObjectValue(String value);
-
- /**
- * Return the {@link TextRange} for the data-value attribute.
- */
- public TextRange getDataValueTextRange();
-
- /**
- * Return the {@link TextRange} for the object-value attribute.
- */
- public TextRange getObjectValueTextRange();
-
-} // XmlConversionValue
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConversionValueImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConversionValueImpl.java
deleted file mode 100644
index 600f1e26d2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConversionValueImpl.java
+++ /dev/null
@@ -1,274 +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.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.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.resource.orm.translators.EclipseLinkOrmXmlMapper;
-
-/**
- * <!-- 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 -->
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConversionValueImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlConversionValueImpl extends AbstractJpaEObject implements XmlConversionValue
-{
- /**
- * 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 XmlConversionValueImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_CONVERSION_VALUE_IMPL;
- }
-
- /**
- * 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.XmlConversionValueImpl#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_IMPL__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.XmlConversionValueImpl#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_IMPL__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_IMPL__DATA_VALUE:
- return getDataValue();
- case EclipseLinkOrmPackage.XML_CONVERSION_VALUE_IMPL__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_IMPL__DATA_VALUE:
- setDataValue((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CONVERSION_VALUE_IMPL__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_IMPL__DATA_VALUE:
- setDataValue(DATA_VALUE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CONVERSION_VALUE_IMPL__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_IMPL__DATA_VALUE:
- return DATA_VALUE_EDEFAULT == null ? dataValue != null : !DATA_VALUE_EDEFAULT.equals(dataValue);
- case EclipseLinkOrmPackage.XML_CONVERSION_VALUE_IMPL__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(EclipseLinkOrmXmlMapper.CONVERSION_VALUE__DATA_VALUE);
- }
-
- public TextRange getObjectValueTextRange() {
- return getAttributeTextRange(EclipseLinkOrmXmlMapper.CONVERSION_VALUE__OBJECT_VALUE);
- }
-} // 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 ef8d9dae5e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConverter.java
+++ /dev/null
@@ -1,68 +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.resource.orm;
-
-
-/**
- * <!-- 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" interface="true" abstract="true"
- * @generated
- */
-public interface XmlConverter extends XmlNamedConverter
-{
- /**
- * 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
- */
- String getClassName();
-
- /**
- * 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
- */
- void setClassName(String value);
-
-} // 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 967f256912..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConverterHolder.java
+++ /dev/null
@@ -1,151 +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.resource.orm;
-
-import org.eclipse.jpt.core.resource.common.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/XmlConverterImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConverterImpl.java
deleted file mode 100644
index b145dfc793..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConverterImpl.java
+++ /dev/null
@@ -1,265 +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.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.common.AbstractJpaEObject;
-
-/**
- * <!-- 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 -->
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlConverterImpl extends AbstractJpaEObject implements XmlConverter
-{
- /**
- * 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 #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 XmlConverterImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_CONVERTER_IMPL;
- }
-
- /**
- * 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.XmlConverterImpl#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_CONVERTER_IMPL__NAME, oldName, name));
- }
-
- /**
- * 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.XmlConverterImpl#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_IMPL__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_IMPL__NAME:
- return getName();
- case EclipseLinkOrmPackage.XML_CONVERTER_IMPL__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_IMPL__NAME:
- setName((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CONVERTER_IMPL__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_IMPL__NAME:
- setName(NAME_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CONVERTER_IMPL__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_IMPL__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case EclipseLinkOrmPackage.XML_CONVERTER_IMPL__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(" (name: ");
- result.append(name);
- result.append(", className: ");
- result.append(className);
- result.append(')');
- return result.toString();
- }
-
-} // XmlConverter
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 85f8dd281d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConvertersHolder.java
+++ /dev/null
@@ -1,112 +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.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.resource.common.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 25dd34f904..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConvertibleMapping.java
+++ /dev/null
@@ -1,76 +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.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/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 2034a80afd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCustomizer.java
+++ /dev/null
@@ -1,213 +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.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.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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();
- }
-
- public TextRange getCustomizerClassNameTextRange() {
- return getAttributeTextRange(OrmXmlMapper.CLASS);
- }
-
-} // 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 02e7fcb28e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCustomizerHolder.java
+++ /dev/null
@@ -1,70 +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.resource.orm;
-
-import org.eclipse.jpt.core.resource.common.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(XmlCustomizer)
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizerHolder_Customizer()
- * @model containment="true"
- * @generated
- */
- XmlCustomizer 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(XmlCustomizer value);
-
-} // XmlCustomizerHolder
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 5356e701d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlEmbeddable.java
+++ /dev/null
@@ -1,560 +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.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;
-
-/**
- * <!-- 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.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * @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 XmlCustomizerHolder, XmlChangeTrackingHolder, XmlConvertersHolder
-{
- /**
- * The cached value of the '{@link #getCustomizer() <em>Customizer</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCustomizer()
- * @generated
- * @ordered
- */
- protected XmlCustomizer 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;
-
- /**
- * <!-- 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>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(XmlCustomizer)
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizerHolder_Customizer()
- * @model containment="true"
- * @generated
- */
- public XmlCustomizer getCustomizer()
- {
- return customizer;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCustomizer(XmlCustomizer newCustomizer, NotificationChain msgs)
- {
- XmlCustomizer 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(XmlCustomizer 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;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- 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);
- }
- 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__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();
- }
- 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__CUSTOMIZER:
- setCustomizer((XmlCustomizer)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;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CUSTOMIZER:
- setCustomizer((XmlCustomizer)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;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- 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();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- 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;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- 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;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
-} // XmlEmbeddable
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 ef778c1b44..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlEntity.java
+++ /dev/null
@@ -1,831 +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.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.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.resource.orm.translators.EclipseLinkOrmXmlMapper;
-
-/**
- * <!-- 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.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * @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 XmlReadOnly, XmlCustomizerHolder, XmlChangeTrackingHolder, XmlCacheHolder, XmlConvertersHolder
-{
- /**
- * 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 XmlCustomizer 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;
-
- /**
- * <!-- 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(XmlCustomizer)
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizerHolder_Customizer()
- * @model containment="true"
- * @generated
- */
- public XmlCustomizer getCustomizer()
- {
- return customizer;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCustomizer(XmlCustomizer newCustomizer, NotificationChain msgs)
- {
- XmlCustomizer 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(XmlCustomizer 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;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- 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);
- }
- 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__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();
- }
- 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__READ_ONLY:
- setReadOnly((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CUSTOMIZER:
- setCustomizer((XmlCustomizer)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;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__READ_ONLY:
- setReadOnly(READ_ONLY_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CUSTOMIZER:
- setCustomizer((XmlCustomizer)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;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- 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();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- 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;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- 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;
- }
- }
- 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(" (readOnly: ");
- result.append(readOnly);
- result.append(", existenceChecking: ");
- result.append(existenceChecking);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getReadOnlyTextRange() {
- return getAttributeTextRange(EclipseLinkOrmXmlMapper.READ_ONLY);
- }
-} \ No newline at end of file
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 82dd8ff654..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlEntityMappings.java
+++ /dev/null
@@ -1,362 +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.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;
-
-/**
- * <!-- 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.1
- * @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
-{
- /**
- * 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;
-
- /**
- * <!-- 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;
- }
-
- /**
- * <!-- 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);
- }
- 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();
- }
- 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;
- }
- 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;
- }
- 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();
- }
- 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;
- }
- }
- 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;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
-} // XmlEntityMappings
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 0830d4bb25..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlId.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.resource.orm;
-
-
-/**
- * <!-- 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.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlId()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlId extends org.eclipse.jpt.core.resource.orm.XmlId, XmlMutable, XmlConvertibleMapping
-{
-} // XmlId
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlIdImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlIdImpl.java
deleted file mode 100644
index afb1d6d8f3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlIdImpl.java
+++ /dev/null
@@ -1,707 +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.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.jpt.eclipselink.core.internal.resource.orm.translators.EclipseLinkOrmXmlMapper;
-
-/**
- * <!-- 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.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlIdImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlIdImpl extends org.eclipse.jpt.core.resource.orm.XmlIdImpl implements XmlId
-{
- /**
- * 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 XmlIdImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ID_IMPL;
- }
-
- /**
- * 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.XmlIdImpl#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_IMPL__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.XmlIdImpl#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_IMPL__CONVERT, oldConvert, convert));
- }
-
- /**
- * 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_IMPL__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.XmlIdImpl#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_IMPL__CONVERTER, null, msgs);
- if (newConverter != null)
- msgs = ((InternalEObject)newConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ID_IMPL__CONVERTER, null, msgs);
- msgs = basicSetConverter(newConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID_IMPL__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_IMPL__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.XmlIdImpl#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_IMPL__TYPE_CONVERTER, null, msgs);
- if (newTypeConverter != null)
- msgs = ((InternalEObject)newTypeConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ID_IMPL__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_IMPL__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_IMPL__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.XmlIdImpl#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_IMPL__OBJECT_TYPE_CONVERTER, null, msgs);
- if (newObjectTypeConverter != null)
- msgs = ((InternalEObject)newObjectTypeConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ID_IMPL__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_IMPL__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_IMPL__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.XmlIdImpl#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_IMPL__STRUCT_CONVERTER, null, msgs);
- if (newStructConverter != null)
- msgs = ((InternalEObject)newStructConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ID_IMPL__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_IMPL__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_IMPL__CONVERTER:
- return basicSetConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_ID_IMPL__TYPE_CONVERTER:
- return basicSetTypeConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_ID_IMPL__OBJECT_TYPE_CONVERTER:
- return basicSetObjectTypeConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_ID_IMPL__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_IMPL__MUTABLE:
- return getMutable();
- case EclipseLinkOrmPackage.XML_ID_IMPL__CONVERTER:
- return getConverter();
- case EclipseLinkOrmPackage.XML_ID_IMPL__TYPE_CONVERTER:
- return getTypeConverter();
- case EclipseLinkOrmPackage.XML_ID_IMPL__OBJECT_TYPE_CONVERTER:
- return getObjectTypeConverter();
- case EclipseLinkOrmPackage.XML_ID_IMPL__STRUCT_CONVERTER:
- return getStructConverter();
- case EclipseLinkOrmPackage.XML_ID_IMPL__CONVERT:
- return getConvert();
- }
- 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_ID_IMPL__MUTABLE:
- setMutable((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID_IMPL__CONVERTER:
- setConverter((XmlConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID_IMPL__TYPE_CONVERTER:
- setTypeConverter((XmlTypeConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID_IMPL__OBJECT_TYPE_CONVERTER:
- setObjectTypeConverter((XmlObjectTypeConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID_IMPL__STRUCT_CONVERTER:
- setStructConverter((XmlStructConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID_IMPL__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_IMPL__MUTABLE:
- setMutable(MUTABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ID_IMPL__CONVERTER:
- setConverter((XmlConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_ID_IMPL__TYPE_CONVERTER:
- setTypeConverter((XmlTypeConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_ID_IMPL__OBJECT_TYPE_CONVERTER:
- setObjectTypeConverter((XmlObjectTypeConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_ID_IMPL__STRUCT_CONVERTER:
- setStructConverter((XmlStructConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_ID_IMPL__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_IMPL__MUTABLE:
- return MUTABLE_EDEFAULT == null ? mutable != null : !MUTABLE_EDEFAULT.equals(mutable);
- case EclipseLinkOrmPackage.XML_ID_IMPL__CONVERTER:
- return converter != null;
- case EclipseLinkOrmPackage.XML_ID_IMPL__TYPE_CONVERTER:
- return typeConverter != null;
- case EclipseLinkOrmPackage.XML_ID_IMPL__OBJECT_TYPE_CONVERTER:
- return objectTypeConverter != null;
- case EclipseLinkOrmPackage.XML_ID_IMPL__STRUCT_CONVERTER:
- return structConverter != null;
- case EclipseLinkOrmPackage.XML_ID_IMPL__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 == XmlMutable.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ID_IMPL__MUTABLE: return EclipseLinkOrmPackage.XML_MUTABLE__MUTABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ID_IMPL__CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__CONVERTER;
- case EclipseLinkOrmPackage.XML_ID_IMPL__TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_ID_IMPL__OBJECT_TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__OBJECT_TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_ID_IMPL__STRUCT_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__STRUCT_CONVERTER;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ID_IMPL__CONVERT: return EclipseLinkOrmPackage.XML_CONVERTIBLE_MAPPING__CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlId.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 == XmlMutable.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MUTABLE__MUTABLE: return EclipseLinkOrmPackage.XML_ID_IMPL__MUTABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__CONVERTER: return EclipseLinkOrmPackage.XML_ID_IMPL__CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_ID_IMPL__TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__OBJECT_TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_ID_IMPL__OBJECT_TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__STRUCT_CONVERTER: return EclipseLinkOrmPackage.XML_ID_IMPL__STRUCT_CONVERTER;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTIBLE_MAPPING__CONVERT: return EclipseLinkOrmPackage.XML_ID_IMPL__CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlId.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(" (mutable: ");
- result.append(mutable);
- result.append(", convert: ");
- result.append(convert);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getMutableTextRange() {
- return getAttributeTextRange(EclipseLinkOrmXmlMapper.MUTABLE);
- }
-
- public TextRange getConvertTextRange() {
- return getElementTextRange(EclipseLinkOrmXmlMapper.CONVERT);
- }
-}
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 0f0fc54163..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlJoinFetch.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: XmlJoinFetch.java,v 1.3 2008/11/03 16:58:54 pfullbright Exp $
- */
-package org.eclipse.jpt.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.common.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 da204c42eb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlJoinFetchType.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: XmlJoinFetchType.java,v 1.2 2008/11/03 16:58:54 pfullbright Exp $
- */
-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 5f16e67824..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlManyToMany.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.resource.orm;
-
-
-/**
- * <!-- 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.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToMany()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlManyToMany extends org.eclipse.jpt.core.resource.orm.XmlManyToMany, XmlJoinFetch
-{
-} // XmlManyToMany
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlManyToManyImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlManyToManyImpl.java
deleted file mode 100644
index 814177deda..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlManyToManyImpl.java
+++ /dev/null
@@ -1,253 +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.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.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.resource.orm.translators.EclipseLinkOrmXmlMapper;
-
-/**
- * <!-- 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.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToManyImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlManyToManyImpl extends org.eclipse.jpt.core.resource.orm.XmlManyToManyImpl implements XmlManyToMany
-{
- /**
- * 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 XmlManyToManyImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_MANY_TO_MANY_IMPL;
- }
-
- /**
- * 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.XmlManyToManyImpl#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_IMPL__JOIN_FETCH, oldJoinFetch, joinFetch));
- }
-
- /**
- * <!-- 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_IMPL__JOIN_FETCH:
- return getJoinFetch();
- }
- 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_MANY_TO_MANY_IMPL__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_IMPL__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_IMPL__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 == XmlJoinFetch.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY_IMPL__JOIN_FETCH: return EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToMany.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 == XmlJoinFetch.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH: return EclipseLinkOrmPackage.XML_MANY_TO_MANY_IMPL__JOIN_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToMany.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(" (joinFetch: ");
- result.append(joinFetch);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getJoinFetchTextRange() {
- return getElementTextRange(EclipseLinkOrmXmlMapper.JOIN_FETCH);
- }
-} // XmlManyToMany
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 c7a413d9e0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlManyToOne.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.resource.orm;
-
-
-/**
- * <!-- 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.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToOne()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlManyToOne extends org.eclipse.jpt.core.resource.orm.XmlManyToOne, XmlJoinFetch
-{
-} // XmlManyToOne
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlManyToOneImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlManyToOneImpl.java
deleted file mode 100644
index 7cbbdd209e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlManyToOneImpl.java
+++ /dev/null
@@ -1,253 +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.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.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.resource.orm.translators.EclipseLinkOrmXmlMapper;
-
-/**
- * <!-- 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.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToOneImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlManyToOneImpl extends org.eclipse.jpt.core.resource.orm.XmlManyToOneImpl implements XmlManyToOne
-{
- /**
- * 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 XmlManyToOneImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_MANY_TO_ONE_IMPL;
- }
-
- /**
- * 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.XmlManyToOneImpl#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_IMPL__JOIN_FETCH, oldJoinFetch, joinFetch));
- }
-
- /**
- * <!-- 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_IMPL__JOIN_FETCH:
- return getJoinFetch();
- }
- 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_MANY_TO_ONE_IMPL__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_IMPL__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_IMPL__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 == XmlJoinFetch.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_FETCH: return EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToOne.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 == XmlJoinFetch.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH: return EclipseLinkOrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToOne.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(" (joinFetch: ");
- result.append(joinFetch);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getJoinFetchTextRange() {
- return getElementTextRange(EclipseLinkOrmXmlMapper.JOIN_FETCH);
- }
-} // XmlManyToOne
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 8d0e3998da..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlMappedSuperclass.java
+++ /dev/null
@@ -1,830 +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.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.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.resource.orm.translators.EclipseLinkOrmXmlMapper;
-
-/**
- * <!-- 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.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * @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 XmlReadOnly, XmlCustomizerHolder, XmlChangeTrackingHolder, XmlCacheHolder, XmlConvertersHolder
-{
- /**
- * 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 XmlCustomizer 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;
-
- /**
- * <!-- 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(XmlCustomizer)
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizerHolder_Customizer()
- * @model containment="true"
- * @generated
- */
- public XmlCustomizer getCustomizer()
- {
- return customizer;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCustomizer(XmlCustomizer newCustomizer, NotificationChain msgs)
- {
- XmlCustomizer 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(XmlCustomizer 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;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- 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);
- }
- 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__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();
- }
- 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__READ_ONLY:
- setReadOnly((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CUSTOMIZER:
- setCustomizer((XmlCustomizer)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;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__READ_ONLY:
- setReadOnly(READ_ONLY_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CUSTOMIZER:
- setCustomizer((XmlCustomizer)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;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- 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();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- 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;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- 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;
- }
- }
- 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(" (readOnly: ");
- result.append(readOnly);
- result.append(", existenceChecking: ");
- result.append(existenceChecking);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getReadOnlyTextRange() {
- return getAttributeTextRange(EclipseLinkOrmXmlMapper.READ_ONLY);
- }
-} // XmlMappedSuperclass
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 dbb97d2ffb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlMutable.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: XmlMutable.java,v 1.3 2008/11/03 16:58:54 pfullbright Exp $
- */
-package org.eclipse.jpt.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.common.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 ecf4d28fde..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlNamedConverter.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: XmlNamedConverter.java,v 1.2 2008/11/03 16:58:54 pfullbright Exp $
- */
-package org.eclipse.jpt.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlNamedConverter 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.EclipseLinkOrmPackage#getXmlNamedConverter_Name()
- * @model
- * @generated
- */
- String getName();
-
- /**
- * 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
- */
- void setName(String value);
-
-} // XmlNamedConverter
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 e6e05ed8f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlObjectTypeConverter.java
+++ /dev/null
@@ -1,140 +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.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-
-/**
- * <!-- 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" interface="true" abstract="true"
- * @generated
- */
-public interface XmlObjectTypeConverter extends XmlNamedConverter
-{
- /**
- * 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
- */
- EList<XmlConversionValue> getConversionValues();
-
- /**
- * 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
- */
- String getDefaultObjectValue();
-
- /**
- * 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
- */
- void setDefaultObjectValue(String value);
-
- /**
- * 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
- */
- String getDataType();
-
- /**
- * 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
- */
- void setDataType(String value);
-
- /**
- * 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
- */
- String getObjectType();
-
- /**
- * 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
- */
- void setObjectType(String value);
-
-} // XmlObjectTypeConverter
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlObjectTypeConverterImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlObjectTypeConverterImpl.java
deleted file mode 100644
index 17badb1635..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlObjectTypeConverterImpl.java
+++ /dev/null
@@ -1,466 +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.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.common.AbstractJpaEObject;
-
-/**
- * <!-- 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 -->
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlObjectTypeConverterImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlObjectTypeConverterImpl extends AbstractJpaEObject implements XmlObjectTypeConverter
-{
- /**
- * 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 #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 XmlObjectTypeConverterImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_OBJECT_TYPE_CONVERTER_IMPL;
- }
-
- /**
- * 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.XmlObjectTypeConverterImpl#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_OBJECT_TYPE_CONVERTER_IMPL__NAME, oldName, name));
- }
-
- /**
- * 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.XmlObjectTypeConverterImpl#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_IMPL__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.XmlObjectTypeConverterImpl#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_IMPL__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_IMPL__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.XmlObjectTypeConverterImpl#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_IMPL__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_IMPL__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_IMPL__NAME:
- return getName();
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER_IMPL__DATA_TYPE:
- return getDataType();
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER_IMPL__OBJECT_TYPE:
- return getObjectType();
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER_IMPL__CONVERSION_VALUES:
- return getConversionValues();
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER_IMPL__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_IMPL__NAME:
- setName((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER_IMPL__DATA_TYPE:
- setDataType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER_IMPL__OBJECT_TYPE:
- setObjectType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER_IMPL__CONVERSION_VALUES:
- getConversionValues().clear();
- getConversionValues().addAll((Collection<? extends XmlConversionValue>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER_IMPL__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_IMPL__NAME:
- setName(NAME_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER_IMPL__DATA_TYPE:
- setDataType(DATA_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER_IMPL__OBJECT_TYPE:
- setObjectType(OBJECT_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER_IMPL__CONVERSION_VALUES:
- getConversionValues().clear();
- return;
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER_IMPL__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_IMPL__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER_IMPL__DATA_TYPE:
- return DATA_TYPE_EDEFAULT == null ? dataType != null : !DATA_TYPE_EDEFAULT.equals(dataType);
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER_IMPL__OBJECT_TYPE:
- return OBJECT_TYPE_EDEFAULT == null ? objectType != null : !OBJECT_TYPE_EDEFAULT.equals(objectType);
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER_IMPL__CONVERSION_VALUES:
- return conversionValues != null && !conversionValues.isEmpty();
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER_IMPL__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(" (name: ");
- result.append(name);
- result.append(", dataType: ");
- result.append(dataType);
- result.append(", objectType: ");
- result.append(objectType);
- result.append(", defaultObjectValue: ");
- result.append(defaultObjectValue);
- result.append(')');
- return result.toString();
- }
-
-} // 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 7fc984103d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOneToMany.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.resource.orm;
-
-
-/**
- * <!-- 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.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToMany()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlOneToMany extends org.eclipse.jpt.core.resource.orm.XmlOneToMany, XmlPrivateOwned, XmlJoinFetch
-{
-} // XmlOneToMany
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOneToManyImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOneToManyImpl.java
deleted file mode 100644
index c9d5adbb45..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOneToManyImpl.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.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.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.resource.orm.translators.EclipseLinkOrmXmlMapper;
-
-/**
- * <!-- 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.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToManyImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlOneToManyImpl extends org.eclipse.jpt.core.resource.orm.XmlOneToManyImpl implements XmlOneToMany
-{
- /**
- * 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 XmlOneToManyImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ONE_TO_MANY_IMPL;
- }
-
- /**
- * 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.XmlOneToManyImpl#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_IMPL__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.XmlOneToManyImpl#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_IMPL__JOIN_FETCH, oldJoinFetch, joinFetch));
- }
-
- /**
- * <!-- 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_IMPL__PRIVATE_OWNED:
- return isPrivateOwned() ? Boolean.TRUE : Boolean.FALSE;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_FETCH:
- return getJoinFetch();
- }
- 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_ONE_TO_MANY_IMPL__PRIVATE_OWNED:
- setPrivateOwned(((Boolean)newValue).booleanValue());
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY_IMPL__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_IMPL__PRIVATE_OWNED:
- setPrivateOwned(PRIVATE_OWNED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY_IMPL__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_IMPL__PRIVATE_OWNED:
- return privateOwned != PRIVATE_OWNED_EDEFAULT;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY_IMPL__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 == XmlPrivateOwned.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY_IMPL__PRIVATE_OWNED: return EclipseLinkOrmPackage.XML_PRIVATE_OWNED__PRIVATE_OWNED;
- default: return -1;
- }
- }
- if (baseClass == XmlJoinFetch.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_FETCH: return EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToMany.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 == XmlPrivateOwned.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PRIVATE_OWNED__PRIVATE_OWNED: return EclipseLinkOrmPackage.XML_ONE_TO_MANY_IMPL__PRIVATE_OWNED;
- default: return -1;
- }
- }
- if (baseClass == XmlJoinFetch.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH: return EclipseLinkOrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToMany.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(" (privateOwned: ");
- result.append(privateOwned);
- result.append(", joinFetch: ");
- result.append(joinFetch);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getPrivateOwnedTextRange() {
- return getElementTextRange(EclipseLinkOrmXmlMapper.PRIVATE_OWNED);
- }
-
- public TextRange getJoinFetchTextRange() {
- return getElementTextRange(EclipseLinkOrmXmlMapper.JOIN_FETCH);
- }
-}
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 95f1da5fa4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOneToOne.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.resource.orm;
-
-
-/**
- * <!-- 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.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToOne()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlOneToOne extends org.eclipse.jpt.core.resource.orm.XmlOneToOne, XmlPrivateOwned, XmlJoinFetch
-{
-} // XmlOneToOne
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOneToOneImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOneToOneImpl.java
deleted file mode 100644
index 0b8d39b0aa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOneToOneImpl.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.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.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.resource.orm.translators.EclipseLinkOrmXmlMapper;
-
-/**
- * <!-- 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.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToOneImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlOneToOneImpl extends org.eclipse.jpt.core.resource.orm.XmlOneToOneImpl implements XmlOneToOne
-{
- /**
- * 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 XmlOneToOneImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ONE_TO_ONE_IMPL;
- }
-
- /**
- * 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.XmlOneToOneImpl#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_IMPL__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.XmlOneToOneImpl#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_IMPL__JOIN_FETCH, oldJoinFetch, joinFetch));
- }
-
- /**
- * <!-- 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_IMPL__PRIVATE_OWNED:
- return isPrivateOwned() ? Boolean.TRUE : Boolean.FALSE;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_FETCH:
- return getJoinFetch();
- }
- 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_ONE_TO_ONE_IMPL__PRIVATE_OWNED:
- setPrivateOwned(((Boolean)newValue).booleanValue());
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE_IMPL__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_IMPL__PRIVATE_OWNED:
- setPrivateOwned(PRIVATE_OWNED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE_IMPL__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_IMPL__PRIVATE_OWNED:
- return privateOwned != PRIVATE_OWNED_EDEFAULT;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE_IMPL__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 == XmlPrivateOwned.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE_IMPL__PRIVATE_OWNED: return EclipseLinkOrmPackage.XML_PRIVATE_OWNED__PRIVATE_OWNED;
- default: return -1;
- }
- }
- if (baseClass == XmlJoinFetch.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_FETCH: return EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToOne.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 == XmlPrivateOwned.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PRIVATE_OWNED__PRIVATE_OWNED: return EclipseLinkOrmPackage.XML_ONE_TO_ONE_IMPL__PRIVATE_OWNED;
- default: return -1;
- }
- }
- if (baseClass == XmlJoinFetch.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH: return EclipseLinkOrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToOne.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(" (privateOwned: ");
- result.append(privateOwned);
- result.append(", joinFetch: ");
- result.append(joinFetch);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getPrivateOwnedTextRange() {
- return getElementTextRange(EclipseLinkOrmXmlMapper.PRIVATE_OWNED);
- }
-
- public TextRange getJoinFetchTextRange() {
- return getElementTextRange(EclipseLinkOrmXmlMapper.JOIN_FETCH);
- }
-}
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 793de3e1c0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlPrivateOwned.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: XmlPrivateOwned.java,v 1.3 2008/11/03 16:58:54 pfullbright Exp $
- */
-package org.eclipse.jpt.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.common.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/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 c46cbc74d4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlReadOnly.java
+++ /dev/null
@@ -1,75 +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.resource.orm;
-
-import org.eclipse.jpt.core.resource.common.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/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 d634bea12c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlStructConverter.java
+++ /dev/null
@@ -1,68 +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.resource.orm;
-
-
-/**
- * <!-- 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" interface="true" abstract="true"
- * @generated
- */
-public interface XmlStructConverter extends XmlNamedConverter
-{
- /**
- * 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
- */
- String getConverter();
-
- /**
- * 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
- */
- void setConverter(String value);
-
-} // XmlStructConverter
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlStructConverterImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlStructConverterImpl.java
deleted file mode 100644
index 62c9985626..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlStructConverterImpl.java
+++ /dev/null
@@ -1,265 +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.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.common.AbstractJpaEObject;
-
-/**
- * <!-- 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 -->
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStructConverterImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlStructConverterImpl extends AbstractJpaEObject implements XmlStructConverter
-{
- /**
- * 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 #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 XmlStructConverterImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_STRUCT_CONVERTER_IMPL;
- }
-
- /**
- * 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.XmlStructConverterImpl#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_STRUCT_CONVERTER_IMPL__NAME, oldName, name));
- }
-
- /**
- * 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.XmlStructConverterImpl#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_IMPL__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_IMPL__NAME:
- return getName();
- case EclipseLinkOrmPackage.XML_STRUCT_CONVERTER_IMPL__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_IMPL__NAME:
- setName((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_STRUCT_CONVERTER_IMPL__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_IMPL__NAME:
- setName(NAME_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_STRUCT_CONVERTER_IMPL__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_IMPL__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case EclipseLinkOrmPackage.XML_STRUCT_CONVERTER_IMPL__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(" (name: ");
- result.append(name);
- result.append(", converter: ");
- result.append(converter);
- result.append(')');
- return result.toString();
- }
-
-} // 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 e8333a899d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTimeOfDay.java
+++ /dev/null
@@ -1,411 +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.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.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- 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();
- }
-
-} // 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 de24874091..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTransformation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Transformation</b></em>'.
- * <!-- end-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. *
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransformation()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlTransformation extends XmlAttributeMapping
-{
-} // XmlTransformation
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTransformationImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTransformationImpl.java
deleted file mode 100644
index 5145ba6396..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTransformationImpl.java
+++ /dev/null
@@ -1,58 +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.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-
-import org.eclipse.jpt.core.resource.orm.AbstractXmlAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Transformation Impl</b></em>'.
- * <!-- end-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. *
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransformationImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlTransformationImpl extends AbstractXmlAttributeMapping implements XmlTransformation
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlTransformationImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_TRANSFORMATION_IMPL;
- }
-
- public String getMappingKey() {
- return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY;
- }
-} // XmlTransformationImpl
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 291c14bec4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTypeConverter.java
+++ /dev/null
@@ -1,95 +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.resource.orm;
-
-
-/**
- * <!-- 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" interface="true" abstract="true"
- * @generated
- */
-public interface XmlTypeConverter extends XmlNamedConverter
-{
- /**
- * 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
- */
- String getDataType();
-
- /**
- * 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
- */
- void setDataType(String value);
-
- /**
- * 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
- */
- String getObjectType();
-
- /**
- * 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
- */
- void setObjectType(String value);
-
-} // XmlTypeConverter
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTypeConverterImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTypeConverterImpl.java
deleted file mode 100644
index 152a5f0c15..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTypeConverterImpl.java
+++ /dev/null
@@ -1,332 +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.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.common.AbstractJpaEObject;
-
-/**
- * <!-- 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 -->
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTypeConverterImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlTypeConverterImpl extends AbstractJpaEObject implements XmlTypeConverter
-{
- /**
- * 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 #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 XmlTypeConverterImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_TYPE_CONVERTER_IMPL;
- }
-
- /**
- * 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.XmlTypeConverterImpl#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_TYPE_CONVERTER_IMPL__NAME, oldName, name));
- }
-
- /**
- * 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.XmlTypeConverterImpl#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_IMPL__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.XmlTypeConverterImpl#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_IMPL__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_IMPL__NAME:
- return getName();
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER_IMPL__DATA_TYPE:
- return getDataType();
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER_IMPL__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_IMPL__NAME:
- setName((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER_IMPL__DATA_TYPE:
- setDataType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER_IMPL__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_IMPL__NAME:
- setName(NAME_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER_IMPL__DATA_TYPE:
- setDataType(DATA_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER_IMPL__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_IMPL__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER_IMPL__DATA_TYPE:
- return DATA_TYPE_EDEFAULT == null ? dataType != null : !DATA_TYPE_EDEFAULT.equals(dataType);
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER_IMPL__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(" (name: ");
- result.append(name);
- result.append(", dataType: ");
- result.append(dataType);
- result.append(", objectType: ");
- result.append(objectType);
- result.append(')');
- return result.toString();
- }
-
-} // XmlTypeConverter
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 4082295230..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlVersion.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.resource.orm;
-
-
-/**
- * <!-- 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.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVersion()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlVersion extends org.eclipse.jpt.core.resource.orm.XmlVersion, XmlMutable, XmlConvertibleMapping
-{
-} // XmlVersion
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlVersionImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlVersionImpl.java
deleted file mode 100644
index 70c46b9cff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlVersionImpl.java
+++ /dev/null
@@ -1,707 +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.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.jpt.eclipselink.core.internal.resource.orm.translators.EclipseLinkOrmXmlMapper;
-
-/**
- * <!-- 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.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVersionImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlVersionImpl extends org.eclipse.jpt.core.resource.orm.XmlVersionImpl implements XmlVersion
-{
- /**
- * 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 XmlVersionImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_VERSION_IMPL;
- }
-
- /**
- * 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.XmlVersionImpl#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_IMPL__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.XmlVersionImpl#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_IMPL__CONVERT, oldConvert, convert));
- }
-
- /**
- * 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_IMPL__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.XmlVersionImpl#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_IMPL__CONVERTER, null, msgs);
- if (newConverter != null)
- msgs = ((InternalEObject)newConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VERSION_IMPL__CONVERTER, null, msgs);
- msgs = basicSetConverter(newConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VERSION_IMPL__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_IMPL__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.XmlVersionImpl#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_IMPL__TYPE_CONVERTER, null, msgs);
- if (newTypeConverter != null)
- msgs = ((InternalEObject)newTypeConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VERSION_IMPL__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_IMPL__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_IMPL__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.XmlVersionImpl#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_IMPL__OBJECT_TYPE_CONVERTER, null, msgs);
- if (newObjectTypeConverter != null)
- msgs = ((InternalEObject)newObjectTypeConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VERSION_IMPL__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_IMPL__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_IMPL__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.XmlVersionImpl#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_IMPL__STRUCT_CONVERTER, null, msgs);
- if (newStructConverter != null)
- msgs = ((InternalEObject)newStructConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VERSION_IMPL__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_IMPL__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_IMPL__CONVERTER:
- return basicSetConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__TYPE_CONVERTER:
- return basicSetTypeConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__OBJECT_TYPE_CONVERTER:
- return basicSetObjectTypeConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__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_IMPL__MUTABLE:
- return getMutable();
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__CONVERTER:
- return getConverter();
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__TYPE_CONVERTER:
- return getTypeConverter();
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__OBJECT_TYPE_CONVERTER:
- return getObjectTypeConverter();
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__STRUCT_CONVERTER:
- return getStructConverter();
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__CONVERT:
- return getConvert();
- }
- 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_VERSION_IMPL__MUTABLE:
- setMutable((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__CONVERTER:
- setConverter((XmlConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__TYPE_CONVERTER:
- setTypeConverter((XmlTypeConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__OBJECT_TYPE_CONVERTER:
- setObjectTypeConverter((XmlObjectTypeConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__STRUCT_CONVERTER:
- setStructConverter((XmlStructConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__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_IMPL__MUTABLE:
- setMutable(MUTABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__CONVERTER:
- setConverter((XmlConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__TYPE_CONVERTER:
- setTypeConverter((XmlTypeConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__OBJECT_TYPE_CONVERTER:
- setObjectTypeConverter((XmlObjectTypeConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__STRUCT_CONVERTER:
- setStructConverter((XmlStructConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__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_IMPL__MUTABLE:
- return MUTABLE_EDEFAULT == null ? mutable != null : !MUTABLE_EDEFAULT.equals(mutable);
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__CONVERTER:
- return converter != null;
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__TYPE_CONVERTER:
- return typeConverter != null;
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__OBJECT_TYPE_CONVERTER:
- return objectTypeConverter != null;
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__STRUCT_CONVERTER:
- return structConverter != null;
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__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 == XmlMutable.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__MUTABLE: return EclipseLinkOrmPackage.XML_MUTABLE__MUTABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__CONVERTER;
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__OBJECT_TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__OBJECT_TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__STRUCT_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__STRUCT_CONVERTER;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VERSION_IMPL__CONVERT: return EclipseLinkOrmPackage.XML_CONVERTIBLE_MAPPING__CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlVersion.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 == XmlMutable.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MUTABLE__MUTABLE: return EclipseLinkOrmPackage.XML_VERSION_IMPL__MUTABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__CONVERTER: return EclipseLinkOrmPackage.XML_VERSION_IMPL__CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_VERSION_IMPL__TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__OBJECT_TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_VERSION_IMPL__OBJECT_TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__STRUCT_CONVERTER: return EclipseLinkOrmPackage.XML_VERSION_IMPL__STRUCT_CONVERTER;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTIBLE_MAPPING__CONVERT: return EclipseLinkOrmPackage.XML_VERSION_IMPL__CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlVersion.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(" (mutable: ");
- result.append(mutable);
- result.append(", convert: ");
- result.append(convert);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getMutableTextRange() {
- return getAttributeTextRange(EclipseLinkOrmXmlMapper.MUTABLE);
- }
-
- public TextRange getConvertTextRange() {
- return getElementTextRange(EclipseLinkOrmXmlMapper.CONVERT);
- }
-}
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 65356ab7c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/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
-Bundle-Version: 1.2.0.qualifier
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Export-Package: org.eclipse.jpt.gen.internal; 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)"
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
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 a1fd5b8411..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/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
-################################################################################
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
-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 7a4e04e21f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/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.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 4875a8b174..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/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 = Java Persistence API Tools - Entity Gen
-providerName = Eclipse.org
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 03e8908d0e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/property_files/jpt_gen.properties
+++ /dev/null
@@ -1,13 +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
-################################################################################
-
-PackageGenerator_taskName=Generate Entities
-GenScope_taskName=Build Database Model
-EntityGenerator_taskName=Generate Entity: {0}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/EntityGenTools.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/EntityGenTools.java
deleted file mode 100644
index 058490ea15..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/EntityGenTools.java
+++ /dev/null
@@ -1,80 +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.internal;
-
-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)) {
- // 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/EntityGenerator.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/EntityGenerator.java
deleted file mode 100644
index 86d10b48a3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/EntityGenerator.java
+++ /dev/null
@@ -1,1779 +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.gen.internal;
-
-import java.io.PrintWriter;
-import java.io.Serializable;
-import java.io.StringWriter;
-import java.lang.reflect.Modifier;
-import java.text.Collator;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jdt.core.IJavaModelStatusConstants;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.JavaType;
-import org.eclipse.jpt.utility.internal.BooleanHolder;
-import org.eclipse.jpt.utility.internal.IndentingPrintWriter;
-import org.eclipse.jpt.utility.internal.NameTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.osgi.util.NLS;
-
-// TODO format generated code per preferences
-// TODO organize generated imports per preferences
-/**
- * This generator will generate an entity for a table.
- */
-public class EntityGenerator {
- final Config config;
- private final IPackageFragment packageFragment;
- private final GenTable genTable;
- private final String entityClassName;
- private final String pkClassName;
-
-
- // ********** public API **********
-
- static void generateEntity(
- Config config,
- IPackageFragment packageFragment,
- GenTable genTable,
- IProgressMonitor progressMonitor
- ) {
- if ((config == null) || (packageFragment == null) || (genTable == null)) {
- throw new NullPointerException();
- }
- new EntityGenerator(config, packageFragment, genTable).generateEntity(progressMonitor);
- }
-
-
- // ********** constructor/initialization **********
-
- private EntityGenerator(Config config, IPackageFragment packageFragment, GenTable genTable) {
- super();
- this.config = config;
- this.packageFragment = packageFragment;
- this.genTable = genTable;
- this.entityClassName = this.fullyQualify(this.getEntityName());
- this.pkClassName = this.entityClassName + '.' + config.getPrimaryKeyMemberClassName();
- }
-
-
- // ********** code gen **********
-
- private void generateEntity(IProgressMonitor progressMonitor) {
- try {
- this.generateEntity_(progressMonitor);
- } catch (JavaModelException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- private void generateEntity_(IProgressMonitor progressMonitor) throws JavaModelException {
- SubMonitor sm = SubMonitor.convert(progressMonitor, this.buildTaskName(), 100);
- String fileName = this.getEntityName() + ".java"; //$NON-NLS-1$
- String source = this.buildSource();
- sm.worked(20);
- try {
- this.packageFragment.createCompilationUnit(fileName, source, false, sm.newChild(40));
- } catch (JavaModelException ex) {
- if (ex.getJavaModelStatus().getCode() == IJavaModelStatusConstants.NAME_COLLISION) {
- if (this.config.getOverwriteConfirmer().overwrite(this.entityClassName)) {
- this.packageFragment.createCompilationUnit(fileName, source, true, sm.newChild(40));
- }
- } else {
- throw ex;
- }
- }
- sm.setWorkRemaining(0);
- }
-
- private String buildTaskName() {
- return NLS.bind(JptGenMessages.EntityGenerator_taskName, this.getEntityName());
- }
-
- /**
- * build the "body" source first; then build the "package" and "imports" source
- * and concatenate the "body" source to it
- */
- private String buildSource() {
- // build the body source first so we can gather up the import statements
- BodySource bodySource = this.buildBodySource();
-
- StringWriter sw = new StringWriter(bodySource.length() + 2000);
- PrintWriter pw = new PrintWriter(sw);
- this.printPackageAndImportsOn(pw, bodySource);
- pw.print(bodySource.getSource());
- return sw.toString();
- }
-
- private BodySource buildBodySource() {
- EntitySourceWriter pw = new EntitySourceWriter(this.getPackageName(), this.entityClassName);
- this.printBodySourceOn(pw);
- return pw;
- }
-
- private void printBodySourceOn(EntitySourceWriter pw) {
- this.printClassDeclarationOn(pw);
-
- pw.indent();
- this.printEntityPrimaryKeyFieldsOn(pw);
- this.printEntityNonPrimaryKeyBasicFieldsOn(pw);
- this.printEntityManyToOneFieldsOn(pw);
- this.printEntityOneToManyFieldsOn(pw);
- this.printEntityOwnedManyToManyFieldsOn(pw);
- this.printEntityNonOwnedManyToManyFieldsOn(pw);
- this.printSerialVersionUIDFieldOn(pw);
- pw.println();
-
- this.printZeroArgumentConstructorOn(this.getEntityName(), this.config.getMethodVisibilityClause(), pw);
- if (this.config.propertyAccessType() || this.config.generateGettersAndSetters()) {
- this.printEntityPrimaryKeyPropertiesOn(pw);
- this.printEntityNonPrimaryKeyBasicPropertiesOn(pw);
- this.printEntityManyToOnePropertiesOn(pw);
- this.printEntityOneToManyPropertiesOn(pw);
- this.printEntityOwnedManyToManyPropertiesOn(pw);
- this.printEntityNonOwnedManyToManyPropertiesOn(pw);
- }
-
- if (this.primaryKeyClassIsRequired()) {
- this.printPrimaryKeyClassOn(pw);
- }
- pw.undent();
-
- pw.print('}');
- pw.println(); // EOF
- }
-
-
- // ********** class declaration **********
-
- private void printClassDeclarationOn(EntitySourceWriter pw) {
- this.printEntityAnnotationOn(pw);
- this.printTableAnnotationOn(pw);
- this.printIdClassAnnotationOn(pw);
-
- pw.print("public class "); //$NON-NLS-1$
- pw.printTypeDeclaration(this.entityClassName);
- if (config.serializable()) {
- pw.print(" implements "); //$NON-NLS-1$
- pw.printTypeDeclaration(Serializable.class.getName());
- }
- pw.print(" {"); //$NON-NLS-1$
- pw.println();
- }
-
- private void printEntityAnnotationOn(EntitySourceWriter pw) {
- pw.printAnnotation(JPA.ENTITY);
- pw.println();
- }
-
- private void printTableAnnotationOn(EntitySourceWriter pw) {
- String tableName = this.config.getDatabaseAnnotationNameBuilder().buildTableAnnotationName(this.getEntityName(), this.getTable());
- if (tableName == null) {
- return; // the default table name is OK
- }
- pw.printAnnotation(JPA.TABLE);
- pw.print("(name="); //$NON-NLS-1$
- pw.printStringLiteral(tableName);
- pw.print(')');
- pw.println();
- }
-
- private void printIdClassAnnotationOn(EntitySourceWriter pw) {
- if (this.primaryKeyClassIsRequired() && this.config.generateIdClassForCompoundPK()) {
- pw.printAnnotation(JPA.ID_CLASS);
- pw.print('(');
- pw.printTypeDeclaration(this.pkClassName);
- pw.print(".class)"); //$NON-NLS-1$
- pw.println();
- }
- }
-
-
- // ********** primary key fields **********
-
- private void printEntityPrimaryKeyFieldsOn(EntitySourceWriter pw) {
- if (this.primaryKeyClassIsRequired() && this.config.generateEmbeddedIdForCompoundPK()) {
- this.printEntityEmbeddedIdPrimaryKeyFieldOn(pw);
- } else {
- this.printEntityReadOnlyPrimaryKeyFieldsOn(pw);
- this.printEntityWritablePrimaryKeyFieldsOn(pw);
- }
- }
-
- private void printEntityEmbeddedIdPrimaryKeyFieldOn(EntitySourceWriter pw) {
- if (this.config.fieldAccessType()) {
- pw.printAnnotation(JPA.EMBEDDED_ID);
- pw.println();
- }
- this.printFieldOn(this.genTable.getAttributeNameForEmbeddedId(), this.pkClassName, pw);
- }
-
- private void printEntityReadOnlyPrimaryKeyFieldsOn(EntitySourceWriter pw) {
- this.printPrimaryKeyFieldsOn(pw, true, true); // true=read-only; true=print ID annotation on fields
- }
-
- private void printEntityWritablePrimaryKeyFieldsOn(EntitySourceWriter pw) {
- this.printPrimaryKeyFieldsOn(pw, false, true); // false=writable; true=print ID annotation on fields
- }
-
- private void printPrimaryKeyFieldsOn(EntitySourceWriter pw, boolean readOnly, boolean printIdAnnotation) {
- for (Iterator<Column> stream = this.primaryKeyColumns(readOnly); stream.hasNext(); ) {
- this.printPrimaryKeyFieldOn(stream.next(), pw, readOnly, printIdAnnotation);
- }
- }
-
- private Iterator<Column> primaryKeyColumns(boolean readOnly) {
- return readOnly ? this.genTable.readOnlyPrimaryKeyColumns() : this.genTable.writablePrimaryKeyColumns();
- }
-
- // TODO if the field's type is java.util/sql.Date, it needs @Temporal(DATE)
- // TODO if the primary key is auto-generated, the field must be an integral type
- private void printPrimaryKeyFieldOn(Column column, EntitySourceWriter pw, boolean readOnly, boolean printIdAnnotation) {
- String fieldName = this.genTable.getAttributeNameFor(column);
- if (this.config.fieldAccessType()) {
- if (printIdAnnotation) {
- pw.printAnnotation(JPA.ID);
- pw.println();
- }
- String columnName = this.config.getDatabaseAnnotationNameBuilder().buildColumnAnnotationName(fieldName, column);
- if (readOnly) {
- this.printReadOnlyColumnAnnotationOn(columnName, pw);
- } else {
- this.printColumnAnnotationOn(columnName, pw);
- }
- }
- this.printFieldOn(fieldName, column.getPrimaryKeyJavaTypeDeclaration(), pw);
- }
-
- private void printReadOnlyColumnAnnotationOn(String columnName, EntitySourceWriter pw) {
- pw.printAnnotation(JPA.COLUMN);
- pw.print('(');
- if (columnName != null) {
- pw.print("name="); //$NON-NLS-1$
- pw.printStringLiteral(columnName);
- pw.print(", "); //$NON-NLS-1$
- }
- pw.print("insertable=false, updatable=false)"); //$NON-NLS-1$
- pw.println();
- }
-
-
- // ********** basic fields **********
-
- private void printEntityNonPrimaryKeyBasicFieldsOn(EntitySourceWriter pw) {
- for (Iterator<Column> stream = this.genTable.nonPrimaryKeyBasicColumns(); stream.hasNext(); ) {
- this.printEntityNonPrimaryKeyBasicFieldOn(stream.next(), pw);
- }
- }
-
- private void printEntityNonPrimaryKeyBasicFieldOn(Column column, EntitySourceWriter pw) {
- String fieldName = this.genTable.getAttributeNameFor(column);
- if (this.config.fieldAccessType()) {
- String columnName = this.config.getDatabaseAnnotationNameBuilder().buildColumnAnnotationName(fieldName, column);
- this.printColumnAnnotationOn(columnName, pw);
- }
- if (column.isLOB()) {
- pw.printAnnotation(JPA.LOB);
- pw.println();
- }
- this.printFieldOn(fieldName, column.getJavaTypeDeclaration(), pw);
- }
-
- private void printColumnAnnotationOn(String columnName, EntitySourceWriter pw) {
- if (columnName != null) { // the column name is null if the default is OK
- pw.printAnnotation(JPA.COLUMN);
- pw.print("(name="); //$NON-NLS-1$
- pw.printStringLiteral(columnName);
- pw.print(')');
- pw.println();
- }
- }
-
-
- // ********** many-to-one fields **********
-
- private void printEntityManyToOneFieldsOn(EntitySourceWriter pw) {
- for (Iterator<ManyToOneRelation> stream = this.genTable.manyToOneRelations(); stream.hasNext(); ) {
- this.printEntityManyToOneFieldOn(stream.next(), pw);
- }
- }
-
- private void printEntityManyToOneFieldOn(ManyToOneRelation relation, EntitySourceWriter pw) {
- String fieldName = this.genTable.getAttributeNameFor(relation);
- if (this.config.fieldAccessType()) {
- this.printManyToOneAnnotationOn(fieldName, relation, pw);
- }
- this.printFieldOn(fieldName, this.fullyQualify(relation.getReferencedEntityName()), pw);
- }
-
- private void printManyToOneAnnotationOn(String attributeName, ManyToOneRelation relation, EntitySourceWriter pw) {
- pw.printAnnotation(JPA.MANY_TO_ONE);
- pw.println();
- ForeignKey foreignKey = relation.getForeignKey();
- if (foreignKey.referencesSingleColumnPrimaryKey()) {
- // if the FK references a single-column PK, 'referencedColumnName' is not required
- String joinColumnName = this.config.getDatabaseAnnotationNameBuilder().buildJoinColumnAnnotationName(attributeName, foreignKey);
- if (joinColumnName == null) {
- // no JoinColumn annotation needed: the default 'name' and 'referencedColumnName' work
- } else {
- // there is only a single join column here (just not the default name)
- this.printJoinColumnAnnotationOn(joinColumnName, null, pw);
- pw.println();
- }
- } else {
- this.printManyToOneJoinColumnsAnnotationOn(foreignKey, pw);
- }
- }
-
- private void printManyToOneJoinColumnsAnnotationOn(ForeignKey foreignKey, EntitySourceWriter pw) {
- if (foreignKey.columnPairsSize() > 1) {
- pw.printAnnotation(JPA.JOIN_COLUMNS);
- pw.print("({"); //$NON-NLS-1$
- pw.println();
- pw.indent();
- }
- this.printJoinColumnAnnotationsOn(foreignKey, pw);
- if (foreignKey.columnPairsSize() > 1) {
- pw.undent();
- pw.println();
- pw.print("})"); //$NON-NLS-1$
- }
- pw.println();
- }
-
- private void printJoinColumnAnnotationsOn(ForeignKey foreignKey, EntitySourceWriter pw) {
- for (Iterator<ForeignKey.ColumnPair> stream = foreignKey.columnPairs(); stream.hasNext(); ) {
- this.printJoinColumnAnnotationOn(stream.next(), pw);
- if (stream.hasNext()) {
- pw.println(',');
- }
- }
- }
-
- private void printJoinColumnAnnotationOn(ForeignKey.ColumnPair columnPair, EntitySourceWriter pw) {
- this.printJoinColumnAnnotationOn(
- this.config.getDatabaseAnnotationNameBuilder().buildJoinColumnAnnotationName(columnPair.getBaseColumn()),
- this.config.getDatabaseAnnotationNameBuilder().buildJoinColumnAnnotationName(columnPair.getReferencedColumn()),
- pw
- );
- }
-
- /**
- * 'baseColumnName' cannot be null;
- * 'referencedColumnName' is null when the default is applicable (i.e. the
- * referenced column is the single-column primary key column of the
- * referenced table)
- */
- private void printJoinColumnAnnotationOn(String baseColumnName, String referencedColumnName, EntitySourceWriter pw) {
- pw.printAnnotation(JPA.JOIN_COLUMN);
- pw.print("(name="); //$NON-NLS-1$
- pw.printStringLiteral(baseColumnName);
-
- if (referencedColumnName != null) {
- pw.print(", referencedColumnName="); //$NON-NLS-1$
- pw.printStringLiteral(referencedColumnName);
- }
-
- pw.print(')');
- }
-
-
- // ********** one-to-many fields **********
-
- private void printEntityOneToManyFieldsOn(EntitySourceWriter pw) {
- for (Iterator<OneToManyRelation> stream = this.genTable.oneToManyRelations(); stream.hasNext(); ) {
- this.printEntityOneToManyFieldOn(stream.next(), pw);
- }
- }
-
- private void printEntityOneToManyFieldOn(OneToManyRelation relation, EntitySourceWriter pw) {
- String fieldName = this.genTable.getAttributeNameFor(relation);
- if (this.config.fieldAccessType()) {
- this.printOneToManyAnnotationOn(relation, pw);
- }
- this.printCollectionFieldOn(fieldName, this.fullyQualify(relation.getReferencedEntityName()), pw);
- }
-
- private void printOneToManyAnnotationOn(OneToManyRelation relation, EntitySourceWriter pw) {
- pw.printAnnotation(JPA.ONE_TO_MANY);
- pw.print("(mappedBy=\""); //$NON-NLS-1$
- pw.print(relation.getMappedBy());
- pw.print("\")"); //$NON-NLS-1$
- pw.println();
- }
-
-
- // ********** owned many-to-many fields **********
-
- private void printEntityOwnedManyToManyFieldsOn(EntitySourceWriter pw) {
- for (Iterator<ManyToManyRelation> stream = this.genTable.ownedManyToManyRelations(); stream.hasNext(); ) {
- this.printEntityOwnedManyToManyFieldOn(stream.next(), pw);
- }
- }
-
- private void printEntityOwnedManyToManyFieldOn(ManyToManyRelation relation, EntitySourceWriter pw) {
- String fieldName = this.genTable.getAttributeNameFor(relation);
- if (this.config.fieldAccessType()) {
- this.printOwnedManyToManyAnnotationOn(fieldName, relation, pw);
- }
- this.printCollectionFieldOn(fieldName, this.fullyQualify(relation.getNonOwningEntityName()), pw);
- }
-
- /**
- * only print the JoinTable annotation if one or more of the
- * [generated] elements is not defaulted:
- * name
- * joinColumns
- * inverseJoinColumns
- * thus the need for the 'printJoinTableAnnotation' flag
- */
- private void printOwnedManyToManyAnnotationOn(String attributeName, ManyToManyRelation relation, EntitySourceWriter pw) {
- pw.printAnnotation(JPA.MANY_TO_MANY);
- pw.println();
- BooleanHolder printJoinTableAnnotation = new BooleanHolder(true);
-
- if ( ! relation.joinTableNameIsDefault()) { // db-only test - no need to delegate to platform?
- printJoinTableAnnotation.setFalse();
- pw.printAnnotation(JPA.JOIN_TABLE);
- pw.print("(name="); //$NON-NLS-1$
- pw.printStringLiteral(this.config.getDatabaseAnnotationNameBuilder().buildJoinTableAnnotationName(relation.getJoinGenTable().getTable()));
- }
-
- this.printJoinTableJoinColumnAnnotationsOn(
- "joinColumns", //$NON-NLS-1$
- attributeName,
- relation.getOwningForeignKey(),
- printJoinTableAnnotation,
- pw
- );
-
- this.printJoinTableJoinColumnAnnotationsOn(
- "inverseJoinColumns", //$NON-NLS-1$
- relation.getNonOwningGenTable().getAttributeNameFor(relation),
- relation.getNonOwningForeignKey(),
- printJoinTableAnnotation,
- pw
- );
-
- if (printJoinTableAnnotation.isFalse()) {
- pw.print(')');
- pw.println();
- }
- }
-
- /**
- * 'elementName' is either "joinColumns" or "inverseJoinColumns"
- */
- private void printJoinTableJoinColumnAnnotationsOn(String elementName, String attributeName, ForeignKey foreignKey, BooleanHolder printJoinTableAnnotation, EntitySourceWriter pw) {
- // we have to pre-calculate whether either 'name' and/or 'referencedColumnName'
- // is required because they are wrapped by the JoinTable annotation and we
- // need to print the JoinTable annotation first (if it hasn't already been printed)
- boolean printRef = ! foreignKey.referencesSingleColumnPrimaryKey();
- // if 'referencedColumnName' is required, 'name' is also required (i.e. it cannot be defaulted);
- // but we will calculate it later [1], since there could be multiple join columns
- String joinColumnName = (printRef) ?
- null // 'joinColumnName' is not used
- :
- this.config.getDatabaseAnnotationNameBuilder().buildJoinColumnAnnotationName(attributeName, foreignKey);
- boolean printBase = (printRef || (joinColumnName != null));
- if (printBase || printRef) {
- if (printJoinTableAnnotation.isTrue()) {
- printJoinTableAnnotation.setFalse();
- pw.printAnnotation(JPA.JOIN_TABLE);
- pw.print('(');
- } else {
- pw.print(',');
- }
- pw.println();
- pw.indent();
- if (printRef) {
- // if 'printRef' is true, 'joinColumnName' will always be "IGNORED" (so we ignore it)
- this.printJoinTableJoinColumnAnnotationsOn(elementName, foreignKey, pw); // [1]
- } else {
- // if the FK references a single-column PK, 'referencedColumnName' is not required
- if (printBase) {
- // there is only a single join column here (just not the default name)
- pw.print(elementName);
- pw.print('=');
- this.printJoinColumnAnnotationOn(joinColumnName, null, pw);
- } else {
- // no JoinColumn annotation needed: the default 'name' and 'referencedColumnName' work
- }
- }
- pw.undent();
- }
- }
-
- /**
- * 'elementName' is either "joinColumns" or "inverseJoinColumns"
- */
- private void printJoinTableJoinColumnAnnotationsOn(String elementName, ForeignKey foreignKey, EntitySourceWriter pw) {
- pw.print(elementName);
- pw.print('=');
- if (foreignKey.columnPairsSize() > 1) {
- pw.print('{');
- pw.println();
- pw.indent();
- }
- this.printJoinColumnAnnotationsOn(foreignKey, pw);
- if (foreignKey.columnPairsSize() > 1) {
- pw.undent();
- pw.println();
- pw.print('}');
- pw.println();
- }
- }
-
-
- // ********** non-owned many-to-many fields **********
-
- private void printEntityNonOwnedManyToManyFieldsOn(EntitySourceWriter pw) {
- for (Iterator<ManyToManyRelation> stream = this.genTable.nonOwnedManyToManyRelations(); stream.hasNext(); ) {
- this.printEntityNonOwnedManyToManyFieldOn(stream.next(), pw);
- }
- }
-
- private void printEntityNonOwnedManyToManyFieldOn(ManyToManyRelation relation, EntitySourceWriter pw) {
- String fieldName = this.genTable.getAttributeNameFor(relation);
- if (this.config.fieldAccessType()) {
- this.printNonOwnedManyToManyAnnotationOn(relation, pw);
- }
- this.printCollectionFieldOn(fieldName, this.fullyQualify(relation.getOwningEntityName()), pw);
- }
-
- private void printNonOwnedManyToManyAnnotationOn(ManyToManyRelation relation, EntitySourceWriter pw) {
- pw.printAnnotation(JPA.MANY_TO_MANY);
- pw.print("(mappedBy=\""); //$NON-NLS-1$
- pw.print(relation.getMappedBy());
- pw.print("\")"); //$NON-NLS-1$
- pw.println();
- }
-
-
- // ********** misc **********
-
- private void printSerialVersionUIDFieldOn(EntitySourceWriter pw) {
- if (this.config.generateSerialVersionUID()) {
- pw.print("private static final long serialVersionUID = 1L;"); //$NON-NLS-1$
- pw.println();
- }
- }
-
- private void printZeroArgumentConstructorOn(String ctorName, String visibility, EntitySourceWriter pw) {
- if (this.config.generateDefaultConstructor()) {
- pw.printVisibility(visibility);
- pw.print(ctorName);
- pw.print("() {"); //$NON-NLS-1$
- pw.println();
- pw.indent();
- pw.println("super();"); //$NON-NLS-1$
- pw.undent();
- pw.print('}');
- pw.println();
- pw.println();
- }
- }
-
-
- // ********** primary key properties **********
-
- private void printEntityPrimaryKeyPropertiesOn(EntitySourceWriter pw) {
- if (this.primaryKeyClassIsRequired() && this.config.generateEmbeddedIdForCompoundPK()) {
- this.printEntityEmbeddedIdPrimaryKeyPropertyOn(pw);
- } else {
- this.printEntityReadOnlyPrimaryKeyPropertiesOn(pw);
- this.printEntityWritablePrimaryKeyPropertiesOn(pw);
- }
- }
-
- private void printEntityEmbeddedIdPrimaryKeyPropertyOn(EntitySourceWriter pw) {
- if (this.config.propertyAccessType()) {
- pw.printAnnotation(JPA.EMBEDDED_ID);
- pw.println();
- }
- this.printPropertyOn(this.genTable.getAttributeNameForEmbeddedId(), this.pkClassName, pw);
- }
-
- private void printEntityReadOnlyPrimaryKeyPropertiesOn(EntitySourceWriter pw) {
- this.printPrimaryKeyPropertiesOn(pw, true, true); // true=read-only; true=print ID annotation on getters
- }
-
- private void printEntityWritablePrimaryKeyPropertiesOn(EntitySourceWriter pw) {
- this.printPrimaryKeyPropertiesOn(pw, false, true); // false=writable; true=print ID annotation on getters
- }
-
- private void printPrimaryKeyPropertiesOn(EntitySourceWriter pw, boolean readOnly, boolean printIdAnnotation) {
- for (Iterator<Column> stream = this.primaryKeyColumns(readOnly); stream.hasNext(); ) {
- this.printPrimaryKeyPropertyOn(stream.next(), pw, readOnly, printIdAnnotation);
- }
- }
-
- // TODO if the property's type is java.util/sql.Date, it needs @Temporal(DATE)
- // TODO if the primary key is auto-generated, the property must be an integral type
- private void printPrimaryKeyPropertyOn(Column column, EntitySourceWriter pw, boolean readOnly, boolean printIdAnnotation) {
- String propertyName = this.genTable.getAttributeNameFor(column);
- if (this.config.propertyAccessType()) {
- if (printIdAnnotation) {
- pw.printAnnotation(JPA.ID);
- pw.println();
- }
- String columnName = this.config.getDatabaseAnnotationNameBuilder().buildColumnAnnotationName(propertyName, column);
- if (readOnly) {
- this.printReadOnlyColumnAnnotationOn(columnName, pw);
- } else {
- this.printColumnAnnotationOn(columnName, pw);
- }
- }
- this.printPropertyOn(propertyName, column.getPrimaryKeyJavaTypeDeclaration(), pw);
- }
-
-
- // ********** basic properties **********
-
- private void printEntityNonPrimaryKeyBasicPropertiesOn(EntitySourceWriter pw) {
- for (Iterator<Column> stream = this.genTable.nonPrimaryKeyBasicColumns(); stream.hasNext(); ) {
- this.printEntityNonPrimaryKeyBasicPropertyOn(stream.next(), pw);
- }
- }
-
- private void printEntityNonPrimaryKeyBasicPropertyOn(Column column, EntitySourceWriter pw) {
- String propertyName = this.genTable.getAttributeNameFor(column);
- if (this.config.propertyAccessType()) {
- String columnName = this.config.getDatabaseAnnotationNameBuilder().buildColumnAnnotationName(propertyName, column);
- this.printColumnAnnotationOn(columnName, pw);
- }
- this.printPropertyOn(propertyName, column.getJavaTypeDeclaration(), pw);
- }
-
-
- // ********** many-to-one properties **********
-
- private void printEntityManyToOnePropertiesOn(EntitySourceWriter pw) {
- for (Iterator<ManyToOneRelation> stream = this.genTable.manyToOneRelations(); stream.hasNext(); ) {
- this.printEntityManyToOnePropertyOn(stream.next(), pw);
- }
- }
-
- private void printEntityManyToOnePropertyOn(ManyToOneRelation relation, EntitySourceWriter pw) {
- String propertyName = this.genTable.getAttributeNameFor(relation);
- if (this.config.propertyAccessType()) {
- this.printManyToOneAnnotationOn(propertyName, relation, pw);
- }
- String typeDeclaration = this.fullyQualify(relation.getReferencedEntityName());
- this.printPropertyOn(propertyName, typeDeclaration, pw);
- }
-
-
- // ********** one-to-many properties **********
-
- private void printEntityOneToManyPropertiesOn(EntitySourceWriter pw) {
- for (Iterator<OneToManyRelation> stream = this.genTable.oneToManyRelations(); stream.hasNext(); ) {
- this.printEntityOneToManyPropertyOn(stream.next(), pw);
- }
- }
-
- private void printEntityOneToManyPropertyOn(OneToManyRelation relation, EntitySourceWriter pw) {
- String propertyName = this.genTable.getAttributeNameFor(relation);
- if (this.config.propertyAccessType()) {
- this.printOneToManyAnnotationOn(relation, pw);
- }
- String elementTypeDeclaration = this.fullyQualify(relation.getReferencedEntityName());
- this.printCollectionPropertyOn(propertyName, elementTypeDeclaration, pw);
- }
-
-
- // ********** owned many-to-many properties **********
-
- private void printEntityOwnedManyToManyPropertiesOn(EntitySourceWriter pw) {
- for (Iterator<ManyToManyRelation> stream = this.genTable.ownedManyToManyRelations(); stream.hasNext(); ) {
- this.printEntityOwnedManyToManyPropertyOn(stream.next(), pw);
- }
- }
-
- private void printEntityOwnedManyToManyPropertyOn(ManyToManyRelation relation, EntitySourceWriter pw) {
- String propertyName = this.genTable.getAttributeNameFor(relation);
- if (this.config.propertyAccessType()) {
- this.printOwnedManyToManyAnnotationOn(propertyName, relation, pw);
- }
- String elementTypeDeclaration = this.fullyQualify(relation.getNonOwningEntityName());
- this.printCollectionPropertyOn(propertyName, elementTypeDeclaration, pw);
- }
-
-
- // ********** non-owned many-to-many properties **********
-
- private void printEntityNonOwnedManyToManyPropertiesOn(EntitySourceWriter pw) {
- for (Iterator<ManyToManyRelation> stream = this.genTable.nonOwnedManyToManyRelations(); stream.hasNext(); ) {
- this.printEntityNonOwnedManyToManyPropertyOn(stream.next(), pw);
- }
- }
-
- private void printEntityNonOwnedManyToManyPropertyOn(ManyToManyRelation relation, EntitySourceWriter pw) {
- String propertyName = this.genTable.getAttributeNameFor(relation);
- if (this.config.propertyAccessType()) {
- this.printNonOwnedManyToManyAnnotationOn(relation, pw);
- }
- String elementTypeDeclaration = this.fullyQualify(relation.getOwningEntityName());
- this.printCollectionPropertyOn(propertyName, elementTypeDeclaration, pw);
- }
-
-
- // ********** compound primary key class **********
-
- private void printPrimaryKeyClassOn(EntitySourceWriter pw) {
- pw.println();
- if (this.config.generateEmbeddedIdForCompoundPK()) {
- pw.printAnnotation(JPA.EMBEDDABLE);
- pw.println();
- }
- pw.print("public static class "); //$NON-NLS-1$
- pw.print(this.config.getPrimaryKeyMemberClassName());
- pw.print(" implements "); //$NON-NLS-1$
- pw.printTypeDeclaration(Serializable.class.getName());
- pw.print(" {"); //$NON-NLS-1$
- pw.println();
-
- pw.indent();
- if (this.config.generateEmbeddedIdForCompoundPK()) {
- this.printEmbeddableReadOnlyPrimaryKeyFieldsOn(pw);
- this.printEmbeddableWritablePrimaryKeyFieldsOn(pw);
- } else {
- this.printIdFieldsOn(pw);
- }
- this.printSerialVersionUIDFieldOn(pw);
- pw.println();
- this.printZeroArgumentConstructorOn(this.config.getPrimaryKeyMemberClassName(), "public", pw); //$NON-NLS-1$
-
- if (this.config.propertyAccessType() || this.config.generateGettersAndSetters()) {
- if (this.config.generateEmbeddedIdForCompoundPK()) {
- this.printEmbeddableReadOnlyPrimaryKeyPropertiesOn(pw);
- this.printEmbeddableWritablePrimaryKeyPropertiesOn(pw);
- } else {
- this.printIdPropertiesOn(pw);
- }
- }
-
- this.printPrimaryKeyEqualsMethodOn(this.config.getPrimaryKeyMemberClassName(), this.getTable().primaryKeyColumns(), pw);
- this.printPrimaryKeyHashCodeMethodOn(this.getTable().primaryKeyColumns(), pw);
- pw.undent();
-
- pw.print('}');
- pw.println();
- pw.println();
- }
-
-
- // ********** compound primary key class fields **********
-
- private void printEmbeddableReadOnlyPrimaryKeyFieldsOn(EntitySourceWriter pw) {
- this.printPrimaryKeyFieldsOn(pw, true, false); // true=read-only; false=do not print ID annotation on fields
- }
-
- private void printEmbeddableWritablePrimaryKeyFieldsOn(EntitySourceWriter pw) {
- this.printPrimaryKeyFieldsOn(pw, false, false); // false=writable; false=do not print ID annotation on fields
- }
-
- private void printIdFieldsOn(EntitySourceWriter pw) {
- for (Iterator<Column> stream = this.getTable().primaryKeyColumns(); stream.hasNext(); ) {
- this.printIdFieldOn(stream.next(), pw);
- }
- }
-
- private void printIdFieldOn(Column column, EntitySourceWriter pw) {
- this.printFieldOn(this.genTable.getAttributeNameFor(column), column.getPrimaryKeyJavaTypeDeclaration(), pw);
- }
-
-
- // ********** compound primary key class properties **********
-
- private void printEmbeddableReadOnlyPrimaryKeyPropertiesOn(EntitySourceWriter pw) {
- this.printPrimaryKeyPropertiesOn(pw, true, false); // true=read-only; false=do not print ID annotation on getters
- }
-
- private void printEmbeddableWritablePrimaryKeyPropertiesOn(EntitySourceWriter pw) {
- this.printPrimaryKeyPropertiesOn(pw, false, false); // false=writable; false=do not print ID annotation on getters
- }
-
- private void printIdPropertiesOn(EntitySourceWriter pw) {
- for (Iterator<Column> stream = this.getTable().primaryKeyColumns(); stream.hasNext(); ) {
- this.printIdPropertyOn(stream.next(), pw);
- }
- }
-
- private void printIdPropertyOn(Column column, EntitySourceWriter pw) {
- this.printPropertyOn(this.genTable.getAttributeNameFor(column), column.getPrimaryKeyJavaTypeDeclaration(), pw);
- }
-
-
- // ********** compound primary key class equals **********
-
- private void printPrimaryKeyEqualsMethodOn(String className, Iterator<Column> columns, EntitySourceWriter pw) {
- pw.printAnnotation("java.lang.Override"); //$NON-NLS-1$
- pw.println();
-
- pw.println("public boolean equals(Object o) {"); //$NON-NLS-1$
- pw.indent();
- pw.println("if (o == this) {"); //$NON-NLS-1$
- pw.indent();
- pw.println("return true;"); //$NON-NLS-1$
- pw.undent();
- pw.print('}');
- pw.println();
-
- pw.print("if ( ! (o instanceof "); //$NON-NLS-1$
- pw.print(className);
- pw.print(")) {"); //$NON-NLS-1$
- pw.println();
- pw.indent();
- pw.println("return false;"); //$NON-NLS-1$
- pw.undent();
- pw.print('}');
- pw.println();
-
- pw.print(className);
- pw.print(" other = ("); //$NON-NLS-1$
- pw.print(className);
- pw.print(") o;"); //$NON-NLS-1$
- pw.println();
-
- pw.print("return "); //$NON-NLS-1$
- pw.indent();
- while (columns.hasNext()) {
- this.printPrimaryKeyEqualsClauseOn(columns.next(), pw);
- if (columns.hasNext()) {
- pw.println();
- pw.print("&& "); //$NON-NLS-1$
- }
- }
- pw.print(';');
- pw.println();
- pw.undent();
- pw.undent();
- pw.print('}');
- pw.println();
- pw.println();
- }
-
- private void printPrimaryKeyEqualsClauseOn(Column column, EntitySourceWriter pw) {
- String fieldName = this.genTable.getAttributeNameFor(column);
- JavaType javaType = column.getPrimaryKeyJavaType();
- if (javaType.isPrimitive()) {
- this.printPrimitiveEqualsClauseOn(fieldName, pw);
- } else {
- this.printReferenceEqualsClauseOn(fieldName, pw);
- }
- }
-
- private void printPrimitiveEqualsClauseOn(String fieldName, EntitySourceWriter pw) {
- pw.print("(this."); //$NON-NLS-1$
- pw.print(fieldName);
- pw.print(" == other."); //$NON-NLS-1$
- pw.print(fieldName);
- pw.print(')');
- }
-
- private void printReferenceEqualsClauseOn(String fieldName, EntitySourceWriter pw) {
- pw.print("this."); //$NON-NLS-1$
- pw.print(fieldName);
- pw.print(".equals(other."); //$NON-NLS-1$
- pw.print(fieldName);
- pw.print(')');
- }
-
-
- // ********** compound primary key class hash code **********
-
- private void printPrimaryKeyHashCodeMethodOn(Iterator<Column> columns, EntitySourceWriter pw) {
- pw.printAnnotation("java.lang.Override"); //$NON-NLS-1$
- pw.println();
-
- pw.println("public int hashCode() {"); //$NON-NLS-1$
- pw.indent();
- pw.println("final int prime = 31;"); //$NON-NLS-1$
- pw.println("int hash = 17;"); //$NON-NLS-1$
- while (columns.hasNext()) {
- pw.print("hash = hash * prime + "); //$NON-NLS-1$
- this.printPrimaryKeyHashCodeClauseOn(columns.next(), pw);
- pw.print(';');
- pw.println();
- }
- pw.println("return hash;"); //$NON-NLS-1$
- pw.undent();
- pw.print('}');
- pw.println();
- pw.println();
- }
-
- private void printPrimaryKeyHashCodeClauseOn(Column column, EntitySourceWriter pw) {
- String fieldName = this.genTable.getAttributeNameFor(column);
- JavaType javaType = column.getPrimaryKeyJavaType();
- if (javaType.isPrimitive()) {
- this.printPrimitiveHashCodeClauseOn(javaType.getElementTypeName(), fieldName, pw);
- } else {
- this.printReferenceHashCodeClauseOn(fieldName, pw);
- }
- }
-
- private void printPrimitiveHashCodeClauseOn(String primitiveName, String fieldName, EntitySourceWriter pw) {
- if (primitiveName.equals("int")) { //$NON-NLS-1$
- // this.value
- pw.print("this."); //$NON-NLS-1$
- pw.print(fieldName);
- } else if (primitiveName.equals("short") //$NON-NLS-1$
- || primitiveName.equals("byte") //$NON-NLS-1$
- || primitiveName.equals("char")) { //$NON-NLS-1$
- // ((int) this.value) - explicit cast
- pw.print("((int) this."); //$NON-NLS-1$
- pw.print(fieldName);
- pw.print(')');
- } else if (primitiveName.equals("long")) { // cribbed from Long#hashCode() //$NON-NLS-1$
- // ((int) (this.value ^ (this.value >>> 32)))
- pw.print("((int) (this."); //$NON-NLS-1$
- pw.print(fieldName);
- pw.print(" ^ (this."); //$NON-NLS-1$
- pw.print(fieldName);
- pw.print(" >>> 32)))"); //$NON-NLS-1$
- } else if (primitiveName.equals("float")) { // cribbed from Float#hashCode() //$NON-NLS-1$
- // java.lang.Float.floatToIntBits(this.value)
- pw.printTypeDeclaration("java.lang.Float"); //$NON-NLS-1$
- pw.print(".floatToIntBits(this."); //$NON-NLS-1$
- pw.print(fieldName);
- pw.print(')');
- } else if (primitiveName.equals("double")) { // cribbed from Double#hashCode() //$NON-NLS-1$
- // ((int) (java.lang.Double.doubleToLongBits(this.value) ^ (java.lang.Double.doubleToLongBits(this.value) >>> 32)))
- pw.print("((int) ("); //$NON-NLS-1$
- pw.printTypeDeclaration("java.lang.Double"); //$NON-NLS-1$
- pw.print(".doubleToLongBits(this."); //$NON-NLS-1$
- pw.print(fieldName);
- pw.print(") ^ ("); //$NON-NLS-1$
- pw.printTypeDeclaration("java.lang.Double"); //$NON-NLS-1$
- pw.print(".doubleToLongBits(this."); //$NON-NLS-1$
- pw.print(fieldName);
- pw.print(") >>> 32)))"); //$NON-NLS-1$
- } else if (primitiveName.equals("boolean")) { //$NON-NLS-1$
- // (this.value ? 1 : 0)
- pw.print("(this."); //$NON-NLS-1$
- pw.print(fieldName);
- pw.print(" ? 1 : 0)"); //$NON-NLS-1$
- } else {
- throw new IllegalArgumentException(primitiveName);
- }
- }
-
- private void printReferenceHashCodeClauseOn(String fieldName, EntitySourceWriter pw) {
- pw.print("this."); //$NON-NLS-1$
- pw.print(fieldName);
- pw.print(".hashCode()"); //$NON-NLS-1$
- }
-
-
- // ********** package and imports **********
-
- private void printPackageAndImportsOn(PrintWriter pw, BodySource bodySource) {
- if (this.getPackageName().length() != 0) {
- pw.print("package "); //$NON-NLS-1$
- pw.print(this.getPackageName());
- pw.print(';');
- pw.println();
- pw.println();
- }
-
- for (Iterator<Map.Entry<String, String>> stream = bodySource.importEntries(); stream.hasNext(); ) {
- Map.Entry<String, String> entry = stream.next();
- pw.print("import "); //$NON-NLS-1$
- pw.print(entry.getValue()); // package
- pw.print('.');
- pw.print(entry.getKey()); // short class name
- pw.print(';');
- pw.println();
- }
- pw.println();
- }
-
-
- // ********** fields **********
-
- /**
- * visibility is set in the config
- */
- private void printFieldOn(String fieldName, String typeDeclaration, EntitySourceWriter pw) {
- pw.printField(
- fieldName,
- typeDeclaration,
- this.config.getFieldVisibilityClause()
- );
- }
-
- /**
- * visibility and collection type are set in the config
- */
- private void printCollectionFieldOn(String fieldName, String elementTypeDeclaration, EntitySourceWriter pw) {
- pw.printParameterizedField(
- fieldName,
- this.config.getCollectionTypeName(),
- elementTypeDeclaration,
- this.config.getFieldVisibilityClause()
- );
- }
-
-
- // ********** properties **********
-
- /**
- * visibility is set in the config
- */
- private void printPropertyOn(String propertyName, String typeDeclaration, EntitySourceWriter pw) {
- pw.printGetterAndSetter(
- propertyName,
- typeDeclaration,
- this.config.getMethodVisibilityClause()
- );
- }
-
- /**
- * visibility and collection type are set in the config
- */
- private void printCollectionPropertyOn(String propertyName, String elementTypeDeclaration, EntitySourceWriter pw) {
- pw.printCollectionGetterAndSetter(
- propertyName,
- this.config.getCollectionTypeName(),
- elementTypeDeclaration,
- this.config.getMethodVisibilityClause()
- );
- }
-
-
- // ********** convenience methods **********
-
- private String getPackageName() {
- return this.packageFragment.getElementName();
- }
-
- private Table getTable() {
- return this.genTable.getTable();
- }
-
- private String getEntityName() {
- return this.genTable.getEntityName();
- }
-
- private boolean primaryKeyClassIsRequired() {
- return this.getTable().primaryKeyColumnsSize() > 1;
- }
-
- private String fullyQualify(String shortClassName) {
- String pkg = this.getPackageName();
- return (pkg.length() == 0) ? shortClassName : pkg + '.' + shortClassName;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.genTable.getName() + " => " + this.entityClassName); //$NON-NLS-1$
- }
-
-
- // ********** source writer **********
-
- private interface BodySource {
-
- /**
- * return a sorted set of map entries; the key is the short class name,
- * the value is the package name
- */
- Iterator<Map.Entry<String, String>> importEntries();
-
- /**
- * return the body source code
- */
- String getSource();
-
- /**
- * return the length of the body source code
- */
- int length();
-
- }
-
- /**
- * Extend IndentingPrintWriter with some methods that facilitate building
- * class source code.
- */
- private static class EntitySourceWriter extends IndentingPrintWriter implements BodySource {
- final String packageName;
- final String className;
- // key = short class name; value = package name
- private final Map<String, String> imports = new HashMap<String, String>();
-
- EntitySourceWriter(String packageName, String className) {
- super(new StringWriter(20000));
- this.packageName = packageName;
- this.className = className;
- }
-
- /**
- * Convert the specified string to a String Literal and print it,
- * adding the surrounding double-quotes and escaping characters
- * as necessary.
- */
- void printStringLiteral(String string) {
- StringTools.convertToJavaStringLiteralOn(string, this);
- }
-
- void printVisibility(String visibilityModifier) {
- if (visibilityModifier.length() != 0) {
- this.print(visibilityModifier);
- this.print(' ');
- }
- }
-
- void printAnnotation(String annotationName) {
- this.print('@');
- this.printTypeDeclaration(annotationName);
- }
-
- void printTypeDeclaration(String typeDeclaration) {
- this.print(this.buildImportedTypeDeclaration(typeDeclaration));
- }
-
- /**
- * 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;")
- */
- private 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 pkg = (last == -1) ? "" : typeDeclaration.substring(0, last); //$NON-NLS-1$
- String shortTypeDeclaration = typeDeclaration.substring(last + 1);
- String shortElementTypeName = shortTypeDeclaration;
- while (shortElementTypeName.endsWith("[]")) { //$NON-NLS-1$
- shortElementTypeName = shortElementTypeName.substring(0, shortElementTypeName.length() - 2);
- }
- String prev = this.imports.get(shortElementTypeName);
- if (prev == null) {
- // this is the first class with this short element type name
- this.imports.put(shortElementTypeName, pkg);
- return shortTypeDeclaration;
- }
- if (prev.equals(pkg)) {
- // this element type has already been imported
- return shortTypeDeclaration;
- }
- // 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
- */
- private 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")
- */
- private String buildMemberClassTypeDeclaration(String typeDeclaration) {
- int index = this.packageName.length();
- if (index != 0) {
- index++; // bump past the '.'
- }
- return typeDeclaration.substring(index);
- }
-
- private Iterator<Map.Entry<String, String>> sortedImportEntries() {
- TreeSet<Map.Entry<String, String>> sortedImports = new TreeSet<Map.Entry<String, String>>(this.buildImportEntriesComparator());
- sortedImports.addAll(this.imports.entrySet());
- return sortedImports.iterator();
- }
-
- private Comparator<Map.Entry<String, String>> buildImportEntriesComparator() {
- return new Comparator<Map.Entry<String, String>>() {
- public int compare(Map.Entry<String, String> e1, Map.Entry<String, String> e2) {
- Collator collator = Collator.getInstance();
- int pkg = collator.compare(e1.getValue(), e2.getValue());
- return (pkg == 0) ? collator.compare(e1.getKey(), e2.getKey()) : pkg;
- }
- };
- }
-
- 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();
- }
-
- 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();
- }
-
- void printGetterAndSetter(String propertyName, String typeDeclaration, String visibility) {
- this.printGetter(propertyName, typeDeclaration, visibility);
- this.println();
- this.println();
-
- this.printSetter(propertyName, typeDeclaration, visibility);
- this.println();
- this.println();
- }
-
- private void printGetter(String propertyName, String typeDeclaration, String visibility) {
- this.printVisibility(visibility);
- this.printTypeDeclaration(typeDeclaration);
- this.print(' ');
- this.print(typeDeclaration.equals("boolean") ? "is" : "get"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- this.print(StringTools.capitalize(propertyName));
- this.print("() {"); //$NON-NLS-1$
- this.println();
-
- this.indent();
- this.print("return this."); //$NON-NLS-1$
- this.print(propertyName);
- this.print(';');
- this.println();
- this.undent();
-
- this.print('}');
- }
-
- private void printSetter(String propertyName, String typeDeclaration, String visibility) {
- this.printVisibility(visibility);
- this.print("void set"); //$NON-NLS-1$
- this.print(StringTools.capitalize(propertyName));
- this.print('(');
- this.printTypeDeclaration(typeDeclaration);
- this.print(' ');
- this.print(propertyName);
- this.print(") {"); //$NON-NLS-1$
- this.println();
-
- this.indent();
- this.print("this."); //$NON-NLS-1$
- this.print(propertyName);
- this.print(" = "); //$NON-NLS-1$
- this.print(propertyName);
- this.print(';');
- this.println();
- this.undent();
-
- this.print('}');
- }
-
- void printCollectionGetterAndSetter(String propertyName, String collectionTypeDeclaration, String elementTypeDeclaration, String visibility) {
- this.printCollectionGetter(propertyName, collectionTypeDeclaration, elementTypeDeclaration, visibility);
- this.println();
- this.println();
-
- this.printCollectionSetter(propertyName, collectionTypeDeclaration, elementTypeDeclaration, visibility);
- this.println();
- this.println();
- }
-
- private void printCollectionGetter(String propertyName, String collectionTypeDeclaration, String elementTypeDeclaration, String visibility) {
- this.printVisibility(visibility);
- this.printTypeDeclaration(collectionTypeDeclaration);
- this.print('<');
- this.printTypeDeclaration(elementTypeDeclaration);
- this.print("> get"); //$NON-NLS-1$
- this.print(StringTools.capitalize(propertyName));
- this.print("() {"); //$NON-NLS-1$
- this.println();
-
- this.indent();
- this.print("return this."); //$NON-NLS-1$
- this.print(propertyName);
- this.print(';');
- this.println();
- this.undent();
-
- this.print('}');
- }
-
- private void printCollectionSetter(String propertyName, String collectionTypeDeclaration, String elementTypeDeclaration, String visibility) {
- this.printVisibility(visibility);
- this.print("void set"); //$NON-NLS-1$
- this.print(StringTools.capitalize(propertyName));
- this.print('(');
- this.printTypeDeclaration(collectionTypeDeclaration);
- this.print('<');
- this.printTypeDeclaration(elementTypeDeclaration);
- this.print('>');
- this.print(' ');
- this.print(propertyName);
- this.print(") {"); //$NON-NLS-1$
- this.println();
-
- this.indent();
- this.print("this."); //$NON-NLS-1$
- this.print(propertyName);
- this.print(" = "); //$NON-NLS-1$
- this.print(propertyName);
- this.print(';');
- this.println();
- this.undent();
-
- this.print('}');
- }
-
-
- // ********** BodySource implementation **********
-
- public Iterator<Map.Entry<String, String>> importEntries() {
- return new FilteringIterator<Map.Entry<String, String>, Map.Entry<String, String>>(this.sortedImportEntries()) {
- @Override
- protected boolean accept(Map.Entry<String, String> next) {
- String pkg = next.getValue();
- if (pkg.equals("") //$NON-NLS-1$
- || pkg.equals("java.lang") //$NON-NLS-1$
- || pkg.equals(EntitySourceWriter.this.packageName)) {
- return false;
- }
- return true;
- }
- };
- }
-
- public String getSource() {
- return this.out.toString();
- }
-
- public int length() {
- return ((StringWriter) this.out).getBuffer().length();
- }
-
- }
-
-
- // ********** config **********
-
- public static class Config {
- private boolean convertToJavaStyleIdentifiers = true;
-
- private boolean propertyAccessType = false; // as opposed to "field"
-
- private String collectionTypeName = Set.class.getName();
- private String collectionAttributeNameSuffix = "Collection"; // e.g. "private Set<Foo> fooCollection" //$NON-NLS-1$
-
- private int fieldVisibility = Modifier.PRIVATE;
- private int methodVisibility = Modifier.PUBLIC;
-
- private boolean generateGettersAndSetters = true;
- private boolean generateDefaultConstructor = true;
-
- private boolean serializable = true;
- private boolean generateSerialVersionUID = true;
-
- private boolean generateEmbeddedIdForCompoundPK = true; // as opposed to IdClass
- private String embeddedIdAttributeName = "pk"; //$NON-NLS-1$
- private String primaryKeyMemberClassName = "PK"; //$NON-NLS-1$
-
- /**
- * key = table
- * value = entity name
- */
- private HashMap<Table, String> tables = new HashMap<Table, String>();
-
- private DatabaseAnnotationNameBuilder databaseAnnotationNameBuilder = DatabaseAnnotationNameBuilder.Default.INSTANCE;
-
- private OverwriteConfirmer overwriteConfirmer = OverwriteConfirmer.Never.INSTANCE;
-
- public static final int PRIVATE = 0;
- public static final int PACKAGE = 1;
- public static final int PROTECTED = 2;
- public static final int PUBLIC = 3;
-
-
- public boolean convertToJavaStyleIdentifiers() {
- return this.convertToJavaStyleIdentifiers;
- }
- public void setConvertToJavaStyleIdentifiers(boolean convertToJavaStyleIdentifiers) {
- this.convertToJavaStyleIdentifiers = convertToJavaStyleIdentifiers;
- }
-
- public boolean propertyAccessType() {
- return this.propertyAccessType;
- }
- public void setPropertyAccessType(boolean propertyAccessType) {
- this.propertyAccessType = propertyAccessType;
- }
-
- public boolean fieldAccessType() {
- return ! this.propertyAccessType;
- }
- public void setFieldAccessType(boolean fieldAccessType) {
- this.propertyAccessType = ! fieldAccessType;
- }
-
- public String getCollectionTypeName() {
- return this.collectionTypeName;
- }
- public void setCollectionTypeName(String collectionTypeName) {
- this.checkRequiredString(collectionTypeName, "collection type name is required"); //$NON-NLS-1$
- this.collectionTypeName = collectionTypeName;
- }
-
- public String getCollectionAttributeNameSuffix() {
- return this.collectionAttributeNameSuffix;
- }
- public void setCollectionAttributeNameSuffix(String collectionAttributeNameSuffix) {
- this.collectionAttributeNameSuffix = collectionAttributeNameSuffix;
- }
-
- public int getFieldVisibility() {
- return this.fieldVisibility;
- }
- /** entity fields cannot be 'public' */
- public void setFieldVisibility(int fieldVisibility) {
- switch (fieldVisibility) {
- case PRIVATE:
- case PACKAGE:
- case PROTECTED:
- this.fieldVisibility = fieldVisibility;
- break;
- default:
- throw new IllegalArgumentException("invalid field visibility: " + fieldVisibility); //$NON-NLS-1$
- }
- }
- String getFieldVisibilityClause() {
- switch (this.fieldVisibility) {
- case PRIVATE:
- return "private"; //$NON-NLS-1$
- case PACKAGE:
- return ""; //$NON-NLS-1$
- case PROTECTED:
- return "protected"; //$NON-NLS-1$
- default:
- throw new IllegalStateException("invalid field visibility: " + this.fieldVisibility); //$NON-NLS-1$
- }
- }
-
- public int getMethodVisibility() {
- return this.methodVisibility;
- }
- /** entity properties must be 'public' or 'protected' */
- public void setMethodVisibility(int methodVisibility) {
- switch (methodVisibility) {
- case PROTECTED:
- case PUBLIC:
- this.methodVisibility = methodVisibility;
- break;
- default:
- throw new IllegalArgumentException("invalid method visibility: " + methodVisibility); //$NON-NLS-1$
- }
- }
- String getMethodVisibilityClause() {
- switch (this.methodVisibility) {
- case PROTECTED:
- return "protected"; //$NON-NLS-1$
- case PUBLIC:
- return "public"; //$NON-NLS-1$
- default:
- throw new IllegalStateException("invalid method visibility: " + this.methodVisibility); //$NON-NLS-1$
- }
- }
-
- public boolean generateGettersAndSetters() {
- return this.generateGettersAndSetters;
- }
- public void setGenerateGettersAndSetters(boolean generateGettersAndSetters) {
- this.generateGettersAndSetters = generateGettersAndSetters;
- }
-
- public boolean generateDefaultConstructor() {
- return this.generateDefaultConstructor;
- }
- public void setGenerateDefaultConstructor(boolean generateDefaultConstructor) {
- this.generateDefaultConstructor = generateDefaultConstructor;
- }
-
- public boolean serializable() {
- return this.serializable;
- }
- public void setSerializable(boolean serializable) {
- this.serializable = serializable;
- }
-
- public boolean generateSerialVersionUID() {
- return this.generateSerialVersionUID;
- }
- public void setGenerateSerialVersionUID(boolean generateSerialVersionUID) {
- this.generateSerialVersionUID = generateSerialVersionUID;
- }
-
- public boolean generateEmbeddedIdForCompoundPK() {
- return this.generateEmbeddedIdForCompoundPK;
- }
- public void setGenerateEmbeddedIdForCompoundPK(boolean generateEmbeddedIdForCompoundPK) {
- this.generateEmbeddedIdForCompoundPK = generateEmbeddedIdForCompoundPK;
- }
-
- public boolean generateIdClassForCompoundPK() {
- return ! this.generateEmbeddedIdForCompoundPK;
- }
- public void setGenerateIdClassForCompoundPK(boolean generateIdClassForCompoundPK) {
- this.generateEmbeddedIdForCompoundPK = ! generateIdClassForCompoundPK;
- }
-
- public String getEmbeddedIdAttributeName() {
- return this.embeddedIdAttributeName;
- }
- public void setEmbeddedIdAttributeName(String embeddedIdAttributeName) {
- this.checkRequiredString(embeddedIdAttributeName, "EmbeddedId attribute name is required"); //$NON-NLS-1$
- this.embeddedIdAttributeName = embeddedIdAttributeName;
- }
-
- public String getPrimaryKeyMemberClassName() {
- return this.primaryKeyMemberClassName;
- }
- public void setPrimaryKeyMemberClassName(String primaryKeyMemberClassName) {
- this.checkRequiredString(primaryKeyMemberClassName, "primary key member class name is required"); //$NON-NLS-1$
- this.primaryKeyMemberClassName = primaryKeyMemberClassName;
- }
-
- String getEntityName(Table table) {
- return this.tables.get(table);
- }
- Iterator<Table> tables() {
- return this.tables.keySet().iterator();
- }
- int tablesSize() {
- return this.tables.size();
- }
- public void addTable(Table table, String entityName) {
- if (table == null) {
- throw new NullPointerException("table is required"); //$NON-NLS-1$
- }
- this.checkRequiredString(entityName, "entity name is required"); //$NON-NLS-1$
- if (this.tables.containsKey(table)) {
- throw new IllegalArgumentException("duplicate table: " + table.getName()); //$NON-NLS-1$
- }
- if (this.tables.values().contains(entityName)) {
- throw new IllegalArgumentException("duplicate entity name: " + entityName); //$NON-NLS-1$
- }
- if ( ! NameTools.stringConsistsOfJavaIdentifierCharacters(entityName)) {
- throw new IllegalArgumentException("entity name is not a valid Java identifier: " + entityName); //$NON-NLS-1$
- }
- if (NameTools.JAVA_RESERVED_WORDS_SET.contains(entityName)) {
- throw new IllegalArgumentException("entity name is a Java reserved word: " + entityName); //$NON-NLS-1$
- }
- this.tables.put(table, entityName);
- }
-
- 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;
- }
-
- public OverwriteConfirmer getOverwriteConfirmer() {
- return this.overwriteConfirmer;
- }
- public void setOverwriteConfirmer(OverwriteConfirmer overwriteConfirmer) {
- if (overwriteConfirmer == null) {
- throw new NullPointerException("overwrite confirmer is required"); //$NON-NLS-1$
- }
- this.overwriteConfirmer = overwriteConfirmer;
- }
-
- private void checkRequiredString(String string, String message) {
- if ((string == null) || (string.length() == 0)) {
- throw new IllegalArgumentException(message);
- }
- }
-
- }
-
-
- // ********** overwrite confirmer **********
-
- public static 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$
- }
- }
-
- }
-
-
- // ********** annotation name builder **********
-
- /**
- * Provide a pluggable way to determine whether and how the entity generator
- * prints the names of various database objects.
- */
- public static 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/GenScope.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenScope.java
deleted file mode 100644
index 4e524e6f68..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenScope.java
+++ /dev/null
@@ -1,186 +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.gen.internal;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.SubMonitor;
-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.iterators.FilteringIterator;
-
-/**
- * Build a GenTable for each db.Table passed in.
- * Determine all the relations among the tables in the scope:
- * many-to-many
- * many-to-one
- * one-to-many
- * Make a first pass to determine each entity table's Java attribute names,
- * because we will need them on subsequent passes.
- */
-class GenScope {
- private final EntityGenerator.Config entityConfig;
- private final HashMap<Table, GenTable> genTables;
-
-
- // ********** construction/initialization **********
-
- GenScope(EntityGenerator.Config entityConfig, IProgressMonitor progressMonitor) {
- super();
- this.entityConfig = entityConfig;
- this.genTables = new HashMap<Table, GenTable>(entityConfig.tablesSize());
- SubMonitor sm = SubMonitor.convert(progressMonitor, JptGenMessages.GenScope_taskName, 4);
-
- this.buildGenTables();
- sm.worked(1);
- this.checkCanceled(sm);
-
- this.buildManyToManyRelations();
- sm.worked(1);
- this.checkCanceled(sm);
-
- this.buildManyToOneRelations(); // this will also build the corresponding one-to-many relations
- sm.worked(1);
- this.checkCanceled(sm);
-
- this.buildAttributeNames();
- sm.worked(1);
- this.checkCanceled(sm);
- }
-
- private void buildGenTables() {
- for (Iterator<Table> stream = entityConfig.tables(); stream.hasNext(); ) {
- Table table = stream.next();
- this.genTables.put(table, new GenTable(this, table));
- }
- }
-
- /**
- * find all the "join" tables
- */
- private void buildManyToManyRelations() {
- for (Iterator<GenTable> stream = this.genTables(); stream.hasNext(); ) {
- stream.next().buildJoinTableRelation();
- }
-
- // revert any "join" table that is referenced by another table back to an "entity" table
- HashSet<GenTable> referencedGenTables = this.buildReferencedGenTables();
- for (Iterator<GenTable> stream = this.joinGenTables(); stream.hasNext(); ) {
- GenTable joinGenTable = stream.next();
- if (referencedGenTables.contains(joinGenTable)) {
- joinGenTable.clearJoinTableRelation();
- }
- }
- }
-
- /**
- * find all the many-to-one and corresponding one-to-many relations
- */
- private void buildManyToOneRelations() {
- for (Iterator<GenTable> stream = this.entityGenTables(); stream.hasNext(); ) {
- stream.next().buildManyToOneRelations();
- }
- }
-
- /**
- * determine all the Java attribute names up-front because we will
- * need them for things like 'mappedBy' annotation elements
- */
- private void buildAttributeNames() {
- for (Iterator<GenTable> stream = this.entityGenTables(); stream.hasNext(); ) {
- stream.next().buildAttributeNames();
- }
- }
-
-
- // ********** package API **********
-
- EntityGenerator.Config getEntityConfig() {
- return this.entityConfig;
- }
-
- /**
- * return only the gen tables that are suitable for generating
- * entities (i.e. exclude the "join" tables)
- */
- Iterator<GenTable> entityGenTables() {
- return new FilteringIterator<GenTable, GenTable>(this.genTables()) {
- @Override
- protected boolean accept(GenTable genTable) {
- return ! genTable.isJoinTable();
- }
- };
- }
-
- int entityTablesSize() {
- return CollectionTools.size(this.entityGenTables());
- }
-
- /**
- * return the gen table corresponding to the specified db table;
- * return null if the gen table is not "in-scope" (e.g. a db foreign key
- * might have a reference to a db table that was not included in the
- * scope, so we won't have a corresponding gen table)
- */
- GenTable getGenTable(Table table) {
- return this.genTables.get(table);
- }
-
-
- // ********** internal methods **********
-
- private Iterator<GenTable> genTables() {
- return this.genTables.values().iterator();
- }
-
- private int genTablesSize() {
- return this.genTables.size();
- }
-
- /**
- * return only the "join" gen tables
- */
- private Iterator<GenTable> joinGenTables() {
- return new FilteringIterator<GenTable, GenTable>(this.genTables()) {
- @Override
- protected boolean accept(GenTable genTable) {
- return genTable.isJoinTable();
- }
- };
- }
-
- /**
- * build a set of the gen tables that are referenced by other gen tables
- * in the scope
- */
- private HashSet<GenTable> buildReferencedGenTables() {
- HashSet<GenTable> referencedGenTables = new HashSet<GenTable>(this.genTablesSize());
- for (Iterator<GenTable> stream = this.genTables(); stream.hasNext(); ) {
- stream.next().addReferencedGenTablesTo(referencedGenTables);
- }
- return referencedGenTables;
- }
-
- private void checkCanceled(IProgressMonitor progressMonitor) {
- if (progressMonitor.isCanceled()) {
- throw new OperationCanceledException();
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.genTables);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenTable.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenTable.java
deleted file mode 100644
index 7c563447a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenTable.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.gen.internal;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.db.Table;
-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.iterators.FilteringIterator;
-
-/**
- * associate a table with the various relations that will be used when
- * generating the entity corresponding to the table
- */
-class GenTable {
- private final GenScope scope;
- private final Table table;
-
- // these relations cannot be built until after we have built all the scope's tables
- private ManyToManyRelation joinTableRelation;
- private final ArrayList<ManyToManyRelation> ownedManyToManyRelations = new ArrayList<ManyToManyRelation>();
- private final ArrayList<ManyToManyRelation> nonOwnedManyToManyRelations = new ArrayList<ManyToManyRelation>();
- private final ArrayList<ManyToOneRelation> manyToOneRelations = new ArrayList<ManyToOneRelation>();
- private final ArrayList<OneToManyRelation> oneToManyRelations = new ArrayList<OneToManyRelation>();
- private final HashSet<Column> foreignKeyColumns = new HashSet<Column>();
-
- // key=column/relation; value=entity attribute (field/property) name
- private final HashMap<Object, String> attributeNames = new HashMap<Object, String>();
- // key to 'attributeNames' for the optional embedded ID attribute name
- private static final Object EMBEDDED_ID_VIRTUAL_COLUMN = new Object();
-
-
- // ********** construction/initialization **********
-
- GenTable(GenScope scope, Table table) {
- super();
- this.scope = scope;
- this.table = table;
- }
-
-
- // ********** package API **********
-
- EntityGenerator.Config getEntityConfig() {
- return this.scope.getEntityConfig();
- }
-
- /**
- * examples:
- * GenTable(FOO) => "FOO_COLLECTION"
- * GenTable(foo) => "fooCollection"
- * GenTable(Foo) => "FooCollection"
- */
- String getCollectionAttributeName() {
- String name = this.getName();
- String suffix = this.getEntityConfig().getCollectionAttributeNameSuffix();
- if (StringTools.stringIsUppercase(name)) { // hmmm ~bjv
- suffix = '_' + suffix.toUpperCase();
- }
- return name + suffix;
- }
-
- /**
- * determine whether the table is a "join" table within the table's scope;
- * this can be removed, later, if we find another table references the,
- * seemingly, join table
- * @see #clearJoinTableRelation() (and callers)
- */
- void buildJoinTableRelation() {
- if ( ! this.table.isPossibleJoinTable()) {
- return; // the table must have exactly 2 foreign keys
- }
- ForeignKey owningFK = this.table.getJoinTableOwningForeignKey();
- GenTable owningGenTable = this.scope.getGenTable(owningFK.getReferencedTable());
- if (owningGenTable == null) {
- return; // both tables must be in the scope
- }
- ForeignKey nonOwningFK = this.table.getJoinTableNonOwningForeignKey();
- GenTable nonOwningGenTable = this.scope.getGenTable(nonOwningFK.getReferencedTable());
- if (nonOwningGenTable == null) {
- return; // both tables must be in the scope
- }
- this.joinTableRelation = new ManyToManyRelation(
- this,
- owningFK,
- owningGenTable,
- nonOwningFK,
- nonOwningGenTable
- );
- }
-
- /**
- * used by the scope to figure out whether "join" tables should be
- * converted to "entity" tables
- */
- void addReferencedGenTablesTo(Set<GenTable> referencedTables) {
- for (Iterator<ForeignKey> stream = this.table.foreignKeys(); stream.hasNext(); ) {
- ForeignKey fk = stream.next();
- GenTable genTable = this.scope.getGenTable(fk.getReferencedTable());
- if (genTable != null) {
- referencedTables.add(genTable);
- }
- }
- }
-
- /**
- * the scope clears the join table relation if there are any references
- * to the join table from other tables in the scope
- */
- void clearJoinTableRelation() {
- this.joinTableRelation.clear();
- this.joinTableRelation = null;
- }
-
- /**
- * find "in-scope" foreign keys
- */
- void buildManyToOneRelations() {
- for (Iterator<ForeignKey> stream = this.table.foreignKeys(); stream.hasNext(); ) {
- ForeignKey fk = stream.next();
- GenTable referencedGenTable = this.scope.getGenTable(fk.getReferencedTable());
- if (referencedGenTable != null) {
- this.manyToOneRelations.add(new ManyToOneRelation(this, fk, referencedGenTable));
- }
- }
- }
-
- /**
- * now that all the relations are in place, we can configure the Java
- * attribute names
- */
- void buildAttributeNames() {
- if ((this.table.primaryKeyColumnsSize() > 1) && this.getEntityConfig().generateEmbeddedIdForCompoundPK()) {
- // if we are going to generate an EmbeddedId attribute, add it to
- // 'attributeNames' so we don't collide with it later, when generating
- // attribute names for the columns etc.
- this.configureAttributeName(EMBEDDED_ID_VIRTUAL_COLUMN, this.getEntityConfig().getEmbeddedIdAttributeName());
- }
-
- // gather up all the table's columns...
- Set<Column> columns = CollectionTools.set(this.table.columns(), this.table.columnsSize());
- // ...remove the columns that belong exclusively to many-to-one foreign keys...
- this.buildManyToOneAttributeNames(columns);
- // ...and use the remaining columns to generate "basic" attribute names
- this.buildBasicAttributeNames(columns);
-
- this.buildOneToManyAttributeNames();
- this.buildOwnedManyToManyAttributeNames();
- this.buildNonOwnedManyToManyAttributeNames();
- }
-
- /**
- * return the columns that are part of the table's primary key
- * but are also part of an "in-scope" foreign key
- */
- Iterator<Column> readOnlyPrimaryKeyColumns() {
- return new FilteringIterator<Column, Column>(this.table.primaryKeyColumns()) {
- @Override
- protected boolean accept(Column pkColumn) {
- return pkColumn.isPartOfForeignKey();
- }
- };
- }
-
- /**
- * return the columns that are part of the table's primary key
- * but are NOT part of any "in-scope" foreign key
- */
- Iterator<Column> writablePrimaryKeyColumns() {
- return new FilteringIterator<Column, Column>(this.table.primaryKeyColumns()) {
- @Override
- protected boolean accept(Column pkColumn) {
- return ! pkColumn.isPartOfForeignKey();
- }
- };
- }
-
- /**
- * return the columns that NEITHER part of the table's primary key
- * NOR part of any foreign key
- */
- Iterator<Column> nonPrimaryKeyBasicColumns() {
- return new FilteringIterator<Column, Column>(this.table.columns()) {
- @Override
- protected boolean accept(Column column) {
- return ! (column.isPartOfPrimaryKey() || column.isPartOfForeignKey());
- }
- };
- }
-
- Table getTable() {
- return this.table;
- }
-
- String getEntityName() {
- return this.getEntityConfig().getEntityName(this.table);
- }
-
- boolean isJoinTable() {
- return this.joinTableRelation != null;
- }
-
- void addOwnedManyToManyRelation(ManyToManyRelation relation) {
- this.ownedManyToManyRelations.add(relation);
- }
-
- void removeOwnedManyToManyRelation(ManyToManyRelation relation) {
- this.ownedManyToManyRelations.remove(relation);
- }
-
- void addNonOwnedManyToManyRelation(ManyToManyRelation relation) {
- this.nonOwnedManyToManyRelations.add(relation);
- }
-
- void removeNonOwnedManyToManyRelation(ManyToManyRelation relation) {
- this.nonOwnedManyToManyRelations.remove(relation);
- }
-
- void addOneToManyRelation(OneToManyRelation relation) {
- this.oneToManyRelations.add(relation);
- }
-
- Iterator<ManyToOneRelation> manyToOneRelations() {
- return this.manyToOneRelations.iterator();
- }
-
- Iterator<OneToManyRelation> oneToManyRelations() {
- return this.oneToManyRelations.iterator();
- }
-
- Iterator<ManyToManyRelation> ownedManyToManyRelations() {
- return this.ownedManyToManyRelations.iterator();
- }
-
- Iterator<ManyToManyRelation> nonOwnedManyToManyRelations() {
- return this.nonOwnedManyToManyRelations.iterator();
- }
-
- /**
- * the key can be a column or relation or #EMBEDDED_ID_VIRTUAL_COLUMN
- */
- private String getAttributeNameFor_(Object o) {
- return this.attributeNames.get(o);
- }
-
- /**
- * this will return null if we don't want an embedded id attribute
- */
- String getAttributeNameForEmbeddedId() {
- return this.getAttributeNameFor_(EMBEDDED_ID_VIRTUAL_COLUMN);
- }
-
- String getAttributeNameFor(Column column) {
- return this.getAttributeNameFor_(column);
- }
-
- String getAttributeNameFor(ManyToOneRelation relation) {
- return this.getAttributeNameFor_(relation);
- }
-
- String getAttributeNameFor(OneToManyRelation relation) {
- return this.getAttributeNameFor_(relation);
- }
-
- String getAttributeNameFor(ManyToManyRelation relation) {
- return this.getAttributeNameFor_(relation);
- }
-
- String getName() {
- return this.table.getName();
- }
-
- boolean joinTableNameIsDefault() {
- return this.table.joinTableNameIsDefault();
- }
-
-
- // ********** internal API **********
-
- /**
- * while we are figuring out the names for the m:1 attributes, remove from the
- * specified set of columns the columns that are only part of the foreign keys
- * (leaving the remaining columns for basic attributes)
- */
- private void buildManyToOneAttributeNames(Set<Column> columns) {
- for (ManyToOneRelation relation : this.manyToOneRelations) {
- CollectionTools.removeAll(columns, relation.getForeignKey().nonPrimaryKeyBaseColumns());
- CollectionTools.addAll(this.foreignKeyColumns, relation.getForeignKey().baseColumns());
- relation.setMappedBy(this.configureAttributeName(relation, relation.getAttributeName()));
- }
- }
-
- /**
- * build a unique attribute name for the specified "basic" columns,
- * checking for name collisions
- */
- private void buildBasicAttributeNames(Set<Column> columns) {
- for (Column column : columns) {
- this.configureAttributeName(column, column.getName());
- }
- }
-
- private void buildOneToManyAttributeNames() {
- for (OneToManyRelation relation : this.oneToManyRelations) {
- this.configureAttributeName(relation, relation.getAttributeName());
- }
- }
-
- private void buildOwnedManyToManyAttributeNames() {
- for (ManyToManyRelation relation : this.ownedManyToManyRelations) {
- relation.setMappedBy(this.configureAttributeName(relation, relation.getOwnedAttributeName()));
- }
- }
-
- private void buildNonOwnedManyToManyAttributeNames() {
- for (ManyToManyRelation relation : this.nonOwnedManyToManyRelations) {
- this.configureAttributeName(relation, relation.getNonOwnedAttributeName());
- }
- }
-
- /**
- * Convert the specified attribute name to something unique for the entity,
- * converting it to something Java-like if the config flag is set.
- * Store the calculated name so we can get it back later, when we
- * are generating source.
- */
- private String configureAttributeName(Object o, String attributeName) {
- String result = attributeName;
- Collection<String> existingAttributeNames = this.attributeNames.values();
- if (this.getEntityConfig().convertToJavaStyleIdentifiers()) {
- result = EntityGenTools.convertToUniqueJavaStyleAttributeName(result, existingAttributeNames);
- } else {
- // first, convert the attribute name to a legal Java identifier
- result = NameTools.convertToJavaIdentifier(result);
- // then make sure it's unique
- result = NameTools.uniqueNameForIgnoreCase(attributeName, existingAttributeNames);
- }
- this.attributeNames.put(o, result);
- return result;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.table);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/JPA.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/JPA.java
deleted file mode 100644
index 7f601e4253..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/JPA.java
+++ /dev/null
@@ -1,302 +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.gen.internal;
-
-
-/**
- * JPA 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.
- */
-// TODO move to utility?
-@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 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 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 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.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 bc3bbf0d38..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/JptGenMessages.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.gen.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Localized messages used by Dali entity generation.
- */
-class JptGenMessages {
-
- public static String PackageGenerator_taskName;
- public static String GenScope_taskName;
- public static String EntityGenerator_taskName;
-
- 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/ManyToManyRelation.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToManyRelation.java
deleted file mode 100644
index 12631a5bf0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToManyRelation.java
+++ /dev/null
@@ -1,111 +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.gen.internal;
-
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * This object is shared by the two gen tables that make up the relation.
- * Upon construction, 'mappedBy' will be 'null'. The first gen table to be
- * used to generate an entity will fill in 'mappedBy' with the appropriate
- * attribute (field/property) name.
- */
-class ManyToManyRelation {
- private final GenTable joinGenTable;
- private final ForeignKey owningForeignKey;
- private final GenTable owningGenTable;
- private final ForeignKey nonOwningForeignKey;
- private final GenTable nonOwningGenTable;
- private String mappedBy; // set while generating entities
-
-
- ManyToManyRelation(
- GenTable joinGenTable,
- ForeignKey owningForeignKey,
- GenTable owningGenTable,
- ForeignKey nonOwningForeignKey,
- GenTable nonOwningGenTable
- ) {
- super();
- this.joinGenTable = joinGenTable;
-
- this.owningForeignKey = owningForeignKey;
- this.owningGenTable = owningGenTable;
- owningGenTable.addOwnedManyToManyRelation(this);
-
- this.nonOwningForeignKey = nonOwningForeignKey;
- this.nonOwningGenTable = nonOwningGenTable;
- nonOwningGenTable.addNonOwnedManyToManyRelation(this);
- }
-
- GenTable getJoinGenTable() {
- return this.joinGenTable;
- }
-
- ForeignKey getOwningForeignKey() {
- return this.owningForeignKey;
- }
-
- GenTable getOwningGenTable() {
- return this.owningGenTable;
- }
-
- ForeignKey getNonOwningForeignKey() {
- return this.nonOwningForeignKey;
- }
-
- GenTable getNonOwningGenTable() {
- return this.nonOwningGenTable;
- }
-
- String getOwnedAttributeName() {
- return this.nonOwningGenTable.getCollectionAttributeName();
- }
-
- String getNonOwnedAttributeName() {
- return this.owningGenTable.getCollectionAttributeName();
- }
-
- /**
- * the scope clears the join table relation if there are any references
- * to the join table
- */
- void clear() {
- this.owningGenTable.removeOwnedManyToManyRelation(this);
- this.nonOwningGenTable.removeNonOwnedManyToManyRelation(this);
- }
-
- String getMappedBy() {
- return this.mappedBy;
- }
-
- void setMappedBy(String mappedBy) {
- this.mappedBy = mappedBy;
- }
-
- String getOwningEntityName() {
- return this.owningGenTable.getEntityName();
- }
-
- String getNonOwningEntityName() {
- return this.nonOwningGenTable.getEntityName();
- }
-
- boolean joinTableNameIsDefault() {
- return this.joinGenTable.joinTableNameIsDefault();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.joinGenTable);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToOneRelation.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToOneRelation.java
deleted file mode 100644
index b69e402a06..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToOneRelation.java
+++ /dev/null
@@ -1,81 +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.gen.internal;
-
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * This object is held by the "base" gen table and, indirectly via a
- * one-to-many relation, the "referenced" gen table.
- * The "mapped by" attribute (field/property) name is set while the
- * "base" table is calculating its attribute names.
- */
-class ManyToOneRelation {
- private final GenTable baseGenTable; // the "many" side (e.g. Detail)
- private final ForeignKey foreignKey;
- private final GenTable referencedGenTable; // the "one" side (e.g. Master)
- private String mappedBy; // set while generating entities; used by partner one-to-many relation
-
-
- ManyToOneRelation(
- GenTable baseGenTable,
- ForeignKey foreignKey,
- GenTable referencedGenTable
- ) {
- super();
- this.baseGenTable = baseGenTable;
- this.foreignKey = foreignKey;
- this.referencedGenTable = referencedGenTable;
- referencedGenTable.addOneToManyRelation(new OneToManyRelation(this));
- }
-
- GenTable getBaseGenTable() {
- return this.baseGenTable;
- }
-
- ForeignKey getForeignKey() {
- return this.foreignKey;
- }
-
- GenTable getReferencedGenTable() {
- return this.referencedGenTable;
- }
-
- String getAttributeName() {
- return this.foreignKey.getAttributeName();
- }
-
- String getMappedBy() {
- return this.mappedBy;
- }
-
- void setMappedBy(String mappedBy) {
- this.mappedBy = mappedBy;
- }
-
- String getBaseEntityName() {
- return this.baseGenTable.getEntityName();
- }
-
- String getReferencedEntityName() {
- return this.referencedGenTable.getEntityName();
- }
-
- String getBaseGenTableCollectionAttributeName() {
- return this.baseGenTable.getCollectionAttributeName();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.foreignKey);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/OneToManyRelation.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/OneToManyRelation.java
deleted file mode 100644
index 8d832ccd1c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/OneToManyRelation.java
+++ /dev/null
@@ -1,47 +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.gen.internal;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * This object is the inverse of the corresponding many-to-one relation.
- */
-class OneToManyRelation {
- private final ManyToOneRelation manyToOneRelation;
-
-
- OneToManyRelation(ManyToOneRelation manyToOneRelation) {
- super();
- this.manyToOneRelation = manyToOneRelation;
- }
-
- ManyToOneRelation getManyToOneRelation() {
- return this.manyToOneRelation;
- }
-
- String getAttributeName() {
- return this.manyToOneRelation.getBaseGenTableCollectionAttributeName();
- }
-
- String getMappedBy() {
- return this.manyToOneRelation.getMappedBy();
- }
-
- String getReferencedEntityName() {
- return this.manyToOneRelation.getBaseEntityName();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.manyToOneRelation);
- }
-
-}
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 0aa0b5ed7e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/PackageGenerator.java
+++ /dev/null
@@ -1,103 +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.gen.internal;
-
-import java.util.Iterator;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * This generator will generate a package of entities for a set of tables.
- */
-public class PackageGenerator {
- private final Config config;
- private final EntityGenerator.Config entityConfig;
- private final GenScope scope;
-
-
- // ********** public API **********
-
- public static void generateEntities(
- Config config,
- EntityGenerator.Config entityConfig,
- IProgressMonitor progressMonitor
- ) {
- if ((config == null) || (entityConfig == null)) {
- throw new NullPointerException();
- }
- SubMonitor sm = SubMonitor.convert(progressMonitor, JptGenMessages.PackageGenerator_taskName, 100);
- new PackageGenerator(config, entityConfig, sm.newChild(10)).generateEntities(sm.newChild(90));
- }
-
-
- // ********** construction/initialization **********
-
- private PackageGenerator(
- Config config,
- EntityGenerator.Config entityConfig,
- IProgressMonitor progressMonitor
- ) {
- super();
- this.config = config;
- this.entityConfig = entityConfig;
- this.scope = new GenScope(entityConfig, progressMonitor);
- }
-
-
- // ********** generation **********
-
- private void generateEntities(IProgressMonitor progressMonitor) {
- SubMonitor sm = SubMonitor.convert(progressMonitor, this.scope.entityTablesSize());
- for (Iterator<GenTable> stream = this.scope.entityGenTables(); stream.hasNext(); ) {
- this.checkCanceled(sm);
- this.generateEntity(stream.next(), sm.newChild(1));
- }
- }
-
- private void generateEntity(GenTable genTable, IProgressMonitor progressMonitor) {
- EntityGenerator.generateEntity(
- this.entityConfig,
- this.config.getPackageFragment(),
- genTable,
- progressMonitor
- );
- }
-
- private void checkCanceled(IProgressMonitor progressMonitor) {
- if (progressMonitor.isCanceled()) {
- throw new OperationCanceledException();
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.scope);
- }
-
-
- // ********** config **********
-
- public static class Config {
- private IPackageFragment packageFragment;
-
- public IPackageFragment getPackageFragment() {
- return this.packageFragment;
- }
-
- public void setPackageFragment(IPackageFragment packageFragment) {
- this.packageFragment = packageFragment;
- }
-
- }
-
-}
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 9f1f09d92a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,67 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.utility
-Bundle-Version: 1.3.0.qualifier
-Bundle-Localization: plugin
-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.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.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.model,
- org.eclipse.jpt.utility.model.event,
- org.eclipse.jpt.utility.model.listener,
- org.eclipse.jpt.utility.model.value
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
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 b210b281dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/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.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 95c029d5d8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/plugin.properties
+++ /dev/null
@@ -1,24 +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 Tools - Utility
-providerName = Eclipse.org
-
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 ffabf124af..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/Command.java
+++ /dev/null
@@ -1,66 +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;
-
-/**
- * Simple interface for implementing the GOF Command design pattern.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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();
-
- final class Null implements Command {
- 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";
- }
- }
-
- final class Disabled implements Command {
- 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";
- }
- }
-
-}
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 f58dbf6674..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/CommandExecutor.java
+++ /dev/null
@@ -1,52 +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;
-
-/**
- * This interface allows clients to control how a command is executed
- * (e.g. dispatching the command to the UI thread).
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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);
-
-
- /**
- * Straightforward implementation of the command executor interface
- * that simply executes the command without any sort of enhancement.
- */
- final class Default implements CommandExecutor {
- 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";
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/CommandExecutorProvider.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/CommandExecutorProvider.java
deleted file mode 100644
index ea1f5c68ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/CommandExecutorProvider.java
+++ /dev/null
@@ -1,53 +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;
-
-/**
- * Yet another level of indirection to allow clients to control
- * how a command is executed by the server
- * (e.g. dispatching the command to the UI thread).
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 CommandExecutorProvider {
-
- /**
- * Return the appropriate command executor.
- */
- CommandExecutor getCommandExecutor();
-
-
- /**
- * Straightforward implementation of the command executor provider
- * interface the returns the default command executor.
- */
- final class Default implements CommandExecutorProvider {
- public static final CommandExecutorProvider INSTANCE = new Default();
- public static CommandExecutorProvider instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Default() {
- super();
- }
- public CommandExecutor getCommandExecutor() {
- return CommandExecutor.Default.instance();
- }
- @Override
- public String toString() {
- return "CommandExecutorProvider.Default";
- }
- }
-
-}
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 7b26b7f8ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/Filter.java
+++ /dev/null
@@ -1,73 +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;
-
-/**
- * Used by various "pluggable" classes to filter 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.
- */
-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);
-
-
- final class Null<S> implements Filter<S> {
- @SuppressWarnings("unchecked")
- 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 next) {
- return true;
- }
- @Override
- public String toString() {
- return "Filter.Null"; //$NON-NLS-1$
- }
- }
-
- final class Disabled<S> implements Filter<S> {
- @SuppressWarnings("unchecked")
- 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 next) {
- throw new UnsupportedOperationException();
- }
- @Override
- public String toString() {
- return "Filter.Disabled"; //$NON-NLS-1$
- }
- }
-
-}
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 9347dbdf39..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/JavaType.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.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.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 JavaType
- extends Comparable<JavaType>
-{
-
- /**
- * Return the name of the type's "element type".
- * A member type will have one or more '$' characters in its name.
- */
- String getElementTypeName();
-
- /**
- * Return the type's "array depth".
- */
- int getArrayDepth();
-
- boolean isArray();
-
- /**
- * NB: void.class.isPrimitive() == true
- */
- boolean isPrimitive();
-
- /**
- * NB: void.class.isPrimitive() == true
- */
- boolean isPrimitiveWrapper();
-
- /**
- * NB: variables cannot be declared 'void'
- */
- boolean isVariablePrimitive();
-
- /**
- * NB: variables cannot be declared 'void'
- */
- 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 java.lang.Class#getName()
- * (e.g. "[[J", "[Ljava.lang.Object;", "java.util.Map$Entry").
- */
- String getJavaClassName();
-
- boolean equals(String otherElementTypeName, int otherArrayDepth);
-
- boolean describes(String className);
-
- boolean describes(Class<?> javaClass);
-
- boolean equals(JavaType other);
-
- /**
- * Return the version of the type's name that can be used in source code:
- * "[[J" => "long[][]"
- * "java.util.Map$Entry" => "java.util.Map.Entry"
- */
- String declaration();
-
- /**
- * Append the version of the type's name that can be used in source code:
- * "[[J" => "long[][]"
- * "java.util.Map$Entry" => "java.util.Map.Entry"
- */
- void appendDeclarationTo(StringBuilder sb);
-
- /**
- * Print the version of the type's name that can be used in source code:
- * "[[J" => "long[][]"
- * "java.util.Map$Entry" => "java.util.Map.Entry"
- */
- 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 08fcbc21d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/MethodSignature.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;
-
-import java.io.PrintWriter;
-
-/**
- * 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.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 MethodSignature
- extends Comparable<MethodSignature>
-{
-
- /**
- * Return the method's name.
- */
- String getName();
-
- /**
- * Return the method's parameter types.
- */
- JavaType[] getParameterTypes();
-
- boolean equals(String otherName, JavaType[] otherParameterTypes);
-
- boolean equals(MethodSignature other);
-
- /**
- * Return a string representation of the method signature:
- * "foo(int, java.lang.String)"
- */
- String getSignature();
-
- /**
- * Append a string representation of the method signature:
- * "foo(int, java.lang.String)"
- */
- void appendSignatureTo(StringBuilder sb);
-
- /**
- * Print a string representation of the method signature:
- * "foo(int, java.lang.String)"
- */
- 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 8ffa61d1d2..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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 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();
- }
-
-}
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/Bag.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Bag.java
deleted file mode 100644
index b2c7223a40..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Bag.java
+++ /dev/null
@@ -1,187 +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.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 <code>java.util.Collection</code> interface,
- * on the contracts of the <code>equals</code> and <code>hashCode</code> 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 <code>Object.hashCode</code> 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.
- */
- 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 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 <code>Bag.entries</code> method returns an iterator whose
- * elements are of this class. The <i>only</i> 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 <i>only</i> 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 <code>setCount</code>
- * 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 the iterator's <code>remove</code> method 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("unchecked")
- 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 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() {
- 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 d102f9e267..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiFilter.java
+++ /dev/null
@@ -1,80 +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;
-
-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> {
- @SuppressWarnings("unchecked")
- 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 next) {
- return true;
- }
- // nothing is "reverse-filtered" - everything is accepted
- public boolean reverseAccept(S o) {
- return true;
- }
- @Override
- public String toString() {
- return "BidiFilter.Null";
- }
- }
-
- final class Disabled<S> implements BidiFilter<S> {
- @SuppressWarnings("unchecked")
- 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 next) {
- throw new UnsupportedOperationException();
- }
- // throw an exception
- public boolean reverseAccept(S o) {
- throw new UnsupportedOperationException();
- }
- @Override
- public String toString() {
- return "BidiFilter.Disabled";
- }
- }
-
-}
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 fcd8f4a311..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiStringConverter.java
+++ /dev/null
@@ -1,127 +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;
-
-/**
- * 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> {
- @SuppressWarnings("unchecked")
- 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";
- }
- }
-
- final class Disabled<S> implements BidiStringConverter<S> {
- @SuppressWarnings("unchecked")
- 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";
- }
- }
-
- final class BooleanConverter implements BidiStringConverter<Boolean> {
- 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";
- }
- }
-
- final class IntegerConverter implements BidiStringConverter<Integer> {
- 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";
- }
- }
-
-}
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 5f6d3d221b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiTransformer.java
+++ /dev/null
@@ -1,81 +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;
-
-/**
- * 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> {
- @SuppressWarnings("unchecked")
- 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";
- }
- }
-
- final class Disabled<S1, S2> implements BidiTransformer<S1, S2> {
- @SuppressWarnings("unchecked")
- 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";
- }
- }
-
-}
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 544f5bba82..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, 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;
-
-/**
- * Assorted bit tools
- */
-public 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/BooleanHolder.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BooleanHolder.java
deleted file mode 100644
index e014e4eea1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BooleanHolder.java
+++ /dev/null
@@ -1,126 +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 java.io.Serializable;
-
-/**
- * Provide a container for passing a flag that can be changed by the recipient.
- * @see SynchronizedBoolean
- */
-public class BooleanHolder
- implements Cloneable, Serializable
-{
- /** Backing boolean. */
- private boolean value;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Create a boolean holder with the specified initial value.
- */
- public BooleanHolder(boolean value) {
- super();
- this.value = value;
- }
-
- /**
- * Create a boolean holder with an initial value of false.
- */
- public BooleanHolder() {
- this(false);
- }
-
-
- // ********** accessors **********
-
- /**
- * Return the current boolean value.
- */
- public boolean getValue() {
- return this.value;
- }
-
- /**
- * Return whether the current boolean value is true.
- */
- public boolean isTrue() {
- return this.value;
- }
-
- /**
- * Return whether the current boolean value is false.
- */
- public boolean isFalse() {
- return ! this.value;
- }
-
- /**
- * Return whether the current boolean value is the specified value.
- */
- public boolean is(boolean v) {
- return this.value == v;
- }
-
- /**
- * Set the boolean value.
- */
- public void setValue(boolean value) {
- this.value = value;
- }
-
- /**
- * Set the boolean value to true.
- */
- public void setTrue() {
- this.value = true;
- }
-
- /**
- * Set the boolean value to false.
- */
- public void setFalse() {
- this.value = false;
- }
-
-
- // ********** standard methods **********
-
- @Override
- public Object clone() {
- try {
- return super.clone();
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- @Override
- public boolean equals(Object o) {
- if (o instanceof BooleanHolder) {
- return this.value == ((BooleanHolder) o).value;
- }
- return false;
- }
-
- @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/ClassTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ClassTools.java
deleted file mode 100644
index a09dc39b06..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ClassTools.java
+++ /dev/null
@@ -1,1678 +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.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()
- */
- 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
- */
- 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(", "); //$NON-NLS-1$
- }
- 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 ""; //$NON-NLS-1$
- }
- 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(" ("); //$NON-NLS-1$
- 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, null);
- }
-
- /**
- * 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, classLoader);
- }
-
- 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); //$NON-NLS-1$
- }
- 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 + '.'); //$NON-NLS-1$
- }
- // 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"; //$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<?>) 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/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 1d21184745..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Classpath.java
+++ /dev/null
@@ -1,911 +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.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.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;
-
-/**
- * TODO
- */
-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 rt.jar.
- */
- 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.
- * e.g. "java/lang/String.class" is converted to "java.lang.String"
- * e.g. "java/lang/String.java" is converted to "java.lang.String"
- */
- 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. File(java/lang/String.class) is converted to "java.lang.String"
- */
- public static String convertToClassName(File classFile) {
- return convertToClassName(classFile.getPath());
- }
-
- /**
- * Convert a relative file name to a class;
- * e.g. "java/lang/String.class" is converted to java.lang.String.class
- */
- public static Class<?> convertToClass(String classFileName) throws ClassNotFoundException {
- return Class.forName(convertToClassName(classFileName));
- }
-
- /**
- * Convert a relative file to a class;
- * e.g. File(java/lang/String.class) is converted to java.lang.String.class
- */
- 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. "java.lang.String" is converted to "java/lang/String"
- */
- public static String convertToArchiveEntryNameBase(String className) {
- return className.replace('.', '/');
- }
-
- /**
- * Convert a class to an archive entry name base;
- * e.g. java.lang.String.class is converted to "java/lang/String"
- */
- public static String convertToArchiveEntryNameBase(Class<?> javaClass) {
- return convertToArchiveEntryNameBase(javaClass.getName());
- }
-
- /**
- * Convert a class name to an archive class file entry name;
- * e.g. "java.lang.String" is converted to "java/lang/String.class"
- */
- 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. java.lang.String.class is converted to "java/lang/String.class"
- */
- 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. "java.lang.String" is converted to "java/lang/String" on Unix
- * and "java\\lang\\String" 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. java.lang.String.class is converted to "java/lang/String" on Unix
- * and "java\\lang\\String" 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. "java.lang.String" is converted to "java/lang/String.class" on Unix
- * and "java\\lang\\String.class" 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. java.lang.String.class is converted to "java/lang/String.class" on Unix
- * and "java\\lang\\String.class" 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. "java.lang.String" is converted to File(java/lang/String.class)
- */
- 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. java.lang.String.class is converted to File(java/lang/String.class)
- */
- 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. "java.lang.String" is converted to "java/lang/String.java" on Unix
- * and "java\\lang\\String.java" 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. java.lang.String.class is converted to "java/lang/String.java" on Unix
- * and "java\\lang\\String.java" 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. "java.lang.String" is converted to File(java/lang/String.java)
- */
- 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. java.lang.String.class is converted to File(java/lang/String.java)
- */
- public static File convertToJavaFile(Class<?> javaClass) {
- return convertToJavaFile(javaClass.getName());
- }
-
-
- // ***** class => resource *****
-
- /**
- * Convert a class to a resource name;
- * e.g. java.lang.String.class is converted to "/java/lang/String.class".
- */
- public static String convertToResourceName(Class<?> javaClass) {
- return '/' + convertToArchiveClassFileEntryName(javaClass);
- }
-
- /**
- * Convert a class to a resource;
- * e.g. java.lang.String.class is converted to
- * URL(jar:file:/C:/jdk/1.4.2_04/jre/lib/rt.jar!/java/lang/String.class).
- */
- 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 ".zip" or ".jar"
- */
- 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 ".zip" or ".jar"
- */
- 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. "C:\jdk1.4.2_04\jre\lib\rt.jar".
- */
- 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:
- * "C:\dev\foo.jar;;C:\dev\bar.jar"
- * will be parsed into three file names:
- * { "C:\dev\foo.jar", "", "C:\dev\bar.jar" }
- */
- 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(List<String> fileNames) {
- this(fileNames.toArray(new String[fileNames.size()]));
- }
-
- /**
- * 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.entries());
- }
- return entries.toArray(new Entry[entries.size()]);
- }
-
-
- // ********** public API **********
-
- /**
- * Return the classpath's entries.
- */
- public Entry[] entries() {
- return this.entries;
- }
-
- /**
- * Return the classpath's path.
- */
- public String path() {
- Entry[] localEntries = this.entries;
- int max = localEntries.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(localEntries[i].fileName());
- sb.append(File.pathSeparatorChar);
- }
- sb.append(localEntries[max].fileName());
- 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 "rt.jar" or "toplink.jar".
- */
- public Entry entryForFileNamed(String shortFileName) {
- Entry[] localEntries = this.entries;
- for (Entry entry : localEntries) {
- if (entry.file().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 entryForClassNamed(String className) {
- String relativeClassFileName = convertToClassFileName(className);
- String archiveEntryName = convertToArchiveClassFileEntryName(className);
- Entry[] localEntries = this.entries;
- for (Entry entry : localEntries) {
- if (entry.contains(relativeClassFileName, archiveEntryName)) {
- return entry;
- }
- }
- return null;
- }
-
- /**
- * Return the names of all the classes discovered on the classpath,
- * with duplicates removed.
- */
- public String[] classNames() {
- return this.classNames(Filter.Null.<String>instance());
- }
-
- /**
- * Return the names of all the classes discovered on the classpath
- * and accepted by the specified filter, with duplicates removed.
- */
- public String[] classNames(Filter<String> filter) {
- Collection<String> classNames = new HashSet<String>(10000);
- this.addClassNamesTo(classNames, filter);
- return classNames.toArray(new String[classNames.size()]);
- }
-
- /**
- * 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) {
- Entry[] localEntries = this.entries;
- for (Entry entry : localEntries) {
- entry.addClassNamesTo(classNames, filter);
- }
- }
-
- /**
- * Return the names of all the classes discovered on the classpath.
- * Just a bit more performant than #classNames().
- */
- public Iterator<String> classNamesStream() {
- return this.classNamesStream(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 #classNames(Filter).
- */
- public Iterator<String> classNamesStream(Filter<String> filter) {
- return new CompositeIterator<String>(this.entryClassNamesStreams(filter));
- }
-
- private Iterator<Iterator<String>> entryClassNamesStreams(final Filter<String> filter) {
- return new TransformationIterator<Entry, Iterator<String>>(new ArrayIterator<Entry>(this.entries)) {
- @Override
- protected Iterator<String> transform(Entry entry) {
- return entry.classNamesStream(filter);
- }
- };
- }
-
- /**
- * Return a "compressed" version of the classpath with its
- * duplicate entries eliminated.
- */
- public Classpath compressed() {
- return new Classpath(CollectionTools.removeDuplicateElements(this.entries));
- }
-
- /**
- * Convert the classpath to an array of URLs
- * (that can be used to instantiate a URLClassLoader).
- */
- public URL[] urls() {
- Entry[] localEntries = this.entries;
- int len = localEntries.length;
- URL[] urls = new URL[len];
- for (int i = 0; i < len; i++) {
- urls[i] = localEntries[i].url();
- }
- return urls;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.path());
- }
-
-
- // ********** inner class **********
-
- /**
- * TODO
- */
- 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 fileName() {
- return this.fileName;
- }
-
- public File file() {
- return this.file;
- }
-
- public File canonicalFile() {
- return this.canonicalFile;
- }
-
- public String canonicalFileName() {
- 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 url() {
- try {
- return this.canonicalFile.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.
- */
- public String[] classNames() {
- return this.classNames(Filter.Null.<String>instance());
- }
-
- /**
- * Return the names of all the classes discovered in the entry
- * and accepted by the specified filter.
- */
- public String[] classNames(Filter<String> filter) {
- Collection<String> classNames = new ArrayList<String>(2000);
- this.addClassNamesTo(classNames, filter);
- return classNames.toArray(new String[classNames.size()]);
- }
-
- /**
- * 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, 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) {
- return;
- }
- 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 ".class" 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 #classNames().
- */
- public Iterator<String> classNamesStream() {
- return this.classNamesStream(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 #classNames(Filter).
- */
- public Iterator<String> classNamesStream(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, 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 a30650564a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CollectionTools.java
+++ /dev/null
@@ -1,3918 +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.lang.reflect.Array;
-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.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.GenericIteratorWrapper;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-
-public final class CollectionTools {
-
- @SuppressWarnings("unchecked")
- private static <E> E[] newArray(E[] array, int length) {
- return (E[]) Array.newInstance(array.getClass().getComponentType(), length);
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array followed by the specified object to be added.
- * java.util.Arrays#add(Object[] array, Object o)
- */
- 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 that contains the elements in the
- * specified array with the specified object added at the specified index.
- * java.util.Arrays#add(Object[] array, int index, Object o)
- */
- 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 (len > index) {
- System.arraycopy(array, index, result, index + 1, len - index);
- }
- return result;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array followed by the specified value to be added.
- * java.util.Arrays#add(char[] array, char value)
- */
- 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 that contains the elements in the
- * specified array with the specified value added at the specified index.
- * java.util.Arrays#add(char[] array, int index, char value)
- */
- 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 (len > index) {
- System.arraycopy(array, index, result, index + 1, len - index);
- }
- return result;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array followed by the specified value to be added.
- * java.util.Arrays#add(int[] array, int value)
- */
- 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 that contains the elements in the
- * specified array with the specified value added at the specified index.
- * java.util.Arrays#add(int[] array, int index, int value)
- */
- 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 (len > index) {
- System.arraycopy(array, index, result, index + 1, len - index);
- }
- return result;
- }
-
- /**
- * Add all the elements returned by the specified iterable
- * to the specified collection.
- * Return whether the collection changed as a result.
- * java.util.Collection#addAll(java.lang.Iterable iterable)
- */
- 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.
- * java.util.Collection#addAll(java.lang.Iterable iterable)
- */
- 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.
- * java.util.Collection#addAll(java.util.Iterator iterator)
- */
- public static <E> boolean addAll(Collection<? super E> collection, Iterator<? extends E> iterator) {
- return (iterator.hasNext()) ? collection.addAll(list(iterator)) : false;
- }
-
- /**
- * Add all the elements returned by the specified iterator
- * to the specified collection.
- * Return whether the collection changed as a result.
- * java.util.Collection#addAll(java.util.Iterator iterator)
- */
- 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.
- * java.util.Collection#addAll(Object[] array)
- */
- public static <E> boolean addAll(Collection<? super E> collection, E[] array) {
- return (array.length == 0) ? false : collection.addAll(Arrays.asList(array));
- }
-
- /**
- * 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.
- * java.util.List#addAll(java.lang.Iterable iterable)
- */
- 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.
- * java.util.List#addAll(java.lang.Iterable iterable)
- */
- 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.
- * java.util.List#addAll(java.util.Iterator iterator)
- */
- 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.
- * java.util.List#addAll(java.util.Iterator iterator)
- */
- 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.
- * java.util.List#addAll(Object[] array)
- */
- public static <E> boolean addAll(List<? super E> list, int index, E[] array) {
- return (array.length == 0) ? false : list.addAll(index, Arrays.asList(array));
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array followed by the elements
- * in the specified collection.
- * java.util.Arrays#addAll(Object[] array, java.util.Collection c)
- */
- public static <E> E[] addAll(E[] array, Collection<? extends E> collection) {
- int size = collection.size();
- return (size == 0) ? array : addAll(array, collection, size);
- }
-
- /**
- * assume collection is non-empty
- */
- private static <E> E[] addAll_(E[] array, Collection<? extends E> collection) {
- return addAll(array, collection, collection.size());
- }
-
- /**
- * assume collection is non-empty
- */
- private static <E> E[] addAll(E[] array, Collection<? extends E> collection, int collectionSize) {
- int len = array.length;
- E[] result = newArray(array, len + collectionSize);
- if (len > 0) {
- System.arraycopy(array, 0, result, 0, len);
- }
- int i = len;
- for (E item : collection) {
- result[i++] = item;
- }
- return result;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array followed by the elements
- * in the specified iterable.
- * java.util.Arrays#addAll(Object[] array, java.lang.Iterable iterable)
- */
- public static <E> E[] addAll(E[] array, Iterable<? extends E> iterable) {
- return addAll(array, iterable.iterator());
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array followed by the elements
- * in the specified iterable.
- * java.util.Arrays#addAll(Object[] array, java.lang.Iterable iterable)
- */
- public static <E> E[] addAll(E[] array, Iterable<? extends E> iterable, int size) {
- return addAll(array, iterable.iterator(), size);
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array followed by the elements
- * in the specified iterator.
- * java.util.Arrays#addAll(Object[] array, java.util.Iterator iterator)
- */
- public static <E> E[] addAll(E[] array, Iterator<? extends E> iterator) {
- return (iterator.hasNext()) ? addAll_(array, list(iterator)) : array;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array followed by the elements
- * in the specified iterator.
- * java.util.Arrays#addAll(Object[] array, java.util.Iterator iterator)
- */
- public static <E> E[] addAll(E[] array, Iterator<? extends E> iterator, int size) {
- return (iterator.hasNext()) ? addAll_(array, list(iterator, size)) : array;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array 1 followed by the elements
- * in the specified array 2.
- * java.util.Arrays#addAll(Object[] array1, Object[] array2)
- */
- public static <E> E[] addAll(E[] array1, E[] array2) {
- int array2Length = array2.length;
- return (array2Length == 0) ? array1 : addAll(array1, array2, array2Length);
- }
-
- /**
- * assume array2Length > 0
- */
- private static <E> E[] addAll(E[] array1, E[] array2, int array2Length) {
- int array1Length = array1.length;
- return (array1Length == 0) ? array2 : addAll(array1, array2, array1Length, array2Length);
- }
-
- /**
- * assume array1Length > 0 and array2Length > 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 a new array that contains the elements in the
- * first specified array with the objects in the second
- * specified array added at the specified index.
- * java.util.Arrays#add(Object[] array1, int index, Object[] array2)
- */
- public static <E> E[] addAll(E[] array1, int index, E[] array2) {
- int array2Length = array2.length;
- return (array2Length == 0) ? array1 : addAll(array1, index, array2, array2Length);
- }
-
- /**
- * assume array2Length > 0
- */
- private static <E> E[] addAll(E[] array1, int index, E[] array2, int array2Length) {
- int array1Length = array1.length;
- return (index == array1Length) ? // array2 added to end of array1
- (array1Length == 0) ? array2 : addAll(array1, array2, array1Length, array2Length)
- :
- addAll(array1, index, array2, array1Length, array2Length);
- }
-
- /**
- * assume array1Length > 0 and array2Length > 0
- */
- 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 a new array that contains the elements in the
- * specified array with the elements
- * in the specified collection inserted at the specified index.
- * java.util.Arrays#addAll(Object[] array, int index, java.util.Collection c)
- */
- public static <E> E[] addAll(E[] array, int index, Collection<? extends E> collection) {
- int size = collection.size();
- return (size == 0) ? array : addAll(array, index, collection, size);
- }
-
- /**
- * 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());
- }
-
- /**
- * assume collection is non-empty
- */
- private static <E> E[] addAll(E[] array, int index, Collection<? extends E> collection, int collectionSize) {
- int arrayLength = array.length;
- E[] result = newArray(array, arrayLength + collectionSize);
- if ((arrayLength == 0) && (index == 0)) {
- return collection.toArray(result);
- }
- 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 a new array that contains the elements in the
- * specified array with the elements
- * in the specified iterable inserted at the specified index.
- * java.util.Arrays#addAll(Object[] array, int index, java.lang.Iterable iterable)
- */
- public static <E> E[] addAll(E[] array, int index, Iterable<? extends E> iterable) {
- return addAll(array, index, iterable.iterator());
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the elements
- * in the specified iterable inserted at the specified index.
- * java.util.Arrays#addAll(Object[] array, int index, java.lang.Iterable iterable)
- */
- public static <E> E[] addAll(E[] array, int index, Iterable<? extends E> iterable, int size) {
- return addAll(array, index, iterable.iterator(), size);
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the elements
- * in the specified iterator inserted at the specified index.
- * java.util.Arrays#addAll(Object[] array, int index, java.util.Iterator iterator)
- */
- public static <E> E[] addAll(E[] array, int index, Iterator<? extends E> iterator) {
- return (iterator.hasNext()) ? addAll_(array, index, list(iterator)) : array;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the elements
- * in the specified iterator inserted at the specified index.
- * java.util.Arrays#addAll(Object[] array, int index, java.util.Iterator iterator)
- */
- public static <E> E[] addAll(E[] array, int index, Iterator<? extends E> iterator, int size) {
- return (iterator.hasNext()) ? addAll_(array, index, list(iterator, size)) : array;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array 1 followed by the elements
- * in the specified array 2.
- * java.util.Arrays#addAll(char[] array1, char[] array2)
- */
- public static char[] addAll(char[] array1, char[] array2) {
- int array2Length = array2.length;
- return (array2Length == 0) ? array1 : addAll(array1, array2, array2Length);
- }
-
- /**
- * assume array2Length > 0
- */
- private static char[] addAll(char[] array1, char[] array2, int array2Length) {
- int array1Length = array1.length;
- return (array1Length == 0) ? array2 : addAll(array1, array2, array1Length, array2Length);
- }
-
- /**
- * assume array1Length > 0 and array2Length > 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 a new array that contains the elements in the
- * first specified array with the objects in the second
- * specified array added at the specified index.
- * java.util.Arrays#add(char[] array1, int index, char[] array2)
- */
- public static char[] addAll(char[] array1, int index, char[] array2) {
- int array2Length = array2.length;
- return (array2Length == 0) ? array1 : addAll(array1, index, array2, array2Length);
- }
-
- /**
- * assume array2Length > 0
- */
- private static char[] addAll(char[] array1, int index, char[] array2, int array2Length) {
- int array1Length = array1.length;
- return (index == array1Length) ? // array2 added to end of array1
- (array1Length == 0) ? array2 : addAll(array1, array2, array1Length, array2Length)
- :
- addAll(array1, index, array2, array1Length, array2Length);
- }
-
- /**
- * assume array1Length > 0 and array2Length > 0
- */
- 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 a new array that contains the elements in the
- * specified array 1 followed by the elements
- * in the specified array 2.
- * java.util.Arrays#addAll(int[] array1, int[] array2)
- */
- public static int[] addAll(int[] array1, int[] array2) {
- int array2Length = array2.length;
- return (array2Length == 0) ? array1 : addAll(array1, array2, array2Length);
- }
-
- /**
- * assume array2Length > 0
- */
- private static int[] addAll(int[] array1, int[] array2, int array2Length) {
- int array1Length = array1.length;
- return (array1Length == 0) ? array2 : addAll(array1, array2, array1Length, array2Length);
- }
-
- /**
- * assume array1Length > 0 and array2Length > 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 a new array that contains the elements in the
- * first specified array with the objects in the second
- * specified array added at the specified index.
- * java.util.Arrays#add(int[] array1, int index, int[] array2)
- */
- public static int[] addAll(int[] array1, int index, int[] array2) {
- int array2Length = array2.length;
- return (array2Length == 0) ? array1 : addAll(array1, index, array2, array2Length);
- }
-
- /**
- * assume array2Length > 0
- */
- private static int[] addAll(int[] array1, int index, int[] array2, int array2Length) {
- int array1Length = array1.length;
- return (index == array1Length) ? // array2 added to end of array1
- (array1Length == 0) ? array2 : addAll(array1, array2, array1Length, array2Length)
- :
- addAll(array1, index, array2, array1Length, array2Length);
- }
-
- /**
- * assume array1Length > 0 and array2Length > 0
- */
- 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;
- }
-
- /**
- * Return an array corresponding to the specified iterable.
- * @see java.util.Collection#toArray()
- * java.lang.Iterable#toArray()
- */
- public static Object[] array(Iterable<?> iterable) {
- return array(iterable.iterator());
- }
-
- /**
- * Return an array corresponding to the specified iterable.
- * @see java.util.Collection#toArray()
- * java.lang.Iterable#toArray()
- */
- public static Object[] array(Iterable<?> iterable, int size) {
- return array(iterable.iterator(), size);
- }
-
- /**
- * Return an array corresponding to the specified iterable;
- * the runtime type of the returned array is that of the specified array.
- * If the collection 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 this collection.
- * @see java.util.Collection#toArray(java.lang.Object[])
- * java.lang.Iterable#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 collection 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 this collection.
- * @see java.util.Collection#toArray(java.lang.Object[])
- * java.lang.Iterable#toArray(Object[])
- */
- public static <E> E[] array(Iterable<? extends E> iterable, int size, E[] array) {
- return array(iterable.iterator(), size, array);
- }
-
- /**
- * Return an array corresponding to the specified iterator.
- * @see java.util.Collection#toArray()
- * java.util.Iterator#toArray()
- */
- public static Object[] array(Iterator<?> iterator) {
- return (iterator.hasNext()) ? list(iterator).toArray() : EMPTY_OBJECT_ARRAY;
- }
- private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
-
- /**
- * Return an array corresponding to the specified iterator.
- * @see java.util.Collection#toArray()
- * java.util.Iterator#toArray()
- */
- public static Object[] array(Iterator<?> iterator, int size) {
- return (iterator.hasNext()) ? list(iterator, size).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 collection 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 this collection.
- * @see java.util.Collection#toArray(java.lang.Object[])
- * java.util.Iterator#toArray(Object[])
- */
- public static <E> E[] array(Iterator<? extends E> iterator, E[] array) {
- return (iterator.hasNext()) ? list(iterator).toArray(array) : newArray(array, 0);
- }
-
- /**
- * Return an array corresponding to the specified iterator;
- * the runtime type of the returned array is that of the specified array.
- * If the collection 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 this collection.
- * @see java.util.Collection#toArray(java.lang.Object[])
- * java.util.Iterator#toArray(Object[])
- */
- public static <E> E[] array(Iterator<? extends E> iterator, int size, E[] array) {
- return (iterator.hasNext()) ? list(iterator, size).toArray(array) : newArray(array, 0);
- }
-
- /**
- * Return a bag corresponding to the specified enumeration.
- * HashBag(java.util.Enumeration enumeration)
- */
- public static <E> HashBag<E> bag(Enumeration<? extends E> enumeration) {
- return bag(enumeration, new HashBag<E>());
- }
-
- /**
- * Return a bag corresponding to the specified enumeration.
- * HashBag(java.util.Enumeration enumeration)
- */
- public static <E> HashBag<E> bag(Enumeration<? extends E> enumeration, int size) {
- return bag(enumeration, new HashBag<E>(size));
- }
-
- 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.
- * HashBag(java.lang.Iterable iterable)
- */
- public static <E> HashBag<E> bag(Iterable<? extends E> iterable) {
- return bag(iterable.iterator());
- }
-
- /**
- * Return a bag corresponding to the specified iterable.
- * HashBag(java.lang.Iterable iterable)
- */
- public static <E> HashBag<E> bag(Iterable<? extends E> iterable, int size) {
- return bag(iterable.iterator(), size);
- }
-
- /**
- * Return a bag corresponding to the specified iterator.
- * HashBag(java.util.Iterator iterator)
- */
- public static <E> HashBag<E> bag(Iterator<? extends E> iterator) {
- return bag(iterator, new HashBag<E>());
- }
-
- /**
- * Return a bag corresponding to the specified iterator.
- * HashBag(java.util.Iterator iterator)
- */
- public static <E> HashBag<E> bag(Iterator<? extends E> iterator, int size) {
- return bag(iterator, new HashBag<E>(size));
- }
-
- 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.
- * HashBag(Object[] array)
- */
- 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;
- }
-
- /**
- * Clear the specified array.
- * java.util.Arrays#clear(Object[] array)
- */
- public static <E> E[] clear(E[] array) {
- if (array.length == 0) {
- return array;
- }
- return newArray(array, 0);
- }
-
- /**
- * 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.
- */
- public static <E> HashBag<E> collection(Enumeration<? extends E> enumeration, int size) {
- return bag(enumeration, size);
- }
-
- /**
- * 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.
- */
- public static <E> HashBag<E> collection(Iterable<? extends E> iterable, int size) {
- return collection(iterable.iterator(), size);
- }
-
- /**
- * 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.
- */
- public static <E> HashBag<E> collection(Iterator<? extends E> iterator, int size) {
- return bag(iterator, size);
- }
-
- /**
- * Return a collection corresponding to the specified array.
- */
- public static <E> HashBag<E> collection(E... array) {
- return bag(array);
- }
-
- /**
- * Return whether the specified enumeration contains the
- * specified element.
- * java.util.Enumeration#contains(Object o)
- */
- 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.
- * java.lang.Iterable#contains(Object o)
- */
- public static boolean contains(Iterable<?> iterable, Object value) {
- return contains(iterable.iterator(), value);
- }
-
- /**
- * Return whether the specified iterator contains the
- * specified element.
- * java.util.Iterator#contains(Object o)
- */
- 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;
- }
-
- /**
- * Return whether the specified array contains the
- * specified element.
- * java.util.Arrays#contains(Object[] array, Object o)
- */
- public static boolean contains(Object[] array, Object value) {
- if (value == null) {
- for (int i = array.length; i-- > 0; ) {
- if (array[i] == null) {
- return true;
- }
- }
- } else {
- for (int i = array.length; i-- > 0; ) {
- if (value.equals(array[i])) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified array contains the
- * specified element.
- * java.util.Arrays#contains(char[] array, char value)
- */
- public static boolean contains(char[] array, char value) {
- return contains(array, value, array.length);
- }
-
- 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.
- * java.util.Arrays#contains(int[] array, int value)
- */
- public static boolean contains(int[] array, int value) {
- return contains(array, value, array.length);
- }
-
- private static boolean contains(int[] array, int value, int arrayLength) {
- for (int i = arrayLength; i-- > 0; ) {
- if (array[i] == value) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified collection contains all of the
- * elements in the specified iterable.
- * java.util.Collection#containsAll(java.lang.Iterable iterable)
- */
- 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.
- * java.util.Collection#containsAll(java.util.Iterator iterator)
- */
- 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.
- * java.util.Collection#containsAll(Object[] array)
- */
- 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.
- * java.lang.Iterable#containsAll(java.util.Collection collection)
- */
- 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.
- * java.lang.Iterable#containsAll(java.util.Collection collection)
- */
- public static boolean containsAll(Iterable<?> iterable, int size, Collection<?> collection) {
- return containsAll(iterable.iterator(), size, collection);
- }
-
- /**
- * Return whether the specified iterable 1 contains all of the
- * elements in the specified iterable 2.
- * java.lang.Iterable#containsAll(java.lang.Iterable iterable)
- */
- 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.
- * java.lang.Iterable#containsAll(java.lang.Iterable iterable)
- */
- public static boolean containsAll(Iterable<?> iterable1, int size, Iterable<?> iterable2) {
- return containsAll(iterable1.iterator(), size, iterable2.iterator());
- }
-
- /**
- * Return whether the specified iterable contains all of the
- * elements in the specified iterator.
- * java.lang.Iterable#containsAll(java.util.Iterator iterator)
- */
- 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.
- * java.lang.Iterable#containsAll(java.util.Iterator iterator)
- */
- public static boolean containsAll(Iterable<?> iterable, int size, Iterator<?> iterator) {
- return containsAll(iterable.iterator(), size, iterator);
- }
-
- /**
- * Return whether the specified iterable contains all of the
- * elements in the specified array.
- * java.lang.Iterable#containsAll(Object[] array)
- */
- 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.
- * java.lang.Iterable#containsAll(Object[] array)
- */
- public static boolean containsAll(Iterable<?> iterable, int size, Object[] array) {
- return containsAll(iterable.iterator(), size, array);
- }
-
- /**
- * Return whether the specified iterator contains all of the
- * elements in the specified collection.
- * java.util.Iterator#containsAll(java.util.Collection collection)
- */
- public static boolean containsAll(Iterator<?> iterator, Collection<?> collection) {
- return collection(iterator).containsAll(collection);
- }
-
- /**
- * Return whether the specified iterator contains all of the
- * elements in the specified collection.
- * java.util.Iterator#containsAll(java.util.Collection collection)
- */
- public static boolean containsAll(Iterator<?> iterator, int size, Collection<?> collection) {
- return collection(iterator, size).containsAll(collection);
- }
-
- /**
- * Return whether the specified iterator contains all of the
- * elements in the specified iterable.
- * java.util.Iterator#containsAll(java.lang.Iterable iterable)
- */
- public static boolean containsAll(Iterator<?> iterator, Iterable<?> iterable) {
- return containsAll(collection(iterator), iterable);
- }
-
- /**
- * Return whether the specified iterator contains all of the
- * elements in the specified iterable.
- * java.util.Iterator#containsAll(java.lang.Iterable iterable)
- */
- public static boolean containsAll(Iterator<?> iterator, int size, Iterable<?> iterable) {
- return containsAll(collection(iterator, size), iterable);
- }
-
- /**
- * Return whether the specified iterator 1 contains all of the
- * elements in the specified iterator 2.
- * java.util.Iterator#containsAll(java.util.Iterator iterator)
- */
- public static boolean containsAll(Iterator<?> iterator1, Iterator<?> iterator2) {
- return containsAll(collection(iterator1), iterator2);
- }
-
- /**
- * Return whether the specified iterator 1 contains all of the
- * elements in the specified iterator 2.
- * java.util.Iterator#containsAll(java.util.Iterator iterator)
- */
- public static boolean containsAll(Iterator<?> iterator1, int size, Iterator<?> iterator2) {
- return containsAll(collection(iterator1, size), iterator2);
- }
-
- /**
- * Return whether the specified iterator contains all of the
- * elements in the specified array.
- * java.util.Iterator#containsAll(Object[] array)
- */
- public static boolean containsAll(Iterator<?> iterator, Object[] array) {
- return containsAll(collection(iterator), array);
- }
-
- /**
- * Return whether the specified iterator contains all of the
- * elements in the specified array.
- * java.util.Iterator#containsAll(Object[] array)
- */
- public static boolean containsAll(Iterator<?> iterator, int size, Object[] array) {
- return containsAll(collection(iterator, size), array);
- }
-
- /**
- * Return whether the specified array contains all of the
- * elements in the specified collection.
- * java.util.Arrays#containsAll(Object[] array, java.util.Collection collection)
- */
- 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.
- * java.util.Arrays#containsAll(Object[] array, java.lang.Iterable iterable)
- */
- 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.
- * java.util.Arrays#containsAll(Object[] array, java.util.Iterator iterator)
- */
- public static boolean containsAll(Object[] array, Iterator<?> iterator) {
- while (iterator.hasNext()) {
- if ( ! contains(array, iterator.next())) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return whether the specified array 1 contains all of the
- * elements in the specified array 2.
- * java.util.Arrays#containsAll(Object[] array1, Object[] array2)
- */
- public static boolean containsAll(Object[] array1, Object[] 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.
- * java.util.Arrays#containsAll(char[] array1, char[] array2)
- */
- 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.
- * java.util.Arrays#containsAll(int[] array1, int[] array2)
- */
- public static boolean containsAll(int[] array1, int[] array2) {
- for (int i = array2.length; i-- > 0; ) {
- if ( ! contains(array1, array2[i])) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * 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' #equals() method to compare the
- * elements.
- */
- public static int diffEnd(Object[] array1, Object[] array2) {
- return diffEnd(Arrays.asList(array1), Arrays.asList(array2));
- }
-
- /**
- * 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' #equals() method to compare the
- * elements.
- */
- public static int diffEnd(List<?> list1, List<?> list2) {
- int size1 = list1.size();
- int size2 = list2.size();
- if (size1 != size2) {
- return Math.max(size1, size2) - 1;
- }
- int end = size1 - 1;
- while (end > -1) {
- Object o = list1.get(end);
- if (o == null) {
- if (list2.get(end) == null) {
- end--;
- } else {
- return end;
- }
- } else {
- if (o.equals(list2.get(end))) {
- end--;
- } else {
- return end;
- }
- }
- }
- return end;
- }
-
- /**
- * Return the range of elements in the specified
- * arrays that are different.
- * If the arrays are identical, return [size, -1].
- * Use the elements' #equals() method to compare the
- * elements.
- * @see #diffStart(Object[], Object[])
- * @see #diffEnd(Object[], Object[])
- */
- public static Range diffRange(Object[] array1, Object[] array2) {
- return diffRange(Arrays.asList(array1), Arrays.asList(array2));
- }
-
- /**
- * Return the range of elements in the specified
- * arrays that are different.
- * If the arrays are identical, return [size, -1].
- * Use the elements' #equals() method to compare the
- * elements.
- * @see #diffStart(java.util.List, java.util.List)
- * @see #diffEnd(java.util.List, java.util.List)
- */
- public static Range diffRange(List<?> list1, List<?> list2) {
- int end = diffEnd(list1, list2);
- if (end == -1) {
- // the lists are identical, the start is the size of the two lists
- return new Range(list1.size(), end);
- }
- // the lists are different, calculate the start of the range
- return new Range(diffStart(list1, list2), 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' #equals() method to compare the
- * elements.
- */
- public static int diffStart(Object[] array1, Object[] array2) {
- return diffStart(Arrays.asList(array1), Arrays.asList(array2));
- }
-
- /**
- * 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' #equals() method to compare the
- * elements.
- */
- public static int diffStart(List<?> list1, List<?> list2) {
- int end = Math.min(list1.size(), list2.size());
- int start = 0;
- while (start < end) {
- Object o = list1.get(start);
- if (o == null) {
- if (list2.get(start) == null) {
- start++;
- } else {
- return start;
- }
- } else {
- if (o.equals(list2.get(start))) {
- start++;
- } else {
- return start;
- }
- }
- }
- return start;
- }
-
- /**
- * Return whether the specified iterators return equal elements.
- * java.util.Iterator#equals(java.util.Iterator iterator)
- */
- public static boolean equals(Iterator<?> iterator1, Iterator<?> iterator2) {
- while (iterator1.hasNext() && iterator2.hasNext()) {
- Object o1 = iterator1.next();
- Object o2 = iterator2.next();
- if ( ! (o1 == null ? o2 == null : o1.equals(o2))) {
- return false;
- }
- }
- return ! (iterator1.hasNext() || iterator2.hasNext());
- }
-
- /**
- * Return the element corresponding to the specified index
- * in the specified iterator.
- * java.util.ListIterator#get(int index)
- */
- public static <E> E get(ListIterator<? extends E> iterator, int index) {
- while (iterator.hasNext()) {
- E next = iterator.next();
- if (iterator.previousIndex() == index) {
- return next;
- }
- }
- throw new IndexOutOfBoundsException(String.valueOf(index) + ':' + String.valueOf(iterator.previousIndex()));
- }
-
- /**
- * Return whether the specified arrays contain the same elements.
- * java.util.Arrays#identical(Object[] array1, Object[] array2)
- */
- public static boolean identical(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;
- }
-
- /**
- * Return whether the specified iterators return the same elements.
- * java.util.Iterator#identical(java.util.Iterator iterator)
- */
- public static boolean identical(Iterator<?> iterator1, Iterator<?> iterator2) {
- while (iterator1.hasNext() && iterator2.hasNext()) {
- if (iterator1.next() != iterator2.next()) {
- return false;
- }
- }
- return ! (iterator1.hasNext() || iterator2.hasNext());
- }
-
- /**
- * 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) {
- return identityDiffEnd(Arrays.asList(array1), Arrays.asList(array2));
- }
-
- /**
- * 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.
- */
- public static int identityDiffEnd(List<?> list1, List<?> list2) {
- int size1 = list1.size();
- int size2 = list2.size();
- if (size1 != size2) {
- return Math.max(size1, size2) - 1;
- }
- int end = size1 - 1;
- while (end > -1) {
- if (list1.get(end) == list2.get(end)) {
- end--;
- } else {
- return end;
- }
- }
- return end;
- }
-
- /**
- * 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) {
- return identityDiffRange(Arrays.asList(array1), Arrays.asList(array2));
- }
-
- /**
- * 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(java.util.List, java.util.List)
- * @see #identityDiffEnd(java.util.List, java.util.List)
- */
- public static Range identityDiffRange(List<?> list1, List<?> list2) {
- int end = identityDiffEnd(list1, list2);
- if (end == -1) {
- // the lists are identical, the start is the size of the two lists
- return new Range(list1.size(), end);
- }
- // the lists are different, calculate the start of the range
- return new Range(identityDiffStart(list1, list2), 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) {
- return identityDiffStart(Arrays.asList(array1), Arrays.asList(array2));
- }
-
- /**
- * 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.
- */
- public static int identityDiffStart(List<?> list1, List<?> list2) {
- int end = Math.min(list1.size(), list2.size());
- int start = 0;
- while (start < end) {
- if (list1.get(start) == list2.get(start)) {
- start++;
- } else {
- return start;
- }
- }
- return start;
- }
-
- /**
- * Return the index of the first occurrence of the
- * specified element in the specified iterator,
- * or return -1 if there is no such index.
- * java.util.Iterator#indexOf(Object o)
- */
- 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;
- }
-
- /**
- * Return the index of the first occurrence of the
- * specified element in the specified array,
- * or return -1 if there is no such index.
- * java.util.Arrays#indexOf(Object[] array, Object o)
- */
- 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.
- * java.util.Arrays#indexOf(char[] array, char value)
- */
- 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.
- * java.util.Arrays#indexOf(int[] array, int value)
- */
- 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;
- }
-
- /**
- * 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;
- }
-
- /**
- * 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;
- }
-
- /**
- * Return a one-use Iterable for the Iterator given.
- * Throws an IllegalStateException if iterable() is called more than once.
- * As such, this utility should only be used in one-use situations, such as
- * a "for" loop.
- */
- public static <E> Iterable<E> iterable(Iterator<? extends E> iterator) {
- return new SingleUseIterable<E>(iterator);
- }
-
- /**
- * Return an iterable on the elements in the specified array.
- * java.util.Arrays#iterable(Object[] array)
- */
- public static <E> Iterable<E> iterable(E... array) {
- return Arrays.asList(array);
- }
-
- /**
- * Return an iterator on the elements in the specified array.
- * java.util.Arrays#iterator(Object[] array)
- */
- public static <E> Iterator<E> iterator(E... array) {
- return new ArrayIterator<E>(array);
- }
-
- /**
- * Return the index of the last occurrence of the
- * specified element in the specified iterator,
- * or return -1 if there is no such index.
- * java.util.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,
- * or return -1 if there is no such index.
- * java.util.Iterator#lastIndexOf(Object o)
- */
- public static int lastIndexOf(Iterator<?> iterator, int size, Object value) {
- return (iterator.hasNext()) ? list(iterator, size).lastIndexOf(value) : -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.
- * java.util.Arrays#lastIndexOf(Object[] array, Object o)
- */
- 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.
- * java.util.Arrays#lastIndexOf(char[] array, char value)
- */
- 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.
- * java.util.Arrays#lastIndexOf(int[] array, int value)
- */
- public static int lastIndexOf(int[] array, int value) {
- for (int i = array.length; i-- > 0; ) {
- if (array[i] == value) {
- return i;
- }
- }
- return -1;
- }
-
- /**
- * Return a list corresponding to the specified iterable.
- * java.lang.Iterable#toList()
- */
- public static <E> ArrayList<E> list(Iterable<? extends E> iterable) {
- return list(iterable.iterator());
- }
-
- /**
- * Return a list corresponding to the specified iterable.
- * java.lang.Iterable#toList()
- */
- public static <E> ArrayList<E> list(Iterable<? extends E> iterable, int size) {
- return list(iterable.iterator(), size);
- }
-
- /**
- * Return a list corresponding to the specified iterator.
- * java.util.Iterator#toList()
- */
- public static <E> ArrayList<E> list(Iterator<? extends E> iterator) {
- return list(iterator, new ArrayList<E>());
- }
-
- /**
- * Return a list corresponding to the specified iterator.
- * java.util.Iterator#toList()
- */
- public static <E> ArrayList<E> list(Iterator<? extends E> iterator, int size) {
- return list(iterator, new ArrayList<E>(size));
- }
-
- 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 java.util.Arrays.asList(Object[]), the list
- * is modifiable and is not backed by the array.
- */
- public static <E> ArrayList<E> list(E... array) {
- ArrayList<E> list = new ArrayList<E>(array.length);
- for (E item : array) {
- list.add(item);
- }
- return list;
- }
-
- /**
- * Return a list iterator for the specified array.
- * java.util.Arrays#listIterator(Object[] array)
- */
- 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.
- * java.util.Arrays#listIterator(Object[] array, int index)
- */
- public static <E> ListIterator<E> listIterator(E[] array, int index) {
- return Arrays.asList(array).listIterator(index);
- }
-
- /**
- * Return the character from the specified array with the maximum value.
- * java.util.Arrays#max(char[] array)
- */
- public static char max(char... array) {
- int len = array.length;
- if (len == 0) {
- throw new IndexOutOfBoundsException();
- }
- char max = array[0];
- // start at 1
- for (int i = 1; i < len; i++) {
- char next = array[i];
- if (next > max) {
- max = next;
- }
- }
- return max;
- }
-
- /**
- * Return the integer from the specified array with the maximum value.
- * java.util.Arrays#max(int[] array)
- */
- public static int max(int... array) {
- int len = array.length;
- if (len == 0) {
- throw new IndexOutOfBoundsException();
- }
- int max = array[0];
- // start at 1
- for (int i = 1; i < len; i++) {
- int next = array[i];
- if (next > max) {
- max = next;
- }
- }
- return max;
- }
-
- /**
- * Return the character from the specified array with the minimum value.
- * java.util.Arrays#min(char[] array)
- */
- public static char min(char... array) {
- int len = array.length;
- if (len == 0) {
- throw new IndexOutOfBoundsException();
- }
- char min = array[0];
- // start at 1
- for (int i = 1; i < len; i++) {
- char next = array[i];
- if (next < min) {
- min = next;
- }
- }
- return min;
- }
-
- /**
- * Return the integer from the specified array with the minimum value.
- * java.util.Arrays#min(int[] array)
- */
- public static int min(int... array) {
- int len = array.length;
- if (len == 0) {
- throw new IndexOutOfBoundsException();
- }
- int min = array[0];
- // start at 1
- for (int i = 1; i < len; i++) {
- int next = array[i];
- if (next < min) {
- min = next;
- }
- }
- return min;
- }
-
- /**
- * Move an element from the specified source index to the specified target
- * index. Return the altered array.
- * java.util.Arrays#move(Object[] array, int targetIndex, int sourceIndex)
- */
- public static <E> E[] move(E[] array, int targetIndex, int sourceIndex) {
- return (targetIndex == sourceIndex) ? array : move_(array, targetIndex, sourceIndex);
- }
-
- /**
- * assume targetIndex != sourceIndex
- */
- 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.
- * java.util.Arrays#move(Object[] array, int targetIndex, int sourceIndex, int length)
- */
- 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.
- * java.util.Arrays#move(int[] array, int targetIndex, int sourceIndex)
- */
- 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.
- * java.util.Arrays#move(int[] array, int targetIndex, int sourceIndex, int length)
- */
- 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.
- * java.util.Arrays#move(char[] array, int targetIndex, int sourceIndex)
- */
- 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.
- * java.util.Arrays#move(char[] array, int targetIndex, int sourceIndex, int length)
- */
- 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;
- }
-
- /**
- * Move an element from the specified source index to the specified target
- * index. Return the altered list.
- * java.util.List#move(int targetIndex, int sourceIndex)
- */
- 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.
- * java.util.List#move(int targetIndex, int sourceIndex, int length)
- */
- 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;
- }
-
- /**
- * Replace all occurrences of the specified old value with
- * the specified new value.
- * java.util.Arrays#replaceAll(Object[] array, Object oldValue, Object newValue)
- */
- 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.
- * java.util.Arrays#replaceAll(int[] array, int oldValue, int newValue)
- */
- 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.
- * java.util.Arrays#replaceAll(char[] array, char oldValue, char newValue)
- */
- 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;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified element removed.
- * java.util.Arrays#remove(Object[] array, Object value)
- */
- 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.
- * java.util.Arrays#remove(char[] array, char value)
- */
- 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.
- * java.util.Arrays#remove(int[] array, int value)
- */
- public static int[] remove(int[] array, int value) {
- return removeElementAtIndex(array, indexOf(array, value));
- }
-
- /**
- * Remove all the elements returned by the specified iterable
- * from the specified collection.
- * Return whether the collection changed as a result.
- * java.util.Collection#removeAll(java.lang.Iterable iterable)
- */
- 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.
- * java.util.Collection#removeAll(java.lang.Iterable iterable)
- */
- public static boolean removeAll(Collection<?> collection, Iterable<?> iterable, int size) {
- return removeAll(collection, iterable.iterator(), size);
- }
-
- /**
- * Remove all the elements returned by the specified iterator
- * from the specified collection.
- * Return whether the collection changed as a result.
- * java.util.Collection#removeAll(java.util.Iterator iterator)
- */
- 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.
- * java.util.Collection#removeAll(java.util.Iterator iterator)
- */
- public static boolean removeAll(Collection<?> collection, Iterator<?> iterator, int size) {
- return (iterator.hasNext()) ? collection.removeAll(set(iterator, size)) : false;
- }
-
- /**
- * Remove all the elements in the specified array
- * from the specified collection.
- * Return whether the collection changed as a result.
- * java.util.Collection#removeAll(Object[] array)
- */
- public static boolean removeAll(Collection<?> collection, Object[] array) {
- return collection.removeAll(set(array));
- }
-
- /**
- * Remove from the specified array all the elements in
- * the specified iterable and return the result.
- * java.util.Arrays#removeAll(Object[] array, Iterable iterable)
- */
- 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.
- * java.util.Arrays#removeAll(Object[] array, Iterable iterable)
- */
- public static <E> E[] removeAll(E[] array, Iterable<?> iterable, int size) {
- return removeAll(array, iterable.iterator(), size);
- }
-
- /**
- * Remove from the specified array all the elements in
- * the specified iterator and return the result.
- * java.util.Arrays#removeAll(Object[] array, Iterator iterator)
- */
- public static <E> E[] removeAll(E[] array, Iterator<?> iterator) {
- return (iterator.hasNext()) ? removeAll_(array, set(iterator)) : array;
- }
-
- /**
- * Remove from the specified array all the elements in
- * the specified iterator and return the result.
- * java.util.Arrays#removeAll(Object[] array, Iterator iterator)
- */
- public static <E> E[] removeAll(E[] array, Iterator<?> iterator, int size) {
- return (iterator.hasNext()) ? removeAll_(array, set(iterator, size)) : array;
- }
-
- /**
- * Remove from the specified array all the elements in
- * the specified collection and return the result.
- * java.util.Arrays#removeAll(Object[] array, Collection collection)
- */
- public static <E> E[] removeAll(E[] array, Collection<?> collection) {
- return (collection.isEmpty()) ? array : removeAll_(array, collection);
- }
-
- /**
- * assume the collection is non-empty
- */
- private static <E> E[] removeAll_(E[] array, Collection<?> collection) {
- int arrayLength = array.length;
- return (arrayLength == 0) ? array : removeAll(array, collection, arrayLength);
- }
-
- /**
- * assume the collection is non-empty and arrayLength > 0
- */
- private static <E> E[] removeAll(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; // 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.
- * java.util.Arrays#removeAll(Object[] array1, Object[] array2)
- */
- public static <E> E[] removeAll(E[] array1, Object[] array2) {
- // convert to a bag to take advantage of hashed look-up
- return (array2.length == 0) ? array1 : removeAll_(array1, set(array2));
- }
-
- /**
- * Remove from the first specified array all the elements in
- * the second specified array and return the result.
- * java.util.Arrays#removeAll(char[] array1, char[] array2)
- */
- 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.
- * java.util.Arrays#removeAll(int[] array1, int[] array2)
- */
- 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 of the specified element
- * from the specified collection.
- * Return whether the collection changed as a result.
- * java.util.Collection#removeAllOccurrences(Object value)
- */
- 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 from the specified array all occurrences of
- * the specified element and return the result.
- * java.util.Arrays#removeAllOccurrences(Object[] array, Object value)
- */
- 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.
- * java.util.Arrays#removeAllOccurrences(char[] array, char value)
- */
- 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.
- * java.util.Arrays#removeAllOccurrences(int[] array, int value)
- */
- 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;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified element removed.
- * java.util.Arrays#removeElementAtIndex(Object[] array, int index)
- */
- 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.
- * java.util.Arrays#removeElementAtIndex(char[] array, int index)
- */
- 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.
- * java.util.Arrays#removeElementAtIndex(int[] array, int index)
- */
- public static int[] removeElementAtIndex(int[] array, int index) {
- return removeElementsAtIndex(array, index, 1);
- }
-
- /**
- * Remove the elements at the specified index.
- * Return the removed elements.
- * java.util.List#remove(int index, int length)
- */
- 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;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified elements removed.
- * java.util.Arrays#removeElementsAtIndex(Object[] array, int index, int length)
- */
- public static <E> E[] removeElementsAtIndex(E[] array, int index, int length) {
- int arrayLength = array.length;
- int newLength = arrayLength - length;
- E[] result = newArray(array, newLength);
- if ((newLength == 0) && (index == 0)) {
- return result; // performance tweak
- }
- System.arraycopy(array, 0, result, 0, index);
- System.arraycopy(array, index + length, result, index, newLength - index);
- return result;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified elements removed.
- * java.util.Arrays#removeElementAtIndex(char[] array, int index, int length)
- */
- public static char[] removeElementsAtIndex(char[] array, int index, int length) {
- int arrayLength = array.length;
- int newLength = arrayLength - length;
- if ((newLength == 0) && (index == 0)) {
- return EMPTY_CHAR_ARRAY; // performance tweak
- }
- char[] result = new char[newLength];
- System.arraycopy(array, 0, result, 0, index);
- System.arraycopy(array, index + length, result, index, newLength - index);
- return result;
- }
- private static final char[] EMPTY_CHAR_ARRAY = new char[0];
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified elements removed.
- * java.util.Arrays#removeElementAtIndex(int[] array, int index, int length)
- */
- public static int[] removeElementsAtIndex(int[] array, int index, int length) {
- int arrayLength = array.length;
- int newLength = arrayLength - length;
- if ((newLength == 0) && (index == 0)) {
- return EMPTY_INT_ARRAY; // performance tweak
- }
- int[] result = new int[newLength];
- System.arraycopy(array, 0, result, 0, index);
- System.arraycopy(array, index + length, result, index, newLength - index);
- return result;
- }
- private static final int[] EMPTY_INT_ARRAY = new int[0];
-
- /**
- * 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 = list(array);
- return removeDuplicateElements(temp, len) ?
- temp.toArray(newArray(array, temp.size()))
- :
- array;
- }
-
- /**
- * 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
- */
- private static <E> boolean removeDuplicateElements(List<E> list, int size) {
- LinkedHashSet<E> temp = new LinkedHashSet<E>(size); // take advantage of hashed look-up
- boolean changed = false;
- for (E item : list) {
- if ( ! temp.add(item)) {
- changed = true; // duplicate item
- }
- }
- if (changed) {
- int i = 0;
- for (Iterator<E> stream = temp.iterator(); stream.hasNext(); ) {
- list.set(i, stream.next());
- i++;
- }
- int tempSize = temp.size();
- for (i = list.size(); i-- > tempSize; ) {
- list.remove(i); // pull off the end
- }
- }
- return changed;
- }
-
- /**
- * Retain only the elements in the specified iterable
- * in the specified collection.
- * Return whether the collection changed as a result.
- * java.util.Collection#retainAll(java.lang.Iterable iterable)
- */
- 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.
- * java.util.Collection#retainAll(java.lang.Iterable iterable)
- */
- public static boolean retainAll(Collection<?> collection, Iterable<?> iterable, int size) {
- return retainAll(collection, iterable.iterator(), size);
- }
-
- /**
- * Retain only the elements in the specified iterator
- * in the specified collection.
- * Return whether the collection changed as a result.
- * java.util.Collection#retainAll(java.util.Iterator iterator)
- */
- 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.
- * java.util.Collection#retainAll(java.util.Iterator iterator)
- */
- public static boolean retainAll(Collection<?> collection, Iterator<?> iterator, int size) {
- if (iterator.hasNext()) {
- return collection.retainAll(set(iterator, size));
- }
- 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.
- * java.util.Collection#retainAll(Object[] array)
- */
- 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;
- }
-
- /**
- * Retain in the specified array all the elements in
- * the specified iterable and return the result.
- * java.util.Arrays#retainAll(Object[] array, Iterable iterable)
- */
- 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.
- * java.util.Arrays#retainAll(Object[] array, Iterable iterable)
- */
- public static <E> E[] retainAll(E[] array, Iterable<?> iterable, int size) {
- int arrayLength = array.length;
- return (arrayLength == 0) ? array : retainAll(array, arrayLength, iterable.iterator(), size);
- }
-
- /**
- * Retain in the specified array all the elements in
- * the specified iterator and return the result.
- * java.util.Arrays#retainAll(Object[] array, Iterator iterator)
- */
- 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.
- * java.util.Arrays#retainAll(Object[] array, Iterator iterator)
- */
- public static <E> E[] retainAll(E[] array, Iterator<?> iterator, int size) {
- int arrayLength = array.length;
- return (arrayLength == 0) ? array : retainAll(array, arrayLength, iterator, size);
- }
-
- /**
- * assume arrayLength > 0
- */
- private static <E> E[] retainAll(E[] array, int arrayLength, Iterator<?> iterator) {
- return (iterator.hasNext()) ?
- retainAll_(array, set(iterator), arrayLength)
- :
- newArray(array, 0);
- }
-
- /**
- * assume arrayLength > 0
- */
- private static <E> E[] retainAll(E[] array, int arrayLength, Iterator<?> iterator, int iteratorSize) {
- return (iterator.hasNext()) ?
- retainAll_(array, set(iterator, iteratorSize), arrayLength)
- :
- newArray(array, 0);
- }
-
- /**
- * Retain in the specified array all the elements in
- * the specified collection and return the result.
- * java.util.Arrays#retainAll(Object[] array, Collection collection)
- */
- public static <E> E[] retainAll(E[] array, Collection<?> collection) {
- int arrayLength = array.length;
- return (arrayLength == 0) ? array : retainAll(array, collection, arrayLength);
- }
-
- /**
- * assume arrayLength > 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 arrayLength > 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.
- * java.util.Arrays#retainAll(Object[] array1, Object[] array2)
- */
- public static <E> E[] retainAll(E[] array1, Object[] array2) {
- int array1Length = array1.length;
- return (array2.length == 0) ?
- (array1Length == 0) ? array1 : newArray(array1, 0)
- :
- retainAll(array1, set(array2), array1Length);
- }
-
- /**
- * Remove from the first specified array all the elements in
- * the second specified array and return the result.
- * java.util.Arrays#retainAll(char[] array1, char[] array2)
- */
- public static char[] retainAll(char[] array1, char[] array2) {
- int array1Length = array1.length;
- return (array1Length == 0) ? array1 : retainAll(array1, array2, array1Length);
- }
-
- /**
- * assume array1Length > 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 array1Length > 0 and array2Length > 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.
- * java.util.Arrays#retainAll(int[] array1, int[] array2)
- */
- public static int[] retainAll(int[] array1, int[] array2) {
- int array1Length = array1.length;
- return (array1Length == 0) ? array1 : retainAll(array1, array2, array1Length);
- }
-
- /**
- * assume array1Length > 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 array1Length > 0 and array2Length > 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;
- }
-
- /**
- * Return the array reversed.
- * java.util.Arrays.reverse(Object[] array)
- */
- public static <E> E[] reverse(E... array) {
- int len = array.length;
- for (int i = 0, mid = len >> 1, j = len - 1; i < mid; i++, j--) {
- swap(array, i, j);
- }
- return array;
- }
-
- /**
- * Return the array reversed.
- * java.util.Arrays.reverse(char[] array)
- */
- public static char[] reverse(char... array) {
- int len = array.length;
- for (int i = 0, mid = len >> 1, j = len - 1; i < mid; i++, j--) {
- swap(array, i, j);
- }
- return array;
- }
-
- /**
- * Return the array reversed.
- * java.util.Arrays.reverse(int[] array)
- */
- public static int[] reverse(int... array) {
- int len = array.length;
- for (int i = 0, mid = len >> 1, j = len - 1; i < mid; i++, j--) {
- swap(array, i, j);
- }
- return array;
- }
-
- /**
- * Return a list with entries in reverse order from those
- * returned by the specified iterable.
- */
- public static <E> List<E> reverseList(Iterable<? extends E> iterable) {
- return reverse(list(iterable));
- }
-
- /**
- * Return a list with entries in reverse order from those
- * returned by the specified iterable.
- */
- public static <E> List<E> reverseList(Iterable<? extends E> iterable, int size) {
- return reverse(list(iterable, size));
- }
-
- /**
- * Return a list with entries in reverse order from those
- * returned by the specified iterator.
- */
- 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.
- */
- public static <E> List<E> reverseList(Iterator<? extends E> iterator, int size) {
- return reverse(list(iterator, size));
- }
-
- /**
- * Return the rotated array after rotating it one position.
- * java.util.Arrays.rotate(Object[] array)
- */
- public static <E> E[] rotate(E... array) {
- return rotate(array, 1);
- }
-
- /**
- * Return the rotated array after rotating it the specified distance.
- * java.util.Arrays.rotate(Object[] array, int distance)
- */
- 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.
- * java.util.Arrays.rotate(char[] array)
- */
- public static char[] rotate(char... array) {
- return rotate(array, 1);
- }
-
- /**
- * Return the rotated array after rotating it the specified distance.
- * java.util.Arrays.rotate(char[] array, int distance)
- */
- 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.
- * java.util.Arrays.rotate(int[] array)
- */
- public static int[] rotate(int... array) {
- return rotate(array, 1);
- }
-
- /**
- * Return the rotated array after rotating it the specified distance.
- * java.util.Arrays.rotate(int[] array, int distance)
- */
- 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;
- }
-
- /**
- * Return a set corresponding to the specified iterable.
- * java.util.HashSet(java.lang.Iterable iterable)
- */
- public static <E> HashSet<E> set(Iterable<? extends E> iterable) {
- return set(iterable.iterator());
- }
-
- /**
- * Return a set corresponding to the specified iterable.
- * java.util.HashSet(java.lang.Iterable iterable)
- */
- public static <E> HashSet<E> set(Iterable<? extends E> iterable, int size) {
- return set(iterable.iterator(), size);
- }
-
- /**
- * Return a set corresponding to the specified iterator.
- * java.util.HashSet(java.util.Iterator iterator)
- */
- public static <E> HashSet<E> set(Iterator<? extends E> iterator) {
- return set(iterator, new HashSet<E>());
- }
-
- /**
- * Return a set corresponding to the specified iterator.
- * java.util.HashSet(java.util.Iterator iterator)
- */
- public static <E> HashSet<E> set(Iterator<? extends E> iterator, int size) {
- return set(iterator, new HashSet<E>(size));
- }
-
- 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.
- * java.util.HashSet(Object[] array)
- */
- public static <E> HashSet<E> set(E... array) {
- HashSet<E> set = new HashSet<E>(array.length);
- for (E item : array) {
- set.add(item);
- }
- return set;
- }
-
- private static final Random RANDOM = new Random();
-
- /**
- * Return the array after "shuffling" it.
- * java.util.Arrays#shuffle(Object[] array)
- */
- public static <E> E[] shuffle(E... array) {
- return shuffle(array, RANDOM);
- }
-
- /**
- * Return the array after "shuffling" it.
- * java.util.Arrays#shuffle(Object[] array, Random r)
- */
- 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.
- * java.util.Arrays#shuffle(char[] array)
- */
- public static char[] shuffle(char... array) {
- return shuffle(array, RANDOM);
- }
-
- /**
- * Return the array after "shuffling" it.
- * java.util.Arrays#shuffle(char[] array, Random r)
- */
- 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.
- * java.util.Arrays#shuffle(int[] array)
- */
- public static int[] shuffle(int... array) {
- return shuffle(array, RANDOM);
- }
-
- /**
- * Return the array after "shuffling" it.
- * java.util.Arrays#shuffle(int[] array, Random r)
- */
- 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;
- }
-
- /**
- * Return an iterator that returns only the single,
- * specified object.
- * Object#toIterator() ?!
- */
- public static <E> Iterator<E> singletonIterator(E value) {
- return new SingleElementIterator<E>(value);
- }
-
- /**
- * Return the number of elements returned by the specified iterable.
- * java.lang.Iterable#size()
- */
- public static int size(Iterable<?> iterable) {
- return size(iterable.iterator());
- }
-
- /**
- * Return the number of elements returned by the specified iterator.
- * java.util.Iterator#size()
- */
- public static int size(Iterator<?> iterator) {
- int size = 0;
- while (iterator.hasNext()) {
- iterator.next();
- size++;
- }
- return size;
- }
-
- /**
- * Return a sorted set corresponding to the specified iterable.
- * java.util.TreeSet(java.lang.Iterable iterable)
- */
- public static <E extends Comparable<? super E>> TreeSet<E> sortedSet(Iterable<? extends E> iterable) {
- return sortedSet(iterable, null);
- }
-
- /**
- * Return a sorted set corresponding to the specified iterable.
- * java.util.TreeSet(java.lang.Iterable iterable)
- */
- public static <E extends Comparable<? super E>> TreeSet<E> sortedSet(Iterable<? extends E> iterable, int size) {
- return sortedSet(iterable, size, null);
- }
-
- /**
- * Return a sorted set corresponding to the specified iterable
- * and comparator.
- * java.util.TreeSet(java.lang.Iterable iterable, java.util.Comparator c)
- */
- 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.
- * java.util.TreeSet(java.lang.Iterable iterable, java.util.Comparator c)
- */
- public static <E> TreeSet<E> sortedSet(Iterable<? extends E> iterable, int size, Comparator<? super E> comparator) {
- return sortedSet(iterable.iterator(), size, comparator);
- }
-
- /**
- * Return a sorted set corresponding to the specified iterator.
- * java.util.TreeSet(java.util.Iterator iterator)
- */
- 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.
- * java.util.TreeSet(java.util.Iterator iterator)
- */
- public static <E extends Comparable<? super E>> TreeSet<E> sortedSet(Iterator<? extends E> iterator, int size) {
- return sortedSet(iterator, size, null);
- }
-
- /**
- * Return a sorted set corresponding to the specified iterator
- * and comparator.
- * java.util.TreeSet(java.util.Iterator iterator, java.util.Comparator c)
- */
- 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.
- * java.util.TreeSet(java.util.Iterator iterator, java.util.Comparator c)
- */
- public static <E> TreeSet<E> sortedSet(Iterator<? extends E> iterator, int size, Comparator<? super E> comparator) {
- return sortedSet(list(iterator, size), 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.
- * java.util.TreeSet(Object[] array)
- */
- 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.
- * java.util.TreeSet(Object[] array, java.util.Comparator c)
- */
- 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;
- }
-
- /**
- * Return a sub-array of the specified array, starting at the specified
- * position with the specified length.
- * java.util.Arrays#subArray(E[] array, int start, int length)
- */
- public static <E> E[] subArray(E[] array, int start, int length) {
- E[] result = newArray(array, length);
- if (length > 0) {
- System.arraycopy(array, start, result, 0, length);
- }
- return result;
- }
-
- /**
- * Return a sub-array of the specified array, starting at the specified
- * position with the specified length.
- * java.util.Arrays#subArray(int[] array, int start, int length)
- */
- public static int[] subArray(int[] array, int start, int length) {
- int[] result = new int[length];
- if (length > 0) {
- System.arraycopy(array, start, result, 0, length);
- }
- return result;
- }
-
- /**
- * Return a sub-array of the specified array, starting at the specified
- * position with the specified length.
- * java.util.Arrays#subArray(char[] array, int start, int length)
- */
- public static char[] subArray(char[] array, int start, int length) {
- char[] result = new char[length];
- if (length > 0) {
- System.arraycopy(array, start, result, 0, length);
- }
- return result;
- }
-
- /**
- * Return the array after the specified elements have been "swapped".
- * java.util.Arrays#swap(Object[] array, int i, int j)
- */
- public 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".
- * java.util.Arrays#swap(char[] array, int i, int j)
- */
- public 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".
- * java.util.Arrays#swap(int[] array, int i, int j)
- */
- public static int[] swap(int[] array, int i, int j) {
- int temp = array[i];
- array[i] = array[j];
- array[j] = temp;
- return array;
- }
-
- /**
- * Return a vector corresponding to the specified iterable.
- * This is useful for legacy code that requires a java.util.Vector.
- * java.util.Vector(java.lang.Iterable iterable)
- */
- 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 java.util.Vector.
- * java.util.Vector(java.lang.Iterable iterable)
- */
- 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 java.util.Vector.
- * java.util.Vector(java.util.Iterator iterator)
- */
- 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 java.util.Vector.
- * java.util.Vector(java.util.Iterator iterator)
- */
- 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 java.util.Vector.
- * java.util.Vector(Object[] array)
- */
- 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 **********
-
- /**
- * 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 GenericIteratorWrapper<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 java.util.Collections#copy(java.util.List, java.util.List)
- */
- public static <E> List<? super E> copy(List<? super E> dest, List<? extends E> src) {
- Collections.copy(dest, src);
- return dest;
- }
-
- /**
- * Return the list after it has been "filled".
- * @see java.util.Collections#fill(java.util.List, java.lang.Object)
- */
- public static <E> List<? super E> fill(List<? super E> list, E value) {
- Collections.fill(list, value);
- return list;
- }
-
- /**
- * Return the list after it has been "reversed".
- * @see java.util.Collections#reverse(java.util.List)
- */
- public static <E> List<E> reverse(List<E> list) {
- Collections.reverse(list);
- return list;
- }
-
- /**
- * Return the list after it has been "rotated" by one position.
- * @see java.util.Collections#rotate(java.util.List, int)
- */
- public static <E> List<E> rotate(List<E> list) {
- return rotate(list, 1);
- }
-
- /**
- * Return the list after it has been "rotated".
- * @see java.util.Collections#rotate(java.util.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 java.util.Collections#shuffle(java.util.List)
- */
- public static <E> List<E> shuffle(List<E> list) {
- Collections.shuffle(list);
- return list;
- }
-
- /**
- * Return the list after it has been "shuffled".
- * @see java.util.Collections#shuffle(java.util.List, java.util.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".
- * @see java.util.Collections#sort(java.util.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".
- * @see java.util.Collections#sort(java.util.List, java.util.Comparator)
- */
- public static <E> List<E> sort(List<E> list, Comparator<? super E> comparator) {
- Collections.sort(list, comparator);
- return list;
- }
-
- /**
- * Return the iterable after it has been "sorted".
- */
- public static <E extends Comparable<? super E>> Iterable<E> sort(Iterable<E> iterable) {
- return sort(iterable, null);
- }
-
- /**
- * Return the iterable after it has been "sorted".
- */
- public static <E> Iterable<E> sort(Iterable<E> iterable, Comparator<? super E> comparator) {
- return sort(list(iterable), comparator);
- }
-
- /**
- * Return the iterator after it has been "sorted".
- */
- public static <E extends Comparable<? super E>> Iterator<E> sort(Iterator<? extends E> iterator) {
- return sort(iterator, null);
- }
-
- /**
- * Return the iterator after it has been "sorted".
- */
- public static <E> Iterator<E> sort(Iterator<? extends E> iterator, Comparator<? super E> comparator) {
- return sort(list(iterator), comparator).iterator();
- }
-
- /**
- * Return the list after the specified elements have been "swapped".
- * @see java.util.Collections#swap(java.util.List, int, int)
- */
- public static <E> List<E> swap(List<E> list, int i, int j) {
- Collections.swap(list, i, j);
- return list;
- }
-
-
- // ********** java.util.Arrays enhancements **********
-
- /**
- * Return the array after it has been "filled".
- * @see java.util.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 java.util.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 java.util.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 java.util.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 java.util.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 java.util.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 java.util.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 java.util.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 java.util.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 java.util.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 java.util.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 java.util.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 java.util.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 java.util.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 java.util.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 java.util.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 java.util.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 java.util.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 java.util.Arrays#sort(byte[])
- */
- public static byte[] sort(byte... array) {
- Arrays.sort(array);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.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 java.util.Arrays#sort(char[])
- */
- public static char[] sort(char... array) {
- Arrays.sort(array);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.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 java.util.Arrays#sort(double[])
- */
- public static double[] sort(double... array) {
- Arrays.sort(array);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.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 java.util.Arrays#sort(float[])
- */
- public static float[] sort(float... array) {
- Arrays.sort(array);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.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 java.util.Arrays#sort(int[])
- */
- public static int[] sort(int... array) {
- Arrays.sort(array);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.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 java.util.Arrays#sort(Object[])
- */
- public static <E> E[] sort(E... array) {
- Arrays.sort(array);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.Arrays#sort(Object[], java.util.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 java.util.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 java.util.Arrays#sort(Object[], int, int, java.util.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 java.util.Arrays#sort(long[])
- */
- public static long[] sort(long... array) {
- Arrays.sort(array);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.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 java.util.Arrays#sort(short[])
- */
- public static short[] sort(short... array) {
- Arrays.sort(array);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.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 CollectionTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Counter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Counter.java
deleted file mode 100644
index fbe3cde738..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Counter.java
+++ /dev/null
@@ -1,109 +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;
-
-import java.io.Serializable;
-
-/**
- * This class can be used wherever a mutable integer object is needed.
- * It is a cross between an int and an Integer. It can be stored in a standard
- * container (e.g. Collection) but can be modified.
- */
-public final class Counter
- implements Cloneable, Serializable
-{
- private int count = 0;
-
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Construct a counter with the specified initial value.
- */
- public Counter(int count) {
- super();
- this.count = count;
- }
-
- /**
- * Construct a counter with an initial value of zero.
- */
- public Counter() {
- this(0);
- }
-
- /**
- * Return the current count of the counter.
- */
- public synchronized int count() {
- return this.count;
- }
-
- /**
- * Increment and return the current count of the counter.
- */
- public synchronized int increment() {
- return ++this.count;
- }
-
- /**
- * Increment and return the current count of the counter.
- */
- public synchronized int increment(int increment) {
- return this.count += increment;
- }
-
- /**
- * Derement and return the current count of the counter.
- */
- public synchronized int decrement() {
- return --this.count;
- }
-
- /**
- * Derement and return the current count of the counter.
- */
- public synchronized int decrement(int decrement) {
- return this.count -= decrement;
- }
-
- @Override
- public synchronized boolean equals(Object o) {
- if ( ! (o instanceof Counter)) {
- return false;
- }
- return this.count == ((Counter) o).count;
- }
-
- @Override
- public synchronized int hashCode() {
- return this.count;
- }
-
- @Override
- public synchronized Object clone() {
- try {
- return super.clone();
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- @Override
- public synchronized String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append(ClassTools.shortClassNameForObject(this));
- sb.append('(');
- sb.append(this.count);
- sb.append(')');
- return sb.toString();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/EmptyIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/EmptyIterable.java
deleted file mode 100644
index 1f90f3d4f0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/EmptyIterable.java
+++ /dev/null
@@ -1,50 +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 java.util.Iterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-/**
- * An <code>EmptyIterable</code> is just that.
- */
-public final class EmptyIterable<E>
- implements Iterable<E>
-{
-
- // singleton
- @SuppressWarnings("unchecked")
- private static final EmptyIterable 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 StringTools.buildToStringFor(this);
- }
-
-}
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 44154c4ed5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/FileTools.java
+++ /dev/null
@@ -1,1006 +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.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");
- public static final String USER_TEMPORARY_DIRECTORY_NAME = System.getProperty("java.io.tmpdir");
- public static String DEFAULT_TEMPORARY_DIRECTORY_NAME = "tmpdir";
- public static final String CURRENT_WORKING_DIRECTORY_NAME = System.getProperty("user.dir");
-
- /** 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. */
- 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());
- }
- }
-
- /**
- * 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());
- }
- }
- }
- }
-
-
- // ********** 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());
- destinationFile.createNewFile();
- 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, 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, 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 "";
- }
- 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 {
- dir.mkdirs();
- }
- return dir;
- }
-
- /**
- * 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()) {
- dir.mkdirs();
- }
- 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(".")) {
- 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("/")) {
- 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 (CollectionTools.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 (CollectionTools.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) {
- if (executingOnWindows()) {
- return CollectionTools.contains(WINDOWS_RESERVED_FILE_NAMES, fileName.toLowerCase());
- }
- return false; // Unix does not have any "reserved" file names (I think...)
- }
-
- /**
- * 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, "...");
- }
-
- 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 **********
-
- private static boolean executingOnWindows() {
- return executingOn("Windows");
- }
-
-// private static boolean executingOnLinux() {
-// return executingOn("Linux");
-// }
-//
- private static boolean executingOn(String osName) {
- return System.getProperty("os.name").indexOf(osName) != -1;
- }
-
- /**
- * 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, 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(".");
- }
-
- 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);
- }
- File result = new File("..");
- for (int i = len - 1; i-- > 0; ) {
- result = new File(result, "..");
- }
- 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 ccf3c54d2f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/HashBag.java
+++ /dev/null
@@ -1,914 +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.AbstractCollection;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.ConcurrentModificationException;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-/**
- * This class implements the <code>Bag</code> 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 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 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>
- * <b>Note that this implementation is not synchronized.</b> If multiple
- * threads access a bag concurrently, and at least one of the threads modifies
- * the bag, it <i>must</i> 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
- * <i>fail-fast</i>: 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 <code>ConcurrentModificationException</code>.
- * 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.
- *
- * @see Collections#synchronizedCollection(Collection)
- */
-public class HashBag<E>
- extends AbstractCollection<E>
- implements Bag<E>, Cloneable, Serializable
-{
-
- /** The hash table. */
- transient Entry<E>[] table;
-
- /** The total number of entries in the bag. */
- transient int count = 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 (int)(capacity * loadFactor).)
- *
- * @serial
- */
- private int threshold;
-
- /**
- * The load factor for the hash table.
- *
- * @serial
- */
- private 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;
-
- /**
- * Constructs a new, empty bag with the
- * default capacity, which is 11, and load factor, which is 0.75.
- */
- public HashBag() {
- this(11, 0.75f);
- }
-
- /**
- * Constructs a new, empty bag with the specified initial capacity
- * and default load factor, which is 0.75.
- *
- * @param initialCapacity the initial capacity of the backing map.
- * @throws IllegalArgumentException if the initial capacity is less
- * than zero.
- */
- public HashBag(int initialCapacity) {
- this(initialCapacity, 0.75f);
- }
-
- /**
- * Constructs a new, empty bag with
- * the specified initial capacity and the specified load factor.
- *
- * @param initialCapacity the initial capacity of the backing map.
- * @param loadFactor the load factor of the backing map.
- * @throws IllegalArgumentException if the initial capacity is less
- * than zero, or if the load factor is nonpositive.
- */
- public HashBag(int initialCapacity, float loadFactor) {
- if (initialCapacity < 0) {
- throw new IllegalArgumentException("Illegal Initial Capacity: " + initialCapacity);
- }
- if (loadFactor <= 0 || Float.isNaN(loadFactor)) {
- throw new IllegalArgumentException("Illegal Load factor: " + loadFactor);
- }
- if (initialCapacity == 0) {
- initialCapacity = 1;
- }
- this.loadFactor = loadFactor;
- this.table = this.buildTable(initialCapacity);
- this.threshold = (int) (initialCapacity * loadFactor);
- }
-
- /**
- * Constructs a new bag containing the elements in the specified
- * collection. The capacity of the bag is
- * twice the size of the specified collection or 11 (whichever is
- * greater), and the default load factor, which is 0.75, is used.
- *
- * @param c the collection whose elements are to be placed into this bag.
- */
- public HashBag(Collection<? extends E> c) {
- this(Math.max(2*c.size(), 11));
- this.addAll(c);
- }
-
- /**
- * This implementation simply returns the maintained count.
- */
- @Override
- public int size() {
- return this.count;
- }
-
- /**
- * This implementation simply compares the maintained count to zero.
- */
- @Override
- public boolean isEmpty() {
- return this.count == 0;
- }
-
- /**
- * 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 contains(Object o) {
- Entry<E>[] tab = this.table;
- if (o == null) {
- for (Entry<E> e = tab[0]; e != null; e = e.next) {
- if (e.object == null) {
- return true;
- }
- }
- } else {
- int hash = o.hashCode();
- int index = (hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[index]; e != null; e = e.next) {
- if ((e.hash == hash) && o.equals(e.object)) {
- return true;
- }
- }
- }
- return false;
- }
-
- public int count(Object o) {
- Entry<E>[] tab = this.table;
- if (o == null) {
- for (Entry<E> e = tab[0]; e != null; e = e.next) {
- if (e.object == null) {
- return e.count;
- }
- }
- } else {
- int hash = o.hashCode();
- int index = (hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[index]; e != null; e = e.next) {
- if ((e.hash == hash) && o.equals(e.object)) {
- return e.count;
- }
- }
- }
- return 0;
- }
-
- /**
- * Rehashes the contents of this bag into a new hash table
- * with a larger capacity. This method is called when the
- * number of different elements in this map exceeds its
- * capacity and load factor.
- */
- private void rehash() {
- Entry<E>[] oldMap = this.table;
- int oldCapacity = oldMap.length;
-
- int newCapacity = oldCapacity * 2 + 1;
- Entry<E>[] newTable = this.buildTable(newCapacity);
-
- this.modCount++;
- this.threshold = (int) (newCapacity * this.loadFactor);
- this.table = newTable;
-
- for (int i = oldCapacity; i-- > 0; ) {
- for (Entry<E> old = oldMap[i]; old != null; ) {
- Entry<E> e = old;
- old = old.next;
-
- int index = (e.hash & 0x7FFFFFFF) % newCapacity;
- e.next = newTable[index];
- newTable[index] = e;
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- private Entry<E>[] buildTable(int capacity) {
- return new Entry[capacity];
- }
-
- @SuppressWarnings("unchecked")
- private <T> Entry<E> buildEntry(int hash, Object o, Entry<T> next) {
- return new Entry(hash, o, next);
- }
-
- @SuppressWarnings("unchecked")
- private <T> Entry<E> buildEntry(int hash, Object o, int cnt, Entry<T> next) {
- return new Entry(hash, o, cnt, 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 add(E o) {
- this.modCount++;
- Entry<E>[] tab = this.table;
- int hash = 0;
- int index = 0;
-
- // if the object is already in the bag, simply bump its count
- if (o == null) {
- for (Entry<E> e = tab[0]; e != null; e = e.next) {
- if (e.object == null) {
- e.count++;
- this.count++;
- return true;
- }
- }
- } else {
- hash = o.hashCode();
- index = (hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[index]; e != null; e = e.next) {
- if ((e.hash == hash) && o.equals(e.object)) {
- e.count++;
- this.count++;
- return true;
- }
- }
- }
-
- // rehash the table if the threshold is exceeded
- if (this.uniqueCount >= this.threshold) {
- this.rehash();
- tab = this.table;
- index = (hash & 0x7FFFFFFF) % tab.length;
- }
-
- // create the new entry and put it in the table
- Entry<E> e = this.buildEntry(hash, o, tab[index]);
- tab[index] = e;
- this.count++;
- this.uniqueCount++;
- return true;
- }
-
- /**
- * 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++;
- Entry<E>[] tab = this.table;
- int hash = 0;
- int index = 0;
-
- // if the object is already in the bag, simply bump its count
- if (o == null) {
- for (Entry<E> e = tab[0]; e != null; e = e.next) {
- if (e.object == null) {
- e.count += cnt;
- this.count += cnt;
- return true;
- }
- }
- } else {
- hash = o.hashCode();
- index = (hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[index]; e != null; e = e.next) {
- if ((e.hash == hash) && o.equals(e.object)) {
- e.count += cnt;
- this.count += cnt;
- return true;
- }
- }
- }
-
- // rehash the table if the threshold is exceeded
- if (this.uniqueCount >= this.threshold) {
- this.rehash();
- tab = this.table;
- index = (hash & 0x7FFFFFFF) % tab.length;
- }
-
- // create the new entry and put it in the table
- Entry<E> e = this.buildEntry(hash, o, cnt, tab[index]);
- tab[index] = e;
- this.count += cnt;
- this.uniqueCount++;
- return true;
- }
-
- /**
- * 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) {
- Entry<E>[] tab = this.table;
- if (o == null) {
- for (Entry<E> e = tab[0], prev = null; e != null; prev = e, e = e.next) {
- if (e.object == null) {
- this.modCount++;
- e.count--;
- // if we are removing the last one, remove the entry from the table
- if (e.count == 0) {
- if (prev == null) {
- tab[0] = e.next;
- } else {
- prev.next = e.next;
- }
- this.uniqueCount--;
- }
- this.count--;
- return true;
- }
- }
- } else {
- int hash = o.hashCode();
- int index = (hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[index], prev = null; e != null; prev = e, e = e.next) {
- if ((e.hash == hash) && o.equals(e.object)) {
- this.modCount++;
- e.count--;
- // if we are removing the last one, remove the entry from the table
- if (e.count == 0) {
- if (prev == null) {
- tab[index] = e.next;
- } else {
- prev.next = e.next;
- }
- this.uniqueCount--;
- }
- this.count--;
- return true;
- }
- }
- }
-
- return false;
- }
-
- /**
- * 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;
- }
- Entry<E>[] tab = this.table;
- if (o == null) {
- for (Entry<E> e = tab[0], prev = null; e != null; prev = e, e = e.next) {
- if (e.object == null) {
- this.modCount++;
- int cnt2 = (cnt < e.count) ? cnt : e.count;
- e.count -= cnt2;
- // if we are removing the last element(s), remove the entry from the table
- if (e.count == 0) {
- if (prev == null) {
- tab[0] = e.next;
- } else {
- prev.next = e.next;
- }
- this.uniqueCount--;
- }
- this.count -= cnt2;
- return true;
- }
- }
- } else {
- int hash = o.hashCode();
- int index = (hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[index], prev = null; e != null; prev = e, e = e.next) {
- if ((e.hash == hash) && o.equals(e.object)) {
- this.modCount++;
- int cnt2 = (cnt < e.count) ? cnt : e.count;
- e.count -= cnt2;
- // if we are removing the last element(s), remove the entry from the table
- if (e.count == 0) {
- if (prev == null) {
- tab[index] = e.next;
- } else {
- prev.next = e.next;
- }
- this.uniqueCount--;
- }
- this.count -= cnt2;
- 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.count = 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);
- for (int i = this.table.length; i-- > 0; ) {
- clone.table[i] = (this.table[i] == null)
- ? null : (Entry<E>) this.table[i].clone();
- }
- clone.modCount = 0;
- return clone;
- } catch (CloneNotSupportedException e) {
- throw new InternalError();
- }
- }
-
-
- /**
- * Hash table collision list entry.
- */
- private static class Entry<E> implements Bag.Entry<E> {
- int hash;
- E object;
- int count;
- Entry<E> next;
-
- Entry(int hash, E object, Entry<E> next) {
- this(hash, object, 1, next);
- }
-
- Entry(int hash, E object, int count, Entry<E> next) {
- this.hash = hash;
- this.object = object;
- this.count = count;
- this.next = next;
- }
-
- /**
- * Cascade the clone to all the entries in the same bucket.
- */
- @Override
- @SuppressWarnings("unchecked")
- protected Entry<E> clone() {
- return new Entry(this.hash, this.object, this.count,
- (this.next == null ? null : this.next.clone()));
- }
-
- // ***** 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);
- }
- int old = this.count;
- this.count = count;
- return old;
- }
-
- @Override
- public boolean equals(Object o) {
- if ( ! (o instanceof Bag.Entry)) {
- return false;
- }
- @SuppressWarnings("unchecked")
- Bag.Entry e = (Bag.Entry) o;
- if (this.count != e.getCount()) {
- return false;
- }
- Object o1 = this.object;
- Object o2 = e.getElement();
- if (o1 == o2) {
- return true;
- }
- if (o1 == null) {
- return false;
- }
- return o1.equals(o2);
- }
-
- @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;
- }
- }
-
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterator<E> iterator() {
- return (this.count == 0) ? EMPTY_ITERATOR : new HashIterator();
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<E> uniqueIterator() {
- return (this.count == 0) ? EMPTY_ITERATOR : new UniqueIterator();
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<Bag.Entry<E>> entries() {
- return (this.count == 0) ? EMPTY_ITERATOR : new EntryIterator();
- }
-
-
- /**
- * Empty iterator that does just about nothing.
- */
- @SuppressWarnings("unchecked")
- private static final Iterator EMPTY_ITERATOR = new EmptyIterator();
-
- @SuppressWarnings("unchecked")
- 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 Entry<E>[] localTable = HashBag.this.table;
- private int index = this.localTable.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 = this.localTable;
- // 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 = this.localTable;
- // 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();
- }
- Entry<E>[] tab = this.localTable;
- int slot = (this.lastReturnedEntry.hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[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) {
- tab[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.count--;
- this.lastReturnedEntry = null; // it cannot be removed again
- return;
- }
- }
- throw new ConcurrentModificationException();
- }
-
- }
-
-
- private class EntryIterator implements Iterator<Entry<E>> {
- private Entry<E>[] localTable = HashBag.this.table;
- private int index = this.localTable.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 = this.localTable;
- // 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 = this.localTable;
- // 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();
- }
- Entry<E>[] tab = this.localTable;
- int slot = (this.lastReturnedEntry.hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[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) {
- tab[slot] = e.next;
- } else {
- prev.next = e.next;
- }
- HashBag.this.uniqueCount--;
- HashBag.this.count -= 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;
- }
- Bag<E> clone = this.clone();
- for (E e : b) {
- if ( ! clone.remove(e)) {
- return false;
- }
- }
- return clone.isEmpty();
- }
-
- @Override
- public int hashCode() {
- int h = 0;
- for (Iterator<E> stream = this.iterator(); stream.hasNext(); ) {
- Object next = stream.next();
- if (next != null) {
- h += next.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 synchronized 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);
-
- Entry<E>[] tab = this.table;
- // write out elements and counts (alternating)
- for (Entry<E> entry : tab) {
- 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 synchronized 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 d56f521cac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IdentityHashBag.java
+++ /dev/null
@@ -1,879 +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;
-
-import java.io.Serializable;
-import java.util.AbstractCollection;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.ConcurrentModificationException;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-/**
- * This class implements the <code>Bag</code> 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>k1</code> and <code>k2</code> are considered
- * equal if and only if <code>(k1 == k2)</code>. (In normal <code>Bag</code>
- * implementations (like <code>HashBag</code>) two objects <code>k1</code>
- * and <code>k2</code> are considered equal if and only if
- * <code>(k1 == null ? k2 == null : k1.equals(k2))</code>.)
- * <p>
- * <b>
- * This class is <i>not</i> a general-purpose <code>Bag</code>
- * implementation! While this class implements the <code>Bag</code> interface, it
- * intentionally violates <code>Bag's</code> 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.
- * </b>
- * <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>
- * <b>Note that this implementation is not synchronized.</b> If multiple
- * threads access a bag concurrently, and at least one of the threads modifies
- * the bag, it <i>must</i> 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
- * <i>fail-fast</i>: 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 <code>ConcurrentModificationException</code>.
- * 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.
- *
- * @see Collections#synchronizedCollection(Collection)
- */
-
-public class IdentityHashBag<E>
- extends AbstractCollection<E>
- implements Bag<E>, Cloneable, Serializable
-{
-
- /** The hash table. */
- transient Entry<E>[] table;
-
- /** The total number of entries in the bag. */
- transient int count = 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 (int)(capacity * loadFactor).)
- *
- * @serial
- */
- private int threshold;
-
- /**
- * The load factor for the hash table.
- *
- * @serial
- */
- private 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;
-
- /**
- * Constructs a new, empty bag with the
- * default capacity, which is 11, and load factor, which is 0.75.
- */
- public IdentityHashBag() {
- this(11, 0.75f);
- }
-
- /**
- * Constructs a new, empty bag with the specified initial capacity
- * and default load factor, which is 0.75.
- *
- * @param initialCapacity the initial capacity of the backing map.
- * @throws IllegalArgumentException if the initial capacity is less
- * than zero.
- */
- public IdentityHashBag(int initialCapacity) {
- this(initialCapacity, 0.75f);
- }
-
- /**
- * Constructs a new, empty bag with
- * the specified initial capacity and the specified load factor.
- *
- * @param initialCapacity the initial capacity of the backing map.
- * @param loadFactor the load factor of the backing map.
- * @throws IllegalArgumentException if the initial capacity is less
- * than zero, or if the load factor is nonpositive.
- */
- public IdentityHashBag(int initialCapacity, float loadFactor) {
- if (initialCapacity < 0) {
- throw new IllegalArgumentException("Illegal Initial Capacity: " + initialCapacity);
- }
- if (loadFactor <= 0 || Float.isNaN(loadFactor)) {
- throw new IllegalArgumentException("Illegal Load factor: " + loadFactor);
- }
- if (initialCapacity == 0) {
- initialCapacity = 1;
- }
- this.loadFactor = loadFactor;
- this.table = this.buildTable(initialCapacity);
- this.threshold = (int) (initialCapacity * loadFactor);
- }
-
- /**
- * Constructs a new bag containing the elements in the specified
- * collection. The capacity of the bag is
- * twice the size of the specified collection or 11 (whichever is
- * greater), and the default load factor, which is 0.75, is used.
- *
- * @param c the collection whose elements are to be placed into this bag.
- */
- public IdentityHashBag(Collection<? extends E> c) {
- this(Math.max(2*c.size(), 11));
- this.addAll(c);
- }
-
- /**
- * This implementation simply returns the maintained count.
- */
- @Override
- public int size() {
- return this.count;
- }
-
- /**
- * This implementation simply compares the maintained count to zero.
- */
- @Override
- public boolean isEmpty() {
- return this.count == 0;
- }
-
- /**
- * 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 contains(Object o) {
- Entry<E>[] tab = this.table;
- int hash = System.identityHashCode(o);
- int index = (hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[index]; e != null; e = e.next) {
- if ((e.hash == hash) && (e.object == o)) {
- return true;
- }
- }
- return false;
- }
-
- public int count(Object o) {
- Entry<E>[] tab = this.table;
- int hash = System.identityHashCode(o);
- int index = (hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[index]; e != null; e = e.next) {
- if ((e.hash == hash) && (e.object == o)) {
- return e.count;
- }
- }
- return 0;
- }
-
- /**
- * Rehashes the contents of this bag into a new hash table
- * with a larger capacity. This method is called when the
- * number of different elements in this map exceeds its
- * capacity and load factor.
- */
- private void rehash() {
- Entry<E>[] oldMap = this.table;
- int oldCapacity = oldMap.length;
-
- int newCapacity = oldCapacity * 2 + 1;
- Entry<E>[] newTable = this.buildTable(newCapacity);
-
- this.modCount++;
- this.threshold = (int) (newCapacity * this.loadFactor);
- this.table = newTable;
-
- for (int i = oldCapacity; i-- > 0; ) {
- for (Entry<E> old = oldMap[i]; old != null; ) {
- Entry<E> e = old;
- old = old.next;
-
- int index = (e.hash & 0x7FFFFFFF) % newCapacity;
- e.next = newTable[index];
- newTable[index] = e;
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- private Entry<E>[] buildTable(int capacity) {
- return new Entry[capacity];
- }
-
- @SuppressWarnings("unchecked")
- private <T> Entry<E> buildEntry(int hash, Object o, Entry<T> next) {
- return new Entry(hash, o, next);
- }
-
- @SuppressWarnings("unchecked")
- private <T> Entry<E> buildEntry(int hash, Object o, int cnt, Entry<T> next) {
- return new Entry(hash, o, cnt, 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 add(E o) {
- this.modCount++;
- Entry<E>[] tab = this.table;
- int hash = 0;
- int index = 0;
-
- // if the object is already in the bag, simply bump its count
- hash = System.identityHashCode(o);
- index = (hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[index]; e != null; e = e.next) {
- if ((e.hash == hash) && (e.object == o)) {
- e.count++;
- this.count++;
- return true;
- }
- }
-
- // rehash the table if the threshold is exceeded
- if (this.uniqueCount >= this.threshold) {
- this.rehash();
- tab = this.table;
- index = (hash & 0x7FFFFFFF) % tab.length;
- }
-
- // create the new entry and put it in the table
- Entry<E> e = this.buildEntry(hash, o, tab[index]);
- tab[index] = e;
- this.count++;
- this.uniqueCount++;
- return true;
- }
-
- /**
- * 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++;
- Entry<E>[] tab = this.table;
- int hash = 0;
- int index = 0;
-
- // if the object is already in the bag, simply bump its count
- hash = System.identityHashCode(o);
- index = (hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[index]; e != null; e = e.next) {
- if ((e.hash == hash) && (e.object == o)) {
- e.count += cnt;
- this.count += cnt;
- return true;
- }
- }
-
- // rehash the table if the threshold is exceeded
- if (this.uniqueCount >= this.threshold) {
- this.rehash();
- tab = this.table;
- index = (hash & 0x7FFFFFFF) % tab.length;
- }
-
- // create the new entry and put it in the table
- Entry<E> e = this.buildEntry(hash, o, cnt, tab[index]);
- tab[index] = e;
- this.count += cnt;
- this.uniqueCount++;
- return true;
- }
-
- /**
- * 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) {
- Entry<E>[] tab = this.table;
- int hash = System.identityHashCode(o);
- int index = (hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[index], prev = null; e != null; prev = e, e = e.next) {
- if ((e.hash == hash) && (e.object == o)) {
- this.modCount++;
- e.count--;
- // if we are removing the last one, remove the entry from the table
- if (e.count == 0) {
- if (prev == null) {
- tab[index] = e.next;
- } else {
- prev.next = e.next;
- }
- this.uniqueCount--;
- }
- this.count--;
- return true;
- }
- }
- return false;
- }
-
- /**
- * 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;
- }
- Entry<E>[] tab = this.table;
- int hash = System.identityHashCode(o);
- int index = (hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[index], prev = null; e != null; prev = e, e = e.next) {
- if ((e.hash == hash) && (e.object == o)) {
- this.modCount++;
- int cnt2 = (cnt < e.count) ? cnt : e.count;
- e.count -= cnt2;
- // if we are removing the last element(s), remove the entry from the table
- if (e.count == 0) {
- if (prev == null) {
- tab[index] = e.next;
- } else {
- prev.next = e.next;
- }
- this.uniqueCount--;
- }
- this.count -= cnt2;
- return true;
- }
- }
- return false;
- }
-
- /**
- * This implementation uses object-identity to determine whether
- * specified collection contains a particular element.
- */
- @Override
- public boolean removeAll(Collection<?> c) {
- return super.removeAll(this.buildIdentityHashBag(c));
- }
-
- /**
- * This implementation uses object-identity to determine whether
- * specified collection contains a particular element.
- */
- @Override
- public boolean retainAll(Collection<?> c) {
- return super.retainAll(this.buildIdentityHashBag(c));
- }
-
- @SuppressWarnings("unchecked")
- private Collection<?> buildIdentityHashBag(Collection<?> c) {
- return new IdentityHashBag(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.count = 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);
- for (int i = this.table.length; i-- > 0; ) {
- clone.table[i] = (this.table[i] == null)
- ? null : (Entry<E>) this.table[i].clone();
- }
- clone.modCount = 0;
- return clone;
- } catch (CloneNotSupportedException e) {
- throw new InternalError();
- }
- }
-
-
- /**
- * Hash table collision list entry.
- */
- private static class Entry<E> implements Bag.Entry<E> {
- int hash;
- E object;
- int count;
- Entry<E> next;
-
- Entry(int hash, E object, Entry<E> next) {
- this(hash, object, 1, next);
- }
-
- Entry(int hash, E object, int count, Entry<E> next) {
- this.hash = hash;
- this.object = object;
- this.count = count;
- this.next = next;
- }
-
- /**
- * Cascade the clone to all the entries in the same bucket.
- */
- @Override
- @SuppressWarnings("unchecked")
- protected Entry<E> clone() {
- return new Entry(this.hash, this.object, this.count,
- (this.next == null ? null : this.next.clone()));
- }
-
-
- // ***** 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);
- }
- int old = this.count;
- this.count = count;
- return old;
- }
-
- @Override
- public boolean equals(Object o) {
- if ( ! (o instanceof Bag.Entry)) {
- return false;
- }
- @SuppressWarnings("unchecked")
- 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;
- }
- }
-
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterator<E> iterator() {
- return (this.count == 0) ? EMPTY_ITERATOR : new HashIterator();
- }
-
- /**
- * 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.
- */
- @SuppressWarnings("unchecked")
- public Iterator<E> uniqueIterator() {
- return (this.count == 0) ? EMPTY_ITERATOR : new UniqueIterator();
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<Bag.Entry<E>> entries() {
- return (this.count == 0) ? EMPTY_ITERATOR : new EntryIterator();
- }
-
-
- /**
- * Empty iterator that does just about nothing.
- */
- @SuppressWarnings("unchecked")
- private static final Iterator EMPTY_ITERATOR = new EmptyIterator();
-
- @SuppressWarnings("unchecked")
- 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 Entry<E>[] localTable = IdentityHashBag.this.table;
- private int index = this.localTable.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 = this.localTable;
- // 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 = this.localTable;
- // 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();
- }
- Entry<E>[] tab = this.localTable;
- int slot = (this.lastReturnedEntry.hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[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) {
- tab[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.count--;
- this.lastReturnedEntry = null; // it cannot be removed again
- return;
- }
- }
- throw new ConcurrentModificationException();
- }
- }
-
-
- private class EntryIterator implements Iterator<Entry<E>> {
- private Entry<E>[] localTable = IdentityHashBag.this.table;
- private int index = this.localTable.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 = this.localTable;
- // 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 = this.localTable;
- // 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();
- }
- Entry<E>[] tab = this.localTable;
- int slot = (this.lastReturnedEntry.hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[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) {
- tab[slot] = e.next;
- } else {
- prev.next = e.next;
- }
- IdentityHashBag.this.uniqueCount--;
- IdentityHashBag.this.count -= 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;
- }
- IdentityHashBag<E> clone = this.clone();
- for (E e : b) {
- if ( ! clone.remove(e)) {
- return false;
- }
- }
- return clone.isEmpty();
- } else if (o instanceof Bag) {
- // hmmm...
- return this.buildBag().equals(o);
- } else {
- return false;
- }
- }
-
- @SuppressWarnings("unchecked")
- private Bag<E> buildBag() {
- return new HashBag(this);
- }
-
- @Override
- public int hashCode() {
- int h = 0;
- for (E e : this) {
- h += System.identityHashCode(e);
- }
- 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 synchronized 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);
-
- Entry<E>[] tab = this.table;
- // write out elements and counts (alternating)
- for (Entry<E> entry : tab) {
- 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 synchronized 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();
- for (int j = 0; j < elementCount; j++) {
- this.add(element);
- }
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IndentingPrintWriter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IndentingPrintWriter.java
deleted file mode 100644
index f2afb1d4e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IndentingPrintWriter.java
+++ /dev/null
@@ -1,148 +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.PrintWriter;
-import java.io.Writer;
-
-/**
- * Extend 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";
-
-
- /**
- * 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.
- */
- 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 indentLevel() {
- return this.indentLevel;
- }
-
- /**
- * Allow the indent level to be set directly.
- */
- public void setIndentLevel(int indentLevel) {
- synchronized (this.lock) {
- this.indentLevel = indentLevel;
- }
- }
-
-}
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 34aff52d7a..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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());
- }
- }
-
- 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());
- }
- }
-
- 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
- */
- private 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(" => ");
- this.javaType.appendDeclarationTo(sb);
- }
-
- }
-
- /**
- * Java => JDBC
- */
- private 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(" => ");
- 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 82ae294c34..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCType.java
+++ /dev/null
@@ -1,167 +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.lang.reflect.Field;
-import java.sql.Types;
-import java.text.Collator;
-
-/**
- * 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 Comparable<JDBCType>, 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(ClassTools.shortClassNameForObject(this));
- 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();
- }
- }
-
- public int compareTo(JDBCType type) {
- return Collator.getInstance().compare(this.name, type.name);
- }
-
-
- // ********** 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);
- }
-
- /**
- * 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);
- }
-
- /**
- * 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 a7749bd731..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ListenerList.java
+++ /dev/null
@@ -1,117 +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 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;
-
-/**
- * Maintain a thread-safe list of listeners that does not allow duplicates.
- */
-public class ListenerList<L extends EventListener>
- implements Serializable
-{
- private transient volatile L[] listeners;
-
- private static final long serialVersionUID = 1L;
-
-
- public ListenerList(Class<L> listenerClass) {
- super();
- this.listeners = this.buildEmptyArray(listenerClass);
- }
-
- @SuppressWarnings("unchecked")
- private L[] buildEmptyArray(Class<L> listenerClass) {
- return (L[]) Array.newInstance(listenerClass, 0);
- }
-
- public L[] getListeners() {
- return this.listeners;
- }
-
- public int size() {
- return this.listeners.length;
- }
-
- public boolean isEmpty() {
- return this.listeners.length == 0;
- }
-
- public synchronized void add(L listener) {
- if (listener == null) {
- throw new NullPointerException();
- }
- if (CollectionTools.contains(this.listeners, listener)) {
- return;//throw new IllegalArgumentException("duplicate listener: " + listener); //$NON-NLS-1$
- }
- this.listeners = CollectionTools.add(this.listeners, listener);
- }
-
- public synchronized void remove(L listener) {
- if (listener == null) {
- throw new NullPointerException();
- }
- int index = CollectionTools.indexOf(this.listeners, listener);
- if (index == -1) {
- return;//throw new IllegalArgumentException("unregistered listener: " + listener); //$NON-NLS-1$
- }
- this.listeners = CollectionTools.removeElementAtIndex(this.listeners, index);
- }
-
- public synchronized void clear() {
- this.listeners = CollectionTools.clear(this.listeners);
- }
-
- @Override
- public String toString() {
- return Arrays.toString(this.listeners);
- }
-
-
- // ********** serialization **********
-
- 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 synchronized void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException {
- // read in any hidden stuff
- s.defaultReadObject();
-
- Class<L> listenerClass = (Class<L>) s.readObject();
- this.listeners = this.buildEmptyArray(listenerClass);
- Object o;
- while ((o = s.readObject()) != null) {
- this.add((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 570398445e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NameTools.java
+++ /dev/null
@@ -1,358 +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.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(CollectionTools.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$
- }
- }
-
-
- // ********** 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/NullList.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NullList.java
deleted file mode 100644
index 9c9b4eaafd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NullList.java
+++ /dev/null
@@ -1,150 +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 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".
- *
- * NB: We return 'null' from the following methods (as opposed to throwing
- * an exception):
- * get(int) : E
- * remove(int) : E
- * set(int, E) : E
- */
-public final class NullList<E> implements List<E> {
-
- // singleton
- @SuppressWarnings("unchecked")
- 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");
- }
-
- 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");
- }
-
- 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");
- }
-
- 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);
- }
-
-}
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 176918d635..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, 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;
-
-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/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/SimpleAssociation.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleAssociation.java
deleted file mode 100644
index 7c9b0a7401..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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 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/SimpleFilter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleFilter.java
deleted file mode 100644
index 80e21f939b..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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 ace5b103ab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleJavaType.java
+++ /dev/null
@@ -1,231 +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.PrintWriter;
-import java.io.Serializable;
-import java.text.Collator;
-import org.eclipse.jpt.utility.JavaType;
-
-/**
- * Straightforward implementation of the 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 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.");
- }
- if (ClassTools.arrayDepthForClassNamed(elementTypeName) != 0) { // e.g. "[Ljava.lang.Object;"
- throw new IllegalArgumentException("The element type must not be an array: " + elementTypeName + '.');
- }
- if (arrayDepth < 0) {
- throw new IllegalArgumentException("The array depth must be greater than or equal to zero: " + arrayDepth + '.');
- }
- if (elementTypeName.equals(void.class.getName()) && (arrayDepth != 0)) {
- throw new IllegalArgumentException("'void' must have an array depth of zero: " + arrayDepth + '.');
- }
- 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:
- * java.lang.Object
- * int
- * java.util.Map$Entry
- * [Ljava.lang.Object;
- * [I
- * [Ljava.util.Map$Entry;
- */
- public SimpleJavaType(String javaClassName) {
- this(ClassTools.elementTypeNameForClassNamed(javaClassName), ClassTools.arrayDepthForClassNamed(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) && ClassTools.classNamedIsPrimitive(this.elementTypeName);
- }
-
- public boolean isPrimitiveWrapper() {
- return (this.arrayDepth == 0) && ClassTools.classNamedIsPrimitiveWrapperClass(this.elementTypeName);
- }
-
- public boolean isVariablePrimitive() {
- return (this.arrayDepth == 0) && ClassTools.classNamedIsVariablePrimitive(this.elementTypeName);
- }
-
- public boolean isVariablePrimitiveWrapper() {
- return (this.arrayDepth == 0) && ClassTools.classNamedIsVariablePrimitiveWrapperClass(this.elementTypeName);
- }
-
- public Class<?> getJavaClass() throws ClassNotFoundException {
- return ClassTools.classForTypeDeclaration(this.elementTypeName, this.arrayDepth);
- }
-
- public String getJavaClassName() {
- return ClassTools.classNameForTypeDeclaration(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(ClassTools.elementTypeNameForClassNamed(className), ClassTools.arrayDepthForClassNamed(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;
- }
-
- public int compareTo(JavaType jt) {
- int x = Collator.getInstance().compare(this.elementTypeName, jt.getElementTypeName());
- return (x != 0) ? x : (this.arrayDepth - jt.getArrayDepth());
- }
-
-
- // ********** printing and displaying **********
-
- /**
- * Return the version of the type's name that can be used in source code:
- * "[[J" => "long[][]"
- * "java.util.Map$Entry" => "java.util.Map.Entry"
- */
- public String declaration() {
- if (this.arrayDepth == 0) {
- return this.elementTypeNameDeclaration();
- }
- StringBuilder sb = new StringBuilder(this.elementTypeName.length() + (2 * this.arrayDepth));
- this.appendDeclarationTo(sb);
- return sb.toString();
- }
-
- /**
- * Append the version of the type's name that can be used in source code:
- * "[[J" => "long[][]"
- * "java.util.Map$Entry" => "java.util.Map.Entry"
- */
- public void appendDeclarationTo(StringBuilder sb) {
- sb.append(this.elementTypeNameDeclaration());
- for (int i = this.arrayDepth; i-- > 0; ) {
- sb.append("[]");
- }
- }
-
- /**
- * Print the version of the type's name that can be used in source code:
- * "[[J" => "long[][]"
- * "java.util.Map$Entry" => "java.util.Map.Entry"
- */
- public void printDeclarationOn(PrintWriter pw) {
- pw.print(this.elementTypeNameDeclaration());
- for (int i = this.arrayDepth; i-- > 0; ) {
- pw.print("[]");
- }
- }
-
- /**
- * The '$' version of the name is used in Class.forName(String),
- * but the '.' verions of the name is used in source code.
- * Very irritating....
- */
- private String elementTypeNameDeclaration() {
- return this.elementTypeName.replace('$', '.');
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(ClassTools.shortClassNameForObject(this));
- 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 7996919350..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleMethodSignature.java
+++ /dev/null
@@ -1,234 +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 java.io.PrintWriter;
-import java.io.Serializable;
-import java.lang.reflect.Method;
-import java.text.Collator;
-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;
-
- private static final long serialVersionUID = 1L;
-
- public static final JavaType[] EMPTY_PARAMETER_TYPES = new JavaType[0];
-
-
- // ********** 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.");
- }
- if (parameterTypes == null) {
- throw new IllegalArgumentException("The parameter types are required.");
- }
- 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);
- }
- if (parameterTypes[i].getElementTypeName().equals(void.class.getName())) {
- throw new IllegalArgumentException("A parameter type of 'void' is not allowed: " + i);
- }
- }
- }
-
- /**
- * 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.");
- }
- 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);
- }
- 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.");
- }
- 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);
- }
- 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 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);
- }
-
- public int compareTo(MethodSignature ms) {
- int compare = Collator.getInstance().compare(this.name, ms.getName());
- return (compare != 0) ? compare : this.compareParameterTypes(ms.getParameterTypes());
- }
-
- private int compareParameterTypes(JavaType[] otherParameterTypes) {
- int len1 = this.parameterTypes.length;
- int len2 = otherParameterTypes.length;
- int min = Math.min(len1, len2);
- for (int i = 0; i < min; i++) {
- int compare = this.parameterTypes[i].compareTo(otherParameterTypes[i]);
- if (compare != 0) {
- return compare;
- }
- }
- return (len1 == len2) ? 0 : (len1 < len2) ? -1 : 1;
- }
-
-
- // ********** 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('(');
- for (int i = 0; i < this.parameterTypes.length; i++) {
- if (i != 0) {
- sb.append(", ");
- }
- this.parameterTypes[i].appendDeclarationTo(sb);
- }
- sb.append(')');
- }
-
- public void printSignatureOn(PrintWriter pw) {
- pw.print(this.name);
- pw.print('(');
- for (int i = 0; i < this.parameterTypes.length; i++) {
- if (i != 0) {
- pw.print(", ");
- }
- this.parameterTypes[i].printDeclarationOn(pw);
- }
- pw.print(')');
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder(200);
- sb.append(ClassTools.shortClassNameForObject(this));
- 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/SimpleStack.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleStack.java
deleted file mode 100644
index f183943d9a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleStack.java
+++ /dev/null
@@ -1,95 +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;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.EmptyStackException;
-import java.util.LinkedList;
-import java.util.NoSuchElementException;
-
-/**
- * Straightforward implementation of the 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 #pop()).
- */
- public SimpleStack(Collection<? extends E> c) {
- super();
- this.elements = new LinkedList<E>(c);
- }
-
-
- // ********** Stack implementation **********
-
- public void push(E o) {
- this.elements.addLast(o);
- }
-
- 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();
- }
-
-
- // ********** Cloneable implementation **********
-
- @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();
- }
- }
-
-}
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 5631b623c8..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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("*");
- }
-
- /**
- * 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 "";
- }
-
- /**
- * 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 "*";
- }
-
- /**
- * 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(".*");
- continue;
- }
- if (c == '?') {
- sb.append('.');
- continue;
- }
- // escape regex meta-chars
- if (CollectionTools.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/Stack.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Stack.java
deleted file mode 100644
index 93bef64f4b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Stack.java
+++ /dev/null
@@ -1,73 +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;
-
-import java.io.Serializable;
-import java.util.EmptyStackException;
-
-/**
- * Interface defining the classic stack behavior,
- * without the backdoors allowed by java.util.Stack.
- * E is 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 o);
-
- /**
- * "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("unchecked")
- 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 o) {
- 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() {
- return INSTANCE;
- }
- }
-
-}
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 556b530862..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringConverter.java
+++ /dev/null
@@ -1,68 +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;
-
-/**
- * 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> {
- @SuppressWarnings("unchecked")
- 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";
- }
- }
-
- final class Disabled<S> implements StringConverter<S> {
- @SuppressWarnings("unchecked")
- 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";
- }
- }
-
-}
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 5f769d7040..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringMatcher.java
+++ /dev/null
@@ -1,58 +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;
-
-/**
- * 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 {
- 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";
- }
- }
-
-}
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 4fd0a82dac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringTools.java
+++ /dev/null
@@ -1,4108 +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.IOException;
-import java.io.Writer;
-import java.util.Arrays;
-import java.util.Iterator;
-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(CollectionTools.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(CollectionTools.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(CollectionTools.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 Iterator<String> delimit(Iterator<String> strings, final char delimiter) {
- return new TransformationIterator<String, String>(strings) {
- @Override
- protected String transform(String string) {
- return StringTools.delimit(string, 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 Iterator<String> delimit(Iterator<String> strings, final String delimiter) {
- if (delimiter.length() == 1) {
- return delimit(strings, delimiter.charAt(0));
- }
- return new TransformationIterator<String, String>(strings) {
- @Override
- protected String transform(String string) {
- return StringTools.delimit(string, 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 Iterator<char[]> delimitCharArrays(Iterator<char[]> strings, final char delimiter) {
- return new TransformationIterator<char[], char[]>(strings) {
- @Override
- protected char[] transform(char[] string) {
- return StringTools.delimit(string, 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 Iterator<char[]> delimitCharArrays(Iterator<char[]> strings, final char[] delimiter) {
- return new TransformationIterator<char[], char[]>(strings) {
- @Override
- protected char[] transform(char[] string) {
- return StringTools.delimit(string, 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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 non-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 non-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 non-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);
- }
- }
- }
-
-
- // ********** 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 Iterator<String> capitalize(Iterator<String> strings) {
- return new TransformationIterator<String, String>(strings) {
- @Override
- protected 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 Iterator<char[]> capitalizeCharArrays(Iterator<char[]> strings) {
- return new TransformationIterator<char[], char[]>(strings) {
- @Override
- protected 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(" ("); //$NON-NLS-1$
- 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(ClassTools.toStringClassNameForObject(o));
- 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(ClassTools.toStringClassNameForObject(o));
- sb.append('[');
- // use System#identityHashCode(Object), since Object#hashCode() may be overridden
- sb.append(zeroPad(Integer.toHexString(System.identityHashCode(o)).toUpperCase(), 8));
- sb.append(']');
- }
-
-
- // ********** 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, 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 Iterator<String> convertToJavaStringLiterals(Iterator<String> strings) {
- return new TransformationIterator<String, String>(strings) {
- @Override
- protected String transform(String string) {
- return StringTools.convertToJavaStringLiteral(string);
- }
- };
- }
-
- // cannot name method simply 'convertToJavaStringLiterals' because of type-erasure...
- public static Iterator<char[]> convertToJavaCharArrayLiterals(Iterator<char[]> strings) {
- return new TransformationIterator<char[], char[]>(strings) {
- @Override
- protected 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/SynchronizedBoolean.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedBoolean.java
deleted file mode 100644
index 001aa64bd6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedBoolean.java
+++ /dev/null
@@ -1,374 +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;
-
-import java.io.Serializable;
-import org.eclipse.jpt.utility.Command;
-
-/**
- * This class provides synchronized access to a boolean value.
- * It also provides protocol for suspending a thread until the
- * boolean value is set to true or false, with optional time-outs.
- * @see BooleanHolder
- */
-public class SynchronizedBoolean
- implements Cloneable, Serializable
-{
- /** Backing boolean. */
- private boolean value;
-
- /** Object to synchronize on. */
- private final Object mutex;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Create a synchronized boolean with the specified initial value
- * and mutex.
- */
- public SynchronizedBoolean(boolean value, Object mutex) {
- super();
- this.value = value;
- this.mutex = mutex;
- }
-
- /**
- * Create a synchronized boolean with the specified initial value.
- */
- public SynchronizedBoolean(boolean value) {
- super();
- this.value = value;
- this.mutex = this;
- }
-
- /**
- * Create a synchronized boolean with an initial value of false
- * and specified mutex.
- */
- public SynchronizedBoolean(Object mutex) {
- this(false, mutex);
- }
-
- /**
- * Create a synchronized boolean with an initial value of false.
- */
- public SynchronizedBoolean() {
- this(false);
- }
-
-
- // ********** accessors **********
-
- /**
- * Return the current boolean value.
- */
- public boolean value() {
- synchronized (this.mutex) {
- return this.value;
- }
- }
-
- /**
- * Return whether the current boolean value is true.
- */
- public boolean isTrue() {
- synchronized (this.mutex) {
- return this.value;
- }
- }
-
- /**
- * Return whether the current boolean value is false.
- */
- public boolean isFalse() {
- synchronized (this.mutex) {
- return ! this.value;
- }
- }
-
- /**
- * Return whether the current boolean value is the specified value.
- */
- public boolean is(boolean v) {
- synchronized (this.mutex) {
- return this.value == v;
- }
- }
-
- /**
- * Set the boolean value. If the value changes, all waiting
- * threads are notified.
- */
- public void setValue(boolean value) {
- synchronized (this.mutex) {
- if (this.value != value) {
- this.value = value;
- this.mutex.notifyAll();
- }
- }
- }
-
- /**
- * Set the boolean value to true. If the value changes, all waiting
- * threads are notified.
- */
- public void setTrue() {
- synchronized (this.mutex) {
- this.setValue(true);
- }
- }
-
- /**
- * Set the boolean value to false. If the value changes, all waiting
- * threads are notified.
- */
- public void setFalse() {
- synchronized (this.mutex) {
- this.setValue(false);
- }
- }
-
- /**
- * Return the object this object locks on while performing
- * its operations.
- */
- public Object mutex() {
- return this.mutex;
- }
-
-
- // ********** indefinite waits **********
-
- /**
- * Suspend the current thread until the boolean value changes
- * to the specified value. If the boolean value is already the
- * specified value, return immediately.
- */
- public void waitUntilValueIs(boolean v) throws InterruptedException {
- synchronized (this.mutex) {
- while (this.value != v) {
- this.mutex.wait();
- }
- }
- }
-
- /**
- * Suspend the current thread until the boolean value changes to true.
- * If the boolean value is already true, return immediately.
- */
- public void waitUntilTrue() throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilValueIs(true);
- }
- }
-
- /**
- * Suspend the current thread until the boolean value changes to false.
- * If the boolean value is already false, return immediately.
- */
- public void waitUntilFalse() throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilValueIs(false);
- }
- }
-
- /**
- * Suspend the current thread until the boolean value changes to
- * NOT the specified value, then change it back to the specified
- * value and continue executing. If the boolean value is already
- * NOT 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 boolean value changes to false,
- * then change it back to true and continue executing. If the boolean
- * value is already false, set the value to true immediately.
- */
- public void waitToSetTrue() throws InterruptedException {
- synchronized (this.mutex) {
- this.waitToSetValue(true);
- }
- }
-
- /**
- * Suspend the current thread until the boolean value changes to true,
- * then change it back to false and continue executing. If the boolean
- * value is already true, set the value to false immediately.
- */
- public void waitToSetFalse() throws InterruptedException {
- synchronized (this.mutex) {
- this.waitToSetValue(false);
- }
- }
-
-
- // ********** timed waits **********
-
- /**
- * Suspend the current thread until the boolean value changes
- * to the specified value or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return true if the specified
- * value was achieved; return false if a time-out occurred.
- * If the boolean value is already the specified value, return true
- * immediately.
- */
- public boolean waitUntilValueIs(boolean v, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- 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 boolean value changes
- * to true or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return true if the specified
- * value was achieved; return false if a time-out occurred.
- * If the boolean value is already true, return true immediately.
- */
- public boolean waitUntilTrue(long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- return this.waitUntilValueIs(true, timeout);
- }
- }
-
- /**
- * Suspend the current thread until the boolean value changes
- * to false or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return true if the specified
- * value was achieved; return false if a time-out occurred.
- * If the boolean value is already true, return true immediately.
- */
- public boolean waitUntilFalse(long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- return this.waitUntilValueIs(false, timeout);
- }
- }
-
- /**
- * Suspend the current thread until the boolean value changes to NOT the
- * specified value, then change it back to the specified value and continue
- * executing. If the boolean value does not change to false before the
- * time-out, simply continue executing without changing the value.
- * The time-out is specified in milliseconds. Return true if the value was
- * set to the specified value; return false if a time-out occurred.
- * If the boolean value is already NOT the specified value, set the value
- * to the specified value immediately and return true.
- */
- 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 boolean value changes to false,
- * then change it back to true and continue executing. If the boolean
- * value does not change to false before the time-out, simply continue
- * executing without changing the value. The time-out is specified in
- * milliseconds. Return true if the value was set to true; return false
- * if a time-out occurred. If the boolean value is already false, set the
- * value to true immediately and return true.
- */
- public boolean waitToSetTrue(long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- return this.waitToSetValue(true, timeout);
- }
- }
-
- /**
- * Suspend the current thread until the boolean value changes to true,
- * then change it back to false and continue executing. If the boolean
- * value does not change to true before the time-out, simply continue
- * executing without changing the value. The time-out is specified in
- * milliseconds. Return true if the value was set to false; return false
- * if a time-out occurred. If the boolean value is already true, set the
- * value to false immediately and return true.
- */
- public boolean waitToSetFalse(long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- 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 in another
- * thread.
- */
- public void execute(Command command) throws InterruptedException {
- if (Thread.interrupted()) {
- throw new InterruptedException();
- }
- synchronized (this.mutex) {
- command.execute();
- }
- }
-
-
- // ********** standard methods **********
-
- @Override
- public Object clone() {
- try {
- synchronized (this.mutex) {
- return super.clone();
- }
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- @Override
- public boolean equals(Object o) {
- if (o instanceof SynchronizedBoolean) {
- return this.value() == ((SynchronizedBoolean) o).value();
- }
- return false;
- }
-
- @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/SynchronizedObject.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedObject.java
deleted file mode 100644
index bcf83dbfa9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedObject.java
+++ /dev/null
@@ -1,372 +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;
-
-import java.io.Serializable;
-import org.eclipse.jpt.utility.Command;
-
-/**
- * This class provides synchronized access to an object of type T.
- * It also provides protocol for suspending a thread until the
- * value is set to null or a non-null value, with optional time-outs.
- */
-public class SynchronizedObject<T>
- implements Cloneable, Serializable
-{
- /** Backing value. */
- private T 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(T value, Object mutex) {
- super();
- this.value = value;
- this.mutex = mutex;
- }
-
- /**
- * Create a synchronized object with the specified initial value.
- */
- public SynchronizedObject(T value) {
- super();
- this.value = value;
- this.mutex = this;
- }
-
- /**
- * Create a synchronized object with an initial value of null.
- */
- public SynchronizedObject() {
- this(null);
- }
-
-
- // ********** accessors **********
-
- /**
- * Return the current value.
- */
- public T value() {
- synchronized (this.mutex) {
- return this.value;
- }
- }
-
- /**
- * Return whether the current value is null.
- */
- public boolean isNull() {
- synchronized (this.mutex) {
- return this.value == null;
- }
- }
-
- /**
- * Return whether the current value is not null.
- */
- public boolean isNotNull() {
- synchronized (this.mutex) {
- return this.value != null;
- }
- }
-
- /**
- * Set the value. If the value changes, all waiting
- * threads are notified.
- */
- public void setValue(T value) {
- synchronized (this.mutex) {
- if (this.value != value) {
- this.value = value;
- this.mutex.notifyAll();
- }
- }
- }
-
- /**
- * Set the value to null. If the value changes, all waiting
- * threads are notified.
- */
- public void setNull() {
- synchronized (this.mutex) {
- this.setValue(null);
- }
- }
-
- /**
- * Return the object this object locks on while performing
- * its operations.
- */
- public Object mutex() {
- 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(T v) throws InterruptedException {
- synchronized (this.mutex) {
- 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 NOT the specified value, return immediately.
- */
- public void waitUntilValueIsNot(T v) throws InterruptedException {
- synchronized (this.mutex) {
- while (this.value == v) {
- this.mutex.wait();
- }
- }
- }
-
- /**
- * Suspend the current thread until the value changes to null.
- * If the value is already null, return immediately.
- */
- public void waitUntilNull() throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilValueIs(null);
- }
- }
-
- /**
- * Suspend the current thread until the value changes
- * to something other than null.
- * If the value is already NOT null, return immediately.
- */
- public void waitUntilNotNull() throws InterruptedException {
- synchronized (this.mutex) {
- 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 NOT the specified value, set
- * the value immediately.
- */
- public void waitToSetValue(T v) throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilValueIsNot(v);
- this.setValue(v);
- }
- }
-
- /**
- * Suspend the current thread until the value changes to
- * something other than null, then change it back to null
- * and continue executing. If the value is already NOT null,
- * set the value to null immediately.
- */
- public void waitToSetNull() throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilNotNull();
- this.setValue(null);
- }
- }
-
-
- // ********** 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 true if the specified
- * value was achieved; return false if a time-out occurred.
- * If the value is already the specified value, return true immediately.
- */
- public boolean waitUntilValueIs(T v, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- 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 value changes to something
- * other than the specified value or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return true if the specified
- * value was removed; return false if a time-out occurred.
- * If the value is already NOT the specified value, return true immediately.
- */
- public boolean waitUntilValueIsNot(T v, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- 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 ((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 null or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return true if the specified
- * value was achieved; return false if a time-out occurred.
- * If the value is already null, return true immediately.
- */
- public boolean waitUntilNull(long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- return this.waitUntilValueIs(null, timeout);
- }
- }
-
- /**
- * Suspend the current thread until the value changes
- * to something other than null or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return true if the specified
- * value was achieved; return false if a time-out occurred.
- * If the value is already NOT null, return true immediately.
- */
- public boolean waitUntilNotNull(long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- 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 before the time-out, simply continue executing
- * without changing the value.
- * The time-out is specified in milliseconds. Return true if the value was
- * set to true; return false if a time-out occurred.
- * If the value is already something other than the specified value, set
- * the value immediately and return true.
- */
- public boolean waitToSetValue(T 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 null, then change it back to null and continue executing.
- * If the value does not change to something other than null before
- * the time-out, simply continue executing without changing the value.
- * The time-out is specified in milliseconds. Return true if the value was
- * set to false; return false if a time-out occurred.
- * If the value is already something other than null, set
- * the value to null immediately and return true.
- */
- public boolean waitToSetNull(long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- boolean success = this.waitUntilNotNull(timeout);
- if (success) {
- this.setValue(null);
- }
- 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 in 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<T> clone() {
- try {
- synchronized (this.mutex) {
- @SuppressWarnings("unchecked")
- SynchronizedObject<T> clone = (SynchronizedObject<T>) super.clone();
- return clone;
- }
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- @Override
- public boolean equals(Object obj) {
- if ( ! (obj instanceof SynchronizedObject)) {
- return false;
- }
- Object v1 = this.value();
- Object v2 = ((SynchronizedObject<?>) obj).value();
- return (v1 == null) ?
- (v2 == null) : v1.equals(v2);
- }
-
- @Override
- public int hashCode() {
- Object v = this.value();
- return (v == null) ? 0 : v.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/SynchronizedStack.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedStack.java
deleted file mode 100644
index e232c402ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedStack.java
+++ /dev/null
@@ -1,279 +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;
-
-import java.io.Serializable;
-import java.util.EmptyStackException;
-import org.eclipse.jpt.utility.Command;
-
-/**
- * Thread-safe implementation of the 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 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();
- 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();
- this.stack = stack;
- this.mutex = this;
- }
-
- /**
- * Construct a synchronized stack that locks on the specified mutex.
- */
- public SynchronizedStack(Object mutex) {
- this(new SimpleStack<E>(), mutex);
- }
-
- /**
- * Construct a synchronized stack that locks on itself.
- */
- public SynchronizedStack() {
- this(new SimpleStack<E>());
- }
-
-
- // ********** Stack implementation **********
-
- public void push(E o) {
- synchronized (this.mutex) {
- this.stack.push(o);
- this.mutex.notifyAll();
- }
- }
-
- public E pop() {
- synchronized (this.mutex) {
- 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) {
- while (this.isEmpty() != empty) {
- this.mutex.wait();
- }
- }
- }
-
- /**
- * Suspend the current thread until the stack is empty.
- */
- public void waitUntilEmpty() throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilEmptyIs(true);
- }
- }
-
- /**
- * Suspend the current thread until the stack has something on it.
- */
- public void waitUntilNotEmpty() throws InterruptedException {
- synchronized (this.mutex) {
- 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 o) throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilEmpty();
- this.push(o);
- }
- }
-
- /**
- * 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.waitUntilNotEmpty();
- 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 true if the specified
- * value was achieved; return false if a time-out occurred.
- */
- public boolean waitUntilEmptyIs(boolean empty, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- 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.isEmpty() != empty) && (remaining > 0L)) {
- this.mutex.wait(remaining);
- remaining = stop - System.currentTimeMillis();
- }
- return (this.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 true if
- * the stack is empty; return false if a time-out occurred.
- */
- public boolean waitUntilEmpty(long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- 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 true if
- * the stack has something on it; return false if a time-out occurred.
- */
- public boolean waitUntilNotEmpty(long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- 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 true if the
- * item was pushed; return false if a time-out occurred.
- */
- public boolean waitToPush(E o, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- boolean success = this.waitUntilEmpty(timeout);
- if (success) {
- this.push(o);
- }
- 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.
- */
- public Object waitToPop(long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- boolean success = this.waitUntilNotEmpty(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 this object locks on while performing
- * its operations.
- */
- public Object mutex() {
- return this.mutex;
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public String toString() {
- synchronized (this.mutex) {
- return this.stack.toString();
- }
- }
-
-}
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 75e4cc0839..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Transformer.java
+++ /dev/null
@@ -1,69 +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.internal;
-
-/**
- * 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);
-
-
- final class Null<S1, S2> implements Transformer<S1, S2> {
- @SuppressWarnings("unchecked")
- 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";
- }
- }
-
- final class Disabled<S1, S2> implements Transformer<S1, S2> {
- @SuppressWarnings("unchecked")
- 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";
- }
- }
-
-}
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 fcc359de00..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, 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;
-
-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 (CollectionTools.contains(chars, '&')) {
- this.chars = chars;
- } else {
- this.chars = CollectionTools.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) && CollectionTools.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");
- 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");
- }
- 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 + "'");
- }
- }
-
- private void checkEndOfStream(int c) {
- if (c == -1) {
- throw new IllegalStateException("unexpected end of string");
- }
- }
-
-}
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 2874af48ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayIterator.java
+++ /dev/null
@@ -1,72 +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.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * An <code>ArrayIterator</code> provides an <code>Iterator</code>
- * for an array of objects of type E.
- */
-public class ArrayIterator<E>
- implements Iterator<E>
-{
- final E[] array; // private-protected
- int nextIndex; // private-protected
- private final int maxIndex;
-
- /**
- * 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 specified length.
- */
- public ArrayIterator(E[] array, int start, int length) {
- if ((start < 0) || (start > array.length)) {
- throw new IllegalArgumentException("start: " + start);
- }
- if ((length < 0) || (length > array.length - start)) {
- throw new IllegalArgumentException("length: " + length);
- }
- this.array = array;
- this.nextIndex = start;
- this.maxIndex = start + length;
- }
-
- public boolean hasNext() {
- return this.nextIndex < this.maxIndex;
- }
-
- public E next() {
- if (this.hasNext()) {
- return this.array[this.nextIndex++];
- }
- throw new NoSuchElementException();
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, CollectionTools.list(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 5b70ed4721..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayListIterator.java
+++ /dev/null
@@ -1,78 +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.internal.iterators;
-
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-
-/**
- * An <code>ArrayListIterator</code> provides a <code>ListIterator</code>
- * for an array of objects.
- *
- * The name might be a bit confusing:
- * This is a <code>ListIterator</code> for an <code>Array</code>;
- * <em>not</em> an <code>Iterator</code> for an <code>ArrayList</code>.
- */
-public class ArrayListIterator<E>
- extends ArrayIterator<E>
- implements ListIterator<E>
-{
- private final int minIndex;
-
- /**
- * 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 specified length.
- */
- public ArrayListIterator(E[] array, int start, int length) {
- super(array, start, length);
- this.minIndex = start;
- }
-
- public int nextIndex() {
- return this.nextIndex;
- }
-
- public int previousIndex() {
- return this.nextIndex - 1;
- }
-
- public boolean hasPrevious() {
- return this.nextIndex > this.minIndex;
- }
-
- public E previous() {
- if (this.hasPrevious()) {
- return this.array[--this.nextIndex];
- }
- 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 ea5076e854..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ChainIterator.java
+++ /dev/null
@@ -1,145 +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.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>ChainIterator</code> provides a pluggable <code>Iterator</code>
- * that loops over a chain of arbitrarily linked objects. The chain
- * should be null-terminated (i.e. a call to the <code>nextLink(Object)</code>
- * 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 <code>Linker</code> or
- * subclass <code>ChainIterator</code> and override the
- * <code>nextLink(Object)</code> 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 that the iterator does not support <code>null</code> elements.
- */
-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
- * <code>nextLink(Object)</code> method instead of building
- * a <code>Linker</code>.
- */
- 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.
- */
- protected E nextLink(E currentLink) {
- return this.linker.nextLink(currentLink);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.nextLink);
- }
-
-
- //********** inner classes **********
-
- /**
- * Used by <code>ChainIterator</code> to link
- * the elements in the chain.
- */
- public interface Linker<T> {
-
- /**
- * Return the next link in the chain.
- */
- T nextLink(T currentLink);
-
-
- final class Null<S> implements Linker<S> {
- @SuppressWarnings("unchecked")
- 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";
- }
- }
-
- final class Disabled<S> implements Linker<S> {
- @SuppressWarnings("unchecked")
- 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";
- }
- }
-
- }
-
-}
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 7976439a03..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneIterator.java
+++ /dev/null
@@ -1,154 +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.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; otherwise you run the risk of
- * a corrupted collection.
- * <p>
- * By default, a <code>CloneIterator</code> does not support the
- * <code>#remove()</code> operation; this is because it does not have
- * access to the original collection. But if the <code>CloneIterator</code>
- * is supplied with an <code>Mutator</code> it will delegate the
- * <code>#remove()</code> operation to the <code>Mutator</code>.
- * Alternatively, a subclass can override the <code>#remove(Object)</code>
- * method.
- */
-public class CloneIterator<E>
- implements Iterator<E>
-{
- private final Iterator<Object> nestedIterator;
- private E current;
- private final Mutator<E> mutator;
- private boolean removeAllowed;
-
-
- // ********** constructors **********
-
- /**
- * Construct an iterator on a copy of the specified collection.
- * The <code>#remove()</code> method will not be supported,
- * unless a subclass overrides the <code>#remove(Object)</code>.
- */
- public CloneIterator(Collection<? extends E> c) {
- this(c, Mutator.ReadOnly.<E>instance());
- }
-
- /**
- * Construct an iterator on a copy of the specified collection.
- * Use the specified mutator to remove objects from the
- * original collection.
- */
- public CloneIterator(Collection<? extends E> c, Mutator<E> mutator) {
- super();
- this.nestedIterator = new ArrayIterator<Object>(c.toArray());
- this.current = null;
- this.mutator = mutator;
- this.removeAllowed = false;
- }
-
-
- // ********** Iterator implementation **********
-
- public boolean hasNext() {
- return this.nestedIterator.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 Es,
- * 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 (Object[]).
- */
- @SuppressWarnings("unchecked")
- protected E nestedNext() {
- return (E) this.nestedIterator.next();
- }
-
- /**
- * Remove the specified element from the original collection.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building an <code>Mutator</code>.
- */
- protected void remove(E e) {
- this.mutator.remove(e);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
-
- //********** member interface **********
-
- /**
- * Used by <code>CloneIterator</code> to remove
- * elements from the original collection; since the iterator
- * does not have direct access to the original collection.
- */
- public interface Mutator<T> {
-
- /**
- * Remove the specified object from the original collection.
- */
- void remove(T current);
-
-
- final class ReadOnly<S> implements Mutator<S> {
- @SuppressWarnings("unchecked")
- public static final Mutator INSTANCE = new ReadOnly();
- @SuppressWarnings("unchecked")
- public static <R> Mutator<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private ReadOnly() {
- super();
- }
- // remove is not supported
- public void remove(Object current) {
- throw new UnsupportedOperationException();
- }
- @Override
- public String toString() {
- return "CloneIterator.Mutator.ReadOnly"; //$NON-NLS-1$
- }
- }
-
- }
-
-}
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 c4b5837ba1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneListIterator.java
+++ /dev/null
@@ -1,253 +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.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.
- * <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 <code>Mutator</code> it will delegate the
- * modification operations to the <code>Mutator</code>.
- * Alternatively, a subclass can override the modification methods.
- */
-public class CloneListIterator<E>
- implements ListIterator<E>
-{
- private final ListIterator<Object> nestedListIterator;
- private int cursor;
- private String state;
- private final Mutator<E> mutator;
-
- private static final String UNKNOWN = "unknown";
- private static final String PREVIOUS = "previous";
- private static final String NEXT = "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 list.
- * Use the specified list mutator to modify the original list.
- */
- public CloneListIterator(List<? extends E> list, Mutator<E> mutator) {
- 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.nestedListIterator = CollectionTools.list(list.toArray()).listIterator();
- this.mutator = mutator;
- this.cursor = 0;
- this.state = UNKNOWN;
- }
-
-
- // ********** ListIterator implementation **********
-
- public boolean hasNext() {
- return this.nestedListIterator.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 = NEXT;
- return next;
- }
-
- public void remove() {
- // allow the nested iterator to throw an exception before we modify the original list
- this.nestedListIterator.remove();
- if (this.state == PREVIOUS) {
- this.remove(this.cursor);
- } else {
- this.cursor--;
- this.remove(this.cursor);
- }
- }
-
- public int nextIndex() {
- return this.nestedListIterator.nextIndex();
- }
-
- public int previousIndex() {
- return this.nestedListIterator.previousIndex();
- }
-
- public boolean hasPrevious() {
- return this.nestedListIterator.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 = PREVIOUS;
- return previous;
- }
-
- public void add(E o) {
- // allow the nested iterator to throw an exception before we modify the original list
- this.nestedListIterator.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.nestedListIterator.set(o);
- if (this.state == PREVIOUS) {
- this.set(this.cursor, o);
- } else {
- this.set(this.cursor - 1, o);
- }
- }
-
-
- // ********** internal methods **********
-
- /**
- * The list passed in during construction held Es,
- * 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 (Object[]).
- */
- @SuppressWarnings("unchecked")
- protected E nestedNext() {
- return (E) this.nestedListIterator.next();
- }
-
- /**
- * The list passed in during construction held Es,
- * 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 (Object[]).
- */
- @SuppressWarnings("unchecked")
- protected E nestedPrevious() {
- return (E) this.nestedListIterator.previous();
- }
-
- /**
- * Add the specified element to the original list.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a <code>Mutator</code>.
- */
- 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 <code>Mutator</code>.
- */
- 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 <code>Mutator</code>.
- */
- 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 <code>CloneListIterator</code> 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("unchecked")
- 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";
- }
- }
-
- }
-
-}
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 083f535b4a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeIterator.java
+++ /dev/null
@@ -1,126 +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.internal.iterators;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>CompositeIterator</code> wraps a collection
- * of <code>Iterator</code>s and makes them appear to be a single
- * <code>Iterator</code>.
- */
-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 with the specified collection of iterators.
- */
- public CompositeIterator(Collection<? extends Iterator<? extends E>> iterators) {
- this(iterators.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 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 iterator.
- */
- @SuppressWarnings("unchecked")
- public CompositeIterator(Iterator<? extends E> iterator, E object) {
- this(iterator, new SingleElementIterator<E>(object));
- }
-
- /**
- * 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 currentIterator with the first iterator that <code>hasNext()</code>
- * 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 c2037f053d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeListIterator.java
+++ /dev/null
@@ -1,194 +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.iterators;
-
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>CompositeListIterator</code> wraps a list
- * of <code>ListIterator</code>s and makes them appear to be a single
- * <code>ListIterator</code>.
- */
-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 remove(Object) on nextIndex
- */
- private boolean nextReturned;
- private ListIterator<E> lastIteratorToReturnElement;
-
-
- /**
- * Construct a list iterator with the specified list of list iterators.
- */
- public CompositeListIterator(List<? extends ListIterator<E>> iterators) {
- this(iterators.listIterator());
- }
-
- /**
- * 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 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 iterator.
- */
- @SuppressWarnings("unchecked")
- public CompositeListIterator(ListIterator<E> iterator, E object) {
- this(iterator, new SingleElementListIterator<E>(object));
- }
-
- /**
- * 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/EmptyEnumeration.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyEnumeration.java
deleted file mode 100644
index 1e7721a892..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyEnumeration.java
+++ /dev/null
@@ -1,55 +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.internal.iterators;
-
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>NullEnumeration</code> is just that.
- */
-public final class EmptyEnumeration<E>
- implements Enumeration<E>
-{
-
- // singleton
- @SuppressWarnings("unchecked")
- 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 StringTools.buildToStringFor(this);
- }
-
-}
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 aacac33339..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyIterator.java
+++ /dev/null
@@ -1,59 +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.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * An <code>EmptyIterator</code> is just that.
- */
-public final class EmptyIterator<E>
- implements Iterator<E>
-{
-
- // singleton
- @SuppressWarnings("unchecked")
- 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);
- }
-
-}
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 f3ab4a464f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyListIterator.java
+++ /dev/null
@@ -1,83 +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.iterators;
-
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * An <code>EmptyListIterator</code> is just that.
- */
-public final class EmptyListIterator<E>
- implements ListIterator<E>
-{
-
- // singleton
- @SuppressWarnings("unchecked")
- 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);
- }
-
-}
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 a75710c4ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EnumerationIterator.java
+++ /dev/null
@@ -1,50 +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.internal.iterators;
-
-import java.util.Enumeration;
-import java.util.Iterator;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * An <code>EnumerationIterator</code> wraps an
- * <code>Enumeration</code> so that it can be treated like an
- * <code>Iterator</code>.
- */
-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 fa22c65476..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/FilteringIterator.java
+++ /dev/null
@@ -1,134 +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.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 <code>Iterator</code>
- * and uses a <code>Filter</code> to determine which elements in the
- * nested iterator are to be returned by calls to <code>next()</code>.
- * <p>
- * As an alternative to building a <code>Filter</code>, a subclass
- * of <code>FilteringIterator</code> can override the
- * <code>accept(Object)</code> 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 <code>next()</code>
- * 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
- * <code>hasNext()</code> method should return <code>true</code>).
- * This also prevents a filtered iterator from supporting the optional
- * <code>remove()</code> method.
- */
-public class FilteringIterator<E1, E2>
- implements Iterator<E2>
-{
- private final Iterator<? extends E1> nestedIterator;
- private final Filter<E1> filter;
- private E2 next;
- private boolean done;
-
-
- /**
- * Construct an iterator with the specified nested
- * iterator and a disabled filter.
- * Use this constructor if you want to override the
- * <code>accept(Object)</code> method instead of building
- * a <code>Filter</code>.
- */
- public FilteringIterator(Iterator<? extends E1> nestedIterator) {
- this(nestedIterator, Filter.Disabled.<E1>instance());
- }
-
- /**
- * Construct an iterator with the specified nested
- * iterator and filter.
- */
- public FilteringIterator(Iterator<? extends E1> nestedIterator, Filter<E1> filter) {
- super();
- this.nestedIterator = nestedIterator;
- this.filter = filter;
- this.loadNext();
- }
-
- public boolean hasNext() {
- return ! this.done;
- }
-
- public E2 next() {
- if (this.done) {
- throw new NoSuchElementException();
- }
- E2 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.nestedIterator.hasNext() && (this.done)) {
- E1 temp = this.nestedIterator.next();
- if (this.accept(temp)) {
- // assume that if the object was accepted it is of type E
- this.next = this.cast(temp);
- this.done = false;
- } else {
- this.next = null;
- this.done = true;
- }
- }
- }
-
- /**
- * We have to assume the filter will only "accept" objects that can
- * be cast to E2.
- */
- @SuppressWarnings("unchecked")
- private E2 cast(E1 o) {
- return (E2) o;
- }
-
- /**
- * Return whether the <code>FilteringIterator</code>
- * should return the specified next element from a call to the
- * <code>next()</code> method.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a <code>Filter</code>.
- */
- protected boolean accept(E1 o) {
- return this.filter.accept(o);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.nestedIterator);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GenericIteratorWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GenericIteratorWrapper.java
deleted file mode 100644
index 01e5e0a93b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GenericIteratorWrapper.java
+++ /dev/null
@@ -1,47 +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.iterators;
-
-import java.util.Iterator;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Wrap an iterator on elements of any sub-type of E, converting it into an
- * iterator on elements of type E. This shouldn't be a problem since there
- * is no way to add elements to the iterator.
- */
-public class GenericIteratorWrapper<E>
- implements Iterator<E>
-{
- private final Iterator<? extends E> iterator;
-
- public GenericIteratorWrapper(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/GraphIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GraphIterator.java
deleted file mode 100644
index c199e6ec4c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GraphIterator.java
+++ /dev/null
@@ -1,242 +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.internal.iterators;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.NoSuchElementException;
-import java.util.Set;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>GraphIterator</code> is similar to a <code>TreeIterator</code>
- * 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 *neighbors*), but does not provide a method for getting *all*
- * 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
- * <code>equals(Object)</code>), 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 *complete* graph.
- * <p>
- * To use, supply:<ul>
- * <li> either the initial node of the graph or an Iterator over an
- * initial collection of graph nodes
- * <li> a <code>MisterRogers</code> that tells who the neighbors are
- * of each node
- * (alternatively, subclass <code>GraphIterator</code>
- * and override the <code>neighbors(Object)</code> method)
- * </ul>
- * <p>
- * <code>remove()</code> is not supported. This method, if
- * desired, must be implemented by the user of this class.
- */
-public class GraphIterator<E>
- implements Iterator<E>
-{
- private final Collection<Iterator<? extends E>> iterators;
- private final Set<E> visitedNeighbors;
- private final MisterRogers<E> misterRogers;
-
- private Iterator<? extends E> currentIterator;
-
- private E nextNeighbor;
- private boolean done;
-
-
- /**
- * Construct an iterator with the specified collection of roots
- * and a disabled mister rogers.
- * Use this constructor if you want to override the
- * <code>children(Object)</code> method instead of building
- * a <code>MisterRogers</code>.
- */
- public GraphIterator(E... roots) {
- this(new ArrayIterator<E>(roots));
- }
-
- /**
- * Construct an iterator with the specified collection of roots
- * and a disabled mister rogers.
- * Use this constructor if you want to override the
- * <code>children(Object)</code> method instead of building
- * a <code>MisterRogers</code>.
- */
- public GraphIterator(Iterator<? extends E> roots) {
- this(roots, MisterRogers.Disabled.<E>instance());
- }
-
- /**
- * Construct an iterator with the specified root
- * and a disabled mister rogers.
- * Use this constructor if you want to override the
- * <code>children(Object)</code> method instead of building
- * a <code>MisterRogers</code>.
- */
- public GraphIterator(E root) {
- this(root, MisterRogers.Disabled.<E>instance());
- }
-
- /**
- * Construct an iterator with the specified root
- * and mister rogers.
- */
- public GraphIterator(E root, MisterRogers<E> misterRogers) {
- this(new SingleElementIterator<E>(root), misterRogers);
- }
-
- /**
- * Construct an iterator with the specified roots
- * and mister rogers.
- */
- public GraphIterator(Iterator<? extends E> roots, MisterRogers<E> misterRogers) {
- 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.misterRogers = misterRogers;
- this.visitedNeighbors = new HashSet<E>();
- 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 '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 <code>GraphIterator</code> 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("unchecked")
- 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";
- }
- }
-
- /** The mister rogers used when the #neighbors(Object) method is overridden. */
- final class Disabled<S> implements MisterRogers<S> {
- @SuppressWarnings("unchecked")
- 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";
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/IteratorEnumeration.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/IteratorEnumeration.java
deleted file mode 100644
index 55a4f08b70..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/IteratorEnumeration.java
+++ /dev/null
@@ -1,47 +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.internal.iterators;
-
-import java.util.Enumeration;
-import java.util.Iterator;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * An <code>IteratorEnumeration</code> wraps an
- * <code>Iterator</code> so that it can be treated like an
- * <code>Enumeration</code>.
- */
-public class IteratorEnumeration<E>
- implements Enumeration<E>
-{
- private final Iterator<? extends E> 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/iterators/PeekableIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/PeekableIterator.java
deleted file mode 100644
index 316aedcf63..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/PeekableIterator.java
+++ /dev/null
@@ -1,100 +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.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>PeekableIterator</code> wraps another <code>Iterator</code>
- * and allows a <code>peek()</code> at the next element to be
- * returned by <code>next()</code>.
- * <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 <code>next()</code>
- * method is invoked. This is because the "next" element must be
- * pre-loaded for the <code>peek()</code> method.
- * This also prevents a peekable iterator from supporting the optional
- * <code>remove()</code> method.
- */
-
-public class PeekableIterator<E>
- implements Iterator<E>
-{
- private final Iterator<? extends E> nestedIterator;
- private E next;
- private boolean done;
-
-
- /**
- * Construct a peekable iterator that wraps the specified nested
- * iterator.
- */
- public PeekableIterator(Iterator<? extends E> nestedIterator) {
- super();
- this.nestedIterator = nestedIterator;
- 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
- * <code>next()</code> 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 <code>remove()</code>
- * method.
- */
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Load next with the next entry from the nested
- * iterator. If there are none, next is set to <code>END</code>.
- */
- private void loadNext() {
- if (this.nestedIterator.hasNext()) {
- this.next = this.nestedIterator.next();
- } else {
- this.next = null;
- this.done = true;
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.nestedIterator);
- }
-
-}
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 92d896c65c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyCompositeListIterator.java
+++ /dev/null
@@ -1,178 +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.iterators;
-
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>ReadOnlyCompositeListIterator</code> wraps a list
- * of <code>ListIterator</code>s and makes them appear to be a single
- * read-only <code>ListIterator</code>. A read-only composite list
- * iterator is more flexible than a normal composite when it comes to the element types of
- * the nested iterators.
- */
-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
- * list iterators.
- */
- public ReadOnlyCompositeListIterator(List<? extends ListIterator<? extends E>> iterators) {
- this(iterators.listIterator());
- }
-
- /**
- * 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 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 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 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 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/ReadOnlyIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyIterator.java
deleted file mode 100644
index df0a51333d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyIterator.java
+++ /dev/null
@@ -1,61 +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.internal.iterators;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>ReadOnlyIterator</code> wraps another <code>Iterator</code>
- * and removes support for #remove().
- */
-public class ReadOnlyIterator<E>
- implements Iterator<E>
-{
- private final Iterator<? extends E> nestedIterator;
-
- /**
- * Construct an iterator on the specified collection that
- * disallows removes.
- */
- public ReadOnlyIterator(Collection<? extends E> c) {
- this(c.iterator());
- }
-
- /**
- * Construct an iterator with the specified nested iterator
- * and disallow removes.
- */
- public ReadOnlyIterator(Iterator<? extends E> nestedIterator) {
- super();
- this.nestedIterator = nestedIterator;
- }
-
- public boolean hasNext() {
- // delegate to the nested iterator
- return this.nestedIterator.hasNext();
- }
-
- public E next() {
- // delegate to the nested iterator
- return this.nestedIterator.next();
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.nestedIterator);
- }
-
-}
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 c3b2591f44..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyListIterator.java
+++ /dev/null
@@ -1,93 +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.internal.iterators;
-
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>ReadOnlyListIterator</code> wraps another
- * <code>ListIterator</code> and removes support for:
- * #remove()
- * #set(Object)
- * #add(Object)
- */
-public class ReadOnlyListIterator<E>
- implements ListIterator<E>
-{
- private final ListIterator<? extends E> nestedListIterator;
-
-
- /**
- * Construct an iterator on the specified list that
- * disallows removes, sets, and adds.
- */
- public ReadOnlyListIterator(List<? extends E> list) {
- this(list.listIterator());
- }
-
- /**
- * Construct an iterator on the specified list iterator that
- * disallows removes, sets, and adds.
- */
- public ReadOnlyListIterator(ListIterator<? extends E> nestedListIterator) {
- super();
- this.nestedListIterator = nestedListIterator;
- }
-
- public boolean hasNext() {
- // delegate to the nested iterator
- return this.nestedListIterator.hasNext();
- }
-
- public E next() {
- // delegate to the nested iterator
- return this.nestedListIterator.next();
- }
-
- public boolean hasPrevious() {
- // delegate to the nested iterator
- return this.nestedListIterator.hasPrevious();
- }
-
- public E previous() {
- // delegate to the nested iterator
- return this.nestedListIterator.previous();
- }
-
- public int nextIndex() {
- // delegate to the nested iterator
- return this.nestedListIterator.nextIndex();
- }
-
- public int previousIndex() {
- // delegate to the nested iterator
- return this.nestedListIterator.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.nestedListIterator);
- }
-
-}
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 a8da8442ab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ResultSetIterator.java
+++ /dev/null
@@ -1,154 +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.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 a <code>ResultSet</code>
- * and transforms its rows for client consumption. Subclasses can override
- * <code>#buildNext(ResultSet)</code> to build the expected object from
- * the current row of the result set.
- * <p>
- * To use, supply:<ul>
- * <li> a <code>ResultSet</code>
- * <li> an <code>Adapter</code> that converts a row in the <code>ResultSet</code>
- * into the desired object
- * (alternatively, subclass <code>ResultSetIterator</code>
- * and override the <code>buildNext(ResultSet)</code> method)
- * </ul>
- * <p>
- */
-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 <code>SQLException</code>s will
- * be caught and wrapped in a <code>RuntimeException</code>.
- */
- 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 <code>ResultSetIterator</code> to convert a
- * <code>ResultSet</code>'s current row into the next object
- * to be returned by the <code>Iterator</code>.
- */
- public interface Adapter<T> {
-
- /**
- * Return an object corresponding to the result set's
- * "current" row. Any <code>SQLException</code>s will
- * be caught and wrapped in a <code>RuntimeException</code>.
- * @see java.sql.ResultSet
- */
- T buildNext(ResultSet rs) throws SQLException;
-
-
- final class Default<S> implements Adapter<S> {
- @SuppressWarnings("unchecked")
- 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";
- }
- }
-
- }
-
-}
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 75fd9d80fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementIterator.java
+++ /dev/null
@@ -1,63 +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.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 <code>next()</code>, at
- * which point it will return <code>false</code> to any subsequent
- * call to <code>hasNext()</code>.
- * <p>
- * A <code>SingleElementIterator</code> is equivalent to the
- * <code>Iterator</code> returned by:
- * <code>java.util.Collections.singleton(element).iterator()</code>
- */
-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 799cb72aef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementListIterator.java
+++ /dev/null
@@ -1,94 +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.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 <code>next()</code>, at
- * which point it will return <code>false</code> to any subsequent
- * call to <code>hasNext()</code>. Likewise, it will return <code>false</code>
- * to a call to <code>hasPrevious()</code> until a call to <code>next()</code>,
- * at which point a call to <code>previous()</code> will return the
- * single element.
- * <p>
- * A <code>SingleElementListIterator</code> is equivalent to the
- * <code>Iterator</code> returned by:
- * <code>java.util.Collections.singletonList(element).listIterator()</code>
- */
-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/TransformationIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationIterator.java
deleted file mode 100644
index b970d28841..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationIterator.java
+++ /dev/null
@@ -1,80 +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.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 <code>Iterator</code>
- * and transforms its results for client consumption. To use, supply a
- * <code>Transformer</code> or subclass <code>TransformationIterator</code>
- * and override the <code>transform(Object)</code> method.
- * Objects of type E1 are transformed into objects of type E2;
- * i.e. the iterator returns objects of type E2.
- */
-public class TransformationIterator<E1, E2>
- implements Iterator<E2>
-{
- private final Iterator<? extends E1> nestedIterator;
- private final Transformer<E1, ? extends E2> transformer;
-
-
- /**
- * Construct an iterator with the specified nested iterator
- * and a disabled transformer.
- * Use this constructor if you want to override the
- * <code>transform(Object)</code> method instead of building
- * a <code>Transformer</code>.
- */
- public TransformationIterator(Iterator<? extends E1> nestedIterator) {
- this(nestedIterator, Transformer.Disabled.<E1, E2>instance());
- }
-
- /**
- * Construct an iterator with the specified nested iterator
- * and transformer.
- */
- public TransformationIterator(Iterator<? extends E1> nestedIterator, Transformer<E1, ? extends E2> transformer) {
- super();
- this.nestedIterator = nestedIterator;
- this.transformer = transformer;
- }
-
- public boolean hasNext() {
- // delegate to the nested iterator
- return this.nestedIterator.hasNext();
- }
-
- public E2 next() {
- // transform the object returned by the nested iterator before returning it
- return this.transform(this.nestedIterator.next());
- }
-
- public void remove() {
- // delegate to the nested iterator
- this.nestedIterator.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.nestedIterator);
- }
-
-}
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 087fc11046..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationListIterator.java
+++ /dev/null
@@ -1,108 +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.internal.iterators;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-
-/**
- * A <code>TransformationListIterator</code> wraps another <code>ListIterator</code>
- * and transforms its results for client consumption. To use, supply a
- * <code>Transformer</code> or subclass <code>TransformationIterator</code>
- * and override the <code>transform(Object)</code> method.
- *
- * The methods <code>set(Object)</code> and <code>add(Object)</code>
- * are left unsupported in this class.
- */
-public class TransformationListIterator<E1, E2>
- implements ListIterator<E2>
-{
- private final ListIterator<? extends E1> nestedIterator;
- private final Transformer<E1, ? extends E2> transformer;
-
-
- /**
- * Construct an iterator with the specified nested iterator
- * and a disabled transformer.
- * Use this constructor if you want to override the
- * <code>transform(Object)</code> method instead of building
- * a <code>Transformer</code>.
- */
- public TransformationListIterator(ListIterator<? extends E1> nestedIterator) {
- this(nestedIterator, Transformer.Disabled.<E1, E2>instance());
- }
-
- /**
- * Construct an iterator with the specified nested iterator
- * and transformer.
- */
- public TransformationListIterator(ListIterator<? extends E1> nestedIterator, Transformer<E1, ? extends E2> transformer) {
- super();
- this.nestedIterator = nestedIterator;
- this.transformer = transformer;
- }
-
- public boolean hasNext() {
- // delegate to the nested iterator
- return this.nestedIterator.hasNext();
- }
-
- public E2 next() {
- // transform the object returned by the nested iterator before returning it
- return this.transform(this.nestedIterator.next());
- }
-
- public int nextIndex() {
- // delegate to the nested iterator
- return this.nestedIterator.nextIndex();
- }
-
- public boolean hasPrevious() {
- // delegate to the nested iterator
- return this.nestedIterator.hasPrevious();
- }
-
- public E2 previous() {
- // transform the object returned by the nested iterator before returning it
- return this.transform(this.nestedIterator.previous());
- }
-
- public int previousIndex() {
- // delegate to the nested iterator
- return this.nestedIterator.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.nestedIterator.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.nestedIterator);
- }
-
-}
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 47074d7c7d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TreeIterator.java
+++ /dev/null
@@ -1,194 +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.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 <code>Iterator</code> over the set of roots
- * <li> a <code>Midwife</code> that delivers the children
- * of each child
- * (alternatively, subclass <code>TreeIterator</code>
- * and override the <code>children(Object)</code> method)
- * </ul>
- * <p>
- */
-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 with the specified collection of roots
- * and a disabled midwife.
- * Use this constructor if you want to override the
- * <code>children(Object)</code> method instead of building
- * a <code>Midwife</code>.
- */
- public TreeIterator(Iterator<? extends E> roots) {
- this(roots, Midwife.Disabled.<E>instance());
- }
-
- /**
- * Construct an iterator with the specified root
- * and a disabled midwife.
- * Use this constructor if you want to override the
- * <code>children(Object)</code> method instead of building
- * a <code>Midwife</code>.
- */
- public TreeIterator(E root) {
- this(root, Midwife.Disabled.<E>instance());
- }
-
- /**
- * Construct an iterator with the specified root
- * and midwife.
- */
- public TreeIterator(E root, Midwife<E> midwife) {
- this(new SingleElementIterator<E>(root), midwife);
- }
-
- /**
- * Construct an iterator 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.
- */
- 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 <code>TreeIterator</code> 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("unchecked")
- 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$
- }
- }
-
- /** The midwife used when the #children(Object) method is overridden. */
- final class Disabled<S> implements Midwife<S> {
- @SuppressWarnings("unchecked")
- 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$
- }
- }
-
- }
-
-}
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 e81db41721..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/AbstractModel.java
+++ /dev/null
@@ -1,996 +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;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-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.ArrayIterator;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-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;
-
-/**
- * Convenience implementation of Model protocol.
- */
-public abstract class AbstractModel implements Model, Serializable {
- /**
- * Delegate state/property/collection/list/tree change support to this
- * helper object. The change support object is "lazy-initialized".
- */
- private ChangeSupport changeSupport;
-
-
- // ********** constructors/initialization **********
-
- /**
- * Default constructor.
- * This will call #initialize() on the newly-created instance.
- */
- protected AbstractModel() {
- super();
- }
-
- /**
- * This accessor will build the change support when required.
- */
- 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);
- }
-
-
- // ********** state change support **********
-
- public synchronized void addStateChangeListener(StateChangeListener listener) {
- this.getChangeSupport().addStateChangeListener(listener);
- }
-
- public synchronized void removeStateChangeListener(StateChangeListener listener) {
- this.getChangeSupport().removeStateChangeListener(listener);
- }
-
- protected final void fireStateChanged() {
- this.getChangeSupport().fireStateChanged();
- }
-
- protected final void fireStateChanged(StateChangeEvent event) {
- this.getChangeSupport().fireStateChanged(event);
- }
-
-
- // ********** property change support **********
-
- public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
- this.getChangeSupport().addPropertyChangeListener(listener);
- }
-
- public synchronized void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- this.getChangeSupport().addPropertyChangeListener(propertyName, listener);
- }
-
- public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
- this.getChangeSupport().removePropertyChangeListener(listener);
- }
-
- public synchronized void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- this.getChangeSupport().removePropertyChangeListener(propertyName, listener);
- }
-
- 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);
- }
-
- protected final void firePropertyChanged(String propertyName, Object newValue) {
- this.getChangeSupport().firePropertyChanged(propertyName, null, newValue);
- }
-
- protected final void firePropertyChanged(PropertyChangeEvent event) {
- this.getChangeSupport().firePropertyChanged(event);
- }
-
-
- // ********** collection change support **********
-
- public synchronized void addCollectionChangeListener(CollectionChangeListener listener) {
- this.getChangeSupport().addCollectionChangeListener(listener);
- }
-
- public synchronized void addCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- this.getChangeSupport().addCollectionChangeListener(collectionName, listener);
- }
-
- public synchronized void removeCollectionChangeListener(CollectionChangeListener listener) {
- this.getChangeSupport().removeCollectionChangeListener(listener);
- }
-
- public synchronized void removeCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- this.getChangeSupport().removeCollectionChangeListener(collectionName, listener);
- }
-
- protected final void fireItemAdded(String collectionName, Object addedItem) {
- this.getChangeSupport().fireItemAdded(collectionName, addedItem);
- }
-
- protected final void fireItemsAdded(String collectionName, Collection<?> addedItems) {
- this.getChangeSupport().fireItemsAdded(collectionName, addedItems);
- }
-
- protected final void fireItemsAdded(CollectionChangeEvent event) {
- this.getChangeSupport().fireItemsAdded(event);
- }
-
- protected final void fireItemRemoved(String collectionName, Object removedItem) {
- this.getChangeSupport().fireItemRemoved(collectionName, removedItem);
- }
-
- protected final void fireItemsRemoved(String collectionName, Collection<?> removedItems) {
- this.getChangeSupport().fireItemsRemoved(collectionName, removedItems);
- }
-
- protected final void fireItemsRemoved(CollectionChangeEvent event) {
- this.getChangeSupport().fireItemsRemoved(event);
- }
-
- protected final void fireCollectionCleared(String collectionName) {
- this.getChangeSupport().fireCollectionCleared(collectionName);
- }
-
- protected final void fireCollectionCleared(CollectionChangeEvent event) {
- this.getChangeSupport().fireCollectionCleared(event);
- }
-
- protected final void fireCollectionChanged(String collectionName) {
- this.getChangeSupport().fireCollectionChanged(collectionName);
- }
-
- protected final void fireCollectionChanged(CollectionChangeEvent event) {
- this.getChangeSupport().fireCollectionChanged(event);
- }
-
- /**
- * Convenience method.
- * 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)
- */
- protected <E> boolean addItemToCollection(E item, Collection<E> collection, String collectionName) {
- if (collection.add(item)) {
- this.fireItemAdded(collectionName, item);
- return true;
- }
- return false;
- }
-
- /**
- * Convenience method.
- * 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)
- */
- protected <E> boolean addItemsToCollection(E[] items, Collection<E> collection, String collectionName) {
- return this.addItemsToCollection(new ArrayIterator<E>(items), collection, collectionName);
- }
-
- /**
- * Convenience method.
- * 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)
- */
- protected <E> boolean addItemsToCollection(Iterable<? extends E> items, Collection<E> collection, String collectionName) {
- return this.addItemsToCollection(items.iterator(), collection, collectionName);
- }
-
- /**
- * Convenience method.
- * 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)
- */
- 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;
- }
-
- /**
- * Convenience method.
- * 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)
- */
- protected boolean removeItemFromCollection(Object item, Collection<?> collection, String collectionName) {
- if (collection.remove(item)) {
- this.fireItemRemoved(collectionName, item);
- return true;
- }
- return false;
- }
-
- /**
- * Convenience method.
- * 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)
- */
- protected boolean removeItemsFromCollection(Object[] items, Collection<?> collection, String collectionName) {
- return this.removeItemsFromCollection(new ArrayIterator<Object>(items), collection, collectionName);
- }
-
- /**
- * Convenience method.
- * 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)
- */
- protected boolean removeItemsFromCollection(Iterable<?> items, Collection<?> collection, String collectionName) {
- return this.removeItemsFromCollection(items.iterator(), collection, collectionName);
- }
-
- /**
- * Convenience method.
- * 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)
- */
- protected boolean removeItemsFromCollection(Iterator<?> items, Collection<?> collection, String collectionName) {
- Collection<?> items2 = CollectionTools.collection(items);
- items2.retainAll(collection);
- boolean changed = collection.removeAll(items2);
-
- if ( ! items2.isEmpty()) {
- this.fireItemsRemoved(collectionName, items2);
- }
- return changed;
- }
-
- /**
- * Convenience method.
- * 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)
- */
- protected boolean retainItemsInCollection(Object[] items, Collection<?> collection, String collectionName) {
- return this.retainItemsInCollection(new ArrayIterator<Object>(items), collection, collectionName);
- }
-
- /**
- * Convenience method.
- * 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)
- */
- protected boolean retainItemsInCollection(Iterable<?> items, Collection<?> collection, String collectionName) {
- return this.retainItemsInCollection(items.iterator(), collection, collectionName);
- }
-
- /**
- * Convenience method.
- * 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)
- */
- protected boolean retainItemsInCollection(Iterator<?> items, Collection<?> collection, String collectionName) {
- Collection<?> items2 = CollectionTools.collection(items);
- Collection<?> removedItems = CollectionTools.collection(collection);
- removedItems.removeAll(items2);
- boolean changed = collection.retainAll(items2);
-
- if ( ! removedItems.isEmpty()) {
- this.fireItemsRemoved(collectionName, removedItems);
- }
- return changed;
- }
-
- /**
- * Convenience method.
- * Clear the entire collection
- * and fire the appropriate event if necessary.
- * Return whether the list changed.
- * @see java.util.Collection#clear()
- */
- protected boolean clearCollection(Collection<?> collection, String collectionName) {
- if (collection.isEmpty()) {
- return false;
- }
- collection.clear();
- this.fireCollectionCleared(collectionName);
- return true;
- }
-
- /**
- * Convenience method.
- * Synchronize the collection with the specified new collection,
- * making a minimum number of removes and adds.
- * Return whether the collection changed.
- */
- protected <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, collection, 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;
- }
-
- /**
- * Convenience method.
- * Synchronize the collection with the specified new collection,
- * making a minimum number of removes and adds.
- * Return whether the collection changed.
- */
- protected <E> boolean synchronizeCollection(Iterator<E> newItems, Collection<E> collection, String collectionName) {
- return this.synchronizeCollection(CollectionTools.collection(newItems), collection, collectionName);
- }
-
-
- // ********** list change support **********
-
- public synchronized void addListChangeListener(ListChangeListener listener) {
- this.getChangeSupport().addListChangeListener(listener);
- }
-
- public synchronized void addListChangeListener(String listName, ListChangeListener listener) {
- this.getChangeSupport().addListChangeListener(listName, listener);
- }
-
- public synchronized void removeListChangeListener(ListChangeListener listener) {
- this.getChangeSupport().removeListChangeListener(listener);
- }
-
- public synchronized void removeListChangeListener(String listName, ListChangeListener listener) {
- this.getChangeSupport().removeListChangeListener(listName, listener);
- }
-
- protected final void fireItemAdded(String listName, int index, Object addedItem) {
- this.getChangeSupport().fireItemAdded(listName, index, addedItem);
- }
-
- protected final void fireItemsAdded(String listName, int index, List<?> addedItems) {
- this.getChangeSupport().fireItemsAdded(listName, index, addedItems);
- }
-
- protected final void fireItemsAdded(ListChangeEvent event) {
- this.getChangeSupport().fireItemsAdded(event);
- }
-
- protected final void fireItemRemoved(String listName, int index, Object removedItem) {
- this.getChangeSupport().fireItemRemoved(listName, index, removedItem);
- }
-
- protected final void fireItemsRemoved(String listName, int index, List<?> removedItems) {
- this.getChangeSupport().fireItemsRemoved(listName, index, removedItems);
- }
-
- protected final void fireItemsRemoved(ListChangeEvent event) {
- this.getChangeSupport().fireItemsRemoved(event);
- }
-
- protected final void fireItemReplaced(String listName, int index, Object newItem, Object replacedItem) {
- this.getChangeSupport().fireItemReplaced(listName, index, newItem, replacedItem);
- }
-
- 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 fireItemsReplaced(ListChangeEvent event) {
- this.getChangeSupport().fireItemsReplaced(event);
- }
-
- protected final void fireItemMoved(String listName, int targetIndex, int sourceIndex) {
- this.getChangeSupport().fireItemMoved(listName, targetIndex, sourceIndex);
- }
-
- protected final <E> void fireItemsMoved(String listName, int targetIndex, int sourceIndex, int length) {
- this.getChangeSupport().fireItemsMoved(listName, targetIndex, sourceIndex, length);
- }
-
- protected final void fireItemsMoved(ListChangeEvent event) {
- this.getChangeSupport().fireItemsMoved(event);
- }
-
- protected final void fireListCleared(String listName) {
- this.getChangeSupport().fireListCleared(listName);
- }
-
- protected final void fireListCleared(ListChangeEvent event) {
- this.getChangeSupport().fireListCleared(event);
- }
-
- protected final void fireListChanged(String listName) {
- this.getChangeSupport().fireListChanged(listName);
- }
-
- protected final void fireListChanged(ListChangeEvent event) {
- this.getChangeSupport().fireListChanged(event);
- }
-
- /**
- * Convenience method.
- * Add the specified item to the specified bound list
- * and fire the appropriate event if necessary.
- * @see java.util.List#add(int, Object)
- */
- protected <E> void addItemToList(int index, E item, List<E> list, String listName) {
- list.add(index, item);
- this.fireItemAdded(listName, index, item);
- }
-
- /**
- * Convenience method.
- * Add the specified item to the end of the specified bound list
- * and fire the appropriate event if necessary.
- * Return whether list changed.
- * @see java.util.List#add(Object)
- */
- protected <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;
- }
-
- /**
- * Convenience method.
- * Add the specified items to the specified bound list
- * and fire the appropriate event if necessary.
- * @see java.util.List#addAll(int, java.util.Collection)
- */
- protected <E> boolean addItemsToList(int index, E[] items, List<E> list, String listName) {
- return this.addItemsToList(index, new ArrayIterator<E>(items), list, listName);
- }
-
- /**
- * Convenience method.
- * Add the specified items to the specified bound list
- * and fire the appropriate event if necessary.
- * @see java.util.List#addAll(int, java.util.Collection)
- */
- protected <E> boolean addItemsToList(int index, Iterable<? extends E> items, List<E> list, String listName) {
- return this.addItemsToList(index, items.iterator(), list, listName);
- }
-
- /**
- * Convenience method.
- * Add the specified items to the specified bound list
- * and fire the appropriate event if necessary.
- * @see java.util.List#addAll(int, java.util.Collection)
- */
- protected <E> boolean addItemsToList(int index, Iterator<? extends E> items, List<E> list, String listName) {
- List<E> items2 = CollectionTools.list(items);
- if (list.addAll(index, items2)) {
- this.fireItemsAdded(listName, index, items2);
- return true;
- }
- return false;
- }
-
- /**
- * Convenience method.
- * Add the specified items to the end of to the specified bound list
- * and fire the appropriate event if necessary.
- * @see java.util.List#addAll(java.util.Collection)
- */
- protected <E> boolean addItemsToList(E[] items, List<E> list, String listName) {
- return this.addItemsToList(new ArrayIterator<E>(items), list, listName);
- }
-
- /**
- * Convenience method.
- * Add the specified items to the end of to the specified bound list
- * and fire the appropriate event if necessary.
- * @see java.util.List#addAll(java.util.Collection)
- */
- protected <E> boolean addItemsToList(Iterable<? extends E> items, List<E> list, String listName) {
- return this.addItemsToList(items.iterator(), list, listName);
- }
-
- /**
- * Convenience method.
- * Add the specified items to the end of to the specified bound list
- * and fire the appropriate event if necessary.
- * @see java.util.List#addAll(java.util.Collection)
- */
- protected <E> boolean addItemsToList(Iterator<? extends E> items, List<E> list, String listName) {
- List<E> items2 = CollectionTools.list(items);
- int index = list.size();
- if (list.addAll(items2)) {
- this.fireItemsAdded(listName, index, items2);
- return true;
- }
- return false; // empty list of items added
- }
-
- /**
- * Convenience method.
- * 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)
- */
- protected <E> E removeItemFromList(int index, List<E> list, String listName) {
- E item = list.remove(index);
- this.fireItemRemoved(listName, index, item);
- return item;
- }
-
- /**
- * Convenience method.
- * 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(Object)
- */
- protected 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;
- }
-
- /**
- * Convenience method.
- * 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)
- */
- 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;
- }
-
- /**
- * Convenience method.
- * Remove the specified items from the specified bound list
- * and fire the appropriate event if necessary.
- * Return the removed items.
- * @see java.util.List#removeAll(java.util.Collection)
- */
- protected boolean removeItemsFromList(Object[] items, List<?> list, String listName) {
- return this.removeItemsFromList(new ArrayIterator<Object>(items), list, listName);
- }
-
- /**
- * Convenience method.
- * Remove the specified items from the specified bound list
- * and fire the appropriate event if necessary.
- * Return the removed items.
- * @see java.util.List#removeAll(java.util.Collection)
- */
- protected boolean removeItemsFromList(Iterable<?> items, List<?> list, String listName) {
- return this.removeItemsFromList(items.iterator(), list, listName);
- }
-
- /**
- * Convenience method.
- * Remove the specified items from the specified bound list
- * and fire the appropriate event if necessary.
- * Return the removed items.
- * @see java.util.List#removeAll(java.util.Collection)
- */
- protected boolean removeItemsFromList(Iterator<?> items, List<?> list, String listName) {
- boolean changed = false;
- while (items.hasNext()) {
- changed |= this.removeItemFromList(items.next(), list, listName);
- }
- return changed;
- }
-
- /**
- * Convenience method.
- * Retain the specified items in the specified bound list
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.List#retainAll(java.util.Collection)
- */
- protected boolean retainItemsInList(Object[] items, List<?> list, String listName) {
- return this.retainItemsInList(new ArrayIterator<Object>(items), list, listName);
- }
-
- /**
- * Convenience method.
- * Retain the specified items in the specified bound list
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.List#retainAll(java.util.Collection)
- */
- protected boolean retainItemsInList(Iterable<?> items, List<?> list, String listName) {
- return this.retainItemsInList(items.iterator(), list, listName);
- }
-
- /**
- * Convenience method.
- * Retain the specified items in the specified bound list
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.List#retainAll(java.util.Collection)
- */
- protected boolean retainItemsInList(Iterator<?> items, List<?> list, String listName) {
- Collection<?> items2 = CollectionTools.collection(items);
- Collection<?> removedItems = CollectionTools.collection(list);
- removedItems.removeAll(items2);
- return this.removeItemsFromList(removedItems, list, listName);
- }
-
- /**
- * Convenience method.
- * 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)
- */
- protected <E> E setItemInList(int index, E item, List<E> list, String listName) {
- E replacedItem = list.set(index, item);
- this.fireItemReplaced(listName, index, item, replacedItem);
- return replacedItem;
- }
-
- /**
- * Convenience method.
- * Replace 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)
- */
- protected <E> E replaceItemInList(E oldItem, E newItem, List<E> list, String listName) {
- return this.setItemInList(list.indexOf(oldItem), newItem, list, listName);
- }
-
- /**
- * Convenience method.
- * 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)
- */
- protected <E> List<E> setItemsInList(int index, E[] items, List<E> list, String listName) {
- return this.setItemsInList(index, Arrays.asList(items), list, listName);
- }
-
- /**
- * Convenience method.
- * 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)
- */
- 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> replacedItems = new ArrayList<E>(subList);
- for (int i = 0; i < items.size(); i++) {
- subList.set(i, items.get(i));
- }
- this.fireItemsReplaced(listName, index, items, replacedItems);
- return replacedItems;
- }
-
- /**
- * Convenience method.
- * Move items in the specified list from the specified source index to the
- * specified target index for the specified length.
- */
- protected <E> void moveItemsInList(int targetIndex, int sourceIndex, int length, List<E> list, String listName) {
- CollectionTools.move(list, targetIndex, sourceIndex, length);
- this.fireItemsMoved(listName, targetIndex, sourceIndex, length);
- }
-
- /**
- * Convenience method.
- * Move an item in the specified list from the specified source index to the
- * specified target index.
- */
- protected <E> void moveItemInList(int targetIndex, int sourceIndex, List<E> list, String listName) {
- CollectionTools.move(list, targetIndex, sourceIndex);
- this.fireItemMoved(listName, targetIndex, sourceIndex);
- }
-
- /**
- * Convenience method.
- * Clear the entire list
- * and fire the appropriate event if necessary.
- * Return whether the list changed.
- * @see java.util.List#clear()
- */
- protected boolean clearList(List<?> list, String listName) {
- if (list.isEmpty()) {
- return false;
- }
- list.clear();
- this.fireListCleared(listName);
- return true;
- }
-
-
- // ********** tree change support **********
-
- public synchronized void addTreeChangeListener(TreeChangeListener listener) {
- this.getChangeSupport().addTreeChangeListener(listener);
- }
-
- public synchronized void addTreeChangeListener(String treeName, TreeChangeListener listener) {
- this.getChangeSupport().addTreeChangeListener(treeName, listener);
- }
-
- public synchronized void removeTreeChangeListener(TreeChangeListener listener) {
- this.getChangeSupport().removeTreeChangeListener(listener);
- }
-
- public synchronized void removeTreeChangeListener(String treeName, TreeChangeListener listener) {
- this.getChangeSupport().removeTreeChangeListener(treeName, listener);
- }
-
- protected final void fireNodeAdded(String treeName, Object[] path) {
- this.getChangeSupport().fireNodeAdded(treeName, path);
- }
-
- protected final void fireNodeAdded(TreeChangeEvent event) {
- this.getChangeSupport().fireNodeAdded(event);
- }
-
- protected final void fireNodeRemoved(String treeName, Object[] path) {
- this.getChangeSupport().fireNodeRemoved(treeName, path);
- }
-
- protected final void fireNodeRemoved(TreeChangeEvent event) {
- this.getChangeSupport().fireNodeRemoved(event);
- }
-
- protected final void fireTreeCleared(String treeName) {
- this.getChangeSupport().fireTreeCleared(treeName);
- }
-
- protected final void fireTreeCleared(TreeChangeEvent event) {
- this.getChangeSupport().fireTreeCleared(event);
- }
-
- protected final void fireTreeChanged(String treeName) {
- this.getChangeSupport().fireTreeChanged(treeName);
- }
-
- protected final void fireTreeChanged(String treeName, Object[] path) {
- this.getChangeSupport().fireTreeChanged(treeName, path);
- }
-
- protected final void fireTreeChanged(TreeChangeEvent event) {
- this.getChangeSupport().fireTreeChanged(event);
- }
-
-
- // ********** queries **********
-
- /**
- * Return whether there are any state change listeners.
- */
- public boolean hasAnyStateChangeListeners() {
- return this.getChangeSupport().hasAnyStateChangeListeners();
- }
-
- /**
- * Return whether there are no state change listeners.
- */
- public boolean hasNoStateChangeListeners() {
- return ! this.hasAnyStateChangeListeners();
- }
-
- /**
- * Return whether there are any property change listeners for a specific property.
- */
- public boolean hasAnyPropertyChangeListeners(String propertyName) {
- return this.getChangeSupport().hasAnyPropertyChangeListeners(propertyName);
- }
-
- /**
- * Return whether there are any property change listeners for a specific property.
- */
- public boolean hasNoPropertyChangeListeners(String propertyName) {
- return ! this.hasAnyPropertyChangeListeners(propertyName);
- }
-
- /**
- * Return whether there are any collection change listeners for a specific collection.
- */
- public boolean hasAnyCollectionChangeListeners(String collectionName) {
- return this.getChangeSupport().hasAnyCollectionChangeListeners(collectionName);
- }
-
- /**
- * Return whether there are any collection change listeners for a specific collection.
- */
- public boolean hasNoCollectionChangeListeners(String collectionName) {
- return ! this.hasAnyCollectionChangeListeners(collectionName);
- }
-
- /**
- * Return whether there are any list change listeners for a specific list.
- */
- public boolean hasAnyListChangeListeners(String listName) {
- return this.getChangeSupport().hasAnyListChangeListeners(listName);
- }
-
- /**
- * Return whether there are any list change listeners for a specific list.
- */
- public boolean hasNoListChangeListeners(String listName) {
- return ! this.hasAnyListChangeListeners(listName);
- }
-
- /**
- * Return whether there are any tree change listeners for a specific tree.
- */
- public boolean hasAnyTreeChangeListeners(String treeName) {
- return this.getChangeSupport().hasAnyTreeChangeListeners(treeName);
- }
-
- /**
- * Return whether there are any tree change listeners for a specific tree.
- */
- public boolean hasNoTreeChangeListeners(String treeName) {
- return ! this.hasAnyTreeChangeListeners(treeName);
- }
-
-
- // ********** convenience methods **********
-
- /**
- * Return whether the values are equal, with the appropriate null checks.
- * Convenience method for checking whether an attribute value has changed.
- *
- * DO NOT use this to determine whether to fire a change notification,
- * 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 values are different, with the appropriate null checks.
- * Convenience method for checking whether an attribute value has changed.
- *
- * DO NOT use this to determine whether to fire a change notification,
- * ChangeSupport already does that.
- *
- * 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();
- clone.postClone();
- return clone;
- }
-
- /**
- * Perform any post-clone processing necessary to
- * successfully disconnect the clone from the original.
- * When this method is called on the clone, the clone
- * is a "shallow" copy of the original (i.e. the clone
- * shares all its instance variables with the original).
- */
- protected void postClone() {
- // clear out change support - models do not share listeners
- this.changeSupport = null;
- // when you override this method, don't forget to include:
- // super.postClone();
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- StringTools.buildSimpleToStringOn(this, sb);
- sb.append(" ("); //$NON-NLS-1$
- this.toString(sb);
- sb.append(')');
- return sb.toString();
- }
-
- /**
- * make this public so one model can call a nested model's
- * #toString(StringBuilder)
- */
- 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 e85a27bbe1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/CallbackChangeSupport.java
+++ /dev/null
@@ -1,83 +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.model;
-
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * This change support class will notify the source when one of the source's
- * aspects has changed.
- */
-public class CallbackChangeSupport extends ChangeSupport {
- private static final long serialVersionUID = 1L;
-
- public CallbackChangeSupport(Source source) {
- super(source);
- }
-
- protected Source source() {
- return (Source) this.source;
- }
-
- @Override
- protected ChangeSupport buildChildChangeSupport() {
- return new Child(this.source());
- }
-
- @Override
- protected void sourceChanged(String aspectName) {
- super.sourceChanged(aspectName);
- this.source().aspectChanged(aspectName);
- }
-
-
- // ********** child change support **********
-
- /**
- * The aspect-specific change support class does not need to
- * notify the source node of changes (the parent will take care of that);
- * nor does it need to build "grandchildren" change support objects.
- */
- protected static class Child extends ChangeSupport {
- private static final long serialVersionUID = 1L;
-
- public Child(Source source) {
- super(source);
- }
-
- protected Source source() {
- return (Source) this.source;
- }
-
- @Override
- protected ChangeSupport buildChildChangeSupport() {
- // there are no grandchildren
- throw new UnsupportedOperationException();
- }
-
- }
-
-
- // ********** source interface **********
-
- /**
- * The callback change support source must implement this interface so it
- * can be notified of any aspect changes.
- */
- public interface Source extends Model {
-
- /**
- * The specified aspect changed.
- */
- void aspectChanged(String aspectName);
-
- }
-
-}
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 3150f612bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/ChangeSupport.java
+++ /dev/null
@@ -1,2363 +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;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.lang.reflect.Array;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-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 Model interface.
- * It provides for state, property, collection, list, and tree change notifications to
- * listeners.
- *
- * NB: 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
- *
- * NB2: 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 *before* it is notified. If the listener has been removed
- * "concurrently" it will *not* be notified. (See the code that uses the
- * 'stillListening' local boolean flag.)
- *
- * NB3: Any listener that is added during the firing of events will *not* be
- * also notified.
- *
- * NB4: This class is serializable, but it will only write out listeners that
- * are also serializable while silently leaving behind listeners that are not.
- *
- * TODO fire a state change event with *every* change?
- * TODO use objects (IDs?) instead of strings to identify aspects?
- */
-public class ChangeSupport
- implements Serializable
-{
-
- /** The object to be provided as the "source" for any generated events. */
- protected final Model source;
-
- /** Associate a listener class to a collection of "generic" listeners for that class. */
- private transient GenericListenerList[] genericListeners = EMPTY_GENERIC_LISTENERS;
- private static final GenericListenerList[] EMPTY_GENERIC_LISTENERS = new GenericListenerList[0];
-
- /** Associate aspect names to child change support objects. */
- private AspectChild[] aspectChildren = EMPTY_ASPECT_CHILDREN;
- private static final AspectChild[] EMPTY_ASPECT_CHILDREN = new AspectChild[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 behavior **********
-
- /**
- * Add a "generic" listener that listens to all events appropriate to that
- * listener, regardless of the aspect name associated with that event.
- * The listener cannot be null.
- */
- protected <T extends ChangeListener> void addListener(Class<T> listenerClass, T listener) {
- if (listener == null) {
- throw new NullPointerException(); // better sooner than later
- }
- synchronized (this) {
- GenericListenerList gll = this.genericListenerList(listenerClass);
- if (gll == null) {
- this.addGenericListenerList(listenerClass, listener);
- } else {
- gll.addListener(listener);
- }
- }
- }
-
- /**
- * Return the "generic" listener list for the specified listener class.
- * Return null if the list is not present.
- */
- protected GenericListenerList genericListenerList(Class<? extends ChangeListener> listenerClass) {
- for (GenericListenerList gll : this.genericListeners) {
- if (gll.listenerClass == listenerClass) {
- return gll;
- }
- }
- return null;
- }
-
- /**
- * Add the "generic" listener list for the specified listener class.
- * Return the newly-built generic listener list.
- */
- protected <T extends ChangeListener> GenericListenerList addGenericListenerList(Class<T> listenerClass, T listener) {
- GenericListenerList gll = new GenericListenerList(listenerClass, listener);
- this.genericListeners = CollectionTools.add(this.genericListeners, gll);
- return gll;
- }
-
- /**
- * Adds a listener that listens to all events appropriate to that listener,
- * and only to those events carrying the aspect name specified.
- * The aspect name cannot be null and the listener cannot be null.
- */
- protected <T extends ChangeListener> void addListener(String aspectName, Class<T> listenerClass, T listener) {
- if ((aspectName == null) || (listener == null)) {
- throw new NullPointerException(); // better sooner than later
- }
- synchronized (this) {
- ChangeSupport child = this.child(aspectName);
- if (child == null) {
- child = this.addChild(aspectName);
- }
- child.addListener(listenerClass, listener);
- }
- }
-
- /**
- * Return the child change support for the specified aspect name.
- * Return null if the aspect name is null or the child is not present.
- */
- protected ChangeSupport child(String aspectName) {
- // put in a null check to simplify calling code
- if (aspectName == null) {
- return null;
- }
- for (AspectChild aspectChild : this.aspectChildren) {
- if (aspectChild.aspectName == aspectName) {
- return aspectChild.child;
- }
- }
- return null;
- }
-
- /**
- * Add the child change support for the specified aspect name.
- * Return the newly-built child change support.
- */
- protected ChangeSupport addChild(String aspectName) {
- ChangeSupport child = this.buildChildChangeSupport();
- this.aspectChildren = CollectionTools.add(this.aspectChildren, new AspectChild(aspectName, child));
- return child;
- }
-
- /**
- * Build and return a child change support to hold aspect-specific listeners.
- */
- protected ChangeSupport buildChildChangeSupport() {
- return new ChangeSupport(this.source);
- }
-
- /**
- * Removes a "generic" listener that has been registered for all events
- * appropriate to that listener.
- */
- protected <T extends ChangeListener> void removeListener(Class<T> listenerClass, T listener) {
- synchronized (this) {
- GenericListenerList gll = this.genericListenerList(listenerClass);
- if (gll == null) {
- throw new IllegalArgumentException("listener not registered"); //$NON-NLS-1$
- }
- if ( ! gll.removeListener(listener)) { // leave the GLL, even if it is empty?
- throw new IllegalArgumentException("listener not registered: " + listener); //$NON-NLS-1$
- }
- }
- }
-
- /**
- * Removes a listener that has been registered for appropriate
- * events carrying the specified aspect name.
- */
- protected <T extends ChangeListener> void removeListener(String aspectName, Class<T> listenerClass, T listener) {
- synchronized (this) {
- ChangeSupport child = this.child(aspectName);
- if (child == null) {
- throw new IllegalArgumentException("listener not registered"); //$NON-NLS-1$
- }
- child.removeListener(listenerClass, listener); // leave the child, even if it is empty?
- }
- }
-
-
- // ********** internal queries **********
-
- /**
- * Return the "generic" listeners for the specified listener class.
- * Return null if there are no listeners.
- */
- protected ChangeListener[] listeners(Class<? extends ChangeListener> listenerClass) {
- GenericListenerList gll = this.genericListenerList(listenerClass);
- return (gll == null) ? null : gll.listeners;
- }
-
- /**
- * Return whether there are any "generic" listeners for the specified
- * listener class.
- */
- protected synchronized <T extends ChangeListener> boolean hasAnyListeners(Class<T> listenerClass) {
- GenericListenerList gll = this.genericListenerList(listenerClass);
- return (gll != null) && gll.hasListeners();
- }
-
- /**
- * Return whether there are no "generic" listeners for the specified
- * listener class.
- */
- protected <T extends ChangeListener> boolean hasNoListeners(Class<T> listenerClass) {
- return ! this.hasAnyListeners(listenerClass);
- }
-
- /**
- * Return whether there are any listeners for the specified
- * listener class and aspect name.
- */
- protected synchronized boolean hasAnyListeners(Class<? extends ChangeListener> listenerClass, String aspectName) {
- if (this.hasAnyListeners(listenerClass)) {
- return true; // there's a "generic" listener
- }
- ChangeSupport child = this.child(aspectName);
- return (child != null) &&
- child.hasAnyListeners(listenerClass);
- }
-
- /**
- * Return whether there are no "generic" listeners for the specified
- * listener class and aspect name.
- */
- protected <T extends ChangeListener> boolean hasNoListeners(Class<T> listenerClass, String aspectName) {
- return ! this.hasAnyListeners(listenerClass, aspectName);
- }
-
-
- // ********** behavior **********
-
- /**
- * The specified aspect of the source has changed;
- * override this method to perform things like setting a
- * dirty flag or validating the source's state.
- * The aspect ID will be null if a "state change" occurred.
- */
- protected void sourceChanged(@SuppressWarnings("unused") String aspectName) {
- // the default is to do nothing
- }
-
-
- // ********** 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 StateChangeListener[] stateChangeListeners() {
- return (StateChangeListener[]) this.listeners(STATE_CHANGE_LISTENER_CLASS);
- }
-
- /**
- * Fire the specified state change event to any registered listeners.
- */
- public void fireStateChanged(StateChangeEvent event) {
-
- StateChangeListener[] targets = null;
-
- synchronized (this) {
- StateChangeListener[] stateChangeListeners = this.stateChangeListeners();
- if (stateChangeListeners != null) {
- targets = stateChangeListeners.clone();
- }
- }
-
- if (targets != null) {
- for (StateChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.stateChangeListeners(), target);
- }
- if (stillListening) {
- target.stateChanged(event);
- }
- }
- }
-
- this.sourceChanged(null);
- }
-
- /**
- * Report a generic state change event to any registered state change
- * listeners.
- */
- public void fireStateChanged() {
-// this.fireStateChange(new StateChangeEvent(this.source));
-
- StateChangeListener[] targets = null;
-
- synchronized (this) {
- StateChangeListener[] stateChangeListeners = this.stateChangeListeners();
- if (stateChangeListeners != null) {
- targets = stateChangeListeners.clone();
- }
- }
-
- if (targets != null) {
- StateChangeEvent event = null;
- for (StateChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.stateChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new StateChangeEvent(this.source);
- }
- target.stateChanged(event);
- }
- }
- }
-
- this.sourceChanged(null);
- }
-
-
- // ********** property change support **********
-
- protected static final Class<PropertyChangeListener> PROPERTY_CHANGE_LISTENER_CLASS = PropertyChangeListener.class;
-
- /**
- * Return whether the 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) {
- if ((value1 == null) && (value2 == null)) {
- return true; // both are null
- }
- if ((value1 == null) || (value2 == null)) {
- return false; // one is null but the other is not
- }
- return value1.equals(value2);
- }
-
- /**
- * Return whether the 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 ! this.valuesAreEqual(value1, value2);
- }
-
- /**
- * Add a property change listener that is registered for all properties.
- */
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- this.addListener(PROPERTY_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * 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(propertyName, PROPERTY_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Remove a property change listener that was registered for all properties.
- */
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- this.removeListener(PROPERTY_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Remove a property change listener that was registered for a specific property.
- */
- public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- this.removeListener(propertyName, PROPERTY_CHANGE_LISTENER_CLASS, 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);
- }
-
- /**
- * Return whether there are any property change listeners that will
- * be notified when any property has changed.
- */
- public boolean hasAnyPropertyChangeListeners() {
- return this.hasAnyListeners(PROPERTY_CHANGE_LISTENER_CLASS);
- }
-
- private PropertyChangeListener[] propertyChangeListeners() {
- return (PropertyChangeListener[]) this.listeners(PROPERTY_CHANGE_LISTENER_CLASS);
- }
-
- /**
- * 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.valuesAreEqual(event.getOldValue(), event.getNewValue())) {
- return;
- }
-
- String propertyName = event.getPropertyName();
-
- PropertyChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- PropertyChangeListener[] propertyChangeListeners = this.propertyChangeListeners();
- if (propertyChangeListeners != null) {
- targets = propertyChangeListeners.clone();
- }
- child = this.child(propertyName);
- }
-
- if (targets != null) {
- for (PropertyChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.propertyChangeListeners(), target);
- }
- if (stillListening) {
- target.propertyChanged(event);
- }
- }
- }
- if (child != null) {
- child.firePropertyChanged(event);
- }
-
- this.sourceChanged(propertyName);
- }
-
- /**
- * 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.valuesAreEqual(oldValue, newValue)) {
- return;
- }
-
- PropertyChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- PropertyChangeListener[] propertyChangeListeners = this.propertyChangeListeners();
- if (propertyChangeListeners != null) {
- targets = propertyChangeListeners.clone();
- }
- child = this.child(propertyName);
- }
-
- PropertyChangeEvent event = null;
-
- if (targets != null) {
- for (PropertyChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.propertyChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new PropertyChangeEvent(this.source, propertyName, oldValue, newValue);
- }
- target.propertyChanged(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.firePropertyChanged(propertyName, oldValue, newValue);
- } else {
- child.firePropertyChanged(event);
- }
- }
-
- this.sourceChanged(propertyName);
- }
-
- /**
- * 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, new Integer(oldValue), new Integer(newValue));
- if (oldValue == newValue) {
- return;
- }
-
- PropertyChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- PropertyChangeListener[] propertyChangeListeners = this.propertyChangeListeners();
- if (propertyChangeListeners != null) {
- targets = propertyChangeListeners.clone();
- }
- child = this.child(propertyName);
- }
-
- PropertyChangeEvent event = null;
-
- if (targets != null) {
- for (PropertyChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.propertyChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new PropertyChangeEvent(this.source, propertyName, new Integer(oldValue), new Integer(newValue));
- }
- target.propertyChanged(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.firePropertyChanged(propertyName, oldValue, newValue);
- } else {
- child.firePropertyChanged(event);
- }
- }
-
- this.sourceChanged(propertyName);
- }
-
- /**
- * 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) {
- return;
- }
-
- PropertyChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- PropertyChangeListener[] propertyChangeListeners = this.propertyChangeListeners();
- if (propertyChangeListeners != null) {
- targets = propertyChangeListeners.clone();
- }
- child = this.child(propertyName);
- }
-
- PropertyChangeEvent event = null;
-
- if (targets != null) {
- for (PropertyChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.propertyChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new PropertyChangeEvent(this.source, propertyName, Boolean.valueOf(oldValue), Boolean.valueOf(newValue));
- }
- target.propertyChanged(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.firePropertyChanged(propertyName, oldValue, newValue);
- } else {
- child.firePropertyChanged(event);
- }
- }
-
- this.sourceChanged(propertyName);
- }
-
-
- // ********** collection change support **********
-
- protected static final Class<CollectionChangeListener> COLLECTION_CHANGE_LISTENER_CLASS = CollectionChangeListener.class;
-
- /**
- * Add a collection change listener that is registered for all collections.
- */
- public void addCollectionChangeListener(CollectionChangeListener listener) {
- this.addListener(COLLECTION_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * 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(collectionName, COLLECTION_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Remove a collection change listener that was registered for all collections.
- */
- public void removeCollectionChangeListener(CollectionChangeListener listener) {
- this.removeListener(COLLECTION_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Remove a collection change listener that was registered for a specific collection.
- */
- public void removeCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- this.removeListener(collectionName, COLLECTION_CHANGE_LISTENER_CLASS, 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);
- }
-
- /**
- * Return whether there are any collection change listeners that will
- * be notified when any collection has changed.
- */
- public boolean hasAnyCollectionChangeListeners() {
- return this.hasAnyListeners(COLLECTION_CHANGE_LISTENER_CLASS);
- }
-
- private CollectionChangeListener[] collectionChangeListeners() {
- return (CollectionChangeListener[]) this.listeners(COLLECTION_CHANGE_LISTENER_CLASS);
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireItemsAdded(CollectionChangeEvent event) {
- if (event.itemsSize() == 0) {
- return;
- }
-
- String collectionName = event.getCollectionName();
-
- CollectionChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- CollectionChangeListener[] collectionChangeListeners = this.collectionChangeListeners();
- if (collectionChangeListeners != null) {
- targets = collectionChangeListeners.clone();
- }
- child = this.child(collectionName);
- }
-
- if (targets != null) {
- for (CollectionChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.collectionChangeListeners(), target);
- }
- if (stillListening) {
- target.itemsAdded(event);
- }
- }
- }
- if (child != null) {
- child.fireItemsAdded(event);
- }
-
- this.sourceChanged(collectionName);
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireItemsAdded(String collectionName, Collection<?> addedItems) {
-// this.fireItemsAdded(new CollectionChangeEvent(this.source, collectionName, addedItems));
- if (addedItems.size() == 0) {
- return;
- }
-
- CollectionChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- CollectionChangeListener[] collectionChangeListeners = this.collectionChangeListeners();
- if (collectionChangeListeners != null) {
- targets = collectionChangeListeners.clone();
- }
- child = this.child(collectionName);
- }
-
- CollectionChangeEvent event = null;
-
- if (targets != null) {
- for (CollectionChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.collectionChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new CollectionChangeEvent(this.source, collectionName, addedItems);
- }
- target.itemsAdded(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireItemsAdded(collectionName, addedItems);
- } else {
- child.fireItemsAdded(event);
- }
- }
-
- this.sourceChanged(collectionName);
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireItemAdded(String collectionName, Object addedItem) {
-// this.fireItemsAdded(collectionName, Collections.singleton(addedItem));
-
- CollectionChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- CollectionChangeListener[] collectionChangeListeners = this.collectionChangeListeners();
- if (collectionChangeListeners != null) {
- targets = collectionChangeListeners.clone();
- }
- child = this.child(collectionName);
- }
-
- CollectionChangeEvent event = null;
-
- if (targets != null) {
- for (CollectionChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.collectionChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new CollectionChangeEvent(this.source, collectionName, Collections.singleton(addedItem));
- }
- target.itemsAdded(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireItemAdded(collectionName, addedItem);
- } else {
- child.fireItemsAdded(event);
- }
- }
-
- this.sourceChanged(collectionName);
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireItemsRemoved(CollectionChangeEvent event) {
- if (event.itemsSize() == 0) {
- return;
- }
-
- String collectionName = event.getCollectionName();
-
- CollectionChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- CollectionChangeListener[] collectionChangeListeners = this.collectionChangeListeners();
- if (collectionChangeListeners != null) {
- targets = collectionChangeListeners.clone();
- }
- child = this.child(collectionName);
- }
-
- if (targets != null) {
- for (CollectionChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.collectionChangeListeners(), target);
- }
- if (stillListening) {
- target.itemsRemoved(event);
- }
- }
- }
- if (child != null) {
- child.fireItemsRemoved(event);
- }
-
- this.sourceChanged(collectionName);
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireItemsRemoved(String collectionName, Collection<?> removedItems) {
-// this.fireItemsRemoved(new CollectionChangeEvent(this.source, collectionName, removedItems));
- if (removedItems.size() == 0) {
- return;
- }
-
- CollectionChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- CollectionChangeListener[] collectionChangeListeners = this.collectionChangeListeners();
- if (collectionChangeListeners != null) {
- targets = collectionChangeListeners.clone();
- }
- child = this.child(collectionName);
- }
-
- CollectionChangeEvent event = null;
-
- if (targets != null) {
- for (CollectionChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.collectionChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new CollectionChangeEvent(this.source, collectionName, removedItems);
- }
- target.itemsRemoved(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireItemsRemoved(collectionName, removedItems);
- } else {
- child.fireItemsRemoved(event);
- }
- }
-
- this.sourceChanged(collectionName);
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireItemRemoved(String collectionName, Object removedItem) {
-// this.fireItemsRemoved(collectionName, Collections.singleton(removedItem));
-
- CollectionChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- CollectionChangeListener[] collectionChangeListeners = this.collectionChangeListeners();
- if (collectionChangeListeners != null) {
- targets = collectionChangeListeners.clone();
- }
- child = this.child(collectionName);
- }
-
- CollectionChangeEvent event = null;
-
- if (targets != null) {
- for (CollectionChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.collectionChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new CollectionChangeEvent(this.source, collectionName, Collections.singleton(removedItem));
- }
- target.itemsRemoved(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireItemRemoved(collectionName, removedItem);
- } else {
- child.fireItemsRemoved(event);
- }
- }
-
- this.sourceChanged(collectionName);
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireCollectionCleared(CollectionChangeEvent event) {
- String collectionName = event.getCollectionName();
-
- CollectionChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- CollectionChangeListener[] collectionChangeListeners = this.collectionChangeListeners();
- if (collectionChangeListeners != null) {
- targets = collectionChangeListeners.clone();
- }
- child = this.child(collectionName);
- }
-
- if (targets != null) {
- for (CollectionChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.collectionChangeListeners(), target);
- }
- if (stillListening) {
- target.collectionCleared(event);
- }
- }
- }
- if (child != null) {
- child.fireCollectionCleared(event);
- }
-
- this.sourceChanged(collectionName);
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireCollectionCleared(String collectionName) {
-// this.fireCollectionCleared(new CollectionChangeEvent(this.source, collectionName));
-
- CollectionChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- CollectionChangeListener[] collectionChangeListeners = this.collectionChangeListeners();
- if (collectionChangeListeners != null) {
- targets = collectionChangeListeners.clone();
- }
- child = this.child(collectionName);
- }
-
- CollectionChangeEvent event = null;
-
- if (targets != null) {
- for (CollectionChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.collectionChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new CollectionChangeEvent(this.source, collectionName);
- }
- target.collectionCleared(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireCollectionCleared(collectionName);
- } else {
- child.fireCollectionCleared(event);
- }
- }
-
- this.sourceChanged(collectionName);
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireCollectionChanged(CollectionChangeEvent event) {
- String collectionName = event.getCollectionName();
-
- CollectionChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- CollectionChangeListener[] collectionChangeListeners = this.collectionChangeListeners();
- if (collectionChangeListeners != null) {
- targets = collectionChangeListeners.clone();
- }
- child = this.child(collectionName);
- }
-
- if (targets != null) {
- for (CollectionChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.collectionChangeListeners(), target);
- }
- if (stillListening) {
- target.collectionChanged(event);
- }
- }
- }
- if (child != null) {
- child.fireCollectionChanged(event);
- }
-
- this.sourceChanged(collectionName);
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireCollectionChanged(String collectionName) {
-// this.fireCollectionChanged(new CollectionChangeEvent(this.source, collectionName));
-
- CollectionChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- CollectionChangeListener[] collectionChangeListeners = this.collectionChangeListeners();
- if (collectionChangeListeners != null) {
- targets = collectionChangeListeners.clone();
- }
- child = this.child(collectionName);
- }
-
- CollectionChangeEvent event = null;
-
- if (targets != null) {
- for (CollectionChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.collectionChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new CollectionChangeEvent(this.source, collectionName);
- }
- target.collectionChanged(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireCollectionChanged(collectionName);
- } else {
- child.fireCollectionChanged(event);
- }
- }
-
- this.sourceChanged(collectionName);
- }
-
-
- // ********** list change support **********
-
- protected static final Class<ListChangeListener> LIST_CHANGE_LISTENER_CLASS = ListChangeListener.class;
-
- /**
- * Add a list change listener that is registered for all lists.
- */
- public void addListChangeListener(ListChangeListener listener) {
- this.addListener(LIST_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * 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(listName, LIST_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Remove a list change listener that was registered for all lists.
- */
- public void removeListChangeListener(ListChangeListener listener) {
- this.removeListener(LIST_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Remove a list change listener that was registered for a specific list.
- */
- public void removeListChangeListener(String listName, ListChangeListener listener) {
- this.removeListener(listName, LIST_CHANGE_LISTENER_CLASS, 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);
- }
-
- /**
- * Return whether there are any list change listeners that will
- * be notified when any list has changed.
- */
- public boolean hasAnyListChangeListeners() {
- return this.hasAnyListeners(LIST_CHANGE_LISTENER_CLASS);
- }
-
- private ListChangeListener[] listChangeListeners() {
- return (ListChangeListener[]) this.listeners(LIST_CHANGE_LISTENER_CLASS);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemsAdded(ListChangeEvent event) {
- if (event.itemsSize() == 0) {
- return;
- }
-
- String listName = event.getListName();
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- target.itemsAdded(event);
- }
- }
- }
- if (child != null) {
- child.fireItemsAdded(event);
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemsAdded(String listName, int index, List<?> addedItems) {
-// this.fireItemsAdded(new ListChangeEvent(this.source, listName, index, addedItems));
- if (addedItems.size() == 0) {
- return;
- }
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- ListChangeEvent event = null;
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new ListChangeEvent(this.source, listName, index, addedItems);
- }
- target.itemsAdded(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireItemsAdded(listName, index, addedItems);
- } else {
- child.fireItemsAdded(event);
- }
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * 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));
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- ListChangeEvent event = null;
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new ListChangeEvent(this.source, listName, index, Collections.singletonList(addedItem));
- }
- target.itemsAdded(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireItemAdded(listName, index, addedItem);
- } else {
- child.fireItemsAdded(event);
- }
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemsRemoved(ListChangeEvent event) {
- if (event.itemsSize() == 0) {
- return;
- }
-
- String listName = event.getListName();
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- target.itemsRemoved(event);
- }
- }
- }
- if (child != null) {
- child.fireItemsRemoved(event);
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemsRemoved(String listName, int index, List<?> removedItems) {
-// this.fireItemsRemoved(new ListChangeEvent(this.source, listName, index, removedItems));
- if (removedItems.size() == 0) {
- return;
- }
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- ListChangeEvent event = null;
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new ListChangeEvent(this.source, listName, index, removedItems);
- }
- target.itemsRemoved(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireItemsRemoved(listName, index, removedItems);
- } else {
- child.fireItemsRemoved(event);
- }
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * 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));
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- ListChangeEvent event = null;
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new ListChangeEvent(this.source, listName, index, Collections.singletonList(removedItem));
- }
- target.itemsRemoved(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireItemRemoved(listName, index, removedItem);
- } else {
- child.fireItemsRemoved(event);
- }
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemsReplaced(ListChangeEvent event) {
- if (event.itemsSize() == 0) {
- return;
- }
-
- String listName = event.getListName();
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- target.itemsReplaced(event);
- }
- }
- }
- if (child != null) {
- child.fireItemsReplaced(event);
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemsReplaced(String listName, int index, List<?> newItems, List<?> replacedItems) {
-// this.fireItemsReplaced(new ListChangeEvent(this.source, listName, index, newItems, replacedItems));
- if (newItems.size() == 0) {
- return;
- }
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- ListChangeEvent event = null;
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new ListChangeEvent(this.source, listName, index, newItems, replacedItems);
- }
- target.itemsReplaced(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireItemsReplaced(listName, index, newItems, replacedItems);
- } else {
- child.fireItemsReplaced(event);
- }
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemReplaced(String listName, int index, Object newItem, Object replacedItem) {
-// this.fireItemsReplaced(listName, index, Collections.singletonList(newItem), Collections.singletonList(replacedItem));
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- ListChangeEvent event = null;
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new ListChangeEvent(this.source, listName, index, Collections.singletonList(newItem), Collections.singletonList(replacedItem));
- }
- target.itemsReplaced(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireItemReplaced(listName, index, newItem, replacedItem);
- } else {
- child.fireItemsReplaced(event);
- }
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemsMoved(ListChangeEvent event) {
- if (event.getTargetIndex() == event.getSourceIndex()) {
- return;
- }
-
- String listName = event.getListName();
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- target.itemsMoved(event);
- }
- }
- }
- if (child != null) {
- child.fireItemsMoved(event);
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemsMoved(String listName, int targetIndex, int sourceIndex, int length) {
-// this.fireItemsMoved(new ListChangeEvent(this.source, listName, targetIndex, sourceIndex, length));
- if (targetIndex == sourceIndex) {
- return;
- }
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- ListChangeEvent event = null;
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new ListChangeEvent(this.source, listName, targetIndex, sourceIndex, length);
- }
- target.itemsMoved(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireItemsMoved(listName, targetIndex, sourceIndex, length);
- } else {
- child.fireItemsMoved(event);
- }
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * 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(ListChangeEvent event) {
- String listName = event.getListName();
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- target.listCleared(event);
- }
- }
- }
- if (child != null) {
- child.fireListCleared(event);
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireListCleared(String listName) {
-// this.fireListCleared(new ListChangeEvent(this.source, listName));
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- ListChangeEvent event = null;
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new ListChangeEvent(this.source, listName);
- }
- target.listCleared(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireListCleared(listName);
- } else {
- child.fireListCleared(event);
- }
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireListChanged(ListChangeEvent event) {
- String listName = event.getListName();
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- target.listChanged(event);
- }
- }
- }
- if (child != null) {
- child.fireListChanged(event);
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireListChanged(String listName) {
-// this.fireListChanged(new ListChangeEvent(this.source, listName));
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- ListChangeEvent event = null;
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new ListChangeEvent(this.source, listName);
- }
- target.listChanged(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireListChanged(listName);
- } else {
- child.fireListChanged(event);
- }
- }
-
- this.sourceChanged(listName);
- }
-
-
- // ********** tree change support **********
-
- protected static final Class<TreeChangeListener> TREE_CHANGE_LISTENER_CLASS = TreeChangeListener.class;
- private static final Object[] EMPTY_TREE_PATH = new Object[0];
-
- /**
- * Add a tree change listener that is registered for all trees.
- */
- public void addTreeChangeListener(TreeChangeListener listener) {
- this.addListener(TREE_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * 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(treeName, TREE_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Remove a tree change listener that was registered for all tree.
- */
- public void removeTreeChangeListener(TreeChangeListener listener) {
- this.removeListener(TREE_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Remove a tree change listener that was registered for a specific tree.
- */
- public void removeTreeChangeListener(String treeName, TreeChangeListener listener) {
- this.removeListener(treeName, TREE_CHANGE_LISTENER_CLASS, 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);
- }
-
- /**
- * Return whether there are any tree change listeners that will
- * be notified when any tree has changed.
- */
- public boolean hasAnyTreeChangeListeners() {
- return this.hasAnyListeners(TREE_CHANGE_LISTENER_CLASS);
- }
-
- private TreeChangeListener[] treeChangeListeners() {
- return (TreeChangeListener[]) this.listeners(TREE_CHANGE_LISTENER_CLASS);
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireNodeAdded(TreeChangeEvent event) {
- String treeName = event.getTreeName();
-
- TreeChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- TreeChangeListener[] treeChangeListeners = this.treeChangeListeners();
- if (treeChangeListeners != null) {
- targets = treeChangeListeners.clone();
- }
- child = this.child(treeName);
- }
-
- if (targets != null) {
- for (TreeChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.treeChangeListeners(), target);
- }
- if (stillListening) {
- target.nodeAdded(event);
- }
- }
- }
- if (child != null) {
- child.fireNodeAdded(event);
- }
-
- this.sourceChanged(treeName);
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireNodeAdded(String treeName, Object[] path) {
-// this.fireNodeAdded(new TreeChangeEvent(this.source, treeName, path));
-
- TreeChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- TreeChangeListener[] treeChangeListeners = this.treeChangeListeners();
- if (treeChangeListeners != null) {
- targets = treeChangeListeners.clone();
- }
- child = this.child(treeName);
- }
-
- TreeChangeEvent event = null;
-
- if (targets != null) {
- for (TreeChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.treeChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new TreeChangeEvent(this.source, treeName, path);
- }
- target.nodeAdded(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireNodeAdded(treeName, path);
- } else {
- child.fireNodeAdded(event);
- }
- }
-
- this.sourceChanged(treeName);
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireNodeRemoved(TreeChangeEvent event) {
- String treeName = event.getTreeName();
-
- TreeChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- TreeChangeListener[] treeChangeListeners = this.treeChangeListeners();
- if (treeChangeListeners != null) {
- targets = treeChangeListeners.clone();
- }
- child = this.child(treeName);
- }
-
- if (targets != null) {
- for (TreeChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.treeChangeListeners(), target);
- }
- if (stillListening) {
- target.nodeRemoved(event);
- }
- }
- }
- if (child != null) {
- child.fireNodeRemoved(event);
- }
-
- this.sourceChanged(treeName);
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireNodeRemoved(String treeName, Object[] path) {
-// this.fireNodeRemoved(new TreeChangeEvent(this.source, treeName, path));
-
- TreeChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- TreeChangeListener[] treeChangeListeners = this.treeChangeListeners();
- if (treeChangeListeners != null) {
- targets = treeChangeListeners.clone();
- }
- child = this.child(treeName);
- }
-
- TreeChangeEvent event = null;
-
- if (targets != null) {
- for (TreeChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.treeChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new TreeChangeEvent(this.source, treeName, path);
- }
- target.nodeRemoved(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireNodeRemoved(treeName, path);
- } else {
- child.fireNodeRemoved(event);
- }
- }
-
- this.sourceChanged(treeName);
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireTreeCleared(TreeChangeEvent event) {
- String treeName = event.getTreeName();
-
- TreeChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- TreeChangeListener[] treeChangeListeners = this.treeChangeListeners();
- if (treeChangeListeners != null) {
- targets = treeChangeListeners.clone();
- }
- child = this.child(treeName);
- }
-
- if (targets != null) {
- for (TreeChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.treeChangeListeners(), target);
- }
- if (stillListening) {
- target.treeCleared(event);
- }
- }
- }
- if (child != null) {
- child.fireTreeCleared(event);
- }
-
- this.sourceChanged(treeName);
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireTreeCleared(String treeName, Object[] path) {
-// this.fireTreeCleared(new TreeChangeEvent(this.source, treeName, path));
-
- TreeChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- TreeChangeListener[] treeChangeListeners = this.treeChangeListeners();
- if (treeChangeListeners != null) {
- targets = treeChangeListeners.clone();
- }
- child = this.child(treeName);
- }
-
- TreeChangeEvent event = null;
-
- if (targets != null) {
- for (TreeChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.treeChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new TreeChangeEvent(this.source, treeName, path);
- }
- target.treeCleared(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireTreeCleared(treeName, path);
- } else {
- child.fireTreeCleared(event);
- }
- }
-
- this.sourceChanged(treeName);
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireTreeCleared(String treeName) {
- this.fireTreeCleared(treeName, EMPTY_TREE_PATH);
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireTreeChanged(TreeChangeEvent event) {
- String treeName = event.getTreeName();
-
- TreeChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- TreeChangeListener[] treeChangeListeners = this.treeChangeListeners();
- if (treeChangeListeners != null) {
- targets = treeChangeListeners.clone();
- }
- child = this.child(treeName);
- }
-
- if (targets != null) {
- for (TreeChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.treeChangeListeners(), target);
- }
- if (stillListening) {
- target.treeChanged(event);
- }
- }
- }
- if (child != null) {
- child.fireTreeChanged(event);
- }
-
- this.sourceChanged(treeName);
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireTreeChanged(String treeName, Object[] path) {
-// this.fireTreeChanged(new TreeChangeEvent(this.source, treeName, path));
-
- TreeChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- TreeChangeListener[] treeChangeListeners = this.treeChangeListeners();
- if (treeChangeListeners != null) {
- targets = treeChangeListeners.clone();
- }
- child = this.child(treeName);
- }
-
- TreeChangeEvent event = null;
-
- if (targets != null) {
- for (TreeChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.treeChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new TreeChangeEvent(this.source, treeName, path);
- }
- target.treeChanged(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireTreeChanged(treeName, path);
- } else {
- child.fireTreeChanged(event);
- }
- }
-
- this.sourceChanged(treeName);
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireTreeChanged(String treeName) {
- this.fireTreeChanged(treeName, EMPTY_TREE_PATH);
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.source);
- }
-
-
- // ********** serialization **********
-
- private synchronized void writeObject(ObjectOutputStream s) throws IOException {
- // write out the source, children, and any hidden stuff
- s.defaultWriteObject();
-
- // only write out Serializable listeners
- int len = this.genericListeners.length;
- for (int i = 0; i < len; i++) {
- this.writeObject(s, this.genericListeners[i]);
- }
- s.writeObject(null);
- }
-
- private void writeObject(ObjectOutputStream s, GenericListenerList gll) throws IOException {
- boolean first = true;
- int len = gll.listeners.length;
- for (int i = 0; i < len; i++) {
- ChangeListener listener = gll.listeners[i];
- if (listener instanceof Serializable) {
- if (first) {
- first = false;
- s.writeObject(gll.listenerClass);
- }
- s.writeObject(listener);
- }
- }
- if ( ! first) {
- s.writeObject(null);
- }
- }
-
- private synchronized void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException {
- // read in the source, children, and any hidden stuff
- s.defaultReadObject();
-
- // read in generic listener lists
- this.genericListeners = EMPTY_GENERIC_LISTENERS;
- Object o;
- while (null != (o = s.readObject())) {
- @SuppressWarnings("unchecked")
- Class<? extends ChangeListener> listenerClass = (Class<? extends ChangeListener>) o;
- GenericListenerList gll = null;
- while (null != (o = s.readObject())) {
- if (gll == null) {
- gll = this.addGenericListenerList_(listenerClass, (ChangeListener) o);
- } else {
- gll.addListener((ChangeListener) o);
- }
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- private <T extends ChangeListener> GenericListenerList addGenericListenerList_(Class<T> listenerClass, ChangeListener listener) {
- return this.addGenericListenerList(listenerClass, (T) listener);
- }
-
-
- // ********** member classes **********
-
- /**
- * Pair a listener class with its "generic" listeners.
- */
- private static class GenericListenerList {
- final Class<? extends ChangeListener> listenerClass;
- ChangeListener[] listeners;
-
- <T extends ChangeListener> GenericListenerList(Class<T> listenerClass, T listener) {
- super();
- this.listenerClass = listenerClass;
- this.listeners = (ChangeListener[]) Array.newInstance(listenerClass, 1);
- this.listeners[0] = listener;
- }
-
- void addListener(ChangeListener listener) {
- this.listeners = CollectionTools.add(this.listeners, listener);
- }
-
- boolean removeListener(ChangeListener listener) {
- int len = this.listeners.length;
- if (len == 0) {
- return false;
- }
- try {
- this.listeners = CollectionTools.remove(this.listeners, listener);
- } catch (ArrayIndexOutOfBoundsException ex) {
- return false; // listener not in the list
- }
- return (this.listeners.length + 1) == len;
- }
-
- boolean hasListeners() {
- return this.listeners.length > 0;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, ClassTools.shortNameFor(this.listenerClass));
- }
-
- }
-
- /**
- * Pair an aspect name with the change support holding its associated
- * listeners.
- */
- private static class AspectChild implements Serializable {
- final String aspectName;
- final ChangeSupport child;
- private static final long serialVersionUID = 1L;
-
- AspectChild(String aspectName, ChangeSupport child) {
- super();
- this.aspectName = aspectName;
- this.child = child;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.aspectName);
- }
-
- }
-
-}
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 29852e2a0f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/SingleAspectChangeSupport.java
+++ /dev/null
@@ -1,331 +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;
-
-import java.util.Collection;
-import java.util.List;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-
-/**
- * This change support class changes the behavior of the standard
- * ChangeSupport in several ways:
- * - All events fired by the source must specify the single aspect.
- * - Listeners are required to be either "generic" listeners or
- * listeners of the single aspect.
- */
-public class SingleAspectChangeSupport
- extends ChangeSupport
-{
- protected final Class<? extends ChangeListener> listenerClass;
- protected final String aspectName;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructor **********
-
- public SingleAspectChangeSupport(Model source, Class<? extends ChangeListener> listenerClass, String aspectName) {
- super(source);
- this.listenerClass = listenerClass;
- this.aspectName = aspectName;
- }
-
-
- // ********** internal behavior **********
-
- private UnsupportedOperationException unsupportedOperationException() {
- return new UnsupportedOperationException("This Model supports only changes for the listener type \"" + this.listenerClass.getName()
- + "\" and the aspect \"" + this.aspectName + "\"");
- }
-
- private void check(Class<? extends ChangeListener> lClass, String aName) {
- if (lClass != this.listenerClass) {
- throw new IllegalArgumentException("This Model supports only changes for the listener type \"" + this.listenerClass.getName() + "\" : \"" + lClass.getName() + "\"");
- }
- if (aName != this.aspectName) {
- throw new IllegalArgumentException("This Model supports only changes for the aspect \"" + this.aspectName + "\" : \"" + aName + "\"");
- }
- }
-
- @Override
- protected <T extends ChangeListener> void addListener(String aName, Class<T> lClass, T listener) {
- this.check(lClass, aName);
- super.addListener(aName, lClass, listener);
- }
-
- @Override
- protected <T extends ChangeListener> void removeListener(String aName, Class<T> lClass, T listener) {
- this.check(lClass, aName);
- super.removeListener(aName, lClass, listener);
- }
-
-
- // ********** internal queries **********
-
- @Override
- protected boolean hasAnyListeners(Class<? extends ChangeListener> lClass, String aName) {
- this.check(lClass, aName);
- return super.hasAnyListeners(lClass, aName);
- }
-
-
- // ********** state change support **********
-
- @Override
- public void fireStateChanged(StateChangeEvent event) {
- throw this.unsupportedOperationException();
- }
-
- @Override
- public void fireStateChanged() {
- throw this.unsupportedOperationException();
- }
-
-
- // ********** 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(CollectionChangeEvent 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(CollectionChangeEvent 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(CollectionChangeEvent 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) {
- this.check(COLLECTION_CHANGE_LISTENER_CLASS, collectionName);
- super.fireCollectionChanged(collectionName);
- }
-
-
- // ********** list change support **********
-
- @Override
- public void fireItemsAdded(ListChangeEvent 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(ListChangeEvent 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(ListChangeEvent 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(ListChangeEvent 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(ListChangeEvent 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) {
- this.check(LIST_CHANGE_LISTENER_CLASS, listName);
- super.fireListChanged(listName);
- }
-
-
- // ********** tree change support **********
-
- @Override
- public void fireNodeAdded(TreeChangeEvent event) {
- this.check(TREE_CHANGE_LISTENER_CLASS, event.getTreeName());
- super.fireNodeAdded(event);
- }
-
- @Override
- public void fireNodeAdded(String treeName, Object[] path) {
- this.check(TREE_CHANGE_LISTENER_CLASS, treeName);
- super.fireNodeAdded(treeName, path);
- }
-
- @Override
- public void fireNodeRemoved(TreeChangeEvent event) {
- this.check(TREE_CHANGE_LISTENER_CLASS, event.getTreeName());
- super.fireNodeRemoved(event);
- }
-
- @Override
- public void fireNodeRemoved(String treeName, Object[] path) {
- this.check(TREE_CHANGE_LISTENER_CLASS, treeName);
- super.fireNodeRemoved(treeName, path);
- }
-
- @Override
- public void fireTreeCleared(TreeChangeEvent event) {
- this.check(TREE_CHANGE_LISTENER_CLASS, event.getTreeName());
- super.fireTreeCleared(event);
- }
-
- @Override
- public void fireTreeCleared(String treeName, Object[] path) {
- this.check(TREE_CHANGE_LISTENER_CLASS, treeName);
- super.fireTreeCleared(treeName, path);
- }
-
- @Override
- public void fireTreeChanged(TreeChangeEvent event) {
- this.check(TREE_CHANGE_LISTENER_CLASS, event.getTreeName());
- super.fireTreeChanged(event);
- }
-
- @Override
- public void fireTreeChanged(String treeName, Object[] path) {
- this.check(TREE_CHANGE_LISTENER_CLASS, treeName);
- super.fireTreeChanged(treeName, path);
- }
-
-}
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 4cab405723..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTCollectionChangeListenerWrapper.java
+++ /dev/null
@@ -1,150 +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.listener.awt;
-
-import java.awt.EventQueue;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-
-/**
- * Wrap another collection change listener and forward events to it on the AWT
- * event queue.
- */
-public 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(CollectionChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.itemsAdded_(event);
- } else {
- this.executeOnEventQueue(this.buildItemsAddedRunnable(event));
- }
- }
-
- public void itemsRemoved(CollectionChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.itemsRemoved_(event);
- } else {
- this.executeOnEventQueue(this.buildItemsRemovedRunnable(event));
- }
- }
-
- public void collectionCleared(CollectionChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.collectionCleared_(event);
- } else {
- this.executeOnEventQueue(this.buildCollectionClearedRunnable(event));
- }
- }
-
- public void collectionChanged(CollectionChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.collectionChanged_(event);
- } else {
- this.executeOnEventQueue(this.buildCollectionChangedRunnable(event));
- }
- }
-
- private Runnable buildItemsAddedRunnable(final CollectionChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTCollectionChangeListenerWrapper.this.itemsAdded_(event);
- }
- @Override
- public String toString() {
- return "items added";
- }
- };
- }
-
- private Runnable buildItemsRemovedRunnable(final CollectionChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTCollectionChangeListenerWrapper.this.itemsRemoved_(event);
- }
- @Override
- public String toString() {
- return "items removed";
- }
- };
- }
-
- private Runnable buildCollectionClearedRunnable(final CollectionChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTCollectionChangeListenerWrapper.this.collectionCleared_(event);
- }
- @Override
- public String toString() {
- return "collection cleared";
- }
- };
- }
-
- private Runnable buildCollectionChangedRunnable(final CollectionChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTCollectionChangeListenerWrapper.this.collectionChanged_(event);
- }
- @Override
- public String toString() {
- return "collection changed";
- }
- };
- }
-
- /**
- * EventQueue#invokeLater(Runnable) seems to work OK;
- * but using #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_(CollectionChangeEvent event) {
- this.listener.itemsAdded(event);
- }
-
- void itemsRemoved_(CollectionChangeEvent event) {
- this.listener.itemsRemoved(event);
- }
-
- void collectionCleared_(CollectionChangeEvent event) {
- this.listener.collectionCleared(event);
- }
-
- void collectionChanged_(CollectionChangeEvent event) {
- this.listener.collectionChanged(event);
- }
-
- @Override
- public String toString() {
- return "AWT(" + this.listener.toString() + ")";
- }
-
-}
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 7bed089ac8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTListChangeListenerWrapper.java
+++ /dev/null
@@ -1,198 +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.listener.awt;
-
-import java.awt.EventQueue;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-
-/**
- * Wrap another list change listener and forward events to it on the AWT
- * event queue.
- */
-public 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(ListChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.itemsAdded_(event);
- } else {
- this.executeOnEventQueue(this.buildItemsAddedRunnable(event));
- }
- }
-
- public void itemsRemoved(ListChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.itemsRemoved_(event);
- } else {
- this.executeOnEventQueue(this.buildItemsRemovedRunnable(event));
- }
- }
-
- public void itemsMoved(ListChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.itemsMoved_(event);
- } else {
- this.executeOnEventQueue(this.buildItemsMovedRunnable(event));
- }
- }
-
- public void itemsReplaced(ListChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.itemsReplaced_(event);
- } else {
- this.executeOnEventQueue(this.buildItemsReplacedRunnable(event));
- }
- }
-
- public void listCleared(ListChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.listCleared_(event);
- } else {
- this.executeOnEventQueue(this.buildListClearedRunnable(event));
- }
- }
-
- public void listChanged(ListChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.listChanged_(event);
- } else {
- this.executeOnEventQueue(this.buildListChangedRunnable(event));
- }
- }
-
- private Runnable buildItemsAddedRunnable(final ListChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTListChangeListenerWrapper.this.itemsAdded_(event);
- }
- @Override
- public String toString() {
- return "items added";
- }
- };
- }
-
- private Runnable buildItemsRemovedRunnable(final ListChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTListChangeListenerWrapper.this.itemsRemoved_(event);
- }
- @Override
- public String toString() {
- return "items removed";
- }
- };
- }
-
- private Runnable buildItemsMovedRunnable(final ListChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTListChangeListenerWrapper.this.itemsMoved_(event);
- }
- @Override
- public String toString() {
- return "items moved";
- }
- };
- }
-
- private Runnable buildItemsReplacedRunnable(final ListChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTListChangeListenerWrapper.this.itemsReplaced_(event);
- }
- @Override
- public String toString() {
- return "items replaced";
- }
- };
- }
-
- private Runnable buildListClearedRunnable(final ListChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTListChangeListenerWrapper.this.listCleared_(event);
- }
- @Override
- public String toString() {
- return "list cleared";
- }
- };
- }
-
- private Runnable buildListChangedRunnable(final ListChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTListChangeListenerWrapper.this.listChanged_(event);
- }
- @Override
- public String toString() {
- return "list changed";
- }
- };
- }
-
- /**
- * EventQueue#invokeLater(Runnable) seems to work OK;
- * but using #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_(ListChangeEvent event) {
- this.listener.itemsAdded(event);
- }
-
- void itemsRemoved_(ListChangeEvent event) {
- this.listener.itemsRemoved(event);
- }
-
- void itemsMoved_(ListChangeEvent event) {
- this.listener.itemsMoved(event);
- }
-
- void itemsReplaced_(ListChangeEvent event) {
- this.listener.itemsReplaced(event);
- }
-
- void listCleared_(ListChangeEvent event) {
- this.listener.listCleared(event);
- }
-
- void listChanged_(ListChangeEvent event) {
- this.listener.listChanged(event);
- }
-
- @Override
- public String toString() {
- return "AWT(" + this.listener.toString() + ")";
- }
-
-}
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 bcc372ac02..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTPropertyChangeListenerWrapper.java
+++ /dev/null
@@ -1,75 +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.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.
- */
-public 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 (EventQueue.isDispatchThread()) {
- this.propertyChanged_(event);
- } else {
- this.executeOnEventQueue(this.buildRunnable(event));
- }
- }
-
- private Runnable buildRunnable(final PropertyChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTPropertyChangeListenerWrapper.this.propertyChanged_(event);
- }
- };
- }
-
- /**
- * EventQueue#invokeLater(Runnable) seems to work OK;
- * but using #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() + ")";
- }
-
-}
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 f5f2988d04..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTStateChangeListenerWrapper.java
+++ /dev/null
@@ -1,74 +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.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.
- */
-public 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 (EventQueue.isDispatchThread()) {
- this.stateChanged_(event);
- } else {
- this.executeOnEventQueue(this.buildRunnable(event));
- }
- }
-
- private Runnable buildRunnable(final StateChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTStateChangeListenerWrapper.this.stateChanged_(event);
- }
- };
- }
-
- /**
- * EventQueue#invokeLater(Runnable) seems to work OK;
- * but using #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() + ")";
- }
-
-}
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 be7cfb113a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTTreeChangeListenerWrapper.java
+++ /dev/null
@@ -1,150 +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.listener.awt;
-
-import java.awt.EventQueue;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-
-/**
- * Wrap another tree change listener and forward events to it on the AWT
- * event queue.
- */
-public 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(TreeChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.nodeAdded_(event);
- } else {
- this.executeOnEventQueue(this.buildNodeAddedRunnable(event));
- }
- }
-
- public void nodeRemoved(TreeChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.nodeRemoved_(event);
- } else {
- this.executeOnEventQueue(this.buildNodeRemovedRunnable(event));
- }
- }
-
- public void treeCleared(TreeChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.treeCleared_(event);
- } else {
- this.executeOnEventQueue(this.buildTreeClearedRunnable(event));
- }
- }
-
- public void treeChanged(TreeChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.treeChanged_(event);
- } else {
- this.executeOnEventQueue(this.buildTreeChangedRunnable(event));
- }
- }
-
- private Runnable buildNodeAddedRunnable(final TreeChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTTreeChangeListenerWrapper.this.nodeAdded_(event);
- }
- @Override
- public String toString() {
- return "node added";
- }
- };
- }
-
- private Runnable buildNodeRemovedRunnable(final TreeChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTTreeChangeListenerWrapper.this.nodeRemoved_(event);
- }
- @Override
- public String toString() {
- return "node removed";
- }
- };
- }
-
- private Runnable buildTreeClearedRunnable(final TreeChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTTreeChangeListenerWrapper.this.treeCleared_(event);
- }
- @Override
- public String toString() {
- return "tree cleared";
- }
- };
- }
-
- private Runnable buildTreeChangedRunnable(final TreeChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTTreeChangeListenerWrapper.this.treeChanged_(event);
- }
- @Override
- public String toString() {
- return "tree changed";
- }
- };
- }
-
- /**
- * EventQueue#invokeLater(Runnable) seems to work OK;
- * but using #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_(TreeChangeEvent event) {
- this.listener.nodeAdded(event);
- }
-
- void nodeRemoved_(TreeChangeEvent event) {
- this.listener.nodeRemoved(event);
- }
-
- void treeCleared_(TreeChangeEvent event) {
- this.listener.treeCleared(event);
- }
-
- void treeChanged_(TreeChangeEvent event) {
- this.listener.treeChanged(event);
- }
-
- @Override
- public String toString() {
- return "AWT(" + this.listener.toString() + ")";
- }
-
-}
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 f7d33d56e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectAdapter.java
+++ /dev/null
@@ -1,279 +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 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.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * This abstract extension of AbstractModel provides a base for adding
- * change listeners (PropertyChange, CollectionChange, ListChange, TreeChange)
- * to a subject and converting the subject's change notifications into a single
- * set of change notifications for a common aspect (e.g. VALUE).
- *
- * 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 AspectAdapters
- * that have the same subject and that subject can change.
- * All the AspectAdapters 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 subjectHolder. */
- protected final PropertyChangeListener subjectChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an AspectAdapter for the specified subject.
- */
- protected AspectAdapter(S subject) {
- this(new StaticPropertyValueModel<S>(subject));
- }
-
- /**
- * Construct an AspectAdapter 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";
- }
- };
- }
-
-
- // ********** 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.fireAspectChange(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 ChangeListener> 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 fireAspectChange(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.
- */
- protected class LocalChangeSupport extends SingleAspectChangeSupport {
- private static final long serialVersionUID = 1L;
-
- public LocalChangeSupport(AspectAdapter<S> source, Class<? extends ChangeListener> listenerClass, String aspectName) {
- super(source, listenerClass, aspectName);
- }
-
- protected boolean listenerIsRelevant(Class<? extends ChangeListener> lClass) {
- return lClass == this.listenerClass;
- }
-
- protected boolean hasNoRelevantListeners(Class<? extends ChangeListener> lClass) {
- return this.listenerIsRelevant(lClass)
- && this.hasNoListeners(lClass);
- }
-
- protected boolean listenerIsRelevant(Class<? extends ChangeListener> lClass, String listenerAspectName) {
- return this.listenerIsRelevant(lClass)
- && (listenerAspectName == AspectAdapter.this.getListenerAspectName());
- }
-
- protected boolean hasNoRelevantListeners(Class<? extends ChangeListener> lClass, String listenerAspectName) {
- return this.listenerIsRelevant(lClass, listenerAspectName)
- && this.hasNoListeners(lClass, listenerAspectName);
- }
-
-
- // ********** overrides **********
-
- @Override
- protected <T extends ChangeListener> void addListener(Class<T> lClass, T listener) {
- if (this.hasNoRelevantListeners(lClass)) {
- AspectAdapter.this.engageModels();
- }
- super.addListener(lClass, listener);
- }
-
- @Override
- protected <T extends ChangeListener> void addListener(String listenerAspectName, Class<T> lClass, T listener) {
- if (this.hasNoRelevantListeners(lClass, listenerAspectName)) {
- AspectAdapter.this.engageModels();
- }
- super.addListener(listenerAspectName, lClass, listener);
- }
-
- @Override
- protected <T extends ChangeListener> void removeListener(Class<T> lClass, T listener) {
- super.removeListener(lClass, listener);
- if (this.hasNoRelevantListeners(lClass)) {
- AspectAdapter.this.disengageModels();
- }
- }
-
- @Override
- protected <T extends ChangeListener> void removeListener(String listenerAspectName, Class<T> lClass, T listener) {
- super.removeListener(listenerAspectName, lClass, listener);
- if (this.hasNoRelevantListeners(lClass, listenerAspectName)) {
- AspectAdapter.this.disengageModels();
- }
- }
-
- }
-
-}
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 75853757ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectPropertyValueModelAdapter.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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.PropertyValueModel;
-
-/**
- * This abstract class provides the infrastructure needed to wrap
- * a value model, "lazily" listen to it, and convert
- * its change notifications into property value model change
- * notifications.
- *
- * Subclasses must override:
- * - #buildValue()
- * to return the current property value, as derived from the
- * current model value
- *
- */
-public abstract class AspectPropertyValueModelAdapter<T>
- extends AbstractModel
- implements PropertyValueModel<T>
-{
- /**
- * 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 the collection
- * change event fired by the collection value model.
- */
- protected T value;
-
-
- // ********** constructor/initialization **********
-
- protected AspectPropertyValueModelAdapter() {
- super();
- // our value is null when we are not listening to the collection holder
- this.value = null;
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, PropertyChangeListener.class, VALUE);
- }
-
-
- // ********** PropertyValueModel implementation **********
-
- /**
- * Return the cached value.
- */
- public T getValue() {
- return this.value;
- }
-
-
- // ********** extend change support **********
-
- /**
- * Extend to start listening to the wrapped collection if necessary.
- */
- @Override
- public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
- if (this.hasNoListeners()) {
- this.engageModel();
- }
- super.addPropertyChangeListener(listener);
- }
-
- /**
- * Extend to start listening to the wrapped collection if necessary.
- */
- @Override
- public synchronized void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- if (propertyName == VALUE && this.hasNoListeners()) {
- this.engageModel();
- }
- super.addPropertyChangeListener(propertyName, listener);
- }
-
- /**
- * Extend to stop listening to the wrapped collection if necessary.
- */
- @Override
- public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
- super.removePropertyChangeListener(listener);
- if (this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
- /**
- * Extend to stop listening to the wrapped collection if necessary.
- */
- @Override
- public synchronized void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- super.removePropertyChangeListener(propertyName, listener);
- if (propertyName == VALUE && this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
-
- // ********** queries **********
-
- /**
- * Return whether there are any listeners for the aspect.
- */
- protected boolean hasListeners() {
- return this.hasAnyPropertyChangeListeners(VALUE);
- }
-
- /**
- * Return whether there are any listeners for the aspect.
- */
- protected boolean hasNoListeners() {
- return ! this.hasListeners();
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to the model and build the value.
- */
- protected void engageModel() {
- this.engageModel_();
- // synch our value *after* we start listening to the collection,
- // since the collection'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 wrapped model.
- */
- protected abstract T buildValue();
-
- /**
- * Stop listening to the model and clear the value.
- */
- protected void disengageModel() {
- this.disengageModel_();
- // clear out our value when we are not listening to the collection
- this.value = null;
- }
-
- /**
- * Stop listening to the model.
- */
- protected abstract void disengageModel_();
-
- /**
- * The wrapped model changed in some fashion.
- * Recalculate the value and notify any listeners.
- */
- protected void propertyChanged() {
- Object old = this.value;
- this.value = this.buildValue();
- this.firePropertyChanged(VALUE, old, this.value);
- }
-
-}
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 8781be4afd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/BufferedWritablePropertyValueModel.java
+++ /dev/null
@@ -1,345 +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 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 BufferedPropertyValueModel 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.
- *
- * The trigger is another value model that holds a Boolean and the application
- * changes the trigger's value to true on "accept", false on "reset". Typically,
- * in a dialog:
- * - pressing the OK button will trigger an "accept" and close the dialog
- * - pressing the Cancel button will simply close the dialog,
- * dropping the "buffered" values into the bit bucket
- * - pressing the Apply button will trigger an "accept" and leave the dialog open
- * - pressing the Restore button will trigger a "reset" and leave the dialog open
- *
- * 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";
- }
- };
- }
-
-
- // ********** 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 forwarded to the wrapped value holder
- * when the trigger is "accepted".
- */
- public void setValue(T value) {
- Object old = this.getValue();
- this.bufferedValue = value;
- this.buffering = true;
- this.firePropertyChanged(VALUE, old, this.bufferedValue);
- }
-
-
- // ********** PropertyValueModelWrapper extensions **********
-
- /**
- * extend to engage the trigger holder also
- */
- @Override
- protected void engageValueHolder() {
- super.engageValueHolder();
- this.triggerHolder.addPropertyChangeListener(VALUE, this.triggerChangeListener);
- }
-
- /**
- * extend to disengage the trigger holder also
- */
- @Override
- protected void disengageValueHolder() {
- this.triggerHolder.removePropertyChangeListener(VALUE, this.triggerChangeListener);
- super.disengageValueHolder();
- }
-
-
- // ********** behavior **********
-
- /**
- * If we do not yet have a "buffered" value, simply propagate the
- * change notification with the buffered model as the source.
- * If we do have a "buffered" value, do nothing.
- */
- @Override
- protected void valueChanged(PropertyChangeEvent event) {
- if (this.accepting) {
- // if we are currently "accepting" the value, ignore change notifications,
- // since we caused them and our own listeners are already aware of the change
- return;
- }
- if (this.buffering) {
- this.handleChangeConflict(event);
- } else {
- this.firePropertyChanged(event.cloneWithSource(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(PropertyChangeEvent event) {
- // the default is to do nothing
- }
-
- /**
- * The trigger changed:
- * If it is now true, "accept" the buffered value and forward
- * it to the wrapped value holder.
- * If it is now false, "reset" the buffered value to its original value.
- */
- protected void triggerChanged(PropertyChangeEvent event) {
- if ( ! this.buffering) {
- // if nothing has been "buffered", we don't need to do anything:
- // nothing needs to be passed through; nothing needs to be reset;
- return;
- }
- if (((Boolean) event.getNewValue()).booleanValue()) {
- // set the accepting flag so we ignore any events
- // fired by the wrapped value holder
- this.accepting = true;
- this.valueHolder().setValue(this.bufferedValue);
- this.bufferedValue = null;
- this.buffering = false;
- // clear the flag once the "accept" is complete
- this.accepting = false;
- } else {
- // 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 WritablePropertyValueModel<T>.
- */
- @SuppressWarnings("unchecked")
- protected WritablePropertyValueModel<T> valueHolder() {
- return (WritablePropertyValueModel<T>) this.valueHolder;
- }
-
-
- // ********** inner class **********
-
- /**
- * Trigger is a special property value model that only maintains its
- * value (of true or false) during the change notification caused by
- * the #setValue(Object) method. In other words, a Trigger object
- * only has a valid value
- */
- 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 #setValue(Object).
- */
- @Override
- public Boolean getValue() {
- if (this.value == null) {
- throw new IllegalStateException("The method Trigger.value() may only be called during change notification.");
- }
- return this.value;
- }
-
- /**
- * Extend to reset the value to null 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:
- * - true indicates "accept"
- * - false indicates "reset"
- */
- public void setValue(boolean value) {
- this.setValue(Boolean.valueOf(value));
- }
-
- /**
- * Return the trigger's value:
- * - true indicates "accept"
- * - false indicates "reset"
- */
- public boolean booleanValue() {
- return this.getValue().booleanValue();
- }
-
- /**
- * Accept the trigger (i.e. set its value to true).
- */
- public void accept() {
- this.setValue(true);
- }
-
- /**
- * Return whether the trigger has been accepted
- * (i.e. its value was changed to true).
- */
- public boolean isAccepted() {
- return this.booleanValue();
- }
-
- /**
- * Reset the trigger (i.e. set its value to false).
- */
- public void reset() {
- this.setValue(false);
- }
-
- /**
- * Return whether the trigger has been reset
- * (i.e. its value was changed to false).
- */
- 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 a2d1e6157d..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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
- * <code>PropertyValueModel</code> and uses a <code>Transformer</code>
- * to transform the wrapped value before it is returned by <code>getValue()</code>.
- * 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 <code>valueChanged(PropertyChangeEvent)</code> 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 <code>Transformer</code>,
- * a subclass of <code>CachingTransformationPropertyValueModel</code> can
- * either override the <code>transform_(Object)</code> method or,
- * if something other than null should be returned when the wrapped value
- * is null, override the <code>transform(Object)</code> method.
- */
-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 the
- * <code>transform_(Object)</code> or <code>transform(Object)</code>
- * method instead of building a <code>Transformer</code>.
- */
- 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 engageValueHolder() {
- super.engageValueHolder();
- this.cachedValue = this.transform(this.valueHolder.getValue());
- }
-
- /**
- * We have no more listeners, clear the cached value.
- */
- @Override
- protected void disengageValueHolder() {
- this.cachedValue = null;
- super.disengageValueHolder();
- }
-
- /**
- * 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.
- */
- @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 18b6ce0bdc..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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 <code>TransformationWritablePropertyValueModel<code> 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 <code>valueChanged(PropertyChangeEvent)</code> 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 the
- * <code>transform_(Object)</code> and <code>reverseTransform_(Object)</code>
- * (or <code>transform(Object)</code> and <code>reverseTransform(Object)</code>)
- * methods instead of building a <code>BidiTransformer</code>.
- */
- 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 engageValueHolder() {
- super.engageValueHolder();
- this.cachedValue = this.transform(this.valueHolder.getValue());
- }
-
- /**
- * We have no more listeners, clear the cached value.
- */
- @Override
- protected void disengageValueHolder() {
- this.cachedValue = null;
- super.disengageValueHolder();
- }
-
- /**
- * 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.
- */
- @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/CollectionAspectAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionAspectAdapter.java
deleted file mode 100644
index f55783e8a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionAspectAdapter.java
+++ /dev/null
@@ -1,238 +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.Arrays;
-import java.util.Collection;
-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.Model;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-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;
-
-/**
- * This extension of AspectAdapter provides CollectionChange support.
- * This allows us to convert a set of one or more collections into
- * a single collection, VALUES.
- *
- * The typical subclass will override the following methods:
- * #iterator_()
- * at the very minimum, override this method to return an iterator on the
- * subject's collection aspect; it does not need to be overridden if
- * #iterator() is overridden and its behavior changed
- * #size_()
- * override this method to improve performance; it does not need to be overridden if
- * #size() is overridden and its behavior changed
- * #iterator()
- * override this method only if returning an empty iterator when the
- * subject is null is unacceptable
- * #size()
- * override this method only if returning a zero when the
- * subject is null is unacceptable
- */
-public abstract class CollectionAspectAdapter<S extends Model, E>
- extends AspectAdapter<S>
- implements CollectionValueModel<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 aspect. */
- protected final CollectionChangeListener collectionChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct a CollectionAspectAdapter for the specified subject
- * and collection.
- */
- protected CollectionAspectAdapter(String collectionName, S subject) {
- this(new String[] {collectionName}, subject);
- }
-
- /**
- * Construct a CollectionAspectAdapter for the specified subject
- * and collections.
- */
- protected CollectionAspectAdapter(String[] collectionNames, S subject) {
- this(new StaticPropertyValueModel<S>(subject), collectionNames);
- }
-
- /**
- * Construct a CollectionAspectAdapter 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 CollectionAspectAdapter 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 CollectionAspectAdapter 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 **********
-
- /**
- * The subject's collection aspect has changed, notify the listeners.
- */
- protected CollectionChangeListener buildCollectionChangeListener() {
- // transform the subject's collection change events into VALUE collection change events
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent event) {
- CollectionAspectAdapter.this.itemsAdded(event);
- }
- public void itemsRemoved(CollectionChangeEvent event) {
- CollectionAspectAdapter.this.itemsRemoved(event);
- }
- public void collectionCleared(CollectionChangeEvent 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);
- }
- };
- }
-
-
- // ********** 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 that the subject is not null.
- * @see #iterator()
- */
- protected Iterator<E> iterator_() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * 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 that the subject is not null.
- * @see #size()
- */
- protected int size_() {
- return CollectionTools.size(this.iterator());
- }
-
-
- // ********** AspectAdapter implementation **********
-
- @Override
- protected Object getValue() {
- return this.iterator();
- }
-
- @Override
- protected Class<? extends ChangeListener> getListenerClass() {
- return CollectionChangeListener.class;
- }
-
- @Override
- protected String getListenerAspectName() {
- return VALUES;
- }
-
- @Override
- protected boolean hasListeners() {
- return this.hasAnyCollectionChangeListeners(VALUES);
- }
-
- @Override
- protected void fireAspectChange(Object oldValue, Object newValue) {
- this.fireCollectionChanged(VALUES);
- }
-
- @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);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- for (int i = 0; i < this.collectionNames.length; i++) {
- if (i != 0) {
- sb.append(", ");
- }
- sb.append(this.collectionNames[i]);
- }
- }
-
-
- // ********** behavior **********
-
- protected void itemsAdded(CollectionChangeEvent event) {
- this.fireItemsAdded(event.cloneWithSource(this, VALUES));
- }
-
- protected void itemsRemoved(CollectionChangeEvent event) {
- this.fireItemsRemoved(event.cloneWithSource(this, VALUES));
- }
-
- protected void collectionCleared(CollectionChangeEvent event) {
- this.fireCollectionCleared(VALUES); // nothing from original event to forward
- }
-
- protected void collectionChanged(CollectionChangeEvent event) {
- this.fireCollectionChanged(VALUES); // nothing from original event to forward
- }
-
-}
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 6c236ab78f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionListValueModelAdapter.java
+++ /dev/null
@@ -1,296 +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.ArrayList;
-import java.util.Iterator;
-import java.util.ListIterator;
-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.ChangeSupport;
-import org.eclipse.jpt.utility.internal.model.SingleAspectChangeSupport;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-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 CollectionValueModel behave like
- * a read-only ListValueModel, sorta.
- *
- * To maintain a reasonably consistent appearance to client code, we
- * keep an internal list somewhat in synch with the wrapped collection.
- *
- * NB: 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. #size(), getItem(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.
- */
-public class CollectionListValueModelAdapter<E>
- extends AbstractModel
- 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 CollectionValueModel.
- */
- 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>();
- // postpone building the list and listening to the underlying collection
- // until we have listeners ourselves...
- }
-
-
- // ********** initialization **********
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, ListChangeListener.class, LIST_VALUES);
- }
-
- /**
- * The wrapped collection has changed, forward an equivalent
- * list change event to our listeners.
- */
- protected CollectionChangeListener buildCollectionChangeListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent event) {
- CollectionListValueModelAdapter.this.itemsAdded(event);
- }
- public void itemsRemoved(CollectionChangeEvent event) {
- CollectionListValueModelAdapter.this.itemsRemoved(event);
- }
- public void collectionCleared(CollectionChangeEvent event) {
- CollectionListValueModelAdapter.this.collectionCleared(event);
- }
- public void collectionChanged(CollectionChangeEvent event) {
- CollectionListValueModelAdapter.this.collectionChanged(event);
- }
- @Override
- public String toString() {
- return "collection change listener";
- }
- };
- }
-
-
- // ********** 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();
- }
-
-
- // ********** extend change support **********
-
- /**
- * Override to start listening to the collection holder if necessary.
- */
- @Override
- public void addListChangeListener(ListChangeListener listener) {
- if (this.hasNoListeners()) {
- this.engageModel();
- }
- super.addListChangeListener(listener);
- }
-
- /**
- * Override to start listening to the collection holder if necessary.
- */
- @Override
- public void addListChangeListener(String listName, ListChangeListener listener) {
- if (listName == LIST_VALUES && this.hasNoListeners()) {
- this.engageModel();
- }
- super.addListChangeListener(listName, listener);
- }
-
- /**
- * Override to stop listening to the collection holder if appropriate.
- */
- @Override
- public void removeListChangeListener(ListChangeListener listener) {
- super.removeListChangeListener(listener);
- if (this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
- /**
- * Override to stop listening to the collection holder if appropriate.
- */
- @Override
- public void removeListChangeListener(String listName, ListChangeListener listener) {
- super.removeListChangeListener(listName, listener);
- if (listName == LIST_VALUES && this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
-
- // ********** queries **********
-
- protected boolean hasListeners() {
- return this.hasAnyListChangeListeners(LIST_VALUES);
- }
-
- protected boolean hasNoListeners() {
- return ! this.hasListeners();
- }
-
- /**
- * Return the index of the specified item, using object
- * identity instead of equality.
- */
- protected int lastIdentityIndexOf(Object o) {
- return this.lastIdentityIndexOf(o, this.list.size());
- }
-
- /**
- * Return the last index of the specified item, starting just before the
- * the specified endpoint, and using object identity instead of equality.
- */
- protected int lastIdentityIndexOf(Object o, int end) {
- for (int i = end; i-- > 0; ) {
- if (this.list.get(i) == o) {
- return i;
- }
- }
- return -1;
- }
-
-
- // ********** behavior **********
-
- protected void buildList() {
- Iterator<? extends E> stream = this.collectionHolder.iterator();
- // if the new collection is empty, do nothing
- if (stream.hasNext()) {
- this.list.ensureCapacity(this.collectionHolder.size());
- while (stream.hasNext()) {
- this.list.add(stream.next());
- }
- this.postBuildList();
- }
- }
-
- /**
- * Allow subclasses to manipulate the internal list before
- * sending out change notification.
- */
- protected void postBuildList() {
- // the default is to do nothing...
- }
-
- 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();
- }
-
- 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 itemsAdded(CollectionChangeEvent e) {
- this.addItemsToList(this.indexToAddItems(), CollectionTools.list(this.items(e)), this.list, LIST_VALUES);
- }
-
- protected int indexToAddItems() {
- return this.list.size();
- }
-
- @SuppressWarnings("unchecked")
- protected Iterator<E> items(CollectionChangeEvent e) {
- return (Iterator<E>) e.items();
- }
-
- protected void itemsRemoved(CollectionChangeEvent e) {
- // we have to remove the items individually,
- // since they are probably not in sequence
- for (Iterator<E> stream = this.items(e); stream.hasNext(); ) {
- this.removeItemFromList(this.lastIdentityIndexOf(stream.next()), this.list, LIST_VALUES);
- }
- }
-
- protected void collectionCleared(CollectionChangeEvent e) {
- this.clearList(this.list, LIST_VALUES);
- }
-
- /**
- * synchronize our internal list with the wrapped collection
- * and fire the appropriate events
- */
- protected void collectionChanged(CollectionChangeEvent e) {
- // put in empty check so we don't fire events unnecessarily
- if ( ! this.list.isEmpty()) {
- @SuppressWarnings("unchecked")
- ArrayList<E> removedItems = (ArrayList<E>) this.list.clone();
- this.list.clear();
- this.fireItemsRemoved(LIST_VALUES, 0, removedItems);
- }
-
- this.buildList();
- // put in empty check so we don't fire events unnecessarily
- if ( ! this.list.isEmpty()) {
- this.fireItemsAdded(LIST_VALUES, 0, this.list);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.collectionHolder);
- }
-
-}
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 a28ff711db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionPropertyValueModelAdapter.java
+++ /dev/null
@@ -1,140 +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 org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-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.
- *
- * Subclasses must override:
- * - #buildValue()
- * to return the current property value, as derived from the
- * current collection value
- *
- * Subclasses might want to override:
- * - #itemsAdded(CollectionChangeEvent event)
- * - #itemsRemoved(CollectionChangeEvent event)
- * - #collectionCleared(CollectionChangeEvent event)
- * - #collectionChanged(CollectionChangeEvent event)
- * to improve performance (by not recalculating the value, if possible)
- */
-public abstract class CollectionPropertyValueModelAdapter<T>
- extends AspectPropertyValueModelAdapter<T>
-{
- /** The wrapped collection value model. */
- protected final CollectionValueModel<?> collectionHolder;
-
- /** 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<?> collectionHolder) {
- super();
- this.collectionHolder = collectionHolder;
- this.collectionChangeListener = this.buildCollectionChangeListener();
- }
-
- protected CollectionChangeListener buildCollectionChangeListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent event) {
- CollectionPropertyValueModelAdapter.this.itemsAdded(event);
- }
- public void itemsRemoved(CollectionChangeEvent event) {
- CollectionPropertyValueModelAdapter.this.itemsRemoved(event);
- }
- public void collectionCleared(CollectionChangeEvent event) {
- CollectionPropertyValueModelAdapter.this.collectionCleared(event);
- }
- public void collectionChanged(CollectionChangeEvent event) {
- CollectionPropertyValueModelAdapter.this.collectionChanged(event);
- }
- @Override
- public String toString() {
- return "collection change listener";
- }
- };
- }
-
-
- // ********** behavior **********
-
- /**
- * 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);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.collectionHolder);
- }
-
-
- // ********** collection change support **********
-
- /**
- * Items were added to the wrapped collection holder;
- * propagate the change notification appropriately.
- */
- protected void itemsAdded(CollectionChangeEvent 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(CollectionChangeEvent 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(CollectionChangeEvent 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(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 4190fe1d41..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionValueModelWrapper.java
+++ /dev/null
@@ -1,179 +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 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.CollectionChangeEvent;
-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.
- */
-public abstract class CollectionValueModelWrapper<E>
- extends AbstractModel
-{
-
- /** 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 **********
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, CollectionChangeListener.class, CollectionValueModel.VALUES);
- }
-
- protected CollectionChangeListener buildCollectionChangeListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent event) {
- CollectionValueModelWrapper.this.itemsAdded(event);
- }
- public void itemsRemoved(CollectionChangeEvent event) {
- CollectionValueModelWrapper.this.itemsRemoved(event);
- }
- public void collectionCleared(CollectionChangeEvent event) {
- CollectionValueModelWrapper.this.collectionCleared(event);
- }
- public void collectionChanged(CollectionChangeEvent event) {
- CollectionValueModelWrapper.this.collectionChanged(event);
- }
- @Override
- public String toString() {
- return "collection change listener";
- }
- };
- }
-
-
- // ********** extend change support **********
-
- /**
- * Extend to start listening to the nested model if necessary.
- */
- @Override
- public synchronized void addCollectionChangeListener(CollectionChangeListener listener) {
- if (this.hasNoCollectionChangeListeners(CollectionValueModel.VALUES)) {
- this.engageModel();
- }
- super.addCollectionChangeListener(listener);
- }
-
- /**
- * Extend to start listening to the nested model if necessary.
- */
- @Override
- public synchronized void addCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- if (collectionName == CollectionValueModel.VALUES && this.hasNoCollectionChangeListeners(CollectionValueModel.VALUES)) {
- this.engageModel();
- }
- super.addCollectionChangeListener(collectionName, listener);
- }
-
- /**
- * Extend to stop listening to the nested model if necessary.
- */
- @Override
- public synchronized void removeCollectionChangeListener(CollectionChangeListener listener) {
- super.removeCollectionChangeListener(listener);
- if (this.hasNoCollectionChangeListeners(CollectionValueModel.VALUES)) {
- this.disengageModel();
- }
- }
-
- /**
- * Extend to stop listening to the nested model if necessary.
- */
- @Override
- public synchronized void removeCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- super.removeCollectionChangeListener(collectionName, listener);
- if (collectionName == CollectionValueModel.VALUES && this.hasNoCollectionChangeListeners(CollectionValueModel.VALUES)) {
- this.disengageModel();
- }
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to the collection holder.
- */
- protected void engageModel() {
- this.collectionHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.collectionChangeListener);
- }
-
- /**
- * Stop listening to the collection holder.
- */
- protected void disengageModel() {
- this.collectionHolder.removeCollectionChangeListener(CollectionValueModel.VALUES, this.collectionChangeListener);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterator<E> items(CollectionChangeEvent event) {
- return (Iterator<E>) event.items();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.collectionHolder);
- }
-
-
- // ********** collection change support **********
-
- /**
- * Items were added to the wrapped collection holder;
- * propagate the change notification appropriately.
- */
- protected abstract void itemsAdded(CollectionChangeEvent event);
-
- /**
- * Items were removed from the wrapped collection holder;
- * propagate the change notification appropriately.
- */
- protected abstract void itemsRemoved(CollectionChangeEvent event);
-
- /**
- * The wrapped collection holder was cleared;
- * propagate the change notification appropriately.
- */
- protected abstract void collectionCleared(CollectionChangeEvent 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/CompositeCollectionValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeCollectionValueModel.java
deleted file mode 100644
index 815e48e54c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeCollectionValueModel.java
+++ /dev/null
@@ -1,406 +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.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.Transformer;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-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
- * <code>CollectionValueModel</code> and uses a <code>Transformer</code>
- * to convert each item in the wrapped collection to yet another
- * <code>CollectionValueModel</code>. This composite collection contains
- * the combined items from all these component collections.
- *
- * NB: The wrapped collection must be an "identity set" that does not
- * contain the same item twice or this class will throw an exception.
- *
- * Terminology:
- * - sources - the items in the wrapped collection value model; these
- * are converted into component CVMs by the transformer
- * - component CVMs - the component collection value models that are combined
- * by this composite collection value model
- * - items - the items held by the component CVMs
- */
-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;
-
- /**
- * Cache of the collections corresponding to the component
- * collection value models above; keyed by the component
- * collection value models.
- * Use ArrayLists so we can use ArrayList-specific methods
- * (e.g. #clone() and #ensureCapacity()).
- */
- private final IdentityHashMap<CollectionValueModel<E2>, ArrayList<E2>> collections;
-
- /** 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
- * - the wrapped collection value model already contains other
- * collection value models or
- * - you want to override the <code>transform(E1)</code> method
- * instead of building a <code>Transformer</code>
- */
- 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.componentCVMs = new IdentityHashMap<E1, CollectionValueModel<E2>>();
- this.collections = new IdentityHashMap<CollectionValueModel<E2>, ArrayList<E2>>();
- this.componentCVMListener = this.buildComponentListener();
- this.size = 0;
- }
-
- /**
- * Construct a collection value model with the specified wrapped
- * list value model. Use this constructor if
- * - the wrapped list value model already contains collection
- * value models or
- * - you want to override the <code>transform(E1)</code> method
- * instead of building a <code>Transformer</code>
- */
- 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
- * - the wrapped collection already contains collection
- * value models or
- * - you want to override the <code>transform(E1)</code> method
- * instead of building a <code>Transformer</code>
- */
- 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);
- }
-
-
- // ********** initialization **********
-
- protected CollectionChangeListener buildComponentListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent event) {
- CompositeCollectionValueModel.this.componentItemsAdded(event);
- }
- public void itemsRemoved(CollectionChangeEvent event) {
- CompositeCollectionValueModel.this.componentItemsRemoved(event);
- }
- public void collectionCleared(CollectionChangeEvent event) {
- CompositeCollectionValueModel.this.componentCollectionCleared(event);
- }
- public void collectionChanged(CollectionChangeEvent event) {
- CompositeCollectionValueModel.this.componentCollectionChanged(event);
- }
- @Override
- public String toString() {
- return "component listener";
- }
- };
- }
-
-
- // ********** 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(CollectionChangeEvent event) {
- ArrayList<E2> addedItems = new ArrayList<E2>();
- for (Iterator<E1> stream = this.items(event); stream.hasNext(); ) {
- this.addComponentSource(stream.next(), 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);
- }
- 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);
- }
- 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(CollectionChangeEvent event) {
- ArrayList<E2> removedItems = new ArrayList<E2>();
- for (Iterator<E1> stream = this.items(event); stream.hasNext(); ) {
- this.removeComponentSource(stream.next(), 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);
- }
- componentCVM.removeCollectionChangeListener(VALUES, this.componentCVMListener);
- ArrayList<E2> componentCollection = this.collections.remove(componentCVM);
- if (componentCollection == null) {
- throw new IllegalStateException("missing collection: " + source);
- }
- 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(CollectionChangeEvent 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);
- }
-
-
- // ********** 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 <code>Transformer</code>.
- */
- 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(CollectionChangeEvent event) {
- int itemsSize = event.itemsSize();
- this.size += itemsSize;
-
- ArrayList<E2> componentCollection = this.collections.get(this.componentCVM(event));
- componentCollection.ensureCapacity(componentCollection.size() + itemsSize);
-
- this.addItemsToCollection(this.componentItems(event), componentCollection, VALUES);
- }
-
- /**
- * One of the component collections had items removed;
- * synchronize our caches.
- */
- protected void componentItemsRemoved(CollectionChangeEvent event) {
- this.size -= event.itemsSize();
- ArrayList<E2> componentCollection = this.collections.get(this.componentCVM(event));
- this.removeItemsFromCollection(this.componentItems(event), componentCollection, VALUES);
- }
-
- /**
- * One of the component collections was cleared;
- * synchronize our caches by clearing out the appropriate
- * collection.
- */
- protected void componentCollectionCleared(CollectionChangeEvent 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);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterator<E2> componentItems(CollectionChangeEvent event) {
- return (Iterator<E2>) event.items();
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected CollectionValueModel<E2> componentCVM(CollectionChangeEvent event) {
- return (CollectionValueModel<E2>) event.getSource();
- }
-
-}
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 3609d5a4dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeListValueModel.java
+++ /dev/null
@@ -1,574 +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.model.value;
-
-import java.util.ArrayList;
-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.Transformer;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyCompositeListIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationListIterator;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * A <code>CompositeListValueModel</code> wraps another
- * <code>ListValueModel</code> and uses a <code>Transformer</code>
- * to convert each item in the wrapped list to yet another
- * <code>ListValueModel</code>. This composite list contains
- * the combined items from all these component lists.
- *
- * Terminology:
- * - sources - the items in the wrapped list value model; these
- * are converted into component LVMs by the transformer
- * - componentLVMs - the component list value models that are combined
- * by this composite list value model
- * - items - the items held by the component LVMs
- */
-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;
- 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;
- 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
- * - the wrapped list value model already contains other
- * list value models or
- * - you want to override the <code>transform(E1)</code> method
- * instead of building a <code>Transformer</code>
- */
- 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.infoList = new ArrayList<Info>();
- this.componentLVMListener = this.buildComponentLVMListener();
- this.size = 0;
- }
-
- /**
- * Construct a list value model with the specified, unchanging, wrapped
- * list. Use this constructor if
- * - the wrapped list already contains list value models or
- * - you want to override the <code>transform(E1)</code> method
- * instead of building a <code>Transformer</code>
- */
- 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);
- }
-
-
- // ********** initialization **********
-
- protected ListChangeListener buildComponentLVMListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent event) {
- CompositeListValueModel.this.componentItemsAdded(event);
- }
- public void itemsRemoved(ListChangeEvent event) {
- CompositeListValueModel.this.componentItemsRemoved(event);
- }
- public void itemsReplaced(ListChangeEvent event) {
- CompositeListValueModel.this.componentItemsReplaced(event);
- }
- public void itemsMoved(ListChangeEvent event) {
- CompositeListValueModel.this.componentItemsMoved(event);
- }
- public void listCleared(ListChangeEvent event) {
- CompositeListValueModel.this.componentListCleared(event);
- }
- public void listChanged(ListChangeEvent event) {
- CompositeListValueModel.this.componentListChanged(event);
- }
- @Override
- public String toString() {
- return "component LVM listener";
- }
- };
- }
-
-
- // ********** ListValueModel implementation **********
-
- public E2 get(int index) {
- if ((index < 0) || (index >= this.size)) {
- throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + this.size);
- }
- // 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 CollectionTools.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.listIterator(), this.listHolder.size());
- }
-
- @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(ListChangeEvent event) {
- this.addComponentSources(event.getIndex(), this.items(event), event.itemsSize(), true); // true = fire event
- }
-
- /**
- * Do not fire an event.
- */
- protected void addComponentSources(int addedSourcesIndex, ListIterator<? extends E1> addedSources, int addedSourcesSize) {
- this.addComponentSources(addedSourcesIndex, addedSources, addedSourcesSize, false); // false = do not fire event
- }
-
- /**
- * Add infos corresponding to the specified sources to our cache.
- * Fire the appropriate event if requested.
- */
- protected void addComponentSources(int addedSourcesIndex, ListIterator<? 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;
- while (addedSources.hasNext()) {
- E1 source = addedSources.next();
- 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(ListChangeEvent event) {
- this.removeComponentSources(event.getIndex(), event.itemsSize(), true); // true = fire event
- }
-
- /**
- * Do not fire an event.
- */
- protected void removeComponentSources(int removedSourcesIndex, int removedSourcesSize) {
- this.removeComponentSources(removedSourcesIndex, removedSourcesSize, false); // false = do not 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(ListChangeEvent event) {
- this.replaceComponentSources(event.getIndex(), this.items(event), event.itemsSize(), 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, ListIterator<? 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(ListChangeEvent event) {
- this.moveComponentSources(event.getTargetIndex(), event.getSourceIndex(), event.getMoveLength(), 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(ListChangeEvent event) {
- this.removeComponentSources(0, this.infoList.size());
- this.fireListCleared(LIST_VALUES);
- }
-
- /**
- * The component sources changed; rebuild our cache.
- */
- @Override
- protected void listChanged(ListChangeEvent event) {
- this.removeComponentSources(0, this.infoList.size());
- this.addComponentSources(0, this.listHolder.listIterator(), this.listHolder.size());
- this.fireListChanged(LIST_VALUES);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(CollectionTools.list(this.listIterator(), this.size));
- }
-
-
- // ********** 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 <code>Transformer</code>.
- */
- 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);
- }
-
- /**
- * Return the index of the specified event's component LVM.
- */
- protected int indexFor(ListChangeEvent event) {
- return this.indexOf(this.componentLVM(event));
- }
-
- /**
- * Items were added to one of the component lists;
- * synchronize our cache.
- */
- protected void componentItemsAdded(ListChangeEvent event) {
- // update the affected 'begin' indices
- int componentLVMIndex = this.indexFor(event);
- int newItemsSize = event.itemsSize();
- for (int i = componentLVMIndex + 1; i < this.infoList.size(); i++) {
- this.infoList.get(i).begin += newItemsSize;
- }
- this.size += newItemsSize;
-
- // synchronize the cached list
- Info info = this.infoList.get(componentLVMIndex);
- CollectionTools.addAll(info.items, event.getIndex(), this.componentItems(event), event.itemsSize());
-
- // translate the event
- this.fireItemsAdded(event.cloneWithSource(this, LIST_VALUES, info.begin));
- }
-
- /**
- * Items were removed from one of the component lists;
- * synchronize our cache.
- */
- protected void componentItemsRemoved(ListChangeEvent event) {
- // update the affected 'begin' indices
- int componentLVMIndex = this.indexFor(event);
- int removedItemsSize = event.itemsSize();
- 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.itemsSize()).clear();
-
- // translate the event
- this.fireItemsRemoved(event.cloneWithSource(this, LIST_VALUES, info.begin));
- }
-
- /**
- * Items were replaced in one of the component lists;
- * synchronize our cache.
- */
- protected void componentItemsReplaced(ListChangeEvent 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 (Iterator<E2> stream = this.componentItems(event); stream.hasNext(); ) {
- info.items.set(i++, stream.next());
- }
-
- // translate the event
- this.fireItemsReplaced(event.cloneWithSource(this, LIST_VALUES, info.begin));
- }
-
- /**
- * Items were moved in one of the component lists;
- * synchronize our cache.
- */
- protected void componentItemsMoved(ListChangeEvent 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.getMoveLength());
-
- // translate the event
- this.fireItemsMoved(event.cloneWithSource(this, LIST_VALUES, info.begin));
- }
-
- /**
- * One of the component lists was cleared;
- * synchronize our cache.
- */
- protected void componentListCleared(ListChangeEvent 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();
- 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);
- info.items.clear();
-
- // translate the event
- this.fireItemsRemoved(LIST_VALUES, info.begin, items);
- }
-
- /**
- * One of the component lists changed;
- * synchronize our cache by clearing out the appropriate
- * list and rebuilding it.
- */
- protected void componentListChanged(ListChangeEvent event) {
- int componentLVMIndex = this.indexFor(event);
- Info info = this.infoList.get(componentLVMIndex);
- this.clearComponentList(componentLVMIndex, info);
-
- // update the affected 'begin' indices
- int newItemsSize = info.componentLVM.size();
- for (int i = componentLVMIndex + 1; i < this.infoList.size(); i++) {
- this.infoList.get(i).begin += newItemsSize;
- }
- this.size += newItemsSize;
-
- // synchronize the cached list
- CollectionTools.addAll(info.items, info.componentLVM.listIterator(), newItemsSize);
-
- // translate the event
- this.fireItemsAdded(LIST_VALUES, info.begin, info.items);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected ListIterator<E2> componentItems(ListChangeEvent event) {
- return (ListIterator<E2>) event.items();
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected ListValueModel<E2> componentLVM(ListChangeEvent event) {
- return (ListValueModel<E2>) event.getSource();
- }
-
-}
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 84650cf2b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ExtendedListValueModelWrapper.java
+++ /dev/null
@@ -1,204 +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.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.iterators.ReadOnlyCompositeListIterator;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * This wrapper extends a ListValueModel (or CollectionValueModel)
- * with fixed collections of items on either end.
- * <p>
- * NB: 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(ListChangeEvent event) {
- this.fireItemsAdded(event.cloneWithSource(this, LIST_VALUES, this.prefix.size()));
- }
-
- @Override
- protected void itemsRemoved(ListChangeEvent event) {
- this.fireItemsRemoved(event.cloneWithSource(this, LIST_VALUES, this.prefix.size()));
- }
-
- @Override
- protected void itemsReplaced(ListChangeEvent event) {
- this.fireItemsReplaced(event.cloneWithSource(this, LIST_VALUES, this.prefix.size()));
- }
-
- @Override
- protected void itemsMoved(ListChangeEvent event) {
- this.fireItemsMoved(event.cloneWithSource(this, LIST_VALUES, this.prefix.size()));
- }
-
- @Override
- protected void listCleared(ListChangeEvent event) {
- this.fireListChanged(LIST_VALUES); // not "cleared"
- }
-
- @Override
- protected void listChanged(ListChangeEvent event) {
- this.fireListChanged(LIST_VALUES);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.prefix);
- sb.append(" ");
- super.toString(sb);
- sb.append(" ");
- sb.append(this.suffix);
- }
-
-
- // ********** miscellaneous **********
-
- public void setPrefix(List<E> prefix) {
- this.prefix = prefix;
- this.fireListChanged(LIST_VALUES);
- }
-
- public void setSuffix(List<E> suffix) {
- this.suffix = suffix;
- this.fireListChanged(LIST_VALUES);
- }
-
-}
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 8dc865a0f3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringCollectionValueModel.java
+++ /dev/null
@@ -1,171 +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.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.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * A <code>FilteringCollectionValueModel</code> wraps another
- * <code>CollectionValueModel</code> and uses a <code>Filter</code>
- * to determine which items in the collection are returned by calls
- * to <code>#iterator()</code>.
- * <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 .java files).
- * <p>
- * NB: 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 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
- * 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;
-
-
- // ********** 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;
- this.filteredItems = new ArrayList<E>();
- }
-
- /**
- * 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.iterator()));
- }
-
- @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(CollectionChangeEvent event) {
- // filter the values before propagating the change event
- this.addItemsToCollection(this.filter(this.items(event)), this.filteredItems, VALUES);
- }
-
- @Override
- protected void itemsRemoved(CollectionChangeEvent 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.items(), this.filteredItems, VALUES);
- }
-
- @Override
- protected void collectionCleared(CollectionChangeEvent 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 iterator that filters the specified iterator.
- */
- protected Iterator<E> filter(Iterator<? extends E> items) {
- return new FilteringIterator<E, 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.iterator()));
- this.fireCollectionChanged(VALUES);
- }
-
-}
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 a56cc34c80..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringPropertyValueModel.java
+++ /dev/null
@@ -1,138 +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 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
- * <code>PropertyValueModel</code> and uses a <code>Filter</code>
- * to determine when the wrapped value is to be returned by calls
- * to <code>value()</code>.
- * <p>
- * As an alternative to building a <code>Filter</code>, a subclass
- * of <code>FilteringPropertyValueModel</code> can override the
- * <code>accept(Object)</code> method.
- * <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.
- */
-public class FilteringPropertyValueModel<T>
- extends PropertyValueModelWrapper<T>
- implements PropertyValueModel<T>
-{
- protected final Filter<T> filter;
- protected final T defaultValue;
-
-
- // ********** constructors **********
-
- /**
- * Construct a property value model with the specified nested
- * property value model and a disabled filter.
- * Use this constructor if you want to override the
- * <code>accept(Object)</code>
- * method instead of building a <code>Filter</code>.
- * The default value will be <code>null</code>.
- */
- public FilteringPropertyValueModel(PropertyValueModel<? extends T> valueHolder) {
- this(valueHolder, Filter.Disabled.<T>instance(), null);
- }
-
- /**
- * Construct a 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 the
- * <code>accept(Object)</code>
- * method instead of building a <code>Filter</code>
- * <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 an 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 an 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")
- Object oldValue = this.filterValue((T) event.getOldValue());
- @SuppressWarnings("unchecked")
- Object newValue = this.filterValue((T) event.getNewValue());
- 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.defaultValue();
- }
-
- /**
- * Return whether the <code>FilteringPropertyValueModel</code> should
- * return the specified value from a call to the
- * <code>value()</code> method; the value came
- * from the nested property value model
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a <code>Filter</code>.
- */
- 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 defaultValue() {
- return this.defaultValue;
- }
-
-}
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 d7e20f4cb3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringWritablePropertyValueModel.java
+++ /dev/null
@@ -1,125 +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.model.value;
-
-import org.eclipse.jpt.utility.internal.BidiFilter;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * A <code>FilteringWritablePropertyValueModel</code> wraps another
- * <code>WritabelPropertyValueModel</code> and uses a <code>BidiFilter</code>
- * to determine when the wrapped value is to be returned by calls
- * to <code>value()</code> and modified by calls to
- * <code>setValue(Object)</code>.
- * <p>
- * As an alternative to building a <code>BidiFilter</code>, a subclass
- * of <code>FilteringWritablePropertyValueModel</code> can override the
- * <code>accept(Object)</code> and <code>reverseAccept(Object)</code>
- * methods.
- * <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.
- * <p>
- * Similarly, if an incoming value is not "reverseAccepted", *nothing* 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 property value model with the specified nested
- * property value model and a disabled filter.
- * Use this constructor if you want to override the
- * <code>accept(Object)</code> and <code>reverseAccept(Object)</code>
- * methods instead of building a <code>BidiFilter</code>.
- * The default value will be <code>null</code>.
- */
- public FilteringWritablePropertyValueModel(WritablePropertyValueModel<T> valueHolder) {
- this(valueHolder, BidiFilter.Disabled.<T>instance(), null);
- }
-
- /**
- * Construct a 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 the
- * <code>accept(Object)</code> and <code>reverseAccept(Object)</code>
- * methods instead of building a <code>BidiFilter</code>
- * <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.valueHolder().setValue(value);
- }
- }
-
-
- // ********** queries **********
-
- /**
- * Return whether the <code>FilteringWritablePropertyValueModel</code>
- * should pass through the specified value to the nested
- * writable property value model in a call to the
- * <code>setValue(Object)</code> method
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a <code>BidiFilter</code>.
- */
- protected boolean reverseAccept(T value) {
- return this.getFilter().reverseAccept(value);
- }
-
- /**
- * Our constructors accept only a WritablePropertyValueModel<T>.
- */
- @SuppressWarnings("unchecked")
- protected WritablePropertyValueModel<T> valueHolder() {
- 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 17538f93d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemAspectListValueModelAdapter.java
+++ /dev/null
@@ -1,295 +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.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.Counter;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-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 list value
- * model (or collection value model) and listening for changes to aspects of the
- * *items* 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 collection's external appearance.
- *
- * Subclasses need to override two methods:
- *
- * #listenToItem(Model)
- * begin listening to the appropriate aspect of the specified item and call
- * #itemAspectChanged(Object) whenever the aspect changes
- *
- * #stopListeningToItem(Model)
- * stop listening to the appropriate aspect of the specified item
- */
-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, Counter> counters;
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the list holder is required.
- */
- protected ItemAspectListValueModelAdapter(ListValueModel<? extends E> listHolder) {
- super(listHolder);
- this.counters = new IdentityHashMap<E, Counter>();
- }
-
- /**
- * 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.iterator());
- }
-
- protected void engageItems(Iterator<? extends E> stream) {
- while (stream.hasNext()) {
- this.engageItem(stream.next());
- }
- }
-
- protected void engageItem(E item) {
- // listen to an item only once
- Counter counter = this.counters.get(item);
- if (counter == null) {
- counter = new Counter();
- this.counters.put(item, counter);
- this.startListeningToItem((Model) item);
- }
- counter.increment();
- }
-
- /**
- * Start listening to the specified item.
- */
- protected abstract void startListeningToItem(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.iterator());
- }
-
- protected void disengageItems(Iterator<? extends E> stream) {
- while (stream.hasNext()) {
- this.disengageItem(stream.next());
- }
- }
-
- protected void disengageItem(E item) {
- // stop listening to an item only once
- Counter counter = this.counters.get(item);
- if (counter == null) {
- // something is wrong if this happens... ~bjv
- throw new IllegalStateException("missing counter: " + item);
- }
- if (counter.decrement() == 0) {
- this.counters.remove(item);
- this.stopListeningToItem((Model) item);
- }
- }
-
- /**
- * Stop listening to the specified item.
- */
- protected abstract void stopListeningToItem(Model item);
-
-
- // ********** 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(ListChangeEvent event) {
- // re-fire event with the wrapper as the source
- this.fireItemsAdded(event.cloneWithSource(this, LIST_VALUES));
- this.engageItems(this.items(event));
- }
-
- /**
- * Items were removed from the wrapped list holder.
- * Stop listening to the removed items and forward the event.
- */
- @Override
- protected void itemsRemoved(ListChangeEvent event) {
- this.disengageItems(this.items(event));
- // re-fire event with the wrapper as the source
- this.fireItemsRemoved(event.cloneWithSource(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(ListChangeEvent event) {
- this.disengageItems(this.replacedItems(event));
- // re-fire event with the wrapper as the source
- this.fireItemsReplaced(event.cloneWithSource(this, LIST_VALUES));
- this.engageItems(this.items(event));
- }
-
- /**
- * Items were moved in the wrapped list holder.
- * No need to change any listeners; just forward the event.
- */
- @Override
- protected void itemsMoved(ListChangeEvent event) {
- // re-fire event with the wrapper as the source
- this.fireItemsMoved(event.cloneWithSource(this, LIST_VALUES));
- }
-
- /**
- * The wrapped list holder was cleared.
- * Stop listening to the removed items and forward the event.
- */
- @Override
- protected void listCleared(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.iterator());
- 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.iterator());
- this.counters.clear();
- // re-fire event with the wrapper as the source
- this.fireListChanged(LIST_VALUES);
- this.engageAllItems();
- }
-
-
- // ********** item change support **********
-
- /**
- * The specified item has a bound property that has changed.
- * Notify listeners of the change.
- */
- protected void itemAspectChanged(EventObject event) {
- Object item = event.getSource();
- int index = this.lastIdentityIndexOf(item);
- while (index != -1) {
- this.itemAspectChanged(index, item);
- index = this.lastIdentityIndexOf(item, index);
- }
- }
-
- /**
- * The specified item has a bound property that has changed.
- * Notify listeners of the change.
- */
- protected void itemAspectChanged(int index, Object item) {
- this.fireItemReplaced(LIST_VALUES, index, item, item); // hmmm...
- }
-
- /**
- * Return the last index of the specified item, using object
- * identity instead of equality.
- */
- protected int lastIdentityIndexOf(Object o) {
- return this.lastIdentityIndexOf(o, this.listHolder.size());
- }
-
- /**
- * Return the last index of the specified item, starting just before the
- * the specified endpoint, and using object identity instead of equality.
- */
- protected int lastIdentityIndexOf(Object o, int end) {
- for (int i = end; i-- > 0; ) {
- if (this.listHolder.get(i) == o) {
- return i;
- }
- }
- return -1;
- }
-
-}
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 151a90f6c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemCollectionListValueModelAdapter.java
+++ /dev/null
@@ -1,97 +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.Arrays;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-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 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(CollectionChangeEvent event) {
- ItemCollectionListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void itemsRemoved(CollectionChangeEvent event) {
- ItemCollectionListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void collectionCleared(CollectionChangeEvent 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);
- }
- };
- }
-
-
- // ********** behavior **********
-
- @Override
- protected void startListeningToItem(Model item) {
- for (String collectionName : this.collectionNames) {
- item.addCollectionChangeListener(collectionName, this.itemCollectionListener);
- }
- }
-
- @Override
- protected void stopListeningToItem(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 5354c1bde5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemListListValueModelAdapter.java
+++ /dev/null
@@ -1,103 +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.Arrays;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-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 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(ListChangeEvent event) {
- ItemListListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void itemsRemoved(ListChangeEvent event) {
- ItemListListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void itemsReplaced(ListChangeEvent event) {
- ItemListListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void itemsMoved(ListChangeEvent event) {
- ItemListListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void listCleared(ListChangeEvent 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);
- }
- };
- }
-
-
- // ********** behavior **********
-
- @Override
- protected void startListeningToItem(Model item) {
- for (String listName : this.listNames) {
- item.addListChangeListener(listName, this.itemListListener);
- }
- }
-
- @Override
- protected void stopListeningToItem(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 48140a0c5b..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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 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);
- }
- };
- }
-
-
- // ********** behavior **********
-
- @Override
- protected void startListeningToItem(Model item) {
- for (String propertyName : this.propertyNames) {
- item.addPropertyChangeListener(propertyName, this.itemPropertyListener);
- }
- }
-
- @Override
- protected void stopListeningToItem(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 46d7d863fb..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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 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";
- }
- };
- }
-
-
- // ********** behavior **********
-
- @Override
- protected void startListeningToItem(Model item) {
- item.addStateChangeListener(this.itemStateListener);
- }
-
- @Override
- protected void stopListeningToItem(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 4e39f6ec34..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemTreeListValueModelAdapter.java
+++ /dev/null
@@ -1,97 +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.model.value;
-
-import java.util.Arrays;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-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 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(TreeChangeEvent event) {
- ItemTreeListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void nodeRemoved(TreeChangeEvent event) {
- ItemTreeListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void treeCleared(TreeChangeEvent 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);
- }
- };
- }
-
-
- // ********** behavior **********
-
- @Override
- protected void startListeningToItem(Model item) {
- for (String treeName : this.treeNames) {
- item.addTreeChangeListener(treeName, this.itemTreeListener);
- }
- }
-
- @Override
- protected void stopListeningToItem(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 b8adaaa96f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListAspectAdapter.java
+++ /dev/null
@@ -1,287 +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.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-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;
-
-/**
- * This extension of AspectAdapter provides ListChange support.
- * This allows us to convert a set of one or more collections into
- * a single collection, LIST_VALUES.
- *
- * The typical subclass will override the following methods:
- * #listIterator_()
- * at the very minimum, override this method to return a list iterator
- * on the subject's list aspect; it does not need to be overridden if
- * #listIterator() is overridden and its behavior changed
- * #get(int)
- * override this method to improve performance
- * #size_()
- * override this method to improve performance; it does not need to be overridden if
- * #size() is overridden and its behavior changed
- * #listIterator()
- * override this method only if returning an empty list iterator when the
- * subject is null is unacceptable
- * #size()
- * override this method only if returning a zero when the
- * subject is null is unacceptable
- */
-public abstract class ListAspectAdapter<S extends Model, E>
- extends AspectAdapter<S>
- implements ListValueModel<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 aspect. */
- protected final ListChangeListener listChangeListener;
-
- private static final Object[] EMPTY_ARRAY = new Object[0];
-
-
- // ********** constructors **********
-
- /**
- * Construct a ListAspectAdapter for the specified subject
- * and list.
- */
- protected ListAspectAdapter(String listName, S subject) {
- this(new String[] {listName}, subject);
- }
-
- /**
- * Construct a ListAspectAdapter for the specified subject
- * and lists.
- */
- protected ListAspectAdapter(String[] listNames, S subject) {
- this(new StaticPropertyValueModel<S>(subject), listNames);
- }
-
- /**
- * Construct a ListAspectAdapter 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 ListAspectAdapter 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 ListAspectAdapter 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 **********
-
- /**
- * The subject's list aspect has changed, notify the listeners.
- */
- protected ListChangeListener buildListChangeListener() {
- // transform the subject's list change events into VALUE list change events
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent event) {
- ListAspectAdapter.this.itemsAdded(event);
- }
- public void itemsRemoved(ListChangeEvent event) {
- ListAspectAdapter.this.itemsRemoved(event);
- }
- public void itemsReplaced(ListChangeEvent event) {
- ListAspectAdapter.this.itemsReplaced(event);
- }
- public void itemsMoved(ListChangeEvent event) {
- ListAspectAdapter.this.itemsMoved(event);
- }
- public void listCleared(ListChangeEvent 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);
- }
- };
- }
-
-
- // ********** ListValueModel implementation **********
-
- /**
- * Return the elements of the subject's list aspect.
- */
- public Iterator<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 that the subject is not null.
- * @see #listIterator()
- */
- protected ListIterator<E> listIterator_() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * 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 that 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 that the subject is not null.
- * @see #toArray()
- */
- protected Object[] toArray_() {
- return CollectionTools.array(this.listIterator(), this.size());
- }
-
-
- // ********** AspectAdapter implementation **********
-
- @Override
- protected Object getValue() {
- return this.iterator();
- }
-
- @Override
- protected Class<? extends ChangeListener> getListenerClass() {
- return ListChangeListener.class;
- }
-
- @Override
- protected String getListenerAspectName() {
- return LIST_VALUES;
- }
-
- @Override
- protected boolean hasListeners() {
- return this.hasAnyListChangeListeners(LIST_VALUES);
- }
-
- @Override
- protected void fireAspectChange(Object oldValue, Object newValue) {
- this.fireListChanged(LIST_VALUES);
- }
-
- @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);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- for (int i = 0; i < this.listNames.length; i++) {
- if (i != 0) {
- sb.append(", ");
- }
- sb.append(this.listNames[i]);
- }
- }
-
-
- // ********** behavior **********
-
- protected void itemsAdded(ListChangeEvent event) {
- this.fireItemsAdded(event.cloneWithSource(this, LIST_VALUES));
- }
-
- protected void itemsRemoved(ListChangeEvent event) {
- this.fireItemsRemoved(event.cloneWithSource(this, LIST_VALUES));
- }
-
- protected void itemsReplaced(ListChangeEvent event) {
- this.fireItemsReplaced(event.cloneWithSource(this, LIST_VALUES));
- }
-
- protected void itemsMoved(ListChangeEvent event) {
- this.fireItemsMoved(event.cloneWithSource(this, LIST_VALUES));
- }
-
- protected void listCleared(ListChangeEvent event) {
- this.fireListCleared(LIST_VALUES); // nothing from original event to forward
- }
-
- protected void listChanged(ListChangeEvent event) {
- this.fireListChanged(LIST_VALUES); // nothing from original event to forward
- }
-
-}
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 dc8a7aad40..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCollectionValueModelAdapter.java
+++ /dev/null
@@ -1,300 +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.ArrayList;
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-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.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-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 ListValueModel behave like
- * a read-only CollectionValueModel, sorta.
- *
- * We keep an internal collection somewhat in synch with the wrapped list.
- *
- * NB: 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. #size(), value()) 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 AbstractModel
- 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/initialization **********
-
- /**
- * Wrap the specified ListValueModel.
- */
- 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...
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, CollectionChangeListener.class, VALUES);
- }
-
- /**
- * The wrapped list has changed, forward an equivalent
- * collection change event to our listeners.
- */
- protected ListChangeListener buildListChangeListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent event) {
- ListCollectionValueModelAdapter.this.itemsAdded(event);
- }
- public void itemsRemoved(ListChangeEvent event) {
- ListCollectionValueModelAdapter.this.itemsRemoved(event);
- }
- public void itemsReplaced(ListChangeEvent event) {
- ListCollectionValueModelAdapter.this.itemsReplaced(event);
- }
- public void itemsMoved(ListChangeEvent event) {
- ListCollectionValueModelAdapter.this.itemsMoved(event);
- }
- public void listCleared(ListChangeEvent event) {
- ListCollectionValueModelAdapter.this.listCleared(event);
- }
- public void listChanged(ListChangeEvent event) {
- ListCollectionValueModelAdapter.this.listChanged(event);
- }
- @Override
- public String toString() {
- return "list change listener";
- }
- };
- }
-
-
- // ********** 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();
- }
-
-
- // ********** extend change support **********
-
- /**
- * Override to start listening to the list holder if necessary.
- */
- @Override
- public void addCollectionChangeListener(CollectionChangeListener listener) {
- if (this.hasNoListeners()) {
- this.engageModel();
- }
- super.addCollectionChangeListener(listener);
- }
-
- /**
- * Override to start listening to the list holder if necessary.
- */
- @Override
- public void addCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- if (collectionName == VALUES && this.hasNoListeners()) {
- this.engageModel();
- }
- super.addCollectionChangeListener(collectionName, listener);
- }
-
- /**
- * Override to stop listening to the list holder if appropriate.
- */
- @Override
- public void removeCollectionChangeListener(CollectionChangeListener listener) {
- super.removeCollectionChangeListener(listener);
- if (this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
- /**
- * Override to stop listening to the list holder if appropriate.
- */
- @Override
- public void removeCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- super.removeCollectionChangeListener(collectionName, listener);
- if (collectionName == VALUES && this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
-
- // ********** queries **********
-
- protected boolean hasListeners() {
- return this.hasAnyCollectionChangeListeners(VALUES);
- }
-
- protected boolean hasNoListeners() {
- return ! this.hasListeners();
- }
-
- /**
- * Return the index of the specified item, using object
- * identity instead of equality.
- */
- protected int lastIdentityIndexOf(Object o) {
- return this.lastIdentityIndexOf(o, this.collection.size());
- }
-
- /**
- * Return the last index of the specified item, starting just before the
- * the specified endpoint, and using object identity instead of equality.
- */
- protected int lastIdentityIndexOf(Object o, int end) {
- for (int i = end; i-- > 0; ) {
- if (this.collection.get(i) == o) {
- return i;
- }
- }
- return -1;
- }
-
-
- // ********** behavior **********
-
- protected void buildCollection() {
- Iterator<? extends E> stream = this.listHolder.iterator();
- // if the new list is empty, do nothing
- if (stream.hasNext()) {
- this.collection.ensureCapacity(this.listHolder.size());
- while (stream.hasNext()) {
- this.collection.add(stream.next());
- }
- }
- }
-
- 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();
- }
-
- 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();
- }
-
- // minimize suppressed warnings
- @SuppressWarnings("unchecked")
- protected ListIterator<E> items(ListChangeEvent event) {
- return (ListIterator<E>) event.items();
- }
-
- // minimize suppressed warnings
- @SuppressWarnings("unchecked")
- protected ListIterator<E> replacedItems(ListChangeEvent event) {
- return (ListIterator<E>) event.replacedItems();
- }
-
- protected void itemsAdded(ListChangeEvent event) {
- this.addItemsToCollection(this.items(event), this.collection, VALUES);
- }
-
- protected void removeInternalItems(Iterator<E> items) {
- // we have to remove the items individually,
- // since they are probably not in sequence
- while (items.hasNext()) {
- Object removedItem = items.next();
- int index = this.lastIdentityIndexOf(removedItem);
- this.collection.remove(index);
- this.fireItemRemoved(VALUES, removedItem);
- }
- }
-
- protected void itemsRemoved(ListChangeEvent event) {
- this.removeInternalItems(this.items(event));
- }
-
- protected void itemsReplaced(ListChangeEvent event) {
- this.removeInternalItems(this.replacedItems(event));
- this.addItemsToCollection(this.items(event), this.collection, VALUES);
- }
-
- protected void itemsMoved(ListChangeEvent event) {
- // do nothing? moving items in a list has no net effect on a collection...
- }
-
- protected void listCleared(ListChangeEvent 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(ListChangeEvent event) {
- // put in empty check so we don't fire events unnecessarily
- if ( ! this.collection.isEmpty()) {
- @SuppressWarnings("unchecked")
- ArrayList<E> removedItems = (ArrayList<E>) this.collection.clone();
- this.collection.clear();
- this.fireItemsRemoved(VALUES, removedItems);
- }
-
- this.buildCollection();
- // put in empty check so we don't fire events unnecessarily
- if ( ! this.collection.isEmpty()) {
- this.fireItemsAdded(VALUES, this.collection);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.listHolder);
- }
-
-}
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 f04821ad82..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCurator.java
+++ /dev/null
@@ -1,220 +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.ArrayList;
-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.ChangeListener;
-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 AspectAdapter provides ListChange 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";
- }
- };
- }
-
-
- // ********** ListValueModel implementation **********
-
- public Iterator<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 Object getValue() {
- return this.iterator();
- }
-
- @Override
- protected Class<? extends ChangeListener> 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 fireAspectChange(Object oldValue, Object newValue) {
- this.fireListChanged(LIST_VALUES);
- }
-
- /**
- * 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 #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, E item) {
- this.removeItemFromList(index, this.record, LIST_VALUES);
- }
-
-}
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 6c78b4fd62..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListPropertyValueModelAdapter.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-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.
- *
- * Subclasses must override:
- * - #buildValue()
- * to return the current property value, as derived from the
- * current list value
- *
- * Subclasses might want to override:
- * - #itemsAdded(ListChangeEvent event)
- * - #itemsRemoved(ListChangeEvent event)
- * - #itemsReplaced(ListChangeEvent event)
- * - #itemsMoved(ListChangeEvent event)
- * - #listCleared(ListChangeEvent event)
- * - #listChanged(ListChangeEvent event)
- * to improve performance (by not recalculating the value, if possible)
- */
-public abstract class ListPropertyValueModelAdapter<T>
- extends AspectPropertyValueModelAdapter<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(ListChangeEvent event) {
- ListPropertyValueModelAdapter.this.itemsAdded(event);
- }
- public void itemsRemoved(ListChangeEvent event) {
- ListPropertyValueModelAdapter.this.itemsRemoved(event);
- }
- public void itemsReplaced(ListChangeEvent event) {
- ListPropertyValueModelAdapter.this.itemsReplaced(event);
- }
- public void itemsMoved(ListChangeEvent event) {
- ListPropertyValueModelAdapter.this.itemsMoved(event);
- }
- public void listCleared(ListChangeEvent event) {
- ListPropertyValueModelAdapter.this.listCleared(event);
- }
- public void listChanged(ListChangeEvent event) {
- ListPropertyValueModelAdapter.this.listChanged(event);
- }
- @Override
- public String toString() {
- return "list change listener";
- }
- };
- }
-
-
- // ********** 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);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.listHolder);
- }
-
-
- // ********** collection change support **********
-
- /**
- * Items were added to the wrapped list holder;
- * propagate the change notification appropriately.
- */
- protected void itemsAdded(ListChangeEvent 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(ListChangeEvent 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(ListChangeEvent 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(ListChangeEvent 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(ListChangeEvent 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(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 06f5a072e5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListValueModelWrapper.java
+++ /dev/null
@@ -1,206 +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.ListIterator;
-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.ListChangeEvent;
-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.
- */
-public abstract class ListValueModelWrapper<E>
- extends AbstractModel
-{
-
- /** 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 **********
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, ListChangeListener.class, ListValueModel.LIST_VALUES);
- }
-
- protected ListChangeListener buildListChangeListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent event) {
- ListValueModelWrapper.this.itemsAdded(event);
- }
- public void itemsRemoved(ListChangeEvent event) {
- ListValueModelWrapper.this.itemsRemoved(event);
- }
- public void itemsReplaced(ListChangeEvent event) {
- ListValueModelWrapper.this.itemsReplaced(event);
- }
- public void itemsMoved(ListChangeEvent event) {
- ListValueModelWrapper.this.itemsMoved(event);
- }
- public void listCleared(ListChangeEvent event) {
- ListValueModelWrapper.this.listCleared(event);
- }
- public void listChanged(ListChangeEvent event) {
- ListValueModelWrapper.this.listChanged(event);
- }
- @Override
- public String toString() {
- return "list change listener";
- }
- };
- }
-
-
- // ********** extend change support **********
-
- /**
- * Extend to start listening to the nested model if necessary.
- */
- @Override
- public synchronized void addListChangeListener(ListChangeListener listener) {
- if (this.hasNoListChangeListeners(ListValueModel.LIST_VALUES)) {
- this.engageModel();
- }
- super.addListChangeListener(listener);
- }
-
- /**
- * Extend to start listening to the nested model if necessary.
- */
- @Override
- public synchronized void addListChangeListener(String listName, ListChangeListener listener) {
- if (listName == ListValueModel.LIST_VALUES && this.hasNoListChangeListeners(ListValueModel.LIST_VALUES)) {
- this.engageModel();
- }
- super.addListChangeListener(listName, listener);
- }
-
- /**
- * Extend to stop listening to the nested model if necessary.
- */
- @Override
- public synchronized void removeListChangeListener(ListChangeListener listener) {
- super.removeListChangeListener(listener);
- if (this.hasNoListChangeListeners(ListValueModel.LIST_VALUES)) {
- this.disengageModel();
- }
- }
-
- /**
- * Extend to stop listening to the nested model if necessary.
- */
- @Override
- public synchronized void removeListChangeListener(String listName, ListChangeListener listener) {
- super.removeListChangeListener(listName, listener);
- if (listName == ListValueModel.LIST_VALUES && this.hasNoListChangeListeners(ListValueModel.LIST_VALUES)) {
- this.disengageModel();
- }
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to the list holder.
- */
- protected void engageModel() {
- this.listHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
-
- /**
- * Stop listening to the list holder.
- */
- protected void disengageModel() {
- this.listHolder.removeListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.listHolder);
- }
-
- // minimize suppressed warnings
- @SuppressWarnings("unchecked")
- protected ListIterator<E> items(ListChangeEvent event) {
- return (ListIterator<E>) event.items();
- }
-
- // minimize suppressed warnings
- @SuppressWarnings("unchecked")
- protected ListIterator<E> replacedItems(ListChangeEvent event) {
- return (ListIterator<E>) event.replacedItems();
- }
-
-
- // ********** list change support **********
-
- /**
- * Items were added to the wrapped list holder;
- * propagate the change notification appropriately.
- */
- protected abstract void itemsAdded(ListChangeEvent event);
-
- /**
- * Items were removed from the wrapped list holder;
- * propagate the change notification appropriately.
- */
- protected abstract void itemsRemoved(ListChangeEvent event);
-
- /**
- * Items were replaced in the wrapped list holder;
- * propagate the change notification appropriately.
- */
- protected abstract void itemsReplaced(ListChangeEvent event);
-
- /**
- * Items were moved in the wrapped list holder;
- * propagate the change notification appropriately.
- */
- protected abstract void itemsMoved(ListChangeEvent event);
-
- /**
- * The wrapped list holder was cleared;
- * propagate the change notification appropriately.
- */
- protected abstract void listCleared(ListChangeEvent 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 db6447c94b..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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.ClassTools;
-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.
- *
- * 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 ClassTools.shortClassNameForObject(this);
- }
-
-}
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 7bdb3ab3a3..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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.ClassTools;
-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.
- *
- * 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");
- }
-
- public Object[] toArray() {
- return EMPTY_ARRAY;
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public String toString() {
- return ClassTools.shortClassNameForObject(this);
- }
-
-}
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 12c9b670e8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullPropertyValueModel.java
+++ /dev/null
@@ -1,50 +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 org.eclipse.jpt.utility.internal.ClassTools;
-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.
- *
- * We don't use a singleton because we hold on to listeners.
- */
-public 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 ClassTools.shortClassNameForObject(this);
- }
-
-}
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 b035c29811..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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.ClassTools;
-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.
- *
- * We don't use a singleton because we hold on to listeners.
- */
-public 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 ClassTools.shortClassNameForObject(this);
- }
-
-}
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 eb2b4f8b43..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyAspectAdapter.java
+++ /dev/null
@@ -1,255 +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.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.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;
-
-/**
- * This AspectAdapter provides basic PropertyChange support.
- * This allows us to convert a set of one or more properties into
- * a single property, VALUE.
- *
- * The typical subclass will override the following methods:
- * #buildValue_()
- * at the very minimum, override this method to return the value of the
- * subject's property (or "virtual" property); it does not need to be
- * overridden if #buildValue() is overridden and its behavior changed
- * #setValue_(Object)
- * override this method if the client code needs to *set* the value of
- * the subject's property; oftentimes, though, the client code (e.g. UI)
- * will need only to *get* the value; it does not need to be
- * overridden if #setValue(Object) is overridden and its behavior changed
- * #buildValue()
- * override this method only if returning a null value when the subject is null
- * is unacceptable
- * #setValue(Object)
- * override this method only if something must be done when the subject
- * is null (e.g. throw an exception)
- */
-public abstract class PropertyAspectAdapter<S extends Model, T>
- extends AspectAdapter<S>
- implements WritablePropertyValueModel<T>
-{
- /**
- * 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 T value;
-
- /** 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 PropertyAspectAdapter for the specified subject
- * and property.
- */
- protected PropertyAspectAdapter(String propertyName, S subject) {
- this(new String[] {propertyName}, subject);
- }
-
- /**
- * Construct a PropertyAspectAdapter for the specified subject
- * and properties.
- */
- protected PropertyAspectAdapter(String[] propertyNames, S subject) {
- this(new StaticPropertyValueModel<S>(subject), propertyNames);
- }
-
- /**
- * Construct a PropertyAspectAdapter for the specified subject holder
- * and properties.
- */
- protected PropertyAspectAdapter(PropertyValueModel<? extends S> subjectHolder, String... propertyNames) {
- super(subjectHolder);
- this.propertyNames = propertyNames;
- this.propertyChangeListener = this.buildPropertyChangeListener();
- // our value is null when we are not listening to the subject
- this.value = null;
- }
-
- /**
- * Construct a PropertyAspectAdapter 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 PropertyAspectAdapter 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 TransformationPropertyValueModel could also be
- * used in this situation.)
- */
- protected PropertyAspectAdapter(PropertyValueModel<? extends S> subjectHolder) {
- this(subjectHolder, EMPTY_PROPERTY_NAMES);
- }
-
-
- // ********** initialization **********
-
- /**
- * The subject's property has changed, notify the listeners.
- */
- 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();
- }
- @Override
- public String toString() {
- return "property change listener: " + Arrays.asList(PropertyAspectAdapter.this.propertyNames); //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** PropertyValueModel implementation **********
-
- /**
- * Return the value of the subject's property.
- */
- @Override
- public final T getValue() {
- return this.value;
- }
-
-
- // ********** WritablePropertyValueModel implementation **********
-
- /**
- * Set the value of the subject's property.
- */
- public void setValue(T value) {
- if (this.subject != null) {
- this.setValue_(value);
- }
- }
-
- /**
- * Set the value of the subject's property.
- * At this point we can be sure that the subject is not null.
- * @see #setValue(Object)
- */
- protected void setValue_(@SuppressWarnings("unused") T value) {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** AspectAdapter implementation **********
-
- @Override
- protected Class<? extends ChangeListener> getListenerClass() {
- return PropertyChangeListener.class;
- }
-
- @Override
- protected String getListenerAspectName() {
- return VALUE;
- }
-
- @Override
- protected boolean hasListeners() {
- return this.hasAnyPropertyChangeListeners(VALUE);
- }
-
- @Override
- protected void fireAspectChange(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 engageSubject_() {
- for (String propertyName : this.propertyNames) {
- ((Model) this.subject).addPropertyChangeListener(propertyName, this.propertyChangeListener);
- }
- }
-
- @Override
- protected void disengageSubject() {
- super.disengageSubject();
- // clear out our value when we are not listening to the subject
- this.value = null;
- }
-
- @Override
- protected void disengageSubject_() {
- for (String propertyName : this.propertyNames) {
- ((Model) this.subject).removePropertyChangeListener(propertyName, this.propertyChangeListener);
- }
- }
-
-
- // ********** AbstractModel implementation **********
-
- @Override
- public void toString(StringBuilder sb) {
- for (int i = 0; i < this.propertyNames.length; i++) {
- if (i != 0) {
- sb.append(", "); //$NON-NLS-1$
- }
- sb.append(this.propertyNames[i]);
- }
- }
-
-
- // ********** behavior **********
-
- /**
- * Return the aspect's value.
- * At this point the subject may be null.
- */
- protected T buildValue() {
- return (this.subject == null) ? null : this.buildValue_();
- }
-
- /**
- * Return the value of the subject's property.
- * At this point we can be sure that the subject is not null.
- * @see #buildValue()
- */
- protected T buildValue_() {
- throw new UnsupportedOperationException();
- }
-
- protected void propertyChanged() {
- T old = this.value;
- this.value = this.buildValue();
- this.fireAspectChange(old, this.value);
- }
-
-}
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 5b09ad161e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyCollectionValueModelAdapter.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 org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-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.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;
-
-/**
- * An adapter that allows us to make a PropertyValueModel behave like
- * a read-only, single-element CollectionValueModel, sorta.
- *
- * If the property's value is null, an empty iterator is returned
- * (i.e. you can't have a collection with a null element).
- */
-public class PropertyCollectionValueModelAdapter<E>
- extends AbstractModel
- 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 **********
-
- /**
- * Wrap the specified ListValueModel.
- */
- public PropertyCollectionValueModelAdapter(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...
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, CollectionChangeListener.class, VALUES);
- }
-
- /**
- * The wrapped value has changed, forward an equivalent
- * collection change event to our listeners.
- */
- protected PropertyChangeListener buildPropertyChangeListener() {
- return new PropertyChangeListener() {
- @SuppressWarnings("unchecked")
- public void propertyChanged(PropertyChangeEvent event) {
- PropertyCollectionValueModelAdapter.this.valueChanged((E) event.getNewValue());
- }
- @Override
- public String toString() {
- return "property change listener";
- }
- };
- }
-
-
- // ********** CollectionValueModel implementation **********
-
- public Iterator<E> iterator() {
- return (this.value == null) ?
- EmptyIterator.<E>instance()
- :
- new SingleElementIterator<E>(this.value);
- }
-
- public int size() {
- return (this.value == null) ? 0 : 1;
- }
-
-
- // ********** extend change support **********
-
- /**
- * Override to start listening to the value holder if necessary.
- */
- @Override
- public void addCollectionChangeListener(CollectionChangeListener listener) {
- if (this.hasNoListeners()) {
- this.engageModel();
- }
- super.addCollectionChangeListener(listener);
- }
-
- /**
- * Override to start listening to the value holder if necessary.
- */
- @Override
- public void addCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- if (collectionName == VALUES && this.hasNoListeners()) {
- this.engageModel();
- }
- super.addCollectionChangeListener(collectionName, listener);
- }
-
- /**
- * Override to stop listening to the value holder if appropriate.
- */
- @Override
- public void removeCollectionChangeListener(CollectionChangeListener listener) {
- super.removeCollectionChangeListener(listener);
- if (this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
- /**
- * Override to stop listening to the value holder if appropriate.
- */
- @Override
- public void removeCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- super.removeCollectionChangeListener(collectionName, listener);
- if (collectionName == VALUES && this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
-
- // ********** queries **********
-
- protected boolean hasListeners() {
- return this.hasAnyCollectionChangeListeners(VALUES);
- }
-
- protected boolean hasNoListeners() {
- return ! this.hasListeners();
- }
-
-
- // ********** behavior **********
-
- 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();
- }
-
- 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) {
- // put in "empty" check so we don't fire events unnecessarily
- if (this.value != null) {
- E oldValue = this.value;
- this.value = null;
- this.fireItemRemoved(VALUES, oldValue);
- }
- this.value = newValue;
- // put in "empty" check so we don't fire events unnecessarily
- if (this.value != null) {
- this.fireItemAdded(VALUES, this.value);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.valueHolder);
- }
-
-}
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 96afe29e1f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyListValueModelAdapter.java
+++ /dev/null
@@ -1,219 +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.model.value;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-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.ListChangeListener;
-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 PropertyValueModel behave like
- * a read-only, single-element ListValueModel, sorta.
- *
- * If the property's value is null, an empty iterator is returned
- * (i.e. you can't have a list with a null element).
- */
-public class PropertyListValueModelAdapter<E>
- extends AbstractModel
- 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 **********
-
- /**
- * Wrap the specified property 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...
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, ListChangeListener.class, LIST_VALUES);
- }
-
- /**
- * The wrapped value has changed, forward an equivalent
- * list change event to our listeners.
- */
- protected PropertyChangeListener buildPropertyChangeListener() {
- return new PropertyChangeListener() {
- @SuppressWarnings("unchecked")
- public void propertyChanged(PropertyChangeEvent event) {
- PropertyListValueModelAdapter.this.valueChanged((E) event.getNewValue());
- }
- @Override
- public String toString() {
- return "property change listener";
- }
- };
- }
-
-
- // ********** 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.ioobe(index, 0);
- }
- if (index > 0) {
- throw this.ioobe(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};
- }
-
-
- // ********** extend change support **********
-
- /**
- * Override to start listening to the value holder if necessary.
- */
- @Override
- public void addListChangeListener(ListChangeListener listener) {
- if (this.hasNoListeners()) {
- this.engageModel();
- }
- super.addListChangeListener(listener);
- }
-
- /**
- * Override to start listening to the value holder if necessary.
- */
- @Override
- public void addListChangeListener(String listName, ListChangeListener listener) {
- if (listName == LIST_VALUES && this.hasNoListeners()) {
- this.engageModel();
- }
- super.addListChangeListener(listName, listener);
- }
-
- /**
- * Override to stop listening to the value holder if appropriate.
- */
- @Override
- public void removeListChangeListener(ListChangeListener listener) {
- super.removeListChangeListener(listener);
- if (this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
- /**
- * Override to stop listening to the value holder if appropriate.
- */
- @Override
- public void removeListChangeListener(String listName, ListChangeListener listener) {
- super.removeListChangeListener(listName, listener);
- if (listName == LIST_VALUES && this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
-
- // ********** queries **********
-
- protected boolean hasListeners() {
- return this.hasAnyListChangeListeners(LIST_VALUES);
- }
-
- protected boolean hasNoListeners() {
- return ! this.hasListeners();
- }
-
-
- // ********** behavior **********
-
- protected IndexOutOfBoundsException ioobe(int index, int size) {
- return new IndexOutOfBoundsException("Index: " + index + ", Size: " + size);
- }
-
- 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();
- }
-
- 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) {
- sb.append(this.valueHolder);
- }
-
-}
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 c5195af061..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyValueModelWrapper.java
+++ /dev/null
@@ -1,145 +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 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 class provides the infrastructure needed to wrap
- * another property value model, "lazily" listen to it, and propagate
- * its change notifications.
- */
-public abstract class PropertyValueModelWrapper<T>
- extends AbstractModel
-{
-
- /** The wrapped property value model. */
- protected final PropertyValueModel<? extends T> 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 T> valueHolder) {
- super();
- if (valueHolder == null) {
- throw new NullPointerException();
- }
- this.valueHolder = valueHolder;
- this.valueChangeListener = this.buildValueChangeListener();
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, PropertyChangeListener.class, PropertyValueModel.VALUE);
- }
-
- 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$
- }
- };
- }
-
-
- // ********** extend change support **********
-
- /**
- * Extend to start listening to the nested model if necessary.
- */
- @Override
- public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
- if (this.hasNoPropertyChangeListeners(PropertyValueModel.VALUE)) {
- this.engageValueHolder();
- }
- super.addPropertyChangeListener(listener);
- }
-
- /**
- * Extend to start listening to the nested model if necessary.
- */
- @Override
- public synchronized void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- if (propertyName == PropertyValueModel.VALUE && this.hasNoPropertyChangeListeners(PropertyValueModel.VALUE)) {
- this.engageValueHolder();
- }
- super.addPropertyChangeListener(propertyName, listener);
- }
-
- /**
- * Extend to stop listening to the nested model if necessary.
- */
- @Override
- public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
- super.removePropertyChangeListener(listener);
- if (this.hasNoPropertyChangeListeners(PropertyValueModel.VALUE)) {
- this.disengageValueHolder();
- }
- }
-
- /**
- * Extend to stop listening to the nested model if necessary.
- */
- @Override
- public synchronized void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- super.removePropertyChangeListener(propertyName, listener);
- if (propertyName == PropertyValueModel.VALUE && this.hasNoPropertyChangeListeners(PropertyValueModel.VALUE)) {
- this.disengageValueHolder();
- }
- }
-
-
- // ********** behavior **********
-
- /**
- * Begin listening to the value holder.
- */
- protected void engageValueHolder() {
- this.valueHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.valueChangeListener);
- }
-
- /**
- * Stop listening to the value holder.
- */
- protected void disengageValueHolder() {
- this.valueHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.valueChangeListener);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.valueHolder);
- }
-
-
- // ********** 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/SimpleCollectionValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimpleCollectionValueModel.java
deleted file mode 100644
index e61c51136d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimpleCollectionValueModel.java
+++ /dev/null
@@ -1,183 +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.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;
-
-/**
- * Implementation of CollectionValueModel and Collection that simply holds a
- * collection and notifies listeners of any changes.
- */
-public class SimpleCollectionValueModel<E>
- extends AbstractModel
- implements CollectionValueModel<E>, Collection<E>
-{
- /** The collection. */
- protected Collection<E> collection;
-
-
- // ********** constructors **********
-
- /**
- * Construct a CollectionValueModel for the specified collection.
- */
- public SimpleCollectionValueModel(Collection<E> collection) {
- super();
- if (collection == null) {
- throw new NullPointerException();
- }
- this.collection = collection;
- }
-
- /**
- * Construct a CollectionValueModel 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();
- }
-
-
- // ********** 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();
- }
-
-
- // ********** additional behavior **********
-
- /**
- * Allow the collection to be replaced.
- */
- public void setCollection(Collection<E> collection) {
- if (collection == null) {
- throw new NullPointerException();
- }
- this.collection = collection;
- this.fireCollectionChanged(VALUES);
- }
-
- @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 e6aca61c50..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimpleListValueModel.java
+++ /dev/null
@@ -1,316 +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.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;
-
-/**
- * Implementation of ListValueModel and List that simply holds a
- * collection and notifies listeners of any changes.
- */
-public class SimpleListValueModel<E>
- extends AbstractModel
- implements ListValueModel<E>, List<E>
-{
- /** The list. */
- protected List<E> list;
-
-
- // ********** constructors **********
-
- /**
- * Construct a ListValueModel for the specified list.
- */
- public SimpleListValueModel(List<E> list) {
- super();
- if (list == null) {
- throw new NullPointerException();
- }
- this.list = list;
- }
-
- /**
- * Construct a ListValueModel 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);
- }
-
-
- // ********** 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 **********
-
- /**
- * Allow the list to be replaced.
- */
- public void setList(List<E> list) {
- if (list == null) {
- throw new NullPointerException();
- }
- this.list = list;
- this.fireListChanged(LIST_VALUES);
- }
-
- /**
- * 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 e7248e65c5..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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 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 PropertyValueModel for the specified value.
- */
- public SimplePropertyValueModel(T value) {
- super();
- this.value = value;
- }
-
- /**
- * Construct a PropertyValueModel 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 2194ba4cb2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SortedListValueModelAdapter.java
+++ /dev/null
@@ -1,132 +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.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.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * An adapter that allows us to make a <code>CollectionValueModel</code>
- * (or <code>ListValueModel</code>) behave like a <code>ListValueModel</code>
- * that keeps its contents sorted and notifies listeners appropriately.
- * <p>
- * The 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>
- * NB: 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. <code>#size()</code>, <code>#getItem(int)</code>) 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 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);
- }
-
- /**
- * Wrap the specified list value model and sort its contents
- * using the specified comparator.
- */
- public SortedListValueModelAdapter(ListValueModel<? extends E> listHolder, Comparator<E> comparator) {
- this(new ListCollectionValueModelAdapter<E>(listHolder), comparator);
- }
-
- /**
- * Wrap the specified list value model and sort its contents
- * based on the elements' "natural ordering".
- */
- public SortedListValueModelAdapter(ListValueModel<? extends E> listHolder) {
- this(listHolder, null);
- }
-
-
- // ********** accessors **********
-
- public void setComparator(Comparator<E> comparator) {
- this.comparator = comparator;
- this.sortList();
- }
-
-
- // ********** behavior **********
-
- /**
- * Sort the internal list before
- * sending out change notification.
- */
- @Override
- protected void postBuildList() {
- super.postBuildList();
- Collections.sort(this.list, this.comparator);
- }
-
- /**
- * the list will need to be sorted after the item is added
- */
- @Override
- protected void itemsAdded(CollectionChangeEvent 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/StatePropertyValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StatePropertyValueModelAdapter.java
deleted file mode 100644
index db6c0c916f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StatePropertyValueModelAdapter.java
+++ /dev/null
@@ -1,100 +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.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.
- *
- * Subclasses must override:
- * - #buildValue()
- * to return the current property value, as derived from the
- * current model
- *
- * Subclasses might want to override:
- * - #stateChanged(StateChangeEvent event)
- * to improve performance (by not recalculating the value, if possible)
- */
-public abstract class StatePropertyValueModelAdapter<T>
- extends AspectPropertyValueModelAdapter<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";
- }
- };
- }
-
-
- // ********** 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);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.model);
- }
-
-
- // ********** state change support **********
-
- /**
- * The model's state changed;
- * propagate the change notification appropriately.
- */
- protected void stateChanged(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 4cbcba4527..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticCollectionValueModel.java
+++ /dev/null
@@ -1,63 +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.Collection;
-import java.util.Iterator;
-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.model.value.CollectionValueModel;
-
-/**
- * Implementation of CollectionValueModel that can be used for
- * returning an iterator on a static collection, but still allows listeners to be added.
- * Listeners will NEVER be notified of any changes, because there should be none.
- */
-public class StaticCollectionValueModel<E>
- extends AbstractModel
- implements CollectionValueModel<E>
-{
- /** The collection. */
- protected final Collection<? extends E> collection;
-
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Construct a static CollectionValueModel for the specified collection.
- */
- public StaticCollectionValueModel(Collection<? extends E> collection) {
- super();
- if (collection == null) {
- throw new NullPointerException();
- }
- this.collection = collection;
- }
-
- // ********** CollectionValueModel implementation **********
-
- public int size() {
- return this.collection.size();
- }
-
- public Iterator<E> iterator() {
- return new ReadOnlyIterator<E>(this.collection.iterator());
- }
-
-
- // ********** Object overrides **********
-
- @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/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 3ddae7920d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticListValueModel.java
+++ /dev/null
@@ -1,78 +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 java.util.ListIterator;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * Implementation of ListValueModel that can be used for
- * returning a list iterator on a static list, but still allows listeners to be added.
- * Listeners will NEVER be notified of any changes, because there should be none.
- */
-public class StaticListValueModel<E>
- extends AbstractModel
- implements ListValueModel<E>
-{
- /** The value. */
- protected final List<? extends E> list;
-
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Construct a static ListValueModel for the specified list.
- */
- public StaticListValueModel(List<? extends E> list) {
- super();
- if (list == null) {
- throw new NullPointerException();
- }
- this.list = list;
- }
-
-
- // ********** ListValueModel implementation **********
-
- public Iterator<E> iterator() {
- return new ReadOnlyIterator<E>(this.list.iterator());
- }
-
- public ListIterator<E> listIterator() {
- return new ReadOnlyListIterator<E>(this.list.listIterator());
- }
-
- public int size() {
- return this.list.size();
- }
-
- public E get(int index) {
- return this.list.get(index);
- }
-
- public Object[] toArray() {
- return this.list.toArray();
- }
-
-
- // ********** Object overrides **********
-
- @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/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 e5eccf3ae2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticPropertyValueModel.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.model.value;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * Implementation of PropertyValueModel that can be used for
- * returning a static value, but still allows listeners to be added.
- * Listeners will NEVER 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 PropertyValueModel for the specified value.
- */
- public StaticPropertyValueModel(T value) {
- super();
- this.value = value;
- }
-
-
- // ********** PropertyValueModel implementation **********
-
- public T getValue() {
- return this.value;
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, 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 6c435a3238..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticTreeValueModel.java
+++ /dev/null
@@ -1,59 +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.model.value;
-
-import java.util.Iterator;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-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.model.value.TreeValueModel;
-
-/**
- * Implementation of TreeValueModel that can be used for
- * returning an iterator on a static tree, but still allows listeners to be added.
- * Listeners will NEVER 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 TreeValueModel 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 String toString() {
- return StringTools.buildToStringFor(this, CollectionTools.collection(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 f1a7c1f877..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationListValueModelAdapter.java
+++ /dev/null
@@ -1,241 +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.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.ListChangeEvent;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * An adapter that allows us to transform a ListValueModel
- * (or CollectionValueModel) into a read-only ListValueModel
- * whose items are tranformations of the items in the wrapped
- * ListValueModel. It will keep its contents in synch with
- * the contents of the wrapped ListValueModel and notifies its
- * listeners of any changes.
- * <p>
- * The transformer can be changed at any time; allowing the same
- * adapter to be used with different transformations.
- * <p>
- * NB: 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. #size(), #getItem(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.
- */
-public class TransformationListValueModelAdapter<E1, E2>
- extends ListValueModelWrapper<E1>
- implements ListValueModel<E2>
-{
-
- /** This transforms the items, unless the subclass overrides #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 associated with the specified event.
- */
- protected List<E2> transformItems(ListChangeEvent event) {
- return this.transformItems(this.items(event), event.itemsSize());
- }
-
- /**
- * Transform the items in the specified list value model.
- */
- protected List<E2> transformItems(ListValueModel<? extends E1> lvm) {
- return this.transformItems(lvm.listIterator(), lvm.size());
- }
-
- /**
- * Transform the replaced items associated with the specified event.
- */
- protected List<E2> transformReplacedItems(ListChangeEvent event) {
- return this.transformItems(this.replacedItems(event), event.itemsSize());
- }
-
- /**
- * Transform the specified items.
- */
- protected List<E2> transformItems(ListIterator<? extends E1> items, int size) {
- List<E2> result = new ArrayList<E2>(size);
- while (items.hasNext()) {
- result.add(this.transformItem(items.next()));
- }
- 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);
- }
-
-
- // ********** 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(ListChangeEvent 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(ListChangeEvent event) {
- this.removeItemsFromList(event.getIndex(), event.itemsSize(), 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(ListChangeEvent event) {
- this.setItemsInList(event.getIndex(), this.transformItems(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(ListChangeEvent event) {
- this.moveItemsInList(event.getTargetIndex(), event.getSourceIndex(), event.getMoveLength(), this.transformedList, LIST_VALUES);
- }
-
- /**
- * The wrapped list holder was cleared.
- * Clear our transformation list and notify our listeners.
- */
- @Override
- protected void listCleared(ListChangeEvent 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 ba878e5c19..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationPropertyValueModel.java
+++ /dev/null
@@ -1,131 +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 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
- * <code>PropertyValueModel</code> and uses a <code>Transformer</code>
- * to transform the wrapped value before it is returned by <code>value()</code>.
- * <p>
- * As an alternative to building a <code>Transformer</code>,
- * a subclass of <code>TransformationPropertyValueModel</code> can
- * either override the <code>transform_(Object)</code> method or,
- * if something other than null should be returned when the wrapped value
- * is null, override the <code>transform(Object)</code> method.
- */
-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 the
- * <code>transform_(Object)</code> or <code>transform(Object)</code>
- * method instead of building a <code>Transformer</code>.
- */
- 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")
- Object oldValue = this.transformOld((T1) event.getOldValue());
- @SuppressWarnings("unchecked")
- Object newValue = this.transformNew((T1) event.getNewValue());
- this.firePropertyChanged(VALUE, oldValue, newValue);
- }
-
-
- // ********** behavior **********
-
- /**
- * Transform the specified value and return the result.
- * This is called by #value() and #valueChanged(PropertyChangeEvent).
- */
- 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 UnsupportedOperationException();
- }
-
- /**
- * 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);
- }
-
- // ********** 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 1299097bf7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationWritablePropertyValueModel.java
+++ /dev/null
@@ -1,127 +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.model.value;
-
-import org.eclipse.jpt.utility.internal.BidiTransformer;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * A <code>TransformationWritablePropertyValueModel</code> wraps another
- * <code>WritablePropertyValueModel</code> and uses a <code>BidiTransformer</code>
- * to:<ul>
- * <li>transform the wrapped value before it is returned by <code>value()</code>
- * <li>"reverse-transform" the new value that comes in via
- * <code>setValue(Object)</code>
- * </ul>
- * As an alternative to building a <code>BidiTransformer</code>,
- * a subclass of <code>TransformationWritablePropertyValueModel</code> can
- * override the <code>transform_(Object)</code> and
- * <code>reverseTransform_(Object)</code> methods; or,
- * if something other than null should be returned when the wrapped value
- * is null or the new value is null, override the <code>transform(Object)</code>
- * and <code>reverseTransform(Object)</code> methods.
- */
-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
- * <code>transform_(Object)</code> and <code>reverseTransform_(Object)</code>
- * (or <code>transform(Object)</code> and <code>reverseTransform(Object)</code>)
- * methods instead of building a <code>BidiTransformer</code>.
- */
- 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.valueHolder().setValue(this.reverseTransform(value));
- }
-
-
- // ********** behavior **********
-
- /**
- * "Reverse-transform" the specified value and return the result.
- * This is called by #setValue(Object).
- */
- protected T1 reverseTransform(T2 value) {
- return this.transformer().reverseTransform(value);
- }
-
- /**
- * "Reverse-transform" the specified, non-null, value and return the result.
- */
- protected T1 reverseTransform_(@SuppressWarnings("unused") T2 value) {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** queries **********
-
- /**
- * Our constructors accept only a WritablePropertyValueModel<T1>.
- */
- @SuppressWarnings("unchecked")
- protected WritablePropertyValueModel<T1> valueHolder() {
- return (WritablePropertyValueModel<T1>) this.valueHolder;
- }
-
- /**
- * Our constructors accept only a bidirectional transformer.
- */
- protected BidiTransformer<T1, T2> transformer() {
- return (BidiTransformer<T1, T2>) this.transformer;
- }
-
-
- // ********** default bidi transformer **********
-
- /**
- * The default bidi 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).
- * The default bidi transformer will also return null if the new value is null.
- * If the new value is not null, it is reverse-transformed by a subclass
- * implementation of #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 739bb97012..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TreeAspectAdapter.java
+++ /dev/null
@@ -1,215 +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.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-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;
-
-/**
- * This extension of PropertyAdapter provides TreeChange support.
- * This allows us to convert a set of one or more trees into
- * a single tree, NODES.
- *
- * The typical subclass will override the following methods:
- * #nodes_()
- * 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
- * #nodes() is overridden and its behavior changed
- * #nodes()
- * override this method only if returning an empty iterator when the
- * subject is null is unacceptable
- */
-public abstract class TreeAspectAdapter<S extends Model, E>
- extends AspectAdapter<S>
- implements TreeValueModel<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 aspect. */
- protected final TreeChangeListener treeChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct a TreeAspectAdapter for the specified subject
- * and tree.
- */
- protected TreeAspectAdapter(String treeName, S subject) {
- this(new String[] {treeName}, subject);
- }
-
- /**
- * Construct a TreeAspectAdapter for the specified subject
- * and trees.
- */
- protected TreeAspectAdapter(String[] treeNames, S subject) {
- this(new StaticPropertyValueModel<S>(subject), treeNames);
- }
-
- /**
- * Construct a TreeAspectAdapter 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 TreeAspectAdapter 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 TreeAspectAdapter 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 **********
-
- /**
- * The subject's tree aspect has changed, notify the listeners.
- */
- protected TreeChangeListener buildTreeChangeListener() {
- // transform the subject's tree change events into VALUE tree change events
- return new TreeChangeListener() {
- public void nodeAdded(TreeChangeEvent event) {
- TreeAspectAdapter.this.nodeAdded(event);
- }
- public void nodeRemoved(TreeChangeEvent event) {
- TreeAspectAdapter.this.nodeRemoved(event);
- }
- public void treeCleared(TreeChangeEvent 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);
- }
- };
- }
-
-
- // ********** 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 that the subject is not null.
- * @see #nodes()
- */
- protected Iterator<E> nodes_() {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** AspectAdapter implementation **********
-
- @Override
- protected Object getValue() {
- return this.nodes();
- }
-
- @Override
- protected Class<? extends ChangeListener> getListenerClass() {
- return TreeChangeListener.class;
- }
-
- @Override
- protected String getListenerAspectName() {
- return NODES;
- }
-
- @Override
- protected boolean hasListeners() {
- return this.hasAnyTreeChangeListeners(NODES);
- }
-
- @Override
- protected void fireAspectChange(Object oldValue, Object newValue) {
- this.fireTreeChanged(NODES);
- }
-
- @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);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- for (int i = 0; i < this.treeNames.length; i++) {
- if (i != 0) {
- sb.append(", ");
- }
- sb.append(this.treeNames[i]);
- }
- }
-
-
- // ********** behavior **********
-
- protected void nodeAdded(TreeChangeEvent event) {
- this.fireNodeAdded(NODES, event.getPath());
- }
-
- protected void nodeRemoved(TreeChangeEvent event) {
- this.fireNodeRemoved(NODES, event.getPath());
- }
-
- protected void treeCleared(TreeChangeEvent event) {
- this.fireTreeCleared(NODES);
- }
-
- protected void treeChanged(TreeChangeEvent event) {
- this.fireTreeChanged(NODES, event.getPath());
- }
-
-}
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 11b6f1a2b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TreePropertyValueModelAdapter.java
+++ /dev/null
@@ -1,137 +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.model.value;
-
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-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.
- *
- * Subclasses must override:
- * - #buildValue()
- * to return the current property value, as derived from the
- * current collection value
- *
- * Subclasses might want to override:
- * - #stateChanged(StateChangeEvent event)
- * to improve performance (by not recalculating the value, if possible)
- */
-public abstract class TreePropertyValueModelAdapter<T>
- extends AspectPropertyValueModelAdapter<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(TreeChangeEvent event) {
- TreePropertyValueModelAdapter.this.nodeAdded(event);
- }
- public void nodeRemoved(TreeChangeEvent event) {
- TreePropertyValueModelAdapter.this.nodeRemoved(event);
- }
- public void treeCleared(TreeChangeEvent event) {
- TreePropertyValueModelAdapter.this.treeCleared(event);
- }
- public void treeChanged(TreeChangeEvent event) {
- TreePropertyValueModelAdapter.this.treeChanged(event);
- }
- @Override
- public String toString() {
- return "tree change listener";
- }
- };
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to the tree holder.
- */
- @Override
- protected void engageModel_() {
- this.treeHolder.addTreeChangeListener(this.treeChangeListener);
- }
-
- /**
- * Stop listening to the tree holder.
- */
- @Override
- protected void disengageModel_() {
- this.treeHolder.removeTreeChangeListener(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(TreeChangeEvent 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(TreeChangeEvent 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(TreeChangeEvent 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(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 6fea2e865f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueAspectAdapter.java
+++ /dev/null
@@ -1,157 +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 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 model that provides behavior for wrapping a property
- * value model and listening for changes to aspects of the *value* contained
- * by the property value model. Changes to the actual value are also monitored.
- *
- * 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.
- *
- * NB: Clients will need to listen for two different change notifications: a property
- * change event will be be fired when the value changes; a state change event
- * will be fired when an aspect of the value changes.
- *
- * Subclasses need to override two methods:
- *
- * #engageValue_()
- * begin listening to the appropriate aspect of the value and call
- * #valueAspectChanged(Object) whenever the aspect changes
- *
- * #disengageValue_()
- * stop listening to the appropriate aspect of the value
- */
-public abstract class ValueAspectAdapter<T>
- extends PropertyValueModelWrapper<T>
- implements WritablePropertyValueModel<T>
-{
- /** Cache the value so we can disengage. Null until we have a listener*/
- protected T value;
-
-
- // ********** constructors/initialization **********
-
- /**
- * Constructor - the value holder is required.
- */
- protected ValueAspectAdapter(WritablePropertyValueModel<T> valueHolder) {
- super(valueHolder);
- }
-
- /**
- * Override to allow both property value model change and state change
- * listeners.
- */
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new ChangeSupport(this);
- }
-
-
- // ********** PropertyValueModel implementation **********
-
- public T getValue() {
- return this.value;
- }
-
-
- // ********** WritablePropertyValueModel implementation **********
-
- public void setValue(T value) {
- this.valueHolder().setValue(value);
- }
-
-
- // ********** PropertyValueModelWrapper implementation **********
-
- @Override
- protected void valueChanged(PropertyChangeEvent event) {
- this.disengageValue();
- this.engageValue();
- this.firePropertyChanged(event.cloneWithSource(this));
- }
-
-
- // ********** extend change support **********
-
- @Override
- public synchronized void addStateChangeListener(StateChangeListener listener) {
- if (this.hasNoStateChangeListeners()) {
- this.engageValue();
- }
- super.addStateChangeListener(listener);
- }
-
- @Override
- public synchronized void removeStateChangeListener(StateChangeListener listener) {
- super.removeStateChangeListener(listener);
- if (this.hasNoStateChangeListeners()) {
- this.disengageValue();
- }
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to the current value.
- */
- protected void engageValue() {
- this.value = this.valueHolder.getValue();
- if (this.value != null) {
- this.engageValue_();
- }
- }
-
- /**
- * Start listening to the current value.
- * At this point we can be sure that the value is not null.
- */
- protected abstract void engageValue_();
-
- /**
- * Stop listening to the current value.
- */
- protected void disengageValue() {
- if (this.value != null) {
- this.disengageValue_();
- this.value = null;
- }
- }
-
- /**
- * Stop listening to the current value.
- * At this point we can be sure that 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 constructors accept only a WritablePropertyValueModel<T1>.
- */
- @SuppressWarnings("unchecked")
- protected WritablePropertyValueModel<T> valueHolder() {
- return (WritablePropertyValueModel<T>) this.valueHolder;
- }
-
-}
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 069fc0e2e0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueCollectionAdapter.java
+++ /dev/null
@@ -1,86 +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.Arrays;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Extend ValueAspectAdapter to listen to one or more collection
- * aspects of the value in the wrapped value model.
- */
-public class ValueCollectionAdapter<T extends Model>
- extends ValueAspectAdapter<T>
-{
-
- /** 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<T> valueHolder, String... collectionNames) {
- super(valueHolder);
- this.collectionNames = collectionNames;
- this.valueCollectionListener = this.buildValueCollectionListener();
- }
-
-
- // ********** 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 buildValueCollectionListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent event) {
- ValueCollectionAdapter.this.valueAspectChanged();
- }
- public void itemsRemoved(CollectionChangeEvent event) {
- ValueCollectionAdapter.this.valueAspectChanged();
- }
- public void collectionCleared(CollectionChangeEvent event) {
- ValueCollectionAdapter.this.valueAspectChanged();
- }
- public void collectionChanged(CollectionChangeEvent event) {
- ValueCollectionAdapter.this.valueAspectChanged();
- }
- @Override
- public String toString() {
- return "value collection listener: " + Arrays.asList(ValueCollectionAdapter.this.collectionNames);
- }
- };
- }
-
- @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);
- }
- }
-
-}
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 85cb429f8f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueListAdapter.java
+++ /dev/null
@@ -1,92 +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.Arrays;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Extend ValueAspectAdapter to listen to one or more list
- * aspects of the value in the wrapped value model.
- */
-public class ValueListAdapter<T extends Model>
- extends ValueAspectAdapter<T>
-{
-
- /** 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<T> valueHolder, String... listNames) {
- super(valueHolder);
- this.listNames = listNames;
- this.valueListListener = this.buildValueListListener();
- }
-
-
- // ********** initialization **********
-
- /**
- * All we really care about is the fact that a List aspect has
- * changed. Do the same thing no matter which event occurs.
- */
- protected ListChangeListener buildValueListListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent event) {
- ValueListAdapter.this.valueAspectChanged();
- }
- public void itemsRemoved(ListChangeEvent event) {
- ValueListAdapter.this.valueAspectChanged();
- }
- public void itemsReplaced(ListChangeEvent event) {
- ValueListAdapter.this.valueAspectChanged();
- }
- public void itemsMoved(ListChangeEvent event) {
- ValueListAdapter.this.valueAspectChanged();
- }
- public void listCleared(ListChangeEvent event) {
- ValueListAdapter.this.valueAspectChanged();
- }
- public void listChanged(ListChangeEvent event) {
- ValueListAdapter.this.valueAspectChanged();
- }
- @Override
- public String toString() {
- return "value list listener: " + Arrays.asList(ValueListAdapter.this.listNames);
- }
- };
- }
-
- @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);
- }
- }
-
-}
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 a3d7e01731..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValuePropertyAdapter.java
+++ /dev/null
@@ -1,75 +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.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 ValueAspectAdapter to listen to one or more
- * properties of the value in the wrapped value model.
- */
-public class ValuePropertyAdapter<T extends Model>
- extends ValueAspectAdapter<T>
-{
- /** The names of the value's properties that 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<T> 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.valueAspectChanged();
- }
- @Override
- public String toString() {
- return "value property listener: " + Arrays.asList(ValuePropertyAdapter.this.propertyNames);
- }
- };
- }
-
-
- // ********** behavior **********
-
- @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);
- }
- }
-
-}
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 d516fdbf1b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueStateAdapter.java
+++ /dev/null
@@ -1,66 +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 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 ValueAspectAdapter to listen to the
- * "state" of the value in the wrapped value model.
- */
-public class ValueStateAdapter<T extends Model>
- extends ValueAspectAdapter<T>
-{
- /** Listener that listens to value. */
- protected final StateChangeListener valueStateListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the value state.
- */
- public ValueStateAdapter(WritablePropertyValueModel<T> valueHolder) {
- super(valueHolder);
- this.valueStateListener = this.buildValueStateListener();
- }
-
-
- // ********** initialization **********
-
- protected StateChangeListener buildValueStateListener() {
- return new StateChangeListener() {
- public void stateChanged(StateChangeEvent event) {
- ValueStateAdapter.this.valueAspectChanged();
- }
- @Override
- public String toString() {
- return "value state listener";
- }
- };
- }
-
-
- // ********** behavior **********
-
- @Override
- protected void engageValue_() {
- this.value.addStateChangeListener(this.valueStateListener);
- }
-
- @Override
- protected void disengageValue_() {
- this.value.removeStateChangeListener(this.valueStateListener);
- }
-
-}
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 41361ed37a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueTreeAdapter.java
+++ /dev/null
@@ -1,84 +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.model.value;
-
-import java.util.Arrays;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Extend ValueAspectAdapter to listen to one or more
- * tree aspects of the value in the wrapped value model.
- */
-public class ValueTreeAdapter<T extends Model>
- extends ValueAspectAdapter<T>
-{
- /** 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<T> valueHolder, String... treeNames) {
- super(valueHolder);
- this.treeNames = treeNames;
- this.valueTreeListener = this.buildValueTreeListener();
- }
-
-
- // ********** initialization **********
-
- protected TreeChangeListener buildValueTreeListener() {
- return new TreeChangeListener() {
- public void nodeAdded(TreeChangeEvent event) {
- ValueTreeAdapter.this.valueAspectChanged();
- }
- public void nodeRemoved(TreeChangeEvent event) {
- ValueTreeAdapter.this.valueAspectChanged();
- }
- public void treeCleared(TreeChangeEvent event) {
- ValueTreeAdapter.this.valueAspectChanged();
- }
- public void treeChanged(TreeChangeEvent event) {
- ValueTreeAdapter.this.valueAspectChanged();
- }
- @Override
- public String toString() {
- return "value tree listener: " + Arrays.asList(ValueTreeAdapter.this.treeNames);
- }
- };
- }
-
-
- // ********** behavior **********
-
- @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);
- }
- }
-
-}
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 44a9d56e11..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencePropertyValueModel.java
+++ /dev/null
@@ -1,345 +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.prefs;
-
-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.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;
-
-/**
- * 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,
- new Integer(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";
- }
- };
- }
-
-
- // ********** 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.fireAspectChange(old, value);
-
- if ((this.subject != null) && this.shouldSetPreference(old, value)) {
- this.setValue_(value);
- }
- }
-
-
- // ********** AspectAdapter implementation **********
-
- @Override
- protected Class<? extends ChangeListener> getListenerClass() {
- return PropertyChangeListener.class;
- }
-
- @Override
- protected String getListenerAspectName() {
- return VALUE;
- }
-
- @Override
- protected boolean hasListeners() {
- return this.hasAnyPropertyChangeListeners(VALUE);
- }
-
- @Override
- protected void fireAspectChange(Object oldValue, Object newValue) {
- this.firePropertyChanged(VALUE, oldValue, newValue);
- }
-
- @Override
- protected void engageSubject_() {
- this.subject.addPreferenceChangeListener(this.preferenceChangeListener);
- this.value = this.buildValue();
- }
-
- @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.")) {
- // 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(" => ");
- 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, 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.fireAspectChange(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 546a6686d2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencesCollectionValueModel.java
+++ /dev/null
@@ -1,200 +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.prefs;
-
-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.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.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;
-
-/**
- * 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";
- }
- };
- }
-
-
- // ********** 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 ChangeListener> getListenerClass() {
- return CollectionChangeListener.class;
- }
-
- @Override
- protected String getListenerAspectName() {
- return VALUES;
- }
-
- @Override
- protected boolean hasListeners() {
- return this.hasAnyCollectionChangeListeners(VALUES);
- }
-
- @Override
- protected void fireAspectChange(Object oldValue, Object newValue) {
- this.fireCollectionChanged(VALUES);
- }
-
- @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.")) {
- // 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 b3e0c9269c..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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";
- }
- };
- }
-
-
- // ********** 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);
- }
-
-}
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 66d09d23ca..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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";
- }
- };
- }
-
-
- // ********** 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 eeb65b4965..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/DocumentAdapter.java
+++ /dev/null
@@ -1,362 +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 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 final PropertyChangeListener stringListener;
-
- /** The event listener list for the document. */
- protected final EventListenerList listenerList = new EventListenerList();
-
-
- // ********** 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";
- }
- };
- }
-
- 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);
- }
-
-
-// ********** inner class **********
-
- protected interface CombinedListener extends DocumentListener, UndoableEditListener {
- // just consolidate the two interfaces
- }
-
- protected class InternalListener implements CombinedListener {
- 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 42e952f6b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ListModelAdapter.java
+++ /dev/null
@@ -1,286 +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 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.ListChangeEvent;
-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(ListChangeEvent event) {
- ListModelAdapter.this.itemsAdded(event);
- }
- public void itemsRemoved(ListChangeEvent event) {
- ListModelAdapter.this.itemsRemoved(event);
- }
- public void itemsReplaced(ListChangeEvent event) {
- ListModelAdapter.this.itemsReplaced(event);
- }
- public void itemsMoved(ListChangeEvent event) {
- ListModelAdapter.this.itemsMoved(event);
- }
- public void listCleared(ListChangeEvent event) {
- ListModelAdapter.this.listCleared();
- }
- public void listChanged(ListChangeEvent event) {
- ListModelAdapter.this.listChanged();
- }
- @Override
- public String toString() {
- return "list listener";
- }
- };
- }
-
-
- // ********** 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")
- 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(ListChangeEvent event) {
- int start = event.getIndex();
- int end = start + event.itemsSize() - 1;
- this.fireIntervalAdded(this, start, end);
- this.listSize += event.itemsSize();
- }
-
- /**
- * Items were removed from the underlying model list.
- * Notify listeners of the changes.
- */
- protected void itemsRemoved(ListChangeEvent event) {
- int start = event.getIndex();
- int end = start + event.itemsSize() - 1;
- this.fireIntervalRemoved(this, start, end);
- this.listSize -= event.itemsSize();
- }
-
- /**
- * Items were replaced in the underlying model list.
- * Notify listeners of the changes.
- */
- protected void itemsReplaced(ListChangeEvent event) {
- int start = event.getIndex();
- int end = start + event.itemsSize() - 1;
- this.fireContentsChanged(this, start, end);
- }
-
- /**
- * Items were moved in the underlying model list.
- * Notify listeners of the changes.
- */
- protected void itemsMoved(ListChangeEvent event) {
- int start = Math.min(event.getSourceIndex(), event.getTargetIndex());
- int end = Math.max(event.getSourceIndex(), event.getTargetIndex()) + event.getMoveLength() - 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 527120367b..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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";
- }
- };
- }
-
-
- // ********** 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 484ff33c3a..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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, new Integer(1), new Integer(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, new Integer(minimum), new Integer(maximum), new Integer(stepSize), new Integer(defaultValue));
- }
-
- /**
- * Constructor - the number holder is required.
- * Use the minimum value as the default spinner value.
- */
- public NumberSpinnerModelAdapter(WritablePropertyValueModel<Number> numberHolder, double value, double minimum, double maximum, double stepSize) {
- this(numberHolder, value, minimum, maximum, stepSize, minimum);
- }
-
- /**
- * Constructor - the number holder is required.
- */
- public NumberSpinnerModelAdapter(WritablePropertyValueModel<Number> numberHolder, double value, double minimum, double maximum, double stepSize, double defaultValue) {
- this(numberHolder, new Double(minimum), new Double(maximum), new Double(stepSize), new Double(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";
- }
- };
- }
-
-
- // ********** 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 61d2e3701f..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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";
- }
- };
- }
-
- /**
- * 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(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) == 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 2bc8a17734..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/PrimitiveListTreeModel.java
+++ /dev/null
@@ -1,233 +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.util.ArrayList;
-import java.util.Iterator;
-import java.util.ListIterator;
-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.ListChangeEvent;
-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(ListChangeEvent event) {
- int i = event.getIndex();
- for (ListIterator<?> stream = event.items(); stream.hasNext(); ) {
- PrimitiveListTreeModel.this.insertPrimitive(i++, stream.next());
- }
- }
-
- public void itemsRemoved(ListChangeEvent event) {
- for (int i = 0; i < event.itemsSize(); i++) {
- PrimitiveListTreeModel.this.removeNode(event.getIndex());
- }
- }
-
- public void itemsReplaced(ListChangeEvent event) {
- int i = event.getIndex();
- for (ListIterator<?> stream = event.items(); stream.hasNext(); ) {
- PrimitiveListTreeModel.this.replacePrimitive(i++, stream.next());
- }
- }
-
- public void itemsMoved(ListChangeEvent event) {
- ArrayList<MutableTreeNode> temp = new ArrayList<MutableTreeNode>(event.getMoveLength());
- for (int i = 0; i < event.getMoveLength(); i++) {
- temp.add(PrimitiveListTreeModel.this.removeNode(event.getSourceIndex()));
- }
- int i = event.getTargetIndex();
- for (MutableTreeNode node : temp) {
- PrimitiveListTreeModel.this.insertPrimitive(i++, node);
- }
- }
-
- public void listCleared(ListChangeEvent 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 1caee488c8..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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 == 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 == 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 c26f18fc90..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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";
- }
- };
- }
-
- /**
- * 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";
- }
- };
- }
-
-
- // ********** 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 5e039e270b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/TableModelAdapter.java
+++ /dev/null
@@ -1,410 +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.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.ListChangeEvent;
-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(ListChangeEvent event) {
- TableModelAdapter.this.addRows(event.getIndex(), event.itemsSize(), this.items(event));
- }
- public void itemsRemoved(ListChangeEvent event) {
- TableModelAdapter.this.removeRows(event.getIndex(), event.itemsSize());
- }
- public void itemsReplaced(ListChangeEvent event) {
- TableModelAdapter.this.replaceRows(event.getIndex(), this.items(event));
- }
- public void itemsMoved(ListChangeEvent event) {
- TableModelAdapter.this.moveRows(event.getTargetIndex(), event.getSourceIndex(), event.getMoveLength());
- }
- public void listCleared(ListChangeEvent event) {
- TableModelAdapter.this.clearTable();
- }
- public void listChanged(ListChangeEvent event) {
- TableModelAdapter.this.rebuildTable();
- }
- /**
- * minimize scope of suppressed warnings
- */
- @SuppressWarnings("unchecked")
- protected Iterator<Object> items(ListChangeEvent event) {
- return (Iterator<Object>) event.items();
- }
- @Override
- public String toString() {
- return "list listener";
- }
- };
- }
-
-
- 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";
- }
- };
- }
-
-
- // ********** 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, Iterator<Object> items) {
- List<WritablePropertyValueModel<Object>[]> newRows = new ArrayList<WritablePropertyValueModel<Object>[]>(size);
- while (items.hasNext()) {
- WritablePropertyValueModel<Object>[] row = this.columnAdapter.cellModels(items.next());
- 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, Iterator<Object> items) {
- int i = index;
- while (items.hasNext()) {
- WritablePropertyValueModel<Object>[] row = this.rows.get(i);
- this.disengageRow(row);
- row = this.columnAdapter.cellModels(items.next());
- 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 7c0e742f33..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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";
- }
- };
- }
-
-
- // ********** 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 f94a723025..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/TreeModelAdapter.java
+++ /dev/null
@@ -1,722 +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.util.ArrayList;
-import java.util.IdentityHashMap;
-import java.util.Iterator;
-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.ListChangeEvent;
-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";
- }
- };
- }
-
- 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";
- }
- };
- }
-
- 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";
- }
- };
- }
-
- protected ListChangeListener buildChildrenListener() {
- return new AWTListChangeListenerWrapper(this.buildChildrenListener_());
- }
-
- protected ListChangeListener buildChildrenListener_() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent event) {
- new EventChangePolicy(event).addChildren();
- }
- public void itemsRemoved(ListChangeEvent event) {
- new EventChangePolicy(event).removeChildren();
- }
- public void itemsReplaced(ListChangeEvent event) {
- new EventChangePolicy(event).replaceChildren();
- }
- public void itemsMoved(ListChangeEvent event) {
- new EventChangePolicy(event).moveChildren();
- }
- public void listCleared(ListChangeEvent event) {
- new EventChangePolicy(event).clearChildren();
- }
- public void listChanged(ListChangeEvent event) {
- new EventChangePolicy(event).rebuildChildren();
- }
- @Override
- public String toString() {
- return "children listener";
- }
- };
- }
-
-
- // ********** 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, node.childrenModel());
- }
-
- /**
- * Remove the specified node from our internal tree.
- */
- private void removeNodeFromInternalTree(TreeNodeValueModel<T> parent, int index, TreeNodeValueModel<T> node, 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.
- */
- private 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.children(), 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(Iterator<TreeNodeValueModel<T>> stream, int size) {
- @SuppressWarnings("unchecked")
- TreeNodeValueModel<T>[] array = new TreeNodeValueModel[size];
- for (int i = 0; stream.hasNext(); i++) {
- array[i] = stream.next();
- }
- 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 an interator on the current set of children.
- */
- abstract Iterator<TreeNodeValueModel<T>> children();
-
- }
-
-
- /**
- * Wraps a ListChangeEvent for adding, removing, replacing,
- * and changing children.
- */
- private class EventChangePolicy extends ChangePolicy {
- private ListChangeEvent event;
-
- EventChangePolicy(ListChangeEvent event) {
- this.event = event;
- }
-
- /**
- * Map the ListChangeEvent's source to the corresponding parent.
- */
- @Override
- TreeNodeValueModel<T> parent() {
- return TreeModelAdapter.this.parents.get(this.event.getSource());
- }
-
- /**
- * The ListChangeEvent's item index is the children start index.
- */
- @Override
- int childrenStartIndex() {
- return this.event.getIndex();
- }
-
- /**
- * The ListChangeEvent's size is the children size.
- */
- @Override
- int childrenSize() {
- return this.event.itemsSize();
- }
-
- /**
- * The ListChangeEvent's items are the children.
- */
- @Override
- @SuppressWarnings("unchecked")
- Iterator<TreeNodeValueModel<T>> children() {
- return (Iterator<TreeNodeValueModel<T>>) this.event.items();
- }
-
- /**
- * 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.replacedChildren());
- TreeModelAdapter.this.addChildren(parentPath, childIndices, this.childArray());
- }
-
- /**
- * Remove the old nodes and add the new ones.
- */
- void moveChildren() {
- TreeModelAdapter.this.moveChildren(this.parent(), this.event.getTargetIndex(), this.event.getSourceIndex(), this.event.getMoveLength());
- }
-
- /**
- * 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.iterator(), childrenList.size());
- TreeModelAdapter.this.removeChildren(parentPath, childIndices, childArray);
- }
-
- /**
- * 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.iterator(), childrenList.size());
- TreeModelAdapter.this.removeChildren(parentPath, childIndices, childArray);
-
- childIndices = this.buildIndices(parent.childrenModel().size());
- childArray = this.buildArray(parent.childrenModel().iterator(), parent.childrenSize());
- TreeModelAdapter.this.addChildren(parentPath, childIndices, childArray);
- }
-
- /**
- * The ListChangeEvent's replaced items are the replaced children.
- */
- @SuppressWarnings("unchecked")
- TreeNodeValueModel<T>[] replacedChildren() {
- return this.buildArray((Iterator<TreeNodeValueModel<T>>) this.event.replacedItems(), this.event.itemsSize());
- }
-
- }
-
-
- /**
- * Wraps a TreeNodeValueModel for adding and removing its children.
- */
- private class NodeChangePolicy extends ChangePolicy {
- private TreeNodeValueModel<T> node;
-
- NodeChangePolicy(TreeNodeValueModel<T> node) {
- 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
- Iterator<TreeNodeValueModel<T>> children() {
- return this.node.childrenModel().iterator();
- }
-
- }
-
-}
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 a7fab12bdb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/AbstractNode.java
+++ /dev/null
@@ -1,939 +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.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, CallbackChangeSupport.Source
-{
-
- /** 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);
- }
-
-
- // ********** 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");
- }
- }
-
- /**
- * 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(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
- */
- public 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.");
- }
- 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).");
- }
- throw new UnsupportedOperationException("Only root nodes implement #setValidator(Node.Validator).");
- }
-
-
- // ********** 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, 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(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);
- 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");
- }
- 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);
- 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 **********
-
- /**
- * Compare display strings.
- */
- public int compareTo(Node node) {
- return DEFAULT_COMPARATOR.compare(this, node);
- }
-
- /**
- * 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 9d3898c59d..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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 2936883fce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/Node.java
+++ /dev/null
@@ -1,419 +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.text.Collator;
-import java.util.Collection;
-import java.util.Comparator;
-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, Comparable<Node> {
-
-
- // ********** 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";
-
- /**
- * 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";
-
- /**
- * 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";
-
- /**
- * 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";
-
- /**
- * 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);
- }
- }
-
- /**
- * Typical comparator that can be used to sort a collection of nodes.
- * Sort based on display string:
- * - identical objects are equal (which means that cannot
- * co-exist in a SortedSet)
- * - use the default collator (which typically interleaves
- * lower- and upper-case letters)
- * - allow duplicate display strings (from different objects)
- * - try to return consistent results for same object pairs
- */
- Comparator<Node> DEFAULT_COMPARATOR =
- new Comparator<Node>() {
- public int compare(Node node1, Node node2) {
- // disallow duplicates based on object identity
- if (node1 == node2) {
- return 0;
- }
-
- // first compare display strings using the default collator
- int result = Collator.getInstance().compare(node1.displayString(), node2.displayString());
- if (result != 0) {
- return result;
- }
-
- // then compare using object-id
- result = System.identityHashCode(node1) - System.identityHashCode(node2);
- 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 "Node.DEFAULT_COMPARATOR";
- }
- };
-
-
- /**
- * 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";
- }
- };
-
-}
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 c44f8aab43..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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");
- }
- this.pause = true;
- }
-
- public synchronized void resume() {
- if ( ! this.pause) {
- throw new IllegalStateException("not paused");
- }
- 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";
- }
- }
-
- }
-
-}
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/RunnableValidation.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/RunnableValidation.java
deleted file mode 100644
index 367d57a028..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/RunnableValidation.java
+++ /dev/null
@@ -1,128 +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 java.util.logging.Level;
-import java.util.logging.LogRecord;
-import java.util.logging.Logger;
-import org.eclipse.jpt.utility.internal.SynchronizedBoolean;
-
-/**
- * This implementation of Runnable will asynchronously validate
- * a branch of nodes. It will wait until a shared "validate" flag is
- * set to validate the branch. Once the the branch is validated,
- * the thread will quiesce until the flag is set again.
- *
- * There are two ways to stop this thread:
- * - Thread.interrupt()
- * - set the "continue" flag to false
- * For now, these two are equivalent; but in the future we might
- * pass the "continue" flag to the Node.validateBranch()
- * method so we can short-circuit the validation instead of waiting
- * until the entire branch is validated.
- */
-public class RunnableValidation
- implements Runnable
-{
- /** The node whose branch this thread will validate. */
- private final Node node;
-
- /** When this flag is set to true, we kick off the validation routine. */
- private final SynchronizedBoolean validateFlag;
-
- /** When this flag is set to false, we allow this thread to die. */
- private final SynchronizedBoolean continueFlag;
-
- /** Log any exceptions encountered during validation with the following settings. */
- private final Logger exceptionLogger;
- private final Level exceptionLevel;
- private final String exceptionMessage;
-
-
- /**
- * Construct a validation thread.
- */
- public RunnableValidation(
- Node node,
- SynchronizedBoolean validateFlag,
- SynchronizedBoolean continueFlag,
- Logger exceptionLogger,
- Level exceptionLevel,
- String exceptionMessage
- ) {
- super();
- this.node = node;
- this.validateFlag = validateFlag;
- this.continueFlag = continueFlag;
- this.exceptionLogger = exceptionLogger;
- this.exceptionLevel = exceptionLevel;
- this.exceptionMessage = exceptionMessage;
- }
-
-
- // ********** Runnable Implementation **********
-
- /**
- * Loop while the "continue" flag is true and the thread
- * has not been interrupted by another thread.
- * In each loop: Wait until the "validate" flag is set to true,
- * then set it back to false and validate the branch of nodes.
- */
- public void run() {
- while (this.continueFlag.isTrue()) {
- try {
- this.validateFlag.waitToSetFalse();
- } catch (InterruptedException ex) {
- // we were interrupted while waiting, must be quittin' time
- return;
- }
- this.validateNode();
- }
- }
-
- /**
- * Validate the node, logging any exceptions.
- * If an exception occurs, we terminate the validation until the
- * "validation" flag is set again. Some exceptions occur because
- * of concurrent changes to the model that occur *after* validation
- * starts but before it completes an entire pass over the model. If that
- * is the case, things should be OK; because the exception will be
- * caught and the "validation" flag will have been set again *during* the
- * initial validation pass. So when we return from catching the exception
- * we will simply re-start the validation, hopefully with the model in
- * a consistent state that will prevent another exception from
- * occurring. Of course, if we have any exceptions that are *not*
- * the result of the model being in an inconsistent state, we will
- * probably fill the log; and those exceptions are bugs that need
- * to be fixed. (!) Hopefully the user will notice the enormous log and
- * contact support.... ~bjv
- */
- private void validateNode() {
- try {
- this.node.validateBranch();
- } catch (Throwable ex) {
- this.logException(ex);
- }
- }
-
- /**
- * We need to do all this because Logger#log(LogRecord) does not pass through
- * Logger#doLog(LogRecord) like all the other Logger#log(...) methods.
- */
- private void logException(Throwable ex) {
- LogRecord logRecord = new LogRecord(this.exceptionLevel, this.exceptionMessage);
- logRecord.setParameters(new Object[] { this.node.displayString() });
- logRecord.setThrown(ex);
- logRecord.setLoggerName(this.exceptionLogger.getName());
- logRecord.setResourceBundle(this.exceptionLogger.getResourceBundle());
- this.exceptionLogger.log(logRecord);
- }
-
-}
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 45ec6be9e2..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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, Object value, boolean selected, boolean hasFocus, int row, int column) {
- if (selected) {
- if (hasFocus && table.isCellEditable(row, column)) {
- return UIManager.getColor("Table.focusCellForeground");
- }
- return table.getSelectionForeground();
- }
- return table.getForeground();
- }
-
- /**
- * Return the cell's background color.
- */
- protected Color backgroundColor(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
- if (selected) {
- if (hasFocus && table.isCellEditable(row, column)) {
- return UIManager.getColor("Table.focusCellBackground");
- }
- return table.getSelectionBackground();
- }
- return table.getBackground();
- }
-
- /**
- * Return the cell's border.
- */
- protected Border border(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
- return hasFocus ? UIManager.getBorder("Table.focusCellHighlightBorder") : NO_FOCUS_BORDER;
- }
-
- /**
- * 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, Object value, boolean selected, boolean hasFocus, int row, 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 55d8d1f9a0..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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.ClassTools;
-
-/**
- * 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");
-
- // 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);
-
- 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);
- 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) ClassTools.fieldValue(result.getUI(), "listBox");
- }
-
-
- 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, 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, 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(JTable table, Object val, boolean selected, boolean hasFocus, int row, int column) {
- return hasFocus ?
- UIManager.getBorder("Table.focusCellHighlightBorder")
- :
- 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 f5149cfb78..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/Displayable.java
+++ /dev/null
@@ -1,93 +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.text.Collator;
-import java.util.Comparator;
-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, Comparable<Displayable>
-{
-
- /**
- * 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";
-
- /**
- * 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";
-
-
- // ********** helper implementations **********
-
- Collator DEFAULT_COLLATOR = Collator.getInstance();
-
- /**
- * Since all displayable objects must be comparable, provide a
- * typical comparator that can be used to sort a collection of
- * displayable objects.
- * Sort based on display string:
- * - identical objects are equal (which means they cannot
- * co-exist in a SortedSet)
- * - use the default collator (which typically interleaves
- * lower- and upper-case letters)
- * - allow duplicate display strings (from different objects)
- * - try to return consistent results for same object pairs
- */
- 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/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 148308eaa9..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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 d59f3e04d3..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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("");
- }
-
- 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(JComboBox comboBox) {
- return null;
- }
-
- protected int optionType(JComboBox comboBox) {
- return JOptionPane.OK_CANCEL_OPTION;
- }
-
- protected int messageType(JComboBox comboBox) {
- return JOptionPane.QUESTION_MESSAGE;
- }
-
- protected Icon icon(JComboBox comboBox) {
- return null;
- }
-
- protected Object[] selectionValues(JComboBox comboBox) {
- return null;
- }
-
- protected Object initialSelectionValue(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 ff17df3305..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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";
- }
- };
- }
-
- 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 <==========";
- }
-
- /**
- * 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 9abc2e58f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/ListChooser.java
+++ /dev/null
@@ -1,425 +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.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.ClassTools;
-
-/**
- * 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";
-
- static JLabel prototypeLabel = new JLabel("Prototype", new EmptyIcon(17), SwingConstants.LEADING);
-
- /**
- * 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";
-
- /** 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) ClassTools.fieldValue(this.ui, "listBox");
- }
-
- /**
- * 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";
- }
- };
- }
-
- /**
- * 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";
- }
- };
- }
-
- 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) ClassTools.fieldValue(comboBoxUi, "arrowButton");
- 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) ClassTools.fieldValue(comboBoxUi, "arrowButton");
- arrowButton.getModel().setPressed(false);
- }
- 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
- }
- }
-
- /**
- * 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 8d5aa452cf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleDisplayable.java
+++ /dev/null
@@ -1,177 +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.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(new Character(c));
- }
-
- public SimpleDisplayable(byte b) {
- this(new Byte(b));
- }
-
- public SimpleDisplayable(short s) {
- this(new Short(s));
- }
-
- public SimpleDisplayable(int i) {
- this(new Integer(i));
- }
-
- public SimpleDisplayable(long l) {
- this(new Long(l));
- }
-
- public SimpleDisplayable(float f) {
- this(new Float(f));
- }
-
- public SimpleDisplayable(double d) {
- this(new Double(d));
- }
-
-
- // ********** Displayable implementation **********
-
- public String displayString() {
- return this.object.toString();
- }
-
- public Icon icon() {
- return null;
- }
-
-
- // ********** Comparable implementation **********
-
- public int compareTo(Displayable o) {
- return DEFAULT_COMPARATOR.compare(this, o);
- }
-
-
- // ********** 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(new Character(c));
- }
-
- public byte getByte() {
- return ((Byte) this.object).byteValue();
- }
-
- public void setByte(byte b) {
- this.setObject(new Byte(b));
- }
-
- public short getShort() {
- return ((Short) this.object).shortValue();
- }
-
- public void setShort(short s) {
- this.setObject(new Short(s));
- }
-
- public int getInt() {
- return ((Integer) this.object).intValue();
- }
-
- public void setInt(int i) {
- this.setObject(new Integer(i));
- }
-
- public long getLong() {
- return ((Long) this.object).longValue();
- }
-
- public void setLong(long l) {
- this.setObject(new Long(l));
- }
-
- public float getFloat() {
- return ((Float) this.object).floatValue();
- }
-
- public void setFloat(float f) {
- this.setObject(new Float(f));
- }
-
- public double getDouble() {
- return ((Double) this.object).doubleValue();
- }
-
- public void setDouble(double d) {
- this.setObject(new Double(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 7215c6a387..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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(JComboBox comboBox) {
- return null;
- }
-
- protected String title(JComboBox comboBox) {
- return null;
- }
-
- protected int messageType(JComboBox comboBox) {
- return JOptionPane.QUESTION_MESSAGE;
- }
-
- protected Icon icon(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 ea649ba33d..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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(JList list, Object value, int index, boolean isSelected, 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(JList list, Object value, int index, boolean isSelected, 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());
- }
-
- /**
- * 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(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
- return this.buildToolTipText(value);
- }
-
- /**
- * Return the text displayed when the cursor lingers over the specified cell.
- */
- protected String buildToolTipText(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(JList list, Object value, int index, boolean isSelected, 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(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 a15e16a570..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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, Object value, boolean selected, boolean hasFocus, int row, int column) {
- if (selected) {
- if (hasFocus && table.isCellEditable(row, column)) {
- return UIManager.getColor("Table.focusCellForeground");
- }
- return table.getSelectionForeground();
- }
- return table.getForeground();
- }
-
- /**
- * Return the cell's background color.
- */
- protected Color backgroundColor(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
- if (selected) {
- if (hasFocus && table.isCellEditable(row, column)) {
- return UIManager.getColor("Table.focusCellBackground");
- }
- return table.getSelectionBackground();
- }
- return table.getBackground();
- }
-
- /**
- * Return the cell's border.
- */
- protected Border border(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
- if (hasFocus) {
- return UIManager.getBorder("Table.focusCellHighlightBorder");
- }
- 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 = new Integer(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 b19c86f08d..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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/model/Model.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/Model.java
deleted file mode 100644
index 33f2fd2afd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/Model.java
+++ /dev/null
@@ -1,195 +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.model;
-
-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.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 Model {
-
- // ********** state change **********
-
- /**
- * Add a listener that listens to all state change events.
- * The same listener may be added more than once and will be called
- * as many times as it is added. The listener cannot be null.
- */
- void addStateChangeListener(StateChangeListener listener);
-
- /**
- * Remove the specified state change listener. If the listener
- * was added more than once, it will be notified one less time
- * after being removed. An exception will be thrown 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,
- * regardless of the property name associated with that event.
- * The same listener may be added more than once and will be called
- * as many times as it is added. The listener cannot be null.
- */
- void addPropertyChangeListener(PropertyChangeListener listener);
-
- /**
- * Add a listener that listens to all property change events with
- * the specified property name.
- * The same listener may be added more than once and will be called
- * as many times as it is added. The listener cannot be null.
- */
- void addPropertyChangeListener(String propertyName, PropertyChangeListener listener);
-
- /**
- * Remove a listener that listens to all property change events,
- * regardless of the property name associated with that event.
- * If the listener was added more than once, it will be notified one less
- * time after being removed. An exception will be thrown if the
- * listener is null or if the listener was never added.
- */
- void removePropertyChangeListener(PropertyChangeListener listener);
-
- /**
- * Remove a listener that listens to all property change events,
- * with the specified property name.
- * If the listener was added more than once, it will be notified one less
- * time after being removed. An exception will be thrown 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,
- * regardless of the collection name associated with that event.
- * The same listener may be added more than once and will be called
- * as many times as it is added. The listener cannot be null.
- */
- void addCollectionChangeListener(CollectionChangeListener listener);
-
- /**
- * Add a listener that listens to all collection change events with
- * the specified collection name.
- * The same listener may be added more than once and will be called
- * as many times as it is added. The listener cannot be null.
- */
- void addCollectionChangeListener(String collectionName, CollectionChangeListener listener);
-
- /**
- * Remove a listener that listens to all collection change events,
- * regardless of the collection name associated with that event.
- * If the listener was added more than once, it will be notified one less
- * time after being removed. An exception will be thrown if the
- * listener is null or if the listener was never added.
- */
- void removeCollectionChangeListener(CollectionChangeListener listener);
-
- /**
- * Remove a listener that listens to all collection change events,
- * with the specified collection name.
- * If the listener was added more than once, it will be notified one less
- * time after being removed. An exception will be thrown 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,
- * regardless of the list name associated with that event.
- * The same listener may be added more than once and will be called
- * as many times as it is added. The listener cannot be null.
- */
- void addListChangeListener(ListChangeListener listener);
-
- /**
- * Add a listener that listens to all list change events with
- * the specified list name.
- * The same listener may be added more than once and will be called
- * as many times as it is added. The listener cannot be null.
- */
- void addListChangeListener(String listName, ListChangeListener listener);
-
- /**
- * Remove a listener that listens to all list change events,
- * regardless of the list name associated with that event.
- * If the listener was added more than once, it will be notified one less
- * time after being removed. An exception will be thrown if the
- * listener is null or if the listener was never added.
- */
- void removeListChangeListener(ListChangeListener listener);
-
- /**
- * Remove a listener that listens to all list change events,
- * with the specified list name.
- * If the listener was added more than once, it will be notified one less
- * time after being removed. An exception will be thrown 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,
- * regardless of the tree name associated with that event.
- * The same listener may be added more than once and will be called
- * as many times as it is added. The listener cannot be null.
- */
- void addTreeChangeListener(TreeChangeListener listener);
-
- /**
- * Add a listener that listens to all tree change events with
- * the specified tree name.
- * The same listener may be added more than once and will be called
- * as many times as it is added. The listener cannot be null.
- */
- void addTreeChangeListener(String treeName, TreeChangeListener listener);
-
- /**
- * Remove a listener that listens to all tree change events,
- * regardless of the tree name associated with that event.
- * If the listener was added more than once, it will be notified one less
- * time after being removed. An exception will be thrown if the
- * listener is null or if the listener was never added.
- */
- void removeTreeChangeListener(TreeChangeListener listener);
-
- /**
- * Remove a listener that listens to all tree change events,
- * with the specified tree name.
- * If the listener was added more than once, it will be notified one less
- * time after being removed. An exception will be thrown 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 5217abbd65..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ChangeEvent.java
+++ /dev/null
@@ -1,64 +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.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.
- *
- * 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();
- }
-
- /**
- * Return the name of the aspect of the source that changed.
- * May be null if inappropriate.
- */
- public abstract String getAspectName();
-
- /**
- * Return a copy of the event with the specified source
- * replacing the current source.
- */
- public abstract ChangeEvent cloneWithSource(Model newSource);
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.getAspectName());
- }
-
-}
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 386026c786..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionChangeEvent.java
+++ /dev/null
@@ -1,137 +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.model.event;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A "collection change" event gets delivered whenever a model changes a "bound"
- * or "constrained" collection. A CollectionChangeEvent is sent as an
- * argument to the CollectionChangeListener.
- *
- * Normally a CollectionChangeEvent is accompanied by the collection name and
- * the items that were added to or removed from the changed collection.
- *
- * 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
- *
- * 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 CollectionChangeEvent extends ChangeEvent {
-
- /** Name of the collection that changed. */
- private final String collectionName;
-
- /** The items that were added to or removed from the collection. May be empty, if not known. */
- private final Collection<?> items;
-
- 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.
- * @param items The items that were added to or removed from the collection.
- */
- public CollectionChangeEvent(Model source, String collectionName, Collection<?> items) {
- super(source);
- if ((collectionName == null) || (items == null)) {
- throw new NullPointerException();
- }
- this.collectionName = collectionName;
- this.items = Collections.unmodifiableCollection(items);
- }
-
- /**
- * 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) {
- this(source, collectionName, Collections.emptySet());
- }
-
-
- // ********** standard state **********
-
- /**
- * Return the programmatic name of the collection that was changed.
- */
- public String getCollectionName() {
- return this.collectionName;
- }
-
- @Override
- public String getAspectName() {
- return this.collectionName;
- }
-
- /**
- * Return an iterator on the items that were added to or
- * removed from the collection.
- * May be empty if inappropriate or unknown.
- */
- public Iterator<?> items() {
- return this.items.iterator();
- }
-
- /**
- * Return the number of items that were added to or
- * removed from the collection.
- * May be 0 if inappropriate or unknown.
- */
- public int itemsSize() {
- return this.items.size();
- }
-
-
- // ********** cloning **********
-
- /**
- * Return a copy of the event with the specified source
- * replacing the current source.
- */
- @Override
- public CollectionChangeEvent cloneWithSource(Model newSource) {
- return new CollectionChangeEvent(newSource, this.collectionName, this.items);
- }
-
- /**
- * Return a copy of the event with the specified source and collection name
- * replacing the current source and collection name.
- */
- public CollectionChangeEvent cloneWithSource(Model newSource, String newCollectionName) {
- return new CollectionChangeEvent(newSource, newCollectionName, 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 9ec18ae194..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListChangeEvent.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.utility.model.event;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A "list change" event gets delivered whenever a model changes a "bound"
- * or "constrained" list. A ListChangeEvent is sent as an
- * argument to the ListChangeListener.
- *
- * Normally a ListChangeEvent is accompanied by the list name,
- * the items that were added to or removed from the changed list,
- * and the index of where the items are or were in the list.
- *
- * Design options:
- * - create a list 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 list each time (@see Collections#singletonList(Object))
- * and forcing downstream code to use a list 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
- *
- * 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 ListChangeEvent extends ChangeEvent {
-
- /**
- * Name of the list that changed.
- */
- private final String listName;
-
- /**
- * The index at which the items were added, removed, or replaced.
- * In the case of "moved" items, this will be the "target" index.
- * May be -1, if not known.
- */
- private final int index;
-
- /**
- * The items that were added to or removed from the list. In the case of
- * "replaced" items, these are the new items in the list.
- * In the case of "moved" items, this will be empty.
- * May be empty, if not known.
- */
- private final List<?> items;
-
- /**
- * The items in the list that were replaced by the items listed above,
- * in #items. May be empty, if not known.
- */
- private final List<?> replacedItems;
-
- /**
- * In the case of "moved" items, this will be the "source" index.
- * May be -1, if not known.
- */
- private final int sourceIndex;
-
- /**
- * In the case of "moved" items, this will be the number of items moved.
- * May be -1, if not known.
- */
- private final int moveLength;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- protected ListChangeEvent(Model source, String listName, int index, List<?> items, List<?> replacedItems, int sourceIndex, int moveLength) {
- super(source);
- if ((listName == null) || (items == null) || (replacedItems == null)) {
- throw new NullPointerException();
- }
- this.listName = listName;
- this.index = index;
- this.items = Collections.unmodifiableList(items);
- this.replacedItems = Collections.unmodifiableList(replacedItems);
- this.sourceIndex = sourceIndex;
- this.moveLength = moveLength;
- }
-
- /**
- * Construct a new list change 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 items The new items in the list.
- * @param replacedItems The items in the list that were replaced.
- */
- public ListChangeEvent(Model source, String listName, int index, List<?> items, List<?> replacedItems) {
- this(source, listName, index, items, replacedItems, -1, -1);
- }
-
- /**
- * Construct a new list change event for a list of added or removed 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 were added to or removed from the list.
- * @param items The items that were added to or removed from the list.
- */
- public ListChangeEvent(Model source, String listName, int index, List<?> items) {
- this(source, listName, index, items, Collections.emptyList(), -1, -1);
- }
-
- /**
- * Construct a new list change event for a list of moved items.
- *
- * @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.
- */
- public ListChangeEvent(Model source, String listName, int targetIndex, int sourceIndex, int length) {
- this(source, listName, targetIndex, Collections.emptyList(), Collections.emptyList(), sourceIndex, length);
- }
-
- /**
- * 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) {
- this(source, listName, -1, Collections.emptyList(), Collections.emptyList(), -1, -1);
- }
-
-
- // ********** standard state **********
-
- /**
- * Return the programmatic name of the list that was changed.
- */
- public String getListName() {
- return this.listName;
- }
-
- @Override
- public String getAspectName() {
- return this.listName;
- }
-
- /**
- * Return the index at which the items were added to, removed from,
- * or replaced in the list.
- * In the case of "moved" items, this will be the "target" index.
- * May be -1 if inappropriate or unknown.
- */
- public int getIndex() {
- return this.index;
- }
-
- /**
- * Return a list iterator on the items that were added to or
- * removed from the list. In the case of "replaced" items, these
- * are the new items in the list.
- * May be empty if inappropriate or unknown.
- */
- public ListIterator<?> items() {
- return this.items.listIterator();
- }
-
- /**
- * Return the number of items that were added to,
- * removed from, or replaced in the list.
- * May be 0 if inappropriate or unknown.
- */
- public int itemsSize() {
- return this.items.size();
- }
-
-
- // ********** replace **********
-
- /**
- * Return a list iterator on the items in the list that were replaced.
- * May be empty if inappropriate or unknown.
- */
- public ListIterator<?> replacedItems() {
- return this.replacedItems.listIterator();
- }
-
-
- // ********** move **********
-
- /**
- * In the case of "moved" items, this will be the "target" index.
- * May be -1 if inappropriate or unknown.
- */
- public int getTargetIndex() {
- return this.index;
- }
-
- /**
- * In the case of "moved" items, this will be the "source" index.
- * May be -1 if inappropriate or unknown.
- */
- public int getSourceIndex() {
- return this.sourceIndex;
- }
-
- /**
- * In the case of "moved" items, this will be the number of items moved.
- * May be -1 if inappropriate or unknown.
- */
- public int getMoveLength() {
- return this.moveLength;
- }
-
-
- // ********** cloning **********
-
- /**
- * Return a copy of the event with the specified source
- * replacing the current source.
- */
- @Override
- public ListChangeEvent cloneWithSource(Model newSource) {
- return new ListChangeEvent(newSource, this.listName, this.index, this.items, this.replacedItems, this.sourceIndex, this.moveLength);
- }
-
- /**
- * Return a copy of the event with the specified source and list name
- * replacing the current source and list name.
- */
- public ListChangeEvent cloneWithSource(Model newSource, String newListName) {
- return new ListChangeEvent(newSource, newListName, this.index, this.items, this.replacedItems, this.sourceIndex, this.moveLength);
- }
-
- /**
- * 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 ListChangeEvent cloneWithSource(Model newSource, String newListName, int offset) {
- return new ListChangeEvent(newSource, newListName, this.index + offset, this.items, this.replacedItems, this.sourceIndex + offset, this.moveLength);
- }
-
-}
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 ee2fa2f8b2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/PropertyChangeEvent.java
+++ /dev/null
@@ -1,104 +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.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 PropertyChangeEvent is sent as an
- * argument to the PropertyChangeListener.
- *
- * 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 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;
- }
-
- @Override
- public String getAspectName() {
- 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;
- }
-
-
- // ********** cloning **********
-
- @Override
- public PropertyChangeEvent cloneWithSource(Model newSource) {
- return new PropertyChangeEvent(newSource, this.propertyName, this.oldValue, this.newValue);
- }
-
- /**
- * Return a copy of the event with the specified source
- * replacing the current source and the property name.
- */
- public PropertyChangeEvent cloneWithSource(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 52e3690e69..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/StateChangeEvent.java
+++ /dev/null
@@ -1,57 +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.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.
- * A StateChangeEvent is sent as an argument to the StateChangeListener.
- *
- * 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 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);
- }
-
-
- // ********** standard state **********
-
- @Override
- public String getAspectName() {
- return null; // the point of the event is that the name is unknown...
- }
-
-
- // ********** cloning **********
-
- @Override
- public StateChangeEvent cloneWithSource(Model newSource) {
- return new StateChangeEvent(newSource);
- }
-
-}
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 2272020490..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeChangeEvent.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.utility.model.event;
-
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A "tree change" event gets delivered whenever a model changes a "bound"
- * or "constrained" tree. A TreeChangeEvent is sent as an
- * argument to the TreeChangeListener.
- *
- * Normally a TreeChangeEvent is accompanied by the tree name and a path
- * to the part of the tree that was changed.
- *
- * 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 TreeChangeEvent extends ChangeEvent {
-
- /** Name of the tree that changed. */
- private final String treeName;
-
- /**
- * Path to the parent of the part of the tree that was changed.
- * May be empty, if not known or if the entire tree changed.
- */
- protected final Object[] path;
-
- private static final Object[] EMPTY_PATH = new Object[0];
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * 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 path The path to the part of the tree that was changed.
- */
- public TreeChangeEvent(Model source, String treeName, Object[] path) {
- super(source);
- if ((treeName == null) || (path == null)) {
- throw new NullPointerException();
- }
- this.treeName = treeName;
- this.path = path;
- }
-
- /**
- * 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.
- */
- public TreeChangeEvent(Model source, String treeName) {
- this(source, treeName, EMPTY_PATH);
- }
-
-
- // ********** standard state **********
-
- /**
- * Return the programmatic name of the tree that was changed.
- */
- public String getTreeName() {
- return this.treeName;
- }
-
- @Override
- public String getAspectName() {
- return this.treeName;
- }
-
- /**
- * Return the path to the part of the tree that was changed.
- * May be empty, if not known.
- */
- public Object[] getPath() {
- return this.path;
- }
-
-
- // ********** cloning **********
-
- @Override
- public TreeChangeEvent cloneWithSource(Model newSource) {
- return new TreeChangeEvent(newSource, this.treeName, this.path);
- }
-
- /**
- * Return a copy of the event with the specified source
- * replacing the current source and the tree name.
- */
- public TreeChangeEvent cloneWithSource(Model newSource, String newTreeName) {
- return new TreeChangeEvent(newSource, newTreeName, this.path);
- }
-
-}
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 d29a7a7de2..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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;
-
-/**
- * Marker 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.
- */
-public interface ChangeListener extends EventListener {
- // nothing for now
-}
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 88b1359e16..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/CollectionChangeAdapter.java
+++ /dev/null
@@ -1,48 +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.model.listener;
-
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-
-/**
- * Convenience implementation of CollectionChangeListener.
- *
- * 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(CollectionChangeEvent event) {
- // do nothing
- }
-
- public void itemsRemoved(CollectionChangeEvent event) {
- // do nothing
- }
-
- public void collectionCleared(CollectionChangeEvent 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 210388b923..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/CollectionChangeListener.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.utility.model.listener;
-
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-
-/**
- * A "collection change" event gets fired whenever a model changes a "bound"
- * collection. You can register a CollectionChangeListener with a source
- * model so as to be notified of any bound collection updates.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 ChangeListener {
-
- /**
- * This method gets called when items are added to a bound collection.
- *
- * @param event A CollectionChangeEvent describing the event source,
- * the collection that changed, and the items that were added.
- */
- void itemsAdded(CollectionChangeEvent event);
-
- /**
- * This method gets called when items are removed from a bound collection.
- *
- * @param event A CollectionChangeEvent describing the event source,
- * the collection that changed, and the items that were removed.
- */
- void itemsRemoved(CollectionChangeEvent event);
-
- /**
- * This method gets called when a bound collection is cleared.
- *
- * @param event A CollectionChangeEvent describing the event source
- * and the collection that changed.
- */
- void collectionCleared(CollectionChangeEvent 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 A CollectionChangeEvent 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/ListChangeAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ListChangeAdapter.java
deleted file mode 100644
index 052abc5cf4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ListChangeAdapter.java
+++ /dev/null
@@ -1,56 +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.model.listener;
-
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-
-/**
- * Convenience implementation of ListChangeListener.
- *
- * 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(ListChangeEvent event) {
- // do nothing
- }
-
- public void itemsRemoved(ListChangeEvent event) {
- // do nothing
- }
-
- public void itemsReplaced(ListChangeEvent event) {
- // do nothing
- }
-
- public void itemsMoved(ListChangeEvent event) {
- // do nothing
- }
-
- public void listCleared(ListChangeEvent 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 74eab3a002..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ListChangeListener.java
+++ /dev/null
@@ -1,80 +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.model.listener;
-
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-
-/**
- * A "list change" event gets fired whenever a model changes a "bound"
- * list. You can register a ListChangeListener with a source
- * model so as to be notified of any bound list updates.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 ChangeListener {
-
- /**
- * This method gets called when items are added to a bound list.
- *
- * @param event A ListChangeEvent describing the event source,
- * the list that changed, the items that were added, and the index
- * at which the items were added.
- */
- void itemsAdded(ListChangeEvent event);
-
- /**
- * This method gets called when items are removed from a bound list.
- *
- * @param event A ListChangeEvent describing the event source,
- * the list that changed, the items that were removed, and the index
- * at which the items were removed.
- */
- void itemsRemoved(ListChangeEvent event);
-
- /**
- * This method gets called when items in a bound list are replaced.
- *
- * @param event A ListChangeEvent 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(ListChangeEvent event);
-
- /**
- * This method gets called when items in a bound list are moved.
- *
- * @param event A ListChangeEvent describing the event source,
- * the list that changed, and the indices of where items were moved
- * from and to.
- */
- void itemsMoved(ListChangeEvent event);
-
- /**
- * This method gets called when a bound list is cleared.
- *
- * @param event A ListChangeEvent object describing the event source
- * and the list that changed.
- */
- void listCleared(ListChangeEvent 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 9b69de5195..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/MultiMethodReflectiveChangeListener.java
+++ /dev/null
@@ -1,145 +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.model.listener;
-
-import java.lang.reflect.Method;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-
-/**
- * This class is used by ReflectiveChangeListener when the requested listener
- * needs to implement multiple methods (i.e. CollectionChangeListener,
- * ListChangeListener, or 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, CollectionChangeEvent event) {
- if (method.getParameterTypes().length == 0) {
- ClassTools.executeMethod(method, this.target, EMPTY_COLLECTION_CHANGE_EVENT_ARRAY);
- } else {
- ClassTools.executeMethod(method, this.target, new CollectionChangeEvent[] {event});
- }
- }
-
- public void itemsAdded(CollectionChangeEvent event) {
- this.invoke(this.addMethod, event);
- }
-
- public void itemsRemoved(CollectionChangeEvent event) {
- this.invoke(this.removeMethod, event);
- }
-
- public void collectionCleared(CollectionChangeEvent event) {
- this.invoke(this.clearMethod, event);
- }
-
- public void collectionChanged(CollectionChangeEvent event) {
- this.invoke(this.changeMethod, event);
- }
-
-
- // ********** ListChangeListener implementation **********
-
- private void invoke(Method method, ListChangeEvent event) {
- if (method.getParameterTypes().length == 0) {
- ClassTools.executeMethod(method, this.target, EMPTY_LIST_CHANGE_EVENT_ARRAY);
- } else {
- ClassTools.executeMethod(method, this.target, new ListChangeEvent[] {event});
- }
- }
-
- public void itemsAdded(ListChangeEvent event) {
- this.invoke(this.addMethod, event);
- }
-
- public void itemsRemoved(ListChangeEvent event) {
- this.invoke(this.removeMethod, event);
- }
-
- public void itemsReplaced(ListChangeEvent event) {
- this.invoke(this.replaceMethod, event);
- }
-
- public void itemsMoved(ListChangeEvent event) {
- this.invoke(this.moveMethod, event);
- }
-
- public void listCleared(ListChangeEvent event) {
- this.invoke(this.clearMethod, event);
- }
-
- public void listChanged(ListChangeEvent event) {
- this.invoke(this.changeMethod, event);
- }
-
-
- // ********** TreeChangeListener implementation **********
-
- private void invoke(Method method, TreeChangeEvent event) {
- if (method.getParameterTypes().length == 0) {
- ClassTools.executeMethod(method, this.target, EMPTY_TREE_CHANGE_EVENT_ARRAY);
- } else {
- ClassTools.executeMethod(method, this.target, new TreeChangeEvent[] {event});
- }
- }
-
- public void nodeAdded(TreeChangeEvent event) {
- this.invoke(this.addMethod, event);
- }
-
- public void nodeRemoved(TreeChangeEvent event) {
- this.invoke(this.removeMethod, event);
- }
-
- public void treeCleared(TreeChangeEvent 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/PropertyChangeListener.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/PropertyChangeListener.java
deleted file mode 100644
index f76bed7d39..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/PropertyChangeListener.java
+++ /dev/null
@@ -1,35 +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.model.listener;
-
-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 PropertyChangeListener with a source
- * model so as to be notified of any bound property updates.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 ChangeListener {
-
- /**
- * This method gets called when a model has changed a bound property.
- *
- * @param event A StateChangeEvent 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 0cab7d7cbd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ReflectiveChangeListener.java
+++ /dev/null
@@ -1,312 +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.model.listener;
-
-import java.lang.reflect.Method;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.model.event.ChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-
-/**
- * This factory builds listeners that reflectively forward ChangeEvents.
- * 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 *do* check the method as soon as the
- * listener is instantiated.
- *
- * 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 StateChangeEvent[] EMPTY_STATE_CHANGE_EVENT_ARRAY = new StateChangeEvent[0];
-
- 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 PropertyChangeEvent[] EMPTY_PROPERTY_CHANGE_EVENT_ARRAY = new PropertyChangeEvent[0];
-
- 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 CollectionChangeEvent[] EMPTY_COLLECTION_CHANGE_EVENT_ARRAY = new CollectionChangeEvent[0];
-
- 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 ListChangeEvent[] EMPTY_LIST_CHANGE_EVENT_ARRAY = new ListChangeEvent[0];
-
- 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 TreeChangeEvent[] EMPTY_TREE_CHANGE_EVENT_ARRAY = new TreeChangeEvent[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) {
- Method method;
- try {
- method = ClassTools.method(target, methodName, eventClassArray);
- } catch (NoSuchMethodException ex1) {
- try {
- method = ClassTools.method(target, methodName);
- } catch (NoSuchMethodException ex2) {
- throw new RuntimeException(ex2); // "checked" exceptions bite
- }
- }
- return method;
- }
-
- /**
- * 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_CHANGE_EVENT_CLASS);
- checkChangeListenerMethod(removeMethod, COLLECTION_CHANGE_EVENT_CLASS);
- checkChangeListenerMethod(clearMethod, COLLECTION_CHANGE_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_CHANGE_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, removeMethodName, COLLECTION_CHANGE_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, clearMethodName, COLLECTION_CHANGE_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_CHANGE_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_CHANGE_EVENT_CLASS);
- checkChangeListenerMethod(removeMethod, LIST_CHANGE_EVENT_CLASS);
- checkChangeListenerMethod(replaceMethod, LIST_CHANGE_EVENT_CLASS);
- checkChangeListenerMethod(moveMethod, LIST_CHANGE_EVENT_CLASS);
- checkChangeListenerMethod(clearMethod, LIST_CHANGE_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_CHANGE_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, removeMethodName, LIST_CHANGE_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, replaceMethodName, LIST_CHANGE_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, moveMethodName, LIST_CHANGE_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, clearMethodName, LIST_CHANGE_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_CHANGE_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_CHANGE_EVENT_CLASS);
- checkChangeListenerMethod(removeMethod, TREE_CHANGE_EVENT_CLASS);
- checkChangeListenerMethod(clearMethod, TREE_CHANGE_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_CHANGE_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, removeMethodName, TREE_CHANGE_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, clearMethodName, TREE_CHANGE_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_CHANGE_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/SingleMethodReflectiveChangeListener.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/SingleMethodReflectiveChangeListener.java
deleted file mode 100644
index ba7ea243e2..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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.ClassTools;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-
-/**
- * This class is used by ReflectiveChangeListener when the requested listener
- * need only implement a single method (i.e. StateChangeListener or
- * 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) {
- ClassTools.executeMethod(this.method, this.target, EMPTY_STATE_CHANGE_EVENT_ARRAY);
- } else {
- ClassTools.executeMethod(this.method, this.target, new StateChangeEvent[] {event});
- }
- }
-
-
- // ********** PropertyChangeListener implementation **********
-
- public void propertyChanged(PropertyChangeEvent event) {
- if (this.methodIsZeroArgument) {
- ClassTools.executeMethod(this.method, this.target, EMPTY_PROPERTY_CHANGE_EVENT_ARRAY);
- } else {
- ClassTools.executeMethod(this.method, this.target, new PropertyChangeEvent[] {event});
- }
- }
-
-}
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 1ce6ba5d69..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/StateChangeListener.java
+++ /dev/null
@@ -1,35 +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.model.listener;
-
-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 StateChangeListener with a source model so as to be notified
- * of any such 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.
- */
-public interface StateChangeListener extends ChangeListener {
-
- /**
- * This method gets called when a model has changed in some general fashion.
- *
- * @param event A StateChangeEvent 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 3b46202fd1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/TreeChangeAdapter.java
+++ /dev/null
@@ -1,48 +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.model.listener;
-
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-
-/**
- * Convenience implementation of TreeChangeListener.
- *
- * 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(TreeChangeEvent event) {
- // do nothing
- }
-
- public void nodeRemoved(TreeChangeEvent event) {
- // do nothing
- }
-
- public void treeCleared(TreeChangeEvent 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 7591f9df78..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/TreeChangeListener.java
+++ /dev/null
@@ -1,62 +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.model.listener;
-
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-
-/**
- * A "tree change" event gets fired whenever a model changes a "bound"
- * tree. You can register a TreeChangeListener with a source
- * model so as to be notified of any bound tree updates.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 ChangeListener {
-
- /**
- * This method gets called when a node is added to a bound tree.
- *
- * @param event A TreeChangeEvent describing the event source,
- * the tree that changed, and the path to the node that was added.
- */
- void nodeAdded(TreeChangeEvent event);
-
- /**
- * This method gets called when a node is removed from a bound tree.
- *
- * @param event A TreeChangeEvent describing the event source,
- * the tree that changed, and the path to the node that was removed.
- */
- void nodeRemoved(TreeChangeEvent event);
-
- /**
- * This method gets called when a bound tree is cleared.
- *
- * @param event A TreeChangeEvent describing the event source,
- * the tree that changed, and an empty path.
- */
- void treeCleared(TreeChangeEvent 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 A TreeChangeEvent describing the event source,
- * the tree that changed, and the path to the branch 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 ba25cf9262..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/CollectionValueModel.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.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.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 CollectionValueModel<E>
- extends Model, Iterable<E>
-{
-
- /**
- * Return the collection's values.
- */
- Iterator<E> iterator();
- String VALUES = "values";
-
- /**
- * Return the size of the collection value.
- */
- 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 65eaa7723b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/ListValueModel.java
+++ /dev/null
@@ -1,55 +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.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.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 ListValueModel<E>
- extends Model, Iterable<E>
-{
- /**
- * Return the list's values.
- */
- Iterator<E> iterator();
- String LIST_VALUES = "list values";
-
- /**
- * 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 82ee3c0096..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/PropertyValueModel.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.utility.model.value;
-
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * Interface used to abstract property accessing and
- * change notification and make it more pluggable.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 PropertyValueModel<T>
- extends Model
-{
-
- /**
- * Return the property's value.
- */
- T getValue();
- String VALUE = "value";
-
-}
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 a6bcea8cdf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/TreeNodeValueModel.java
+++ /dev/null
@@ -1,71 +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.model.value;
-
-/**
- * Extend WritablePropertyValueModel to better support TreeModelAdapter.
- *
- * 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.
- *
- * 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.
- *
- * @see org.eclipse.jpt.utility.internal.model.value.AbstractTreeNodeValueModel
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 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 ec87a2771a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/TreeValueModel.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.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.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 TreeValueModel<E>
- extends Model
-{
- /**
- * Return the tree's nodes.
- */
- Iterator<E> nodes();
- String NODES = "nodes";
-
-}
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 c2ddacebe4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/WritablePropertyValueModel.java
+++ /dev/null
@@ -1,31 +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.model.value;
-
-/**
- * Extend ValueModel to allow the setting of the property's value.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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 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 304e86186a..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.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/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/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/META-INF/MANIFEST.MF
deleted file mode 100644
index 35447db004..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/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.core.tests.extension.resource;singleton:=true
-Bundle-Version: 2.1.0.qualifier
-Bundle-Activator: org.eclipse.jpt.core.tests.extension.resource.ExtensionTestPlugin
-Bundle-ActivationPolicy: lazy
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.jpt.core,
- org.eclipse.jpt.ui,
- org.eclipse.wst.validation,
- org.eclipse.jpt.core,
- org.eclipse.jpt.gen,
- org.eclipse.jface,
- org.eclipse.jpt.db,
- org.eclipse.jdt.core,
- org.eclipse.emf.ecore,
- org.eclipse.jpt.utility,
- org.eclipse.core.resources,
- org.eclipse.ui.navigator;bundle-version="3.3.100",
- org.eclipse.ui.views.properties.tabbed;bundle-version="3.4.0"
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-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 f5e3f40ad8..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
-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 83f727f621..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/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 = Java Persistence API Tools - ExtensionTestPlugin
-providerName = Eclipse.org
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 e74df7f16b..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/plugin.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
-
- <extension
- point="org.eclipse.jpt.core.jpaPlatform">
-
- <jpaPlatform
- id="core.testJpaPlatform"
- label="Test Jpa Platform"
- class="org.eclipse.jpt.core.tests.extension.resource.TestJpaPlatform"
- default="true">
- </jpaPlatform>
-
- </extension>
-
- <extension
- point="org.eclipse.jpt.ui.jpaPlatform">
-
- <jpaPlatform
- id="core.testJpaPlatform"
- class="org.eclipse.jpt.core.tests.extension.resource.TestJpaPlatformUi">
- </jpaPlatform>
-
- </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 51075a6443..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/ExtensionTestPlugin.java
+++ /dev/null
@@ -1,54 +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.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";
-
- // The shared instance
- private static ExtensionTestPlugin plugin;
-
- /**
- * The constructor
- */
- public ExtensionTestPlugin() {
- }
-
- @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 5f777f3f54..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMapping.java
+++ /dev/null
@@ -1,38 +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.tests.extension.resource;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaAttributeMapping;
-
-public class JavaTestAttributeMapping extends AbstractJavaAttributeMapping
-{
- public static final String TEST_ATTRIBUTE_MAPPING_KEY = "testAttribute";
- public static final String TEST_ATTRIBUTE_ANNOTATION_NAME = "test.TestAttribute";
-
-
- public JavaTestAttributeMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return JavaTestAttributeMapping.TEST_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JavaTestAttributeMapping.TEST_ATTRIBUTE_ANNOTATION_NAME;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMappingProvider.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMappingProvider.java
deleted file mode 100644
index 5eed911d38..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMappingProvider.java
+++ /dev/null
@@ -1,48 +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.tests.extension.resource;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-
-public class JavaTestAttributeMappingProvider
- implements JavaAttributeMappingProvider
-{
- // singleton
- private static final JavaTestAttributeMappingProvider INSTANCE = new JavaTestAttributeMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaTestAttributeMappingProvider() {
- 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 7a7d848fbd..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMapping.java
+++ /dev/null
@@ -1,43 +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.tests.extension.resource;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaTypeMapping;
-
-public class JavaTestTypeMapping extends AbstractJavaTypeMapping
-{
- public static final String TEST_TYPE_MAPPING_KEY = "test";
- public static final String TEST_TYPE_ANNOTATION_NAME = "test.Test";
-
-
- public JavaTestTypeMapping(JavaPersistentType parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return TEST_TYPE_ANNOTATION_NAME;
- }
-
- public String getKey() {
- return TEST_TYPE_MAPPING_KEY;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public boolean isMapped() {
- return true;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMappingProvider.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMappingProvider.java
deleted file mode 100644
index 4eb6560a3d..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMappingProvider.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.tests.extension.resource;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingProvider;
-
-/**
- *
- */
-public class JavaTestTypeMappingProvider
- implements JavaTypeMappingProvider
-{
- // singleton
- private static final JavaTestTypeMappingProvider INSTANCE = new JavaTestTypeMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaTestTypeMappingProvider() {
- 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 ccd2f6ae1d..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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.GenericJavaBasicMapping;
-
-public class TestJavaBasicMapping extends GenericJavaBasicMapping
-{
- 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 ecffe3a2b6..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaEntity.java
+++ /dev/null
@@ -1,20 +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.tests.extension.resource;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaEntity;
-
-public class TestJavaEntity extends GenericJavaEntity
-{
- protected TestJavaEntity(JavaPersistentType parent) {
- super(parent);
- }
-}
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 203e751149..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaFactory.java
+++ /dev/null
@@ -1,37 +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.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.platform.GenericJpaFactory;
-
-public class TestJpaFactory extends GenericJpaFactory
-{
- @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/TestJpaPlatform.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatform.java
deleted file mode 100644
index 297fc008cd..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatform.java
+++ /dev/null
@@ -1,50 +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.tests.extension.resource;
-
-import java.util.List;
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingProvider;
-import org.eclipse.jpt.core.internal.platform.GenericJpaPlatform;
-
-public class TestJpaPlatform extends GenericJpaPlatform
-{
- public static final String ID = "core.testJpaPlatform";
-
- @Override
- public String getId() {
- return ID;
- }
-
- @Override
- protected JpaFactory buildJpaFactory() {
- return new TestJpaFactory();
- }
-
- @Override
- public JpaAnnotationProvider getAnnotationProvider() {
- return super.getAnnotationProvider();
- }
-
- @Override
- protected void addJavaTypeMappingProvidersTo(List<JavaTypeMappingProvider> providers) {
- super.addJavaTypeMappingProvidersTo(providers);
- providers.add(JavaTestTypeMappingProvider.instance());
- }
-
- @Override
- protected void addJavaAttributeMappingProvidersTo(List<JavaAttributeMappingProvider> providers) {
- super.addJavaAttributeMappingProvidersTo(providers);
- providers.add(JavaTestAttributeMappingProvider.instance());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatformUi.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatformUi.java
deleted file mode 100644
index d508f79e23..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatformUi.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.tests.extension.resource;
-
-import java.util.List;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.ui.JpaUiFactory;
-import org.eclipse.jpt.ui.details.AttributeMappingUiProvider;
-import org.eclipse.jpt.ui.details.TypeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.platform.base.BaseJpaPlatformUi;
-import org.eclipse.jpt.ui.internal.platform.generic.GenericNavigatorProvider;
-import org.eclipse.jpt.ui.navigator.JpaNavigatorProvider;
-
-public class TestJpaPlatformUi extends BaseJpaPlatformUi
-{
- public TestJpaPlatformUi() {
- super();
- }
-
- public JpaNavigatorProvider buildNavigatorProvider() {
- return new GenericNavigatorProvider();
- }
-
- @Override
- protected JpaUiFactory createJpaUiFactory() {
- return new TestJpaUiFactory();
- }
-
- public void generateDDL(JpaProject project, IStructuredSelection selection) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- protected void addJavaAttributeMappingUiProvidersTo(List<AttributeMappingUiProvider<? extends AttributeMapping>> providers) {
- super.addJavaAttributeMappingUiProvidersTo(providers);
-
- }
-
- @Override
- protected void addJavaTypeMappingUiProvidersTo(List<TypeMappingUiProvider<? extends TypeMapping>> providers) {
- super.addJavaTypeMappingUiProvidersTo(providers);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaUiFactory.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaUiFactory.java
deleted file mode 100644
index bfd77f229e..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaUiFactory.java
+++ /dev/null
@@ -1,27 +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.tests.extension.resource;
-
-import org.eclipse.jpt.ui.JpaUiFactory;
-import org.eclipse.jpt.ui.internal.BaseJpaUiFactory;
-
-/**
- * The default implementation of the UI factory required to show the information
- * related to a JPA mapping (type or attribute).
- *
- * @see JpaUiFactory
- *
- * @version 1.0
- * @since 1.0
- */
-public class TestJpaUiFactory extends BaseJpaUiFactory
-{
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/.classpath b/jpa/tests/org.eclipse.jpt.core.tests/.classpath
deleted file mode 100644
index 3c0b3a6a9e..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/.classpath
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jst/**"/>
- <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.core.tests/.cvsignore b/jpa/tests/org.eclipse.jpt.core.tests/.cvsignore
deleted file mode 100644
index c4ba612bad..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.core.tests/.project b/jpa/tests/org.eclipse.jpt.core.tests/.project
deleted file mode 100644
index 08395a8e86..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.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.core.tests/.settings/org.eclipse.core.resources.prefs b/jpa/tests/org.eclipse.jpt.core.tests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index eb348782fa..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Jan 15 11:10:55 EST 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.core.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index a2f6604d54..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun May 27 14:58:31 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/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.core.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 9625819de5..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,40 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.core.tests
-Bundle-Version: 2.1.0
-Bundle-Localization: plugin
-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.emf.ecore;bundle-version="[2.4.0,3.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.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jem;bundle-version="[2.0.200,3.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.core.tests.extension.resource;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.jpt.utility.tests;bundle-version="[1.2.0,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,1.2.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.2,4.0.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.0,1.3.0)"
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.jpt.core.tests.internal;x-friends:="org.eclipse.jpt.ui.tests",
- org.eclipse.jpt.core.tests.internal.context;x-internal:=true,
- org.eclipse.jpt.core.tests.internal.context.java;x-internal:=true,
- org.eclipse.jpt.core.tests.internal.context.orm;x-internal:=true,
- org.eclipse.jpt.core.tests.internal.context.persistence;x-internal:=true,
- org.eclipse.jpt.core.tests.internal.model;x-internal:=true,
- org.eclipse.jpt.core.tests.internal.platform;x-internal:=true,
- org.eclipse.jpt.core.tests.internal.projects;x-friends:="org.eclipse.jpt.ui.tests",
- org.eclipse.jpt.core.tests.internal.resource;x-internal:=true,
- org.eclipse.jpt.core.tests.internal.resource.java;x-internal:=true,
- org.eclipse.jpt.core.tests.internal.utility.jdt;x-internal:=true
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/about.html b/jpa/tests/org.eclipse.jpt.core.tests/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.core.tests/build.properties b/jpa/tests/org.eclipse.jpt.core.tests/build.properties
deleted file mode 100644
index 96de1ee6d2..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.core.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.core.tests/plugin.properties
deleted file mode 100644
index 6ebf8dbed1..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/plugin.properties
+++ /dev/null
@@ -1,22 +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 Core Tests
-providerName=Eclipse.org
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/JptAllCoreTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/JptAllCoreTests.java
deleted file mode 100644
index 9b0e632be8..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/JptAllCoreTests.java
+++ /dev/null
@@ -1,35 +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.core.tests.internal;
-
-import junit.framework.Test;
-
-/**
- * This test suite is temporary, until jpa.jar can be checked into the CVS
- * repository and used during the nightly builds.
- *
- * Runs ALL JPT Core Tests. Currently we do not have a jpa.jar checked in to CVS.
- * As a result we cannot run any tests that depend on that jar during the build.
- * In our local development environments we should run this suite (JptAllCoreTests)
- * until jpa.jar is checked into CVS.
- * In the nightly build we should continue to run JptCoreTests.
- */
-public class JptAllCoreTests {
-
- public static Test suite() {
- return JptCoreTests.suite(true);
- }
-
- private JptAllCoreTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/JptCoreTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/JptCoreTests.java
deleted file mode 100644
index 39f675b685..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/JptCoreTests.java
+++ /dev/null
@@ -1,73 +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.tests.internal;
-
-import java.io.File;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.core.tests.internal.context.JptCoreContextModelTests;
-import org.eclipse.jpt.core.tests.internal.model.JptCoreModelTests;
-import org.eclipse.jpt.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.jpt.core.tests.internal.resource.JptCoreResourceModelTests;
-import org.eclipse.jpt.core.tests.internal.utility.jdt.JptCoreUtilityJdtTests;
-
-/**
- * Runs MOST JPT Core Tests. Currently we do not have a jpa.jar checked into cvs.
- * As a result we cannot run any tests that depend on that jar during the nightly build.
- * In our development environments we should run JptAllCoreTests (NOT this suite)
- * until jpa.jar is checked into CVS.
- */
-public class JptCoreTests {
- private static final String JPA_JAR_PROPERTY = TestJpaProject.JPA_JAR_NAME_SYSTEM_PROPERTY;
-
- public static Test suite() {
- return suite(false);
- }
-
- // TODO delete parameter all
- public static Test suite(boolean all) {
- String quantity = all ? "All" : "Most";
- TestSuite suite = new TestSuite(quantity + " JPT Core Tests");
-
- if(jpaJarPropertyExists() && jpaJarFileExists()) {
- suite.addTest(JptCoreUtilityJdtTests.suite(all));
- suite.addTest(JptCoreModelTests.suite(all));
- suite.addTest(JptCoreResourceModelTests.suite(all));
- suite.addTest(JptCoreContextModelTests.suite(all));
- }
- else {
- String message = ( ! jpaJarPropertyExists()) ?
- "missing Java system property: \"" + JPA_JAR_PROPERTY + "\"" :
- "missing JPA jar file: \"" + getJpaJarProperty() + "\"";
- suite.addTest(TestSuite.warning(message));
- }
- return suite;
- }
-
- public static boolean jpaJarPropertyExists() {
- String jpaJarName = getJpaJarProperty();
- return jpaJarName != null;
- }
-
- public static boolean jpaJarFileExists() {
- File file = new File(getJpaJarProperty());
- return file.exists();
- }
-
- public static String getJpaJarProperty() {
- return System.getProperty(JPA_JAR_PROPERTY);
- }
-
- private JptCoreTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/ContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/ContextModelTestCase.java
deleted file mode 100644
index c5ba89db3e..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/ContextModelTestCase.java
+++ /dev/null
@@ -1,177 +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.tests.internal.context;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.JpaRootContextNode;
-import org.eclipse.jpt.core.context.MappingFile;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.internal.resource.orm.OrmResourceModelProvider;
-import org.eclipse.jpt.core.internal.resource.persistence.PersistenceResourceModelProvider;
-import org.eclipse.jpt.core.resource.orm.OrmResource;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.PersistenceResource;
-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.tests.internal.projects.TestJavaProject;
-import org.eclipse.jpt.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.jpt.core.tests.internal.utility.jdt.AnnotationTestCase;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.internal.emfworkbench.WorkbenchResourceHelper;
-
-public abstract class ContextModelTestCase extends AnnotationTestCase
-{
- protected static final String BASE_PROJECT_NAME = "ContextModelTestProject";
-
- protected PersistenceResourceModelProvider persistenceResourceModelProvider;
-
- protected OrmResourceModelProvider ormResourceModelProvider;
-
-
- protected ContextModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.persistenceResourceModelProvider =
- PersistenceResourceModelProvider.getDefaultModelProvider(getJavaProject().getProject());
- this.ormResourceModelProvider =
- OrmResourceModelProvider.getDefaultModelProvider(getJavaProject().getProject());
- waitForWorkspaceJobs();
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.persistenceResourceModelProvider = null;
- this.ormResourceModelProvider = null;
- super.tearDown();
- }
-
- @Override
- protected TestJavaProject buildJavaProject(boolean autoBuild) throws Exception {
- return buildJpaProject(BASE_PROJECT_NAME, autoBuild, buildJpaConfigDataModel());
- }
-
- protected TestJpaProject buildJpaProject(String projectName, boolean autoBuild, IDataModel jpaConfig)
- throws Exception {
- return TestJpaProject.buildJpaProject(projectName, autoBuild, jpaConfig);
- }
-
- protected IDataModel buildJpaConfigDataModel() {
- return null;
- }
-
- protected JpaProject jpaProject() {
- return getJavaProject().getJpaProject();
- }
-
- protected void waitForWorkspaceJobs() {
- // This job will not finish running until the workspace jobs are done
- Job waitJob = new Job("Wait job") {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- return Status.OK_STATUS;
- }
- };
- waitJob.setRule(ResourcesPlugin.getWorkspace().getRoot());
- waitJob.schedule();
- try {
- waitJob.join();
- } catch (InterruptedException ex) {
- // the job thread was interrupted during a wait - ignore
- }
- }
-
- protected PersistenceResource persistenceResource() {
- return this.persistenceResourceModelProvider.getResource();
- }
-
- protected OrmResource ormResource() {
- return this.ormResourceModelProvider.getResource();
- }
-
- protected XmlPersistence xmlPersistence() {
- return persistenceResource().getPersistence();
- }
-
- protected EntityMappings entityMappings() {
- MappingFile mappingFile = persistenceUnit().mappingFileRefs().next().getMappingFile();
- return (mappingFile == null) ? null : (EntityMappings) mappingFile.getRoot();
- }
-
- protected XmlPersistenceUnit xmlPersistenceUnit() {
- return persistenceResource().getPersistence().getPersistenceUnits().get(0);
- }
-
- protected PersistenceUnit persistenceUnit() {
- return getRootContextNode().getPersistenceXml().getPersistence().persistenceUnits().next();
- }
-
- protected ClassRef classRef() {
- return persistenceUnit().specifiedClassRefs().next();
- }
-
- protected JavaPersistentType javaPersistentType() {
- return classRef().getJavaPersistentType();
- }
-
- protected Entity javaEntity() {
- return (Entity) javaPersistentType().getMapping();
- }
-
- protected void addXmlClassRef(String className) {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
-
- XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass(className);
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
- }
-
- protected void removeXmlClassRef(String className) {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- XmlJavaClassRef xmlJavaClassRefToRemove = null;
- for (XmlJavaClassRef xmlJavaClassRef : xmlPersistenceUnit.getClasses()) {
- if (xmlJavaClassRef.getJavaClass().equals(className)) {
- xmlJavaClassRefToRemove = xmlJavaClassRef;
- }
- }
- if (xmlJavaClassRefToRemove == null) {
- throw new IllegalArgumentException();
- }
- xmlPersistenceUnit.getClasses().remove(xmlJavaClassRefToRemove);
- }
-
- protected JpaRootContextNode getRootContextNode() {
- return getJavaProject().getJpaProject().getRootContextNode();
- }
-
- @Override
- protected TestJpaProject getJavaProject() {
- return (TestJpaProject) super.getJavaProject();
- }
-
- protected void deleteResource(Resource resource) throws CoreException {
- WorkbenchResourceHelper.deleteResource(resource);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/JpaFileTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/JpaFileTests.java
deleted file mode 100644
index d77ebadc11..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/JpaFileTests.java
+++ /dev/null
@@ -1,400 +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.tests.internal.context;
-
-import java.util.Iterator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmXml;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.core.resource.java.JPA;
-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 JpaFileTests extends ContextModelTestCase
-{
- public JpaFileTests(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);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- public void testGetRootStructureNode() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- IFile file = ormResource().getFile();
- JpaFile ormXmlJpaFile = JptCorePlugin.getJpaFile(file);
-
- assertEquals(entityMappings(), ormXmlJpaFile.rootStructureNodes().next());
-
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource());
-
- assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.rootStructureNodes().next());
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- //verify the mapping file reference "wins" as the root structure node when both
- //persistence.xml <class> tag and mapping file <entity> tag exist for a particulary java class
- assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.rootStructureNodes().next());
-
- entityMappings().removeOrmPersistentType(ormPersistentType);
-
- assertEquals(javaEntity().getPersistentType(), javaJpaFile.rootStructureNodes().next());
-
- ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.rootStructureNodes().next());
- }
-
- public void testEntityMappingsRootStructureNodeRemoved() throws Exception {
- IFile file = ormResource().getFile();
- JpaFile ormXmlJpaFile = JptCorePlugin.getJpaFile(file);
- assertEquals(entityMappings(), ormXmlJpaFile.rootStructureNodes().next());
-
- ((OrmXml) entityMappings().getParent()).removeEntityMappings();
-
- assertFalse(ormXmlJpaFile.rootStructureNodes().hasNext());
- }
-
- public void testImpliedEntityMappingsRootStructureNodeRemoved() throws Exception {
- IFile file = ormResource().getFile();
- JpaFile ormXmlJpaFile = JptCorePlugin.getJpaFile(file);
-
- assertNull(persistenceUnit().getImpliedMappingFileRef());
-
- xmlPersistenceUnit().getMappingFiles().remove(0);
- assertNotNull(persistenceUnit().getImpliedMappingFileRef());
- assertEquals(persistenceUnit().getImpliedMappingFileRef().getMappingFile().getRoot(), ormXmlJpaFile.rootStructureNodes().next());
-
- ((OrmXml) persistenceUnit().getImpliedMappingFileRef().getMappingFile()).removeEntityMappings();
- assertFalse(ormXmlJpaFile.rootStructureNodes().hasNext());
- }
-
- public void testEntityMappingsRootStructureNodeRemovedFromResourceModel() throws Exception {
- IFile file = ormResource().getFile();
- JpaFile ormXmlJpaFile = JptCorePlugin.getJpaFile(file);
- assertEquals(entityMappings(), ormXmlJpaFile.rootStructureNodes().next());
-
- ormResource().getContents().remove(ormResource().getEntityMappings());
-
- assertFalse(ormXmlJpaFile.rootStructureNodes().hasNext());
- }
-
- public void testUpdatePersistenceRootStructureNodePersistenceRemoved() throws Exception {
- IFile file = persistenceResource().getFile();
- JpaFile persistenceXmlJpaFile = JptCorePlugin.getJpaFile(file);
- assertEquals(getRootContextNode().getPersistenceXml().getPersistence(), persistenceXmlJpaFile.rootStructureNodes().next());
-
- getRootContextNode().getPersistenceXml().removePersistence();
- assertFalse(persistenceXmlJpaFile.rootStructureNodes().hasNext());
- }
-
- public void testUpdateOrmJavaRootStructureNodePersistenceRemoved() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource());
-
- assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.rootStructureNodes().next());
-
- getRootContextNode().getPersistenceXml().removePersistence();
- assertFalse(javaJpaFile.rootStructureNodes().hasNext());
- }
-
- public void testUpdateJavaRootStructureNodePersistenceRemoved() throws Exception {
- ICompilationUnit cu = createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource());
-
- assertEquals(javaPersistentType(), javaJpaFile.rootStructureNodes().next());
-
- getRootContextNode().getPersistenceXml().removePersistence();
- assertFalse(javaJpaFile.rootStructureNodes().hasNext());
- }
-
- public void testPersistenceRootStructureNodeRemovedFromResourceModel() throws Exception {
- IFile file = persistenceResource().getFile();
- JpaFile persistenceXmlJpaFile = JptCorePlugin.getJpaFile(file);
- getRootContextNode().getPersistenceXml().getPersistence();
- assertEquals(getRootContextNode().getPersistenceXml().getPersistence(), persistenceXmlJpaFile.rootStructureNodes().next());
-
- persistenceResource().getContents().remove(persistenceResource().getPersistence());
-
- assertFalse(persistenceXmlJpaFile.rootStructureNodes().hasNext());
- }
-
- public void testUpdateOrmJavaRootStructureNodePersistenceXmlRemoved() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource());
-
- assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.rootStructureNodes().next());
-
- getRootContextNode().removePersistenceXml();
- assertFalse(javaJpaFile.rootStructureNodes().hasNext());
- }
-
- public void testUpdateJavaRootStructureNodePersistenceXmlRemoved() throws Exception {
- ICompilationUnit cu = createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource());
-
- assertEquals(javaPersistentType(), javaJpaFile.rootStructureNodes().next());
-
- getRootContextNode().removePersistenceXml();
- assertFalse(javaJpaFile.rootStructureNodes().hasNext());
- }
-
- public void testOrmJavaPersistentTypeRootStructureNodeRemoved() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource());
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.rootStructureNodes().next());
- assertTrue(javaJpaFile.rootStructureNodes().next().getParent() instanceof OrmEntity);
-
-
- entityMappings().removeOrmPersistentType(0);
-
- assertEquals(1, javaJpaFile.rootStructureNodesSize());
- assertTrue(javaJpaFile.rootStructureNodes().next().getParent() instanceof ClassRef);
- assertNotSame(javaPersistentType, javaJpaFile.rootStructureNodes().next());
- }
-
- public void testOrmJavaPersistentTypeRootStructureNodeRemovedFromResourceModel() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource());
-
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.rootStructureNodes().next());
- assertTrue(javaJpaFile.rootStructureNodes().next().getParent() instanceof OrmEntity);
-
- ormResource().getEntityMappings().getEntities().remove(0);
-
- assertEquals(1, javaJpaFile.rootStructureNodesSize());
- assertTrue(javaJpaFile.rootStructureNodes().next().getParent() instanceof ClassRef);
- assertNotSame(javaPersistentType, javaJpaFile.rootStructureNodes().next());
- }
-
- public void testJavaPersistentTypeRootStructureNodeRemoved() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource());
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = javaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.rootStructureNodes().next());
- assertEquals(entityMappings().getPersistenceUnit().specifiedClassRefs().next(), javaJpaFile.rootStructureNodes().next().getParent());
-
- entityMappings().getPersistenceUnit().removeSpecifiedClassRef(0);
- assertNotSame(javaPersistentType, javaJpaFile.rootStructureNodes().next());
- assertEquals(entityMappings().getPersistenceUnit().impliedClassRefs().next(), javaJpaFile.rootStructureNodes().next().getParent());
- }
-
- public void testJavaPersistentTypeRootStructureNodeRemovedFromResourceModel() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource());
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = javaPersistentType();
- Iterator<JpaStructureNode> rootStructureNodes = javaJpaFile.rootStructureNodes();
- JpaStructureNode rootStructureNode = rootStructureNodes.next();
- assertEquals(javaPersistentType, rootStructureNode);
- assertEquals(entityMappings().getPersistenceUnit().specifiedClassRefs().next(), rootStructureNode.getParent());
- assertFalse(rootStructureNodes.hasNext());
-
- removeXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertNotSame(javaPersistentType, javaJpaFile.rootStructureNodes().next());
- assertEquals(entityMappings().getPersistenceUnit().impliedClassRefs().next(), javaJpaFile.rootStructureNodes().next().getParent());
- }
-
- public void testImpliedJavaPersistentTypeRootStructureNodeRemoved() throws Exception {
- jpaProject().setDiscoversAnnotatedClasses(true);
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource());
-
- JavaPersistentType javaPersistentType = persistenceUnit().impliedClassRefs().next().getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.rootStructureNodes().next());
-
- javaPersistentType.setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
-
- assertFalse(javaJpaFile.rootStructureNodes().hasNext());
- }
-
- public void testJavaRootStructureNodesEntityMappingsRemoved() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource());
-
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.rootStructureNodes().next());
-
- ormResource().getContents().remove(ormResource().getEntityMappings());
- assertNotSame(javaPersistentType, javaJpaFile.rootStructureNodes().next());
- assertEquals(1, javaJpaFile.rootStructureNodesSize());
- assertEquals(persistenceUnit().impliedClassRefs().next(), javaJpaFile.rootStructureNodes().next().getParent());
- }
-
- public void testJavaRootStructureNodesPersistenceUnitRemovedFromResourceModel() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource());
-
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.rootStructureNodes().next());
-
- persistenceResource().getPersistence().getPersistenceUnits().remove(0);
-
- assertFalse(javaJpaFile.rootStructureNodes().hasNext());
- assertEquals(0, javaJpaFile.rootStructureNodesSize());
- }
-
- public void testJavaRootStructureNodesPersistenceUnitRemoved() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource());
-
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.rootStructureNodes().next());
-
- jpaProject().getRootContextNode().getPersistenceXml().getPersistence().removePersistenceUnit(0);
-
- assertFalse(javaJpaFile.rootStructureNodes().hasNext());
- assertEquals(0, javaJpaFile.rootStructureNodesSize());
- }
-
- public void testJavaRootStructureNodesOrmPersistentTypeRemoved() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource());
-
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.rootStructureNodes().next());
-
- entityMappings().removeOrmPersistentType(0);
- assertNotSame(javaPersistentType, javaJpaFile.rootStructureNodes().next());
- assertEquals(1, javaJpaFile.rootStructureNodesSize());
- assertEquals(entityMappings().getPersistenceUnit().impliedClassRefs().next(), javaJpaFile.rootStructureNodes().next().getParent());
- }
-
- public void testJavaRootStructureNodesOrmTypeMappingMorphed() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource());
-
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.rootStructureNodes().next());
-
- ormPersistentType.setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
- assertEquals(1, javaJpaFile.rootStructureNodesSize());
- javaPersistentType = entityMappings().ormPersistentTypes().next().getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.rootStructureNodes().next());
-
- entityMappings().removeOrmPersistentType(0);
- assertNotSame(javaPersistentType, javaJpaFile.rootStructureNodes().next());
- assertEquals(1, javaJpaFile.rootStructureNodesSize());
- assertEquals(entityMappings().getPersistenceUnit().impliedClassRefs().next(), javaJpaFile.rootStructureNodes().next().getParent());
- }
-
- public void testUpdateOrmJavaRootStructureNodeMappingFileRefChanged() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource());
-
- assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.rootStructureNodes().next());
-
- MappingFileRef mappingFileRef = persistenceUnit().mappingFileRefs().next();
- mappingFileRef.setFileName("foo");
-
- ormPersistentType = ((EntityMappings) persistenceUnit().getImpliedMappingFileRef().getMappingFile().getMappingFileRoot()).ormPersistentTypes().next();
- assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.rootStructureNodes().next());
-
- IFile file = persistenceResource().getFile();
- JpaFile ormXmlJpaFile = JptCorePlugin.getJpaFile(file);
-
- assertEquals(1, ormXmlJpaFile.rootStructureNodesSize());
- }
-
- public void testUpdateJavaRootStructureNodeMappingFileRefChanged() throws Exception {
- ICompilationUnit cu = createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource());
-
- assertEquals(javaPersistentType(), javaJpaFile.rootStructureNodes().next());
-
- MappingFileRef mappingFileRef = persistenceUnit().mappingFileRefs().next();
- mappingFileRef.setFileName("foo");
- assertEquals(javaPersistentType(), javaJpaFile.rootStructureNodes().next());
- }
-
-
- public void testUpdateJavaRootStrucutreNodeDeleteOrmResource() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource());
-
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.rootStructureNodes().next());
-
-
- deleteResource(ormResource());
-
- assertNotSame(javaPersistentType, javaJpaFile.rootStructureNodes().next());
- assertEquals(1, javaJpaFile.rootStructureNodesSize());
- assertEquals(persistenceUnit().impliedClassRefs().next(), javaJpaFile.rootStructureNodes().next().getParent());
- }
-
- //TODO test rootStructureNodes with a static inner class
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/JptCoreContextModelTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/JptCoreContextModelTests.java
deleted file mode 100644
index 307e3051db..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/JptCoreContextModelTests.java
+++ /dev/null
@@ -1,39 +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.core.tests.internal.context;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.core.tests.internal.context.java.JptCoreContextJavaModelTests;
-import org.eclipse.jpt.core.tests.internal.context.orm.JptCoreOrmContextModelTests;
-import org.eclipse.jpt.core.tests.internal.context.persistence.JptCorePersistenceContextModelTests;
-
-public class JptCoreContextModelTests extends TestCase
-{
- public static Test suite() {
- return suite(true);
- }
-
- public static Test suite(boolean all) {
- TestSuite suite = new TestSuite(JptCoreContextModelTests.class.getName());
- suite.addTestSuite(JpaFileTests.class);
- suite.addTest(JptCorePersistenceContextModelTests.suite(all));
- suite.addTest(JptCoreOrmContextModelTests.suite(all));
- suite.addTest(JptCoreContextJavaModelTests.suite(all));
- return suite;
- }
-
- private JptCoreContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaAssociationOverrideTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaAssociationOverrideTests.java
deleted file mode 100644
index dbe6d891e5..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaAssociationOverrideTests.java
+++ /dev/null
@@ -1,389 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JavaAssociationOverrideTests extends ContextModelTestCase
-{
- private static final String ASSOCIATION_OVERRIDE_NAME = "MY_ASSOCIATION_OVERRIDE_NAME";
-
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithAssociationOverride() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ASSOCIATION_OVERRIDE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\")");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
-
-
- public JavaAssociationOverrideTests(String name) {
- super(name);
- }
-
- public void testUpdateName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- AssociationOverride javaAssociationOverride = entity.virtualAssociationOverrides().next();
- javaAssociationOverride = javaAssociationOverride.setVirtual(false);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild");
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE);
-
- assertEquals("address", javaAssociationOverride.getName());
- assertEquals("address", associationOverrideResource.getName());
- assertTrue(javaEntity().associationOverrides().hasNext());
-
- //set name in the resource model, verify context model updated
- associationOverrideResource.setName("FOO");
- assertEquals("FOO", javaAssociationOverride.getName());
- assertEquals("FOO", associationOverrideResource.getName());
-
- //set name to null in the resource model
- associationOverrideResource.setName(null);
- assertNull(javaAssociationOverride.getName());
- assertNull(associationOverrideResource.getName());
-
- associationOverrideResource.setName("FOO");
- assertEquals("FOO", javaAssociationOverride.getName());
- assertEquals("FOO", associationOverrideResource.getName());
-
- typeResource.removeSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- assertFalse(javaEntity().specifiedAssociationOverrides().hasNext());
- assertFalse(typeResource.supportingAnnotations(JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES).hasNext());
- }
-
- public void testModifyName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- AssociationOverride javaAssociationOverride = entity.virtualAssociationOverrides().next();
- javaAssociationOverride = javaAssociationOverride.setVirtual(false);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild");
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE);
-
- assertEquals("address", javaAssociationOverride.getName());
- assertEquals("address", associationOverrideResource.getName());
- assertTrue(javaEntity().associationOverrides().hasNext());
-
- //set name in the context model, verify resource model modified
- javaAssociationOverride.setName("foo");
- assertEquals("foo", javaAssociationOverride.getName());
- assertEquals("foo", associationOverrideResource.getName());
-
- //set name to null in the context model
- javaAssociationOverride.setName(null);
- assertNull(javaAssociationOverride.getName());
- associationOverrideResource = (AssociationOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE);
- assertNull(associationOverrideResource.getName());
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- AssociationOverride javaAssociationOverride = entity.virtualAssociationOverrides().next();
- javaAssociationOverride = javaAssociationOverride.setVirtual(false);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild");
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE);
-
-
- JoinColumn joinColumn = javaAssociationOverride.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", associationOverrideResource.joinColumnAt(0).getName());
-
- JoinColumn joinColumn2 = javaAssociationOverride.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", associationOverrideResource.joinColumnAt(0).getName());
- assertEquals("FOO", associationOverrideResource.joinColumnAt(1).getName());
-
- JoinColumn joinColumn3 = javaAssociationOverride.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", associationOverrideResource.joinColumnAt(0).getName());
- assertEquals("BAZ", associationOverrideResource.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverrideResource.joinColumnAt(2).getName());
-
- ListIterator<JoinColumn> joinColumns = javaAssociationOverride.specifiedJoinColumns();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = javaAssociationOverride.specifiedJoinColumns();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- AssociationOverride javaAssociationOverride = entity.virtualAssociationOverrides().next();
- javaAssociationOverride = javaAssociationOverride.setVirtual(false);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild");
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE);
-
- javaAssociationOverride.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- javaAssociationOverride.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- javaAssociationOverride.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, associationOverrideResource.joinColumnsSize());
-
- javaAssociationOverride.removeSpecifiedJoinColumn(0);
- assertEquals(2, associationOverrideResource.joinColumnsSize());
- assertEquals("BAR", associationOverrideResource.joinColumnAt(0).getName());
- assertEquals("BAZ", associationOverrideResource.joinColumnAt(1).getName());
-
- javaAssociationOverride.removeSpecifiedJoinColumn(0);
- assertEquals(1, associationOverrideResource.joinColumnsSize());
- assertEquals("BAZ", associationOverrideResource.joinColumnAt(0).getName());
-
- javaAssociationOverride.removeSpecifiedJoinColumn(0);
- assertEquals(0, associationOverrideResource.joinColumnsSize());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- AssociationOverride javaAssociationOverride = entity.virtualAssociationOverrides().next();
- javaAssociationOverride = javaAssociationOverride.setVirtual(false);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild");
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE);
-
- javaAssociationOverride.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- javaAssociationOverride.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- javaAssociationOverride.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, associationOverrideResource.joinColumnsSize());
-
-
- javaAssociationOverride.moveSpecifiedJoinColumn(2, 0);
- ListIterator<JoinColumn> joinColumns = javaAssociationOverride.specifiedJoinColumns();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", associationOverrideResource.joinColumnAt(0).getName());
- assertEquals("BAZ", associationOverrideResource.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverrideResource.joinColumnAt(2).getName());
-
-
- javaAssociationOverride.moveSpecifiedJoinColumn(0, 1);
- joinColumns = javaAssociationOverride.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", associationOverrideResource.joinColumnAt(0).getName());
- assertEquals("BAR", associationOverrideResource.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverrideResource.joinColumnAt(2).getName());
- }
-
- public void testUpdateJoinColumns() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- AssociationOverride javaAssociationOverride = entity.virtualAssociationOverrides().next();
- javaAssociationOverride = javaAssociationOverride.setVirtual(false);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild");
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE);
-
- associationOverrideResource.addJoinColumn(0);
- associationOverrideResource.addJoinColumn(1);
- associationOverrideResource.addJoinColumn(2);
-
- associationOverrideResource.joinColumnAt(0).setName("FOO");
- associationOverrideResource.joinColumnAt(1).setName("BAR");
- associationOverrideResource.joinColumnAt(2).setName("BAZ");
-
- ListIterator<JoinColumn> joinColumns = javaAssociationOverride.specifiedJoinColumns();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.moveJoinColumn(2, 0);
- joinColumns = javaAssociationOverride.specifiedJoinColumns();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.moveJoinColumn(0, 1);
- joinColumns = javaAssociationOverride.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.removeJoinColumn(1);
- joinColumns = javaAssociationOverride.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.removeJoinColumn(1);
- joinColumns = javaAssociationOverride.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.removeJoinColumn(0);
- assertFalse(javaAssociationOverride.specifiedJoinColumns().hasNext());
- }
-
-
-
-
- public void testGetName() throws Exception {
- createTestEntityWithAssociationOverride();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AssociationOverride specifiedAssociationOverride = javaEntity().specifiedAssociationOverrides().next();
- assertEquals(ASSOCIATION_OVERRIDE_NAME, specifiedAssociationOverride.getName());
-
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE);
-
- associationOverrideResource.setName("FOO");
- specifiedAssociationOverride = javaEntity().specifiedAssociationOverrides().next();
- assertEquals("FOO", specifiedAssociationOverride.getName());
- }
-
- public void testSetName() throws Exception {
- createTestEntityWithAssociationOverride();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AssociationOverride specifiedAssociationOverride = javaEntity().specifiedAssociationOverrides().next();
- assertEquals(ASSOCIATION_OVERRIDE_NAME, specifiedAssociationOverride.getName());
-
- specifiedAssociationOverride.setName("FOO");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE);
-
- assertEquals("FOO", associationOverrideResource.getName());
- }
-
- public void testDefaultName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- assertEquals("AnnotationTestTypeChild", entity.getName());
- assertEquals(1, entity.virtualAssociationOverridesSize());
-
- AssociationOverride associationOverride = entity.virtualAssociationOverrides().next();
- assertEquals("address", associationOverride.getName());
- }
-
- public void testIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- assertEquals("AnnotationTestTypeChild", entity.getName());
- assertEquals(1, entity.virtualAssociationOverridesSize());
-
- AssociationOverride associationOverride = entity.virtualAssociationOverrides().next();
- assertTrue(associationOverride.isVirtual());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaAttributeOverrideTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaAttributeOverrideTests.java
deleted file mode 100644
index 7bd7922e87..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaAttributeOverrideTests.java
+++ /dev/null
@@ -1,259 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-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.Column;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-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.JavaResourcePersistentType;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JavaAttributeOverrideTests extends ContextModelTestCase
-{
- private static final String ATTRIBUTE_OVERRIDE_NAME = "MY_ATTRIBUTE_OVERRIDE_NAME";
- private static final String ATTRIBUTE_OVERRIDE_COLUMN_NAME = "MY_ATTRIBUTE_OVERRIDE_COLUMN_NAME";
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithAttributeOverride() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ATTRIBUTE_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\", column=@Column(name=\"" + ATTRIBUTE_OVERRIDE_COLUMN_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
-
-
- public JavaAttributeOverrideTests(String name) {
- super(name);
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithAttributeOverride();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverride specifiedAttributeOverride = javaEntity().specifiedAttributeOverrides().next();
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, specifiedAttributeOverride.getName());
-
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE);
-
- attributeOverrideResource.setName("FOO");
- specifiedAttributeOverride = javaEntity().specifiedAttributeOverrides().next();
- assertEquals("FOO", specifiedAttributeOverride.getName());
- }
-
- public void testSetName() throws Exception {
- createTestEntityWithAttributeOverride();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverride specifiedAttributeOverride = javaEntity().specifiedAttributeOverrides().next();
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, specifiedAttributeOverride.getName());
-
- specifiedAttributeOverride.setName("FOO");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE);
-
- assertEquals("FOO", attributeOverrideResource.getName());
- }
-
- public void testColumnGetName() throws Exception {
- createTestEntityWithAttributeOverride();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverride specifiedAttributeOverride = javaEntity().specifiedAttributeOverrides().next();
- Column column = specifiedAttributeOverride.getColumn();
- assertEquals(ATTRIBUTE_OVERRIDE_COLUMN_NAME, column.getName());
-
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE);
- ColumnAnnotation columnResource = attributeOverrideResource.getColumn();
- columnResource.setName("FOO");
-
-
- column = javaEntity().specifiedAttributeOverrides().next().getColumn();
- assertEquals("FOO", column.getName());
- }
-
- public void testColumnSetName() throws Exception {
- createTestEntityWithAttributeOverride();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverride specifiedAttributeOverride = javaEntity().specifiedAttributeOverrides().next();
- Column column = specifiedAttributeOverride.getColumn();
- assertEquals(ATTRIBUTE_OVERRIDE_COLUMN_NAME, column.getName());
-
- column.setSpecifiedName("FOO");
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE);
- ColumnAnnotation columnResource = attributeOverrideResource.getColumn();
-
- assertEquals("FOO", columnResource.getName());
-
- column.setSpecifiedName(null);
-
- attributeOverrideResource = (AttributeOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE);
- assertNull(attributeOverrideResource.getColumn());
- assertNotNull(specifiedAttributeOverride.getColumn());
- }
-
- public void testColumnDefaultName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- assertEquals("AnnotationTestTypeChild", entity.getName());
- assertEquals(2, entity.virtualAttributeOverridesSize());
-
- AttributeOverride attributeOverride = entity.virtualAttributeOverrides().next();
- assertEquals("id", attributeOverride.getColumn().getDefaultName());
-
-
- JavaPersistentType mappedSuperclass = CollectionTools.list(persistenceUnit().specifiedClassRefs()).get(1).getJavaPersistentType();
- BasicMapping basicMapping = (BasicMapping) mappedSuperclass.getAttributeNamed("id").getMapping();
- basicMapping.getColumn().setSpecifiedName("FOO");
-
- attributeOverride = entity.virtualAttributeOverrides().next();
- assertEquals("FOO", attributeOverride.getColumn().getDefaultName());
- }
-
- public void testColumnDefaultTableName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- assertEquals("AnnotationTestTypeChild", entity.getName());
- assertEquals(2, entity.virtualAttributeOverridesSize());
-
- AttributeOverride attributeOverride = entity.virtualAttributeOverrides().next();
- assertEquals("AnnotationTestTypeChild", attributeOverride.getColumn().getDefaultTable());
-
-
- JavaPersistentType mappedSuperclass = CollectionTools.list(persistenceUnit().specifiedClassRefs()).get(1).getJavaPersistentType();
- BasicMapping basicMapping = (BasicMapping) mappedSuperclass.getAttributeNamed("id").getMapping();
- basicMapping.getColumn().setSpecifiedTable("BAR");
-
- attributeOverride = entity.virtualAttributeOverrides().next();
- assertEquals("BAR", attributeOverride.getColumn().getDefaultTable());
- }
-
- public void testDefaultName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- assertEquals("AnnotationTestTypeChild", entity.getName());
- assertEquals(2, entity.virtualAttributeOverridesSize());
-
- AttributeOverride attributeOverride = entity.virtualAttributeOverrides().next();
- assertEquals("id", attributeOverride.getName());
- }
-
- public void testIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- assertEquals("AnnotationTestTypeChild", entity.getName());
- assertEquals(2, entity.virtualAttributeOverridesSize());
-
- AttributeOverride attributeOverride = entity.virtualAttributeOverrides().next();
- assertTrue(attributeOverride.isVirtual());
- }
-
- public void testSetColumn() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- AttributeOverride attributeOverride = entity.virtualAttributeOverrides().next();
- attributeOverride = attributeOverride.setVirtual(false);
- attributeOverride.getColumn().setSpecifiedName("FOO");
-
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild");
- AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE);
-
- assertEquals("FOO", attributeOverrideResource.getColumn().getName());
- assertEquals("FOO", entity.specifiedAttributeOverrides().next().getColumn().getSpecifiedName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaBasicMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaBasicMappingTests.java
deleted file mode 100644
index a2fbdfb5c6..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaBasicMappingTests.java
+++ /dev/null
@@ -1,977 +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.tests.internal.context.java;
-
-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.Converter;
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-import org.eclipse.jpt.core.context.EnumType;
-import org.eclipse.jpt.core.context.EnumeratedConverter;
-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.OneToOneMapping;
-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.TransientMapping;
-import org.eclipse.jpt.core.context.VersionMapping;
-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.EnumeratedAnnotation;
-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.LobAnnotation;
-import org.eclipse.jpt.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JavaBasicMappingTests extends ContextModelTestCase
-{
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithBasicMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- }
- });
- }
- private ICompilationUnit createTestEntityWithBasicMappingFetchOptionalSpecified() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, JPA.FETCH_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic(fetch=FetchType.EAGER, optional=false)").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithLob() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.LOB);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Lob").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithEnumerated() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ENUMERATED, JPA.ENUM_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Enumerated(EnumType.STRING)").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithTemporal() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TEMPORAL, JPA.TEMPORAL_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Temporal(TemporalType.TIMESTAMP)").append(CR);
- }
- });
- }
-
- public JavaBasicMappingTests(String name) {
- super(name);
- }
-
- public void testDefaultBasicGetDefaultFetch() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertEquals(FetchType.EAGER, basicMapping.getDefaultFetch());
- }
-
- public void testSpecifiedBasicGetDefaultFetch() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
- assertEquals(FetchType.EAGER, basicMapping.getDefaultFetch());
- }
-
- public void testGetFetch() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
-
- assertEquals(FetchType.EAGER, basicMapping.getFetch());
-
- basicMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, basicMapping.getFetch());
- }
-
- public void testGetSpecifiedFetch() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
-
- assertNull(basicMapping.getSpecifiedFetch());
-
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- BasicAnnotation basic = (BasicAnnotation) attributeResource.getMappingAnnotation(JPA.BASIC);
- basic.setFetch(org.eclipse.jpt.core.resource.java.FetchType.LAZY);
-
- assertEquals(FetchType.LAZY, basicMapping.getSpecifiedFetch());
- }
-
- public void testGetSpecifiedFetch2() throws Exception {
- createTestEntityWithBasicMappingFetchOptionalSpecified();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
-
- assertEquals(FetchType.EAGER, basicMapping.getSpecifiedFetch());
- }
-
- public void testSetSpecifiedFetch() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
- assertNull(basicMapping.getSpecifiedFetch());
-
- basicMapping.setSpecifiedFetch(FetchType.LAZY);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- BasicAnnotation basic = (BasicAnnotation) attributeResource.getMappingAnnotation(JPA.BASIC);
-
- assertEquals(org.eclipse.jpt.core.resource.java.FetchType.LAZY, basic.getFetch());
-
- basicMapping.setSpecifiedFetch(null);
- assertNotNull(attributeResource.getMappingAnnotation(JPA.BASIC));
- }
-
- public void testSetSpecifiedFetch2() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- createOrmXmlFile();
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY);
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertNull(basicMapping.getSpecifiedFetch());
- assertTrue(basicMapping.isDefault());
-
- basicMapping.setSpecifiedFetch(FetchType.LAZY);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableProperties().next();
- BasicAnnotation basic = (BasicAnnotation) attributeResource.getMappingAnnotation(JPA.BASIC);
-
- assertEquals(org.eclipse.jpt.core.resource.java.FetchType.LAZY, basic.getFetch());
-
- basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertEquals(FetchType.LAZY, basicMapping.getSpecifiedFetch());
- assertFalse(basicMapping.isDefault());
-
- basicMapping.setSpecifiedFetch(null);
- assertNotNull(attributeResource.getMappingAnnotation(JPA.BASIC));
-
- basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- }
-
- protected void createOrmXmlFile() throws Exception {
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- public void testSetBasicRemovedFromResourceModel() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- attributeResource.addSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- attributeResource.addSupportingAnnotation(LobAnnotation.ANNOTATION_NAME);
- attributeResource.addSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- assertFalse(basicMapping.isDefault());
-
- attributeResource.setMappingAnnotation(null);
-
- assertNotSame(basicMapping, persistentAttribute.getMapping());
-
- basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertTrue(basicMapping.isDefault());
- assertEquals("FOO", basicMapping.getColumn().getSpecifiedName());
-
-
- assertNotNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToDefaultBasic() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setSpecifiedConverter(Converter.ENUMERATED_CONVERTER);
- ((EnumeratedConverter) basicMapping.getSpecifiedConverter()).setSpecifiedEnumType(EnumType.STRING);
- attributeResource.addSupportingAnnotation(LobAnnotation.ANNOTATION_NAME);
- attributeResource.addSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(EnumType.STRING, ((EnumeratedConverter) ((BasicMapping) persistentAttribute.getMapping()).getSpecifiedConverter()).getEnumType());
-
- assertNull(((BasicMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
- assertNull(((BasicMapping) persistentAttribute.getMapping()).getSpecifiedOptional());
- assertNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToId() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) basicMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- attributeResource.addSupportingAnnotation(LobAnnotation.ANNOTATION_NAME);
- attributeResource.addSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((IdMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ((IdMapping) persistentAttribute.getMapping()).getSpecifiedConverter()).getTemporalType());
-
- assertNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToVersion() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) basicMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- attributeResource.addSupportingAnnotation(LobAnnotation.ANNOTATION_NAME);
- attributeResource.addSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((VersionMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ((VersionMapping) persistentAttribute.getMapping()).getSpecifiedConverter()).getTemporalType());
-
- assertNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToEmbedded() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- attributeResource.addSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- attributeResource.addSupportingAnnotation(LobAnnotation.ANNOTATION_NAME);
- attributeResource.addSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
-
- assertNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToEmbeddedId() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- attributeResource.addSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- attributeResource.addSupportingAnnotation(LobAnnotation.ANNOTATION_NAME);
- attributeResource.addSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
-
- assertNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToTransient() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- attributeResource.addSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- attributeResource.addSupportingAnnotation(LobAnnotation.ANNOTATION_NAME);
- attributeResource.addSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- assertNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToOneToOne() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- attributeResource.addSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- attributeResource.addSupportingAnnotation(LobAnnotation.ANNOTATION_NAME);
- attributeResource.addSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
-//TODO assertEquals(FetchType.EAGER, ((IOneToOneMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
-// assertEquals(Boolean.FALSE, ((IOneToOneMapping) persistentAttribute.getMapping()).getSpecifiedOptional());
- assertNotNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToOneToMany() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- attributeResource.addSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- attributeResource.addSupportingAnnotation(LobAnnotation.ANNOTATION_NAME);
- attributeResource.addSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
-//TODO assertEquals(FetchType.EAGER, ((IOneToManyMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
-// assertNotNull(attributeResource.mappingAnnotation(OneToMany.ANNOTATION_NAME));
- assertNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
- public void testBasicMorphToManyToOne() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- attributeResource.addSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- attributeResource.addSupportingAnnotation(LobAnnotation.ANNOTATION_NAME);
- attributeResource.addSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
-//TODO assertEquals(FetchType.EAGER, ((IManyToOneMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
-// assertEquals(Boolean.FALSE, ((IManyToOneMapping) persistentAttribute.getMapping()).getSpecifiedOptional());
- assertNotNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToManyToMany() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- attributeResource.addSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- attributeResource.addSupportingAnnotation(LobAnnotation.ANNOTATION_NAME);
- attributeResource.addSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
-//TODO assertEquals(FetchType.EAGER, ((IManyToManyMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
-// assertNotNull(attributeResource.mappingAnnotation(ManyToMany.ANNOTATION_NAME));
- assertNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testDefaultBasicGetDefaultOptional() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertEquals(Boolean.TRUE, basicMapping.getDefaultOptional());
- }
-
- public void testSpecifiedBasicGetDefaultOptional() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
- assertEquals(Boolean.TRUE, basicMapping.getDefaultOptional());
- }
-
- public void testGetOptional() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
-
- assertEquals(Boolean.TRUE, basicMapping.getOptional());
-
- basicMapping.setSpecifiedOptional(basicMapping.getOptional());
- assertEquals(Boolean.TRUE, basicMapping.getOptional());
- }
-
- public void testGetSpecifiedOptional() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
-
- assertNull(basicMapping.getSpecifiedOptional());
-
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- BasicAnnotation basic = (BasicAnnotation) attributeResource.getMappingAnnotation(JPA.BASIC);
- basic.setOptional(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, basicMapping.getSpecifiedOptional());
- }
-
- public void testGetSpecifiedOptional2() throws Exception {
- createTestEntityWithBasicMappingFetchOptionalSpecified();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
-
- assertEquals(Boolean.FALSE, basicMapping.getSpecifiedOptional());
- }
-
- public void testSetSpecifiedOptional() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
- assertNull(basicMapping.getSpecifiedOptional());
-
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- BasicAnnotation basic = (BasicAnnotation) attributeResource.getMappingAnnotation(JPA.BASIC);
-
- assertEquals(Boolean.FALSE, basic.getOptional());
-
- basicMapping.setSpecifiedOptional(null);
- assertNotNull(attributeResource.getMappingAnnotation(JPA.BASIC));
- }
-
- public void testSetSpecifiedOptional2() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertNull(basicMapping.getSpecifiedOptional());
- assertTrue(basicMapping.isDefault());
-
- basicMapping.setSpecifiedOptional(Boolean.TRUE);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- BasicAnnotation basic = (BasicAnnotation) attributeResource.getMappingAnnotation(JPA.BASIC);
-
- assertEquals(Boolean.TRUE, basic.getOptional());
-
- basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertEquals(Boolean.TRUE, basicMapping.getSpecifiedOptional());
- assertFalse(basicMapping.isDefault());
-
- basicMapping.setSpecifiedOptional(null);
- assertNotNull(attributeResource.getMappingAnnotation(JPA.BASIC));
-
- basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- }
-
-
- public void testGetSpecifiedOptionalUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
-
- assertNull(basicMapping.getSpecifiedOptional());
-
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- BasicAnnotation basic = (BasicAnnotation) attributeResource.getMappingAnnotation(JPA.BASIC);
- basic.setOptional(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, basicMapping.getSpecifiedOptional());
-
- basic.setOptional(null);
- assertNull(basicMapping.getSpecifiedOptional());
- assertFalse(basicMapping.isDefault());
- assertSame(basicMapping, persistentAttribute.getSpecifiedMapping());
-
- basic.setOptional(Boolean.FALSE);
- attributeResource.setMappingAnnotation(null);
-
- assertNull(persistentAttribute.getSpecifiedMapping());
- assertEquals(Boolean.TRUE, ((BasicMapping) persistentAttribute.getMapping()).getOptional());
- }
-
-
- public void testIsLob() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
-
- assertFalse(basicMapping.getConverter().getType() == Converter.LOB_CONVERTER);
- }
-
- public void testIsLob2() throws Exception {
- createTestEntityWithLob();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertTrue(basicMapping.getConverter().getType() == Converter.LOB_CONVERTER);
- }
-
- public void testSetLob() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
-
- basicMapping.setSpecifiedConverter(Converter.LOB_CONVERTER);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNotNull(attributeResource.getSupportingAnnotation(LobAnnotation.ANNOTATION_NAME));
-
- basicMapping.setSpecifiedConverter(null);
- assertNull(attributeResource.getSupportingAnnotation(LobAnnotation.ANNOTATION_NAME));
- }
-
- public void testIsLobUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
-
- assertFalse(basicMapping.getConverter().getType() == Converter.LOB_CONVERTER);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(LobAnnotation.ANNOTATION_NAME);
-
- assertTrue(basicMapping.getConverter().getType() == Converter.LOB_CONVERTER);
-
- attributeResource.removeSupportingAnnotation(LobAnnotation.ANNOTATION_NAME);
-
- assertFalse(basicMapping.getConverter().getType() == Converter.LOB_CONVERTER);
- }
-
- public void testDefaultBasicGetDefaultConverter() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertTrue(basicMapping.getConverter().getType() == Converter.NO_CONVERTER);
- }
-
- public void testSpecifiedBasicGetDefaultConverter() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
- assertTrue(basicMapping.getConverter().getType() == Converter.NO_CONVERTER);
- }
-
- public void testGetEnumerated() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
-
- assertTrue(basicMapping.getConverter().getType() == Converter.NO_CONVERTER);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EnumeratedAnnotation enumeratedAnnotation = (EnumeratedAnnotation) attributeResource.addSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- assertEquals(EnumType.ORDINAL, ((EnumeratedConverter) basicMapping.getConverter()).getDefaultEnumType());
-
- enumeratedAnnotation.setValue(org.eclipse.jpt.core.resource.java.EnumType.STRING);
- assertEquals(EnumType.STRING, ((EnumeratedConverter) basicMapping.getConverter()).getSpecifiedEnumType());
- }
-
- public void testGetSpecifiedEnumerated() throws Exception {
- createTestEntityWithEnumerated();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertEquals(EnumType.STRING, ((EnumeratedConverter) basicMapping.getConverter()).getSpecifiedEnumType());
- }
-
- public void testSetSpecifiedEnumerated() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
- assertTrue(basicMapping.getConverter().getType() == Converter.NO_CONVERTER);
-
- basicMapping.setSpecifiedConverter(Converter.ENUMERATED_CONVERTER);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EnumeratedAnnotation enumerated = (EnumeratedAnnotation) attributeResource.getSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
-
- assertNotNull(enumerated);
- assertEquals(null, enumerated.getValue());
-
- ((EnumeratedConverter) basicMapping.getConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.core.resource.java.EnumType.STRING, enumerated.getValue());
-
- ((EnumeratedConverter) basicMapping.getConverter()).setSpecifiedEnumType(null);
- assertNotNull(attributeResource.getSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- assertNull(enumerated.getValue());
-
- basicMapping.setSpecifiedConverter(Converter.NO_CONVERTER);
- assertNull(attributeResource.getSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetSpecifiedEnumeratedUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
-
- assertTrue(basicMapping.getConverter().getType() == Converter.NO_CONVERTER);
-
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EnumeratedAnnotation enumerated = (EnumeratedAnnotation) attributeResource.addSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- enumerated.setValue(org.eclipse.jpt.core.resource.java.EnumType.STRING);
-
- assertEquals(EnumType.STRING, ((EnumeratedConverter) basicMapping.getConverter()).getSpecifiedEnumType());
-
- enumerated.setValue(null);
- assertNotNull(attributeResource.getSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- assertNull(((EnumeratedConverter) basicMapping.getConverter()).getSpecifiedEnumType());
- assertFalse(basicMapping.isDefault());
- assertSame(basicMapping, persistentAttribute.getSpecifiedMapping());
- }
-
- public void testGetTemporal() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
-
- assertEquals(Converter.TEMPORAL_CONVERTER, basicMapping.getConverter().getType());
- }
-
- public void testGetTemporal2() throws Exception {
- createTestEntityWithTemporal();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertEquals(Converter.TEMPORAL_CONVERTER, basicMapping.getConverter().getType());
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) basicMapping.getConverter()).getTemporalType());
- }
-
- public void testSetTemporal() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
- assertEquals(Converter.NO_CONVERTER, basicMapping.getConverter().getType());
-
- basicMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) basicMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TemporalAnnotation temporal = (TemporalAnnotation) attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- basicMapping.setSpecifiedConverter(null);
- assertNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetTemporalUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
-
- assertEquals(Converter.NO_CONVERTER, basicMapping.getConverter().getType());
-
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TemporalAnnotation temporal = (TemporalAnnotation) attributeResource.addSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- temporal.setValue(org.eclipse.jpt.core.resource.java.TemporalType.DATE);
-
- assertEquals(Converter.TEMPORAL_CONVERTER, basicMapping.getConverter().getType());
- assertEquals(TemporalType.DATE, ((TemporalConverter) basicMapping.getConverter()).getTemporalType());
-
- attributeResource.removeSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME);
-
- assertEquals(Converter.NO_CONVERTER, basicMapping.getConverter().getType());
- assertFalse(basicMapping.isDefault());
- assertSame(basicMapping, persistentAttribute.getSpecifiedMapping());
- }
-
- public void testGetColumn() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedName());
- assertEquals("id", basicMapping.getColumn().getName());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN);
- column.setName("foo");
-
- assertEquals("foo", basicMapping.getColumn().getSpecifiedName());
- assertEquals("foo", basicMapping.getColumn().getName());
- assertEquals("id", basicMapping.getColumn().getDefaultName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaColumnTests.java
deleted file mode 100644
index a6650f6529..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaColumnTests.java
+++ /dev/null
@@ -1,815 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-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.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JavaColumnTests extends ContextModelTestCase
-{
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String TABLE_NAME = "MY_TABLE";
- private static final String COLUMN_DEFINITION = "MY_COLUMN_DEFINITION";
-
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithDefaultBasicColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column(name=\"" + COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithBasicColumnTableSet() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic");
- sb.append("@Column(table=\"" + TABLE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithBasicColumnColumnDefinitionSet() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic");
- sb.append("@Column(columnDefinition=\"" + COLUMN_DEFINITION + "\")");
- }
- });
- }
-
- public JavaColumnTests(String name) {
- super(name);
- }
-
- public void testGetSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedName());
- }
-
- public void testGetSpecifiedName() throws Exception {
- createTestEntityWithDefaultBasicColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertEquals(COLUMN_NAME, basicMapping.getColumn().getSpecifiedName());
- }
-
- public void testGetDefaultNameSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertEquals(basicMapping.getPersistentAttribute().getName(), basicMapping.getColumn().getDefaultName());
- assertEquals("id", basicMapping.getColumn().getDefaultName());
- }
-
- public void testGetDefaultName() throws Exception {
- createTestEntityWithDefaultBasicColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
- assertEquals("id", basicMapping.getColumn().getDefaultName());
-
- basicMapping.getColumn().setSpecifiedName("foo");
- assertEquals("id", basicMapping.getColumn().getDefaultName());
- }
-
- public void testGetNameSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertEquals("id", basicMapping.getColumn().getName());
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithDefaultBasicColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertEquals(COLUMN_NAME, basicMapping.getColumn().getName());
- }
-
- public void testSetSpecifiedName() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- basicMapping.getColumn().setSpecifiedName("foo");
-
- assertEquals("foo", basicMapping.getColumn().getSpecifiedName());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertEquals("foo", column.getName());
- }
-
- public void testSetSpecifiedNameNull() throws Exception {
- createTestEntityWithDefaultBasicColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- basicMapping.getColumn().setSpecifiedName(null);
-
- assertNull(basicMapping.getColumn().getSpecifiedName());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getSupportingAnnotation(JPA.COLUMN));
- }
-
- public void testGetNameUpdatesFromResourceChange() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedName());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN);
-
- column.setName("foo");
- assertEquals("foo", basicMapping.getColumn().getSpecifiedName());
- assertEquals("foo", basicMapping.getColumn().getName());
-
- column.setName(null);
- assertNull(basicMapping.getColumn().getSpecifiedName());
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
- public void testGetSpecifiedTableNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedTable());
- }
-
- public void testGetSpecifiedTable() throws Exception {
- createTestEntityWithBasicColumnTableSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertEquals(TABLE_NAME, basicMapping.getColumn().getSpecifiedTable());
- }
-
- public void testGetDefaultTableSpecifiedTableNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertEquals(((Entity) basicMapping.getTypeMapping()).getName(), basicMapping.getColumn().getDefaultTable());
- assertEquals(TYPE_NAME, basicMapping.getColumn().getDefaultTable());
- }
-
- public void testGetDefaultTable() throws Exception {
- createTestEntityWithDefaultBasicColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
- assertEquals(TYPE_NAME, basicMapping.getColumn().getDefaultTable());
-
- basicMapping.getColumn().setSpecifiedTable("foo");
- assertEquals(TYPE_NAME, basicMapping.getColumn().getDefaultTable());
- }
-
- public void testGetTable() throws Exception {
- createTestEntityWithBasicColumnTableSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertEquals(TABLE_NAME, basicMapping.getColumn().getTable());
- }
-
- public void testSetSpecifiedTable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- basicMapping.getColumn().setSpecifiedTable("foo");
-
- assertEquals("foo", basicMapping.getColumn().getSpecifiedTable());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertEquals("foo", column.getTable());
- }
-
- public void testSetSpecifiedTableNull() throws Exception {
- createTestEntityWithBasicColumnTableSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- basicMapping.getColumn().setSpecifiedTable(null);
-
- assertNull(basicMapping.getColumn().getSpecifiedTable());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getSupportingAnnotation(JPA.COLUMN));
- }
-
- public void testGetTableUpdatesFromResourceChange() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedTable());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN);
-
- column.setTable("foo");
- assertEquals("foo", basicMapping.getColumn().getSpecifiedTable());
- assertEquals("foo", basicMapping.getColumn().getTable());
-
- column.setTable(null);
- assertNull(basicMapping.getColumn().getSpecifiedTable());
- }
-
- public void testGetColumnDefinition() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertEquals(COLUMN_DEFINITION, basicMapping.getColumn().getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- createTestEntityWithBasicColumnTableSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- basicMapping.getColumn().setColumnDefinition("foo");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertEquals("foo", column.getColumnDefinition());
-
- basicMapping.getColumn().setColumnDefinition(null);
- assertNull(column.getColumnDefinition());
- }
-
- public void testGetColumnDefinitionUpdatesFromResourceChange() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertNull(basicMapping.getColumn().getColumnDefinition());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN);
-
- column.setColumnDefinition("foo");
- assertEquals("foo", basicMapping.getColumn().getColumnDefinition());
-
- column.setColumnDefinition(null);
- assertNull(basicMapping.getColumn().getColumnDefinition());
-
- }
-
- public void testGetLength() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertEquals(Column.DEFAULT_LENGTH, basicMapping.getColumn().getLength());
- basicMapping.getColumn().setSpecifiedLength(Integer.valueOf(55));
- assertEquals(Integer.valueOf(55), basicMapping.getColumn().getLength());
- }
-
- public void testGetDefaultLength() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertEquals(Column.DEFAULT_LENGTH, basicMapping.getColumn().getDefaultLength());
- basicMapping.getColumn().setSpecifiedLength(Integer.valueOf(55));
-
- assertEquals(Column.DEFAULT_LENGTH, basicMapping.getColumn().getDefaultLength());
- }
-
- public void testGetSpecifiedLength() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedLength());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN);
- column.setLength(Integer.valueOf(66));
-
- assertEquals(Integer.valueOf(66), basicMapping.getColumn().getSpecifiedLength());
- assertEquals(Integer.valueOf(66), basicMapping.getColumn().getLength());
-
- column.setLength(null);
-
- assertNull(attributeResource.getSupportingAnnotation(JPA.COLUMN));
- assertNull(basicMapping.getColumn().getSpecifiedLength());
- }
-
- public void testSetSpecifiedLength() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedLength());
-
- basicMapping.getColumn().setSpecifiedLength(Integer.valueOf(100));
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertEquals(Integer.valueOf(100), column.getLength());
-
- basicMapping.getColumn().setSpecifiedLength(null);
-
- assertNull(column.getLength());
- }
-
- public void testGetPrecision() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertEquals(Column.DEFAULT_PRECISION, basicMapping.getColumn().getPrecision());
- basicMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(55));
- assertEquals(Integer.valueOf(55), basicMapping.getColumn().getPrecision());
- }
-
- public void testGetDefaultPrecision() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertEquals(Column.DEFAULT_PRECISION, basicMapping.getColumn().getDefaultPrecision());
- basicMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(55));
-
- assertEquals(Column.DEFAULT_PRECISION, basicMapping.getColumn().getDefaultPrecision());
- }
-
- public void testGetSpecifiedPrecision() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedPrecision());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN);
- column.setPrecision(Integer.valueOf(66));
-
- assertEquals(Integer.valueOf(66), basicMapping.getColumn().getSpecifiedPrecision());
- assertEquals(Integer.valueOf(66), basicMapping.getColumn().getPrecision());
-
- column.setPrecision(null);
-
- assertNull(attributeResource.getSupportingAnnotation(JPA.COLUMN));
- assertNull(basicMapping.getColumn().getSpecifiedPrecision());
- }
-
- public void testSetSpecifiedPrecision() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedPrecision());
-
- basicMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(100));
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertEquals(Integer.valueOf(100), column.getPrecision());
-
- basicMapping.getColumn().setSpecifiedPrecision(null);
-
- assertNull(column.getPrecision());
- }
-
- public void testGetScale() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertEquals(Column.DEFAULT_SCALE, basicMapping.getColumn().getScale());
- basicMapping.getColumn().setSpecifiedScale(Integer.valueOf(55));
- assertEquals(Integer.valueOf(55), basicMapping.getColumn().getScale());
- }
-
- public void testGetDefaultScale() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertEquals(Column.DEFAULT_SCALE, basicMapping.getColumn().getDefaultScale());
- basicMapping.getColumn().setSpecifiedScale(Integer.valueOf(55));
-
- assertEquals(Column.DEFAULT_SCALE, basicMapping.getColumn().getDefaultScale());
- }
-
- public void testGetSpecifiedScale() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedScale());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN);
- column.setScale(Integer.valueOf(66));
-
- assertEquals(Integer.valueOf(66), basicMapping.getColumn().getSpecifiedScale());
- assertEquals(Integer.valueOf(66), basicMapping.getColumn().getScale());
-
- column.setScale(null);
-
- assertNull(attributeResource.getSupportingAnnotation(JPA.COLUMN));
- assertNull(basicMapping.getColumn().getSpecifiedScale());
- }
-
- public void testSetSpecifiedScale() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedScale());
-
- basicMapping.getColumn().setSpecifiedScale(Integer.valueOf(100));
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertEquals(Integer.valueOf(100), column.getScale());
-
- basicMapping.getColumn().setSpecifiedScale(null);
-
- assertNull(column.getScale());
- }
-
- public void testGetUnique() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertEquals(BaseColumn.DEFAULT_UNIQUE, basicMapping.getColumn().getUnique());
- basicMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- assertEquals(Boolean.TRUE, basicMapping.getColumn().getUnique());
- }
-
- public void testGetDefaultUnique() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertEquals(BaseColumn.DEFAULT_UNIQUE, basicMapping.getColumn().getDefaultUnique());
- basicMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
-
- assertEquals(BaseColumn.DEFAULT_UNIQUE, basicMapping.getColumn().getDefaultUnique());
- }
-
- public void testGetSpecifiedUnique() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedUnique());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN);
- column.setUnique(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, basicMapping.getColumn().getSpecifiedUnique());
- assertEquals(Boolean.TRUE, basicMapping.getColumn().getUnique());
-
- column.setUnique(null);
-
- assertNull(attributeResource.getSupportingAnnotation(JPA.COLUMN));
- assertNull(basicMapping.getColumn().getSpecifiedUnique());
- }
-
- public void testSetSpecifiedUnique() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedUnique());
-
- basicMapping.getColumn().setSpecifiedUnique(Boolean.FALSE);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertEquals(Boolean.FALSE, column.getUnique());
-
- basicMapping.getColumn().setSpecifiedUnique(null);
-
- assertNull(column.getUnique());
- }
-
- public void testGetInsertable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertEquals(BaseColumn.DEFAULT_INSERTABLE, basicMapping.getColumn().getInsertable());
- basicMapping.getColumn().setSpecifiedInsertable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, basicMapping.getColumn().getInsertable());
- }
-
- public void testGetDefaultInsertable() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertEquals(BaseColumn.DEFAULT_INSERTABLE, basicMapping.getColumn().getDefaultInsertable());
- basicMapping.getColumn().setSpecifiedInsertable(Boolean.TRUE);
-
- assertEquals(BaseColumn.DEFAULT_INSERTABLE, basicMapping.getColumn().getDefaultInsertable());
- }
-
- public void testGetSpecifiedInsertable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedInsertable());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN);
- column.setInsertable(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, basicMapping.getColumn().getSpecifiedInsertable());
- assertEquals(Boolean.TRUE, basicMapping.getColumn().getInsertable());
-
- column.setInsertable(null);
-
- assertNull(attributeResource.getSupportingAnnotation(JPA.COLUMN));
- assertNull(basicMapping.getColumn().getSpecifiedInsertable());
- }
-
- public void testSetSpecifiedInsertable() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedInsertable());
-
- basicMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertEquals(Boolean.FALSE, column.getInsertable());
-
- basicMapping.getColumn().setSpecifiedInsertable(null);
-
- assertNull(column.getInsertable());
- }
-
- public void testGetNullable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertEquals(BaseColumn.DEFAULT_NULLABLE, basicMapping.getColumn().getNullable());
- basicMapping.getColumn().setSpecifiedNullable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, basicMapping.getColumn().getNullable());
- }
-
- public void testGetDefaultNullable() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertEquals(BaseColumn.DEFAULT_NULLABLE, basicMapping.getColumn().getDefaultNullable());
- basicMapping.getColumn().setSpecifiedNullable(Boolean.TRUE);
-
- assertEquals(BaseColumn.DEFAULT_NULLABLE, basicMapping.getColumn().getDefaultNullable());
- }
-
- public void testGetSpecifiedNullable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedNullable());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN);
- column.setNullable(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, basicMapping.getColumn().getSpecifiedNullable());
- assertEquals(Boolean.TRUE, basicMapping.getColumn().getNullable());
-
- column.setNullable(null);
-
- assertNull(attributeResource.getSupportingAnnotation(JPA.COLUMN));
- assertNull(basicMapping.getColumn().getSpecifiedNullable());
- }
-
- public void testSetSpecifiedNullable() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedNullable());
-
- basicMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertEquals(Boolean.FALSE, column.getNullable());
-
- basicMapping.getColumn().setSpecifiedNullable(null);
-
- assertNull(column.getNullable());
- }
-
- public void testGetUpdatable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertEquals(BaseColumn.DEFAULT_UPDATABLE, basicMapping.getColumn().getUpdatable());
- basicMapping.getColumn().setSpecifiedUpdatable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, basicMapping.getColumn().getUpdatable());
- }
-
- public void testGetDefaultUpdatable() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertEquals(BaseColumn.DEFAULT_UPDATABLE, basicMapping.getColumn().getDefaultUpdatable());
- basicMapping.getColumn().setSpecifiedUpdatable(Boolean.TRUE);
-
- assertEquals(BaseColumn.DEFAULT_UPDATABLE, basicMapping.getColumn().getDefaultUpdatable());
- }
-
- public void testGetSpecifiedUpdatable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedUpdatable());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN);
- column.setUpdatable(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, basicMapping.getColumn().getSpecifiedUpdatable());
- assertEquals(Boolean.TRUE, basicMapping.getColumn().getUpdatable());
-
- column.setUpdatable(null);
-
- assertNull(attributeResource.getSupportingAnnotation(JPA.COLUMN));
- assertNull(basicMapping.getColumn().getSpecifiedUpdatable());
- }
-
- public void testSetSpecifiedUpdatable() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedUpdatable());
-
- basicMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertEquals(Boolean.FALSE, column.getUpdatable());
-
- basicMapping.getColumn().setSpecifiedUpdatable(null);
-
- assertNull(column.getUpdatable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaDiscriminatorColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaDiscriminatorColumnTests.java
deleted file mode 100644
index cdfc40c78f..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaDiscriminatorColumnTests.java
+++ /dev/null
@@ -1,310 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.context.DiscriminatorColumn;
-import org.eclipse.jpt.core.context.DiscriminatorType;
-import org.eclipse.jpt.core.resource.java.DiscriminatorColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JavaDiscriminatorColumnTests extends ContextModelTestCase
-{
- private static final String DISCRIMINATOR_COLUMN_NAME = "MY_DISCRIMINATOR_COLUMN";
- private static final String COLUMN_DEFINITION = "MY_COLUMN_DEFINITION";
-
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithDiscriminatorColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@DiscriminatorColumn(name=\"" + DISCRIMINATOR_COLUMN_NAME + "\")");
- }
- });
- }
-
-
- public JavaDiscriminatorColumnTests(String name) {
- super(name);
- }
-
- public void testGetSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(javaEntity().getDiscriminatorColumn().getSpecifiedName());
- }
-
- public void testGetSpecifiedName() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(DISCRIMINATOR_COLUMN_NAME, javaEntity().getDiscriminatorColumn().getSpecifiedName());
- }
-
- public void testGetDefaultNameSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals("DTYPE", javaEntity().getDiscriminatorColumn().getDefaultName());
- }
-
- public void testGetDefaultName() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals("DTYPE", javaEntity().getDiscriminatorColumn().getDefaultName());
-
- javaEntity().getDiscriminatorColumn().setSpecifiedName("foo");
- assertEquals("DTYPE", javaEntity().getDiscriminatorColumn().getDefaultName());
- }
-
- public void testGetNameSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals("DTYPE", javaEntity().getDiscriminatorColumn().getName());
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(DISCRIMINATOR_COLUMN_NAME, javaEntity().getDiscriminatorColumn().getName());
- }
-
- public void testSetSpecifiedName() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- javaEntity().getDiscriminatorColumn().setSpecifiedName("foo");
-
- assertEquals("foo", javaEntity().getDiscriminatorColumn().getSpecifiedName());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- DiscriminatorColumnAnnotation discriminatorColumn = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertEquals("foo", discriminatorColumn.getName());
- }
-
- public void testSetSpecifiedNameNull() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- javaEntity().getDiscriminatorColumn().setSpecifiedName(null);
-
- assertNull(javaEntity().getDiscriminatorColumn().getSpecifiedName());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- DiscriminatorColumnAnnotation discriminatorColumn = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertNull(discriminatorColumn);
- }
-
- public void testGetDefaultDiscriminatorType() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(DiscriminatorType.STRING, javaEntity().getDiscriminatorColumn().getDefaultDiscriminatorType());
- }
-
- public void testGetDiscriminatorType() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(DiscriminatorType.STRING, javaEntity().getDiscriminatorColumn().getDiscriminatorType());
-
- javaEntity().getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.CHAR);
- assertEquals(DiscriminatorType.CHAR, javaEntity().getDiscriminatorColumn().getDiscriminatorType());
- }
-
- public void testGetSpecifiedDiscriminatorType() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(javaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType());
-
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- DiscriminatorColumnAnnotation discriminatorColumn = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN);
- discriminatorColumn.setDiscriminatorType(org.eclipse.jpt.core.resource.java.DiscriminatorType.CHAR);
-
- assertEquals(DiscriminatorType.CHAR, javaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType());
- }
-
- public void testSetSpecifiedDiscriminatorType() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(javaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType());
-
- javaEntity().getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.CHAR);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- DiscriminatorColumnAnnotation discriminatorColumn = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertEquals(org.eclipse.jpt.core.resource.java.DiscriminatorType.CHAR, discriminatorColumn.getDiscriminatorType());
-
- javaEntity().getDiscriminatorColumn().setSpecifiedName(null);
- javaEntity().getDiscriminatorColumn().setSpecifiedDiscriminatorType(null);
- assertNull(typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN));
- }
-
- public void testGetDiscriminatorTypeUpdatesFromResourceChange() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(javaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) typeResource.addSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- column.setDiscriminatorType(org.eclipse.jpt.core.resource.java.DiscriminatorType.INTEGER);
- assertEquals(DiscriminatorType.INTEGER, javaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType());
- assertEquals(DiscriminatorType.INTEGER, javaEntity().getDiscriminatorColumn().getDiscriminatorType());
-
- column.setDiscriminatorType(null);
- assertNull(javaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType());
- assertEquals(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE, javaEntity().getDiscriminatorColumn().getDiscriminatorType());
- }
-
- public void testGetLength() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, javaEntity().getDiscriminatorColumn().getLength());
- javaEntity().getDiscriminatorColumn().setSpecifiedLength(Integer.valueOf(55));
- assertEquals(Integer.valueOf(55), javaEntity().getDiscriminatorColumn().getLength());
- }
-
- public void testGetDefaultLength() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, javaEntity().getDiscriminatorColumn().getDefaultLength());
- javaEntity().getDiscriminatorColumn().setSpecifiedLength(Integer.valueOf(55));
-
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, javaEntity().getDiscriminatorColumn().getDefaultLength());
- }
-
- public void testGetSpecifiedLength() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(javaEntity().getDiscriminatorColumn().getSpecifiedLength());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- DiscriminatorColumnAnnotation discriminatorColumn = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN);
- discriminatorColumn.setLength(Integer.valueOf(66));
-
- assertEquals(Integer.valueOf(66), javaEntity().getDiscriminatorColumn().getSpecifiedLength());
- assertEquals(Integer.valueOf(66), javaEntity().getDiscriminatorColumn().getLength());
- discriminatorColumn.setName(null);
- discriminatorColumn.setLength(null);
-
- assertNull(typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN));
- assertNull(javaEntity().getDiscriminatorColumn().getSpecifiedLength());
- }
-
- public void testSetSpecifiedLength() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(javaEntity().getDiscriminatorColumn().getSpecifiedLength());
-
- javaEntity().getDiscriminatorColumn().setSpecifiedLength(Integer.valueOf(100));
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- DiscriminatorColumnAnnotation discriminatorColumn = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertEquals(Integer.valueOf(100), discriminatorColumn.getLength());
-
- javaEntity().getDiscriminatorColumn().setSpecifiedName(null);
- javaEntity().getDiscriminatorColumn().setSpecifiedLength(null);
- assertNull(typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN));
- }
-
- public void testGetLengthUpdatesFromResourceChange() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(javaEntity().getDiscriminatorColumn().getSpecifiedLength());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) typeResource.addSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- column.setLength(Integer.valueOf(78));
- assertEquals(Integer.valueOf(78), javaEntity().getDiscriminatorColumn().getSpecifiedLength());
- assertEquals(Integer.valueOf(78), javaEntity().getDiscriminatorColumn().getLength());
-
- column.setLength(null);
- assertNull(javaEntity().getDiscriminatorColumn().getSpecifiedLength());
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, javaEntity().getDiscriminatorColumn().getLength());
- }
-
-
- public void testGetColumnDefinition() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(javaEntity().getDiscriminatorColumn().getColumnDefinition());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN);
- column.setColumnDefinition(COLUMN_DEFINITION);
-
- assertEquals(COLUMN_DEFINITION, javaEntity().getDiscriminatorColumn().getColumnDefinition());
-
- column.setColumnDefinition(null);
-
- assertNull(javaEntity().getDiscriminatorColumn().getColumnDefinition());
-
- typeResource.removeSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN);
- }
-
- public void testSetColumnDefinition() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- javaEntity().getDiscriminatorColumn().setColumnDefinition("foo");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertEquals("foo", column.getColumnDefinition());
-
- javaEntity().getDiscriminatorColumn().setColumnDefinition(null);
- column = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN);
- assertNull(column.getColumnDefinition());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEmbeddableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEmbeddableTests.java
deleted file mode 100644
index cf42052cfb..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEmbeddableTests.java
+++ /dev/null
@@ -1,177 +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.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.Embeddable;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.MappedSuperclass;
-import org.eclipse.jpt.core.internal.context.java.JavaNullTypeMapping;
-import org.eclipse.jpt.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JavaEmbeddableTests extends ContextModelTestCase
-{
-
- private ICompilationUnit createTestEmbeddable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Embeddable");
- }
- });
- }
-
-
- public JavaEmbeddableTests(String name) {
- super(name);
- }
-
- public void testMorphToEntity() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- javaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
- assertTrue(javaPersistentType().getMapping() instanceof Entity);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- assertNull(typeResource.getMappingAnnotation(EmbeddableAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToMappedSuperclass() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- javaPersistentType().setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
- assertTrue(javaPersistentType().getMapping() instanceof MappedSuperclass);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- assertNull(typeResource.getMappingAnnotation(EmbeddableAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToNull() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- javaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertTrue(javaPersistentType().getMapping() instanceof JavaNullTypeMapping);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- assertNull(typeResource.getMappingAnnotation(EmbeddableAnnotation.ANNOTATION_NAME));
- }
-
- public void testEmbeddable() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertTrue(javaPersistentType().getMapping() instanceof Embeddable);
- }
-
- public void testOverridableAttributeNames() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) javaPersistentType().getMapping();
- Iterator<String> overridableAttributeNames = embeddable.overridableAttributeNames();
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testOverridableAssociationNames() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) javaPersistentType().getMapping();
- Iterator<String> overridableAssociationNames = embeddable.overridableAssociationNames();
- assertFalse(overridableAssociationNames.hasNext());
- }
-
- public void testTableNameIsInvalid() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) javaPersistentType().getMapping();
-
- assertFalse(embeddable.tableNameIsInvalid(FULLY_QUALIFIED_TYPE_NAME));
- assertFalse(embeddable.tableNameIsInvalid("FOO"));
- }
-
- public void testAttributeMappingKeyAllowed() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) javaPersistentType().getMapping();
- assertTrue(embeddable.attributeMappingKeyAllowed(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY));
- assertTrue(embeddable.attributeMappingKeyAllowed(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY));
- assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY));
- assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY));
- assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY));
- assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY));
- assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- }
-
-
- public void testAssociatedTables() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) javaPersistentType().getMapping();
-
- assertFalse(embeddable.associatedTables().hasNext());
- }
-
- public void testAssociatedTablesIncludingInherited() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) javaPersistentType().getMapping();
-
- assertFalse(embeddable.associatedTablesIncludingInherited().hasNext());
- }
-
- public void testAssociatedTableNamesIncludingInherited() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) javaPersistentType().getMapping();
-
- assertFalse(embeddable.associatedTableNamesIncludingInherited().hasNext());
- }
-
- public void testAllOverridableAttributeNames() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) javaPersistentType().getMapping();
- Iterator<String> overridableAttributeNames = embeddable.overridableAttributeNames();
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- //TODO need to create a subclass mappedSuperclass and test this
- public void testAllOverridableAssociationNames() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) javaPersistentType().getMapping();
- Iterator<String> overridableAssociationNames = embeddable.overridableAssociationNames();
- assertFalse(overridableAssociationNames.hasNext());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEmbeddedIdMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEmbeddedIdMappingTests.java
deleted file mode 100644
index 3e4013ef1c..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEmbeddedIdMappingTests.java
+++ /dev/null
@@ -1,590 +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.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.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.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.OneToOneMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.TransientMapping;
-import org.eclipse.jpt.core.context.VersionMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaNullAttributeMapping;
-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.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.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class JavaEmbeddedIdMappingTests extends ContextModelTestCase
-{
-
- public static final String EMBEDDABLE_TYPE_NAME = "MyEmbeddable";
- public static final String FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME = PACKAGE_NAME + "." + EMBEDDABLE_TYPE_NAME;
-
- private ICompilationUnit createTestEntityWithEmbeddedIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDED_ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@EmbeddedId").append(CR);
- sb.append(CR);
- sb.append(" private " + EMBEDDABLE_TYPE_NAME +" myEmbeddedId;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private void createEmbeddableType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append(EMBEDDABLE_TYPE_NAME).append(" {");
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" ");
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, EMBEDDABLE_TYPE_NAME + ".java", sourceWriter);
- }
-
-
- public JavaEmbeddedIdMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(((EmbeddedMapping) persistentAttribute.getMapping()).attributeOverrides().hasNext());
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- assertNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testDefaultEmbeddedIdMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof GenericJavaNullAttributeMapping);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
-
- assertNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- assertNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
-
- assertNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
-
- assertNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
- assertNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
- assertNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
- assertNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
- assertNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testSpecifiedAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) javaPersistentType().getAttributeNamed("myEmbeddedId").getMapping();
-
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = embeddedIdMapping.specifiedAttributeOverrides();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourcePersistentType typeResource = jpaProject().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.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- specifiedAttributeOverrides = embeddedIdMapping.specifiedAttributeOverrides();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addSupportingAnnotation(1, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAR");
- specifiedAttributeOverrides = embeddedIdMapping.specifiedAttributeOverrides();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAZ");
- specifiedAttributeOverrides = embeddedIdMapping.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.moveSupportingAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDES);
- specifiedAttributeOverrides = embeddedIdMapping.specifiedAttributeOverrides();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeResource.removeSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- specifiedAttributeOverrides = embeddedIdMapping.specifiedAttributeOverrides();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeResource.removeSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- specifiedAttributeOverrides = embeddedIdMapping.specifiedAttributeOverrides();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeResource.removeSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- specifiedAttributeOverrides = embeddedIdMapping.specifiedAttributeOverrides();
- assertFalse(specifiedAttributeOverrides.hasNext());
- }
-
- public void testDefaultAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) javaPersistentType().getAttributeNamed("myEmbeddedId").getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertEquals("myEmbeddedId", attributeResource.getName());
- assertNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(AttributeOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, embeddedIdMapping.virtualAttributeOverridesSize());
- AttributeOverride defaultAttributeOverride = embeddedIdMapping.virtualAttributeOverrides().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME, defaultAttributeOverride.getColumn().getTable());
-
-
- ListIterator<ClassRef> classRefs = persistenceUnit().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");
-
- assertEquals(2, embeddedIdMapping.virtualAttributeOverridesSize());
- defaultAttributeOverride = embeddedIdMapping.virtualAttributeOverrides().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("FOO", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR", defaultAttributeOverride.getColumn().getTable());
-
- cityMapping.getColumn().setSpecifiedName(null);
- cityMapping.getColumn().setSpecifiedTable(null);
- defaultAttributeOverride = embeddedIdMapping.virtualAttributeOverrides().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME, defaultAttributeOverride.getColumn().getTable());
-
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- annotation.setName("city");
- assertEquals(1, embeddedIdMapping.virtualAttributeOverridesSize());
- }
-
- public void testSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) javaPersistentType().getAttributeNamed("myEmbeddedId").getMapping();
- assertEquals(0, embeddedIdMapping.specifiedAttributeOverridesSize());
-
- JavaResourcePersistentType typeResource = jpaProject().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.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAR");
-
- assertEquals(2, embeddedIdMapping.specifiedAttributeOverridesSize());
- }
-
- public void testAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) javaPersistentType().getAttributeNamed("myEmbeddedId").getMapping();
- assertEquals(2, embeddedIdMapping.attributeOverridesSize());
-
- JavaResourcePersistentType typeResource = jpaProject().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.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAR");
-
- assertEquals(4, embeddedIdMapping.attributeOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("city");
- assertEquals(4, embeddedIdMapping.attributeOverridesSize());
- }
-
- public void testVirtualAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) javaPersistentType().getAttributeNamed("myEmbeddedId").getMapping();
- assertEquals(2, embeddedIdMapping.virtualAttributeOverridesSize());
-
- JavaResourcePersistentType typeResource = jpaProject().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.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
-
- assertEquals(2, embeddedIdMapping.virtualAttributeOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("city");
- assertEquals(1, embeddedIdMapping.virtualAttributeOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("state");
- assertEquals(0, embeddedIdMapping.virtualAttributeOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) javaPersistentType().getAttributeNamed("myEmbeddedId").getMapping();
- embeddedIdMapping.virtualAttributeOverrides().next().setVirtual(false);
- embeddedIdMapping.virtualAttributeOverrides().next().setVirtual(false);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- Iterator<NestableAnnotation> attributeOverrides = attributeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedIdMapping.specifiedAttributeOverrides().next().setVirtual(true);
- attributeOverrides = attributeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- assertEquals("city", embeddedIdMapping.virtualAttributeOverrides().next().getName());
- assertEquals(1, embeddedIdMapping.virtualAttributeOverridesSize());
-
- embeddedIdMapping.specifiedAttributeOverrides().next().setVirtual(true);
- attributeOverrides = attributeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- assertFalse(attributeOverrides.hasNext());
-
- Iterator<AttributeOverride> virtualAttributeOverrides = embeddedIdMapping.virtualAttributeOverrides();
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state", virtualAttributeOverrides.next().getName());
- assertEquals(2, embeddedIdMapping.virtualAttributeOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual2() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) javaPersistentType().getAttributeNamed("myEmbeddedId").getMapping();
- ListIterator<AttributeOverride> virtualAttributeOverrides = embeddedIdMapping.virtualAttributeOverrides();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().setVirtual(false);
- embeddedIdMapping.virtualAttributeOverrides().next().setVirtual(false);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- Iterator<NestableAnnotation> attributeOverrides = attributeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) javaPersistentType().getAttributeNamed("myEmbeddedId").getMapping();
- embeddedIdMapping.virtualAttributeOverrides().next().setVirtual(false);
- embeddedIdMapping.virtualAttributeOverrides().next().setVirtual(false);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- attributeResource.moveSupportingAnnotation(1, 0, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- Iterator<NestableAnnotation> attributeOverrides = attributeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEmbeddedMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEmbeddedMappingTests.java
deleted file mode 100644
index dda4c2e03a..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEmbeddedMappingTests.java
+++ /dev/null
@@ -1,640 +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.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.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.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.OneToOneMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.TransientMapping;
-import org.eclipse.jpt.core.context.VersionMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaNullAttributeMapping;
-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.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.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class JavaEmbeddedMappingTests extends ContextModelTestCase
-{
-
- public static final String EMBEDDABLE_TYPE_NAME = "MyEmbeddable";
- public static final String FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME = PACKAGE_NAME + "." + EMBEDDABLE_TYPE_NAME;
-
- private ICompilationUnit createTestEntityWithEmbeddedMapping() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDED);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Embedded").append(CR);
- sb.append(" private " + EMBEDDABLE_TYPE_NAME + " myEmbedded;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private void createEmbeddableType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append(EMBEDDABLE_TYPE_NAME).append(" {");
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" ");
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, EMBEDDABLE_TYPE_NAME + ".java", sourceWriter);
- }
-
-
- public JavaEmbeddedMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(((EmbeddedMapping) persistentAttribute.getMapping()).attributeOverrides().hasNext());
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- assertNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testDefaultEmbeddedMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof GenericJavaNullAttributeMapping);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- public void testDefaultEmbeddedMappingGenericEmbeddable() throws Exception {
- createTestEntityWithDefaultEmbeddedMapping();
- createTestGenericEmbeddable();
- addXmlClassRef(PACKAGE_NAME + ".Entity1");
- addXmlClassRef(PACKAGE_NAME + ".Embeddable1");
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- assertNull(persistentAttribute.getSpecifiedMapping());
- assertNotNull(persistentAttribute.getMapping());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- private void createTestEntityWithDefaultEmbeddedMapping() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Entity1 { ").append(CR);
- sb.append("private Embeddable1<Integer> myEmbeddable;").append(CR);
- sb.append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Entity1.java", sourceWriter);
- }
-
- private void createTestGenericEmbeddable() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class Embeddable1<T> {}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Embeddable1.java", sourceWriter);
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
-
- assertNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- assertNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
-
- assertNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
-
- assertNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
- assertNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
- assertNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
- assertNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
- assertNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testSpecifiedAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) javaPersistentType().getAttributeNamed("myEmbedded").getMapping();
-
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = embeddedMapping.specifiedAttributeOverrides();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourcePersistentType typeResource = jpaProject().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.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- specifiedAttributeOverrides = embeddedMapping.specifiedAttributeOverrides();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addSupportingAnnotation(1, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAR");
- specifiedAttributeOverrides = embeddedMapping.specifiedAttributeOverrides();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAZ");
- specifiedAttributeOverrides = embeddedMapping.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.moveSupportingAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDES);
- specifiedAttributeOverrides = embeddedMapping.specifiedAttributeOverrides();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeResource.removeSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- specifiedAttributeOverrides = embeddedMapping.specifiedAttributeOverrides();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeResource.removeSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- specifiedAttributeOverrides = embeddedMapping.specifiedAttributeOverrides();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeResource.removeSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- specifiedAttributeOverrides = embeddedMapping.specifiedAttributeOverrides();
- assertFalse(specifiedAttributeOverrides.hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) javaPersistentType().getAttributeNamed("myEmbedded").getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertEquals("myEmbedded", attributeResource.getName());
- assertNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(AttributeOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, embeddedMapping.virtualAttributeOverridesSize());
- AttributeOverride defaultAttributeOverride = embeddedMapping.virtualAttributeOverrides().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME, defaultAttributeOverride.getColumn().getTable());
-
-
- ListIterator<ClassRef> classRefs = persistenceUnit().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");
-
- assertEquals("myEmbedded", attributeResource.getName());
- assertNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(AttributeOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, embeddedMapping.virtualAttributeOverridesSize());
- defaultAttributeOverride = embeddedMapping.virtualAttributeOverrides().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("FOO", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR", defaultAttributeOverride.getColumn().getTable());
-
- cityMapping.getColumn().setSpecifiedName(null);
- cityMapping.getColumn().setSpecifiedTable(null);
- defaultAttributeOverride = embeddedMapping.virtualAttributeOverrides().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME, defaultAttributeOverride.getColumn().getTable());
-
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- annotation.setName("city");
- assertEquals(1, embeddedMapping.virtualAttributeOverridesSize());
- }
-
- public void testSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) javaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- assertEquals(0, embeddedMapping.specifiedAttributeOverridesSize());
-
- JavaResourcePersistentType typeResource = jpaProject().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.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAR");
-
- assertEquals(2, embeddedMapping.specifiedAttributeOverridesSize());
- }
-
- public void testAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) javaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- assertEquals(2, embeddedMapping.attributeOverridesSize());
-
- JavaResourcePersistentType typeResource = jpaProject().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.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAR");
-
- assertEquals(4, embeddedMapping.attributeOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("city");
- assertEquals(4, embeddedMapping.attributeOverridesSize());
- }
-
- public void testVirtualAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) javaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- assertEquals(2, embeddedMapping.virtualAttributeOverridesSize());
-
- JavaResourcePersistentType typeResource = jpaProject().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.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
-
- assertEquals(2, embeddedMapping.virtualAttributeOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("city");
- assertEquals(1, embeddedMapping.virtualAttributeOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("state");
- assertEquals(0, embeddedMapping.virtualAttributeOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) javaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- embeddedMapping.virtualAttributeOverrides().next().setVirtual(false);
- embeddedMapping.virtualAttributeOverrides().next().setVirtual(false);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- Iterator<NestableAnnotation> attributeOverrides = attributeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedMapping.specifiedAttributeOverrides().next().setVirtual(true);
- attributeOverrides = attributeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- assertEquals("city", embeddedMapping.virtualAttributeOverrides().next().getName());
- assertEquals(1, embeddedMapping.virtualAttributeOverridesSize());
-
- embeddedMapping.specifiedAttributeOverrides().next().setVirtual(true);
- attributeOverrides = attributeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- assertFalse(attributeOverrides.hasNext());
-
- Iterator<AttributeOverride> virtualAttributeOverrides = embeddedMapping.virtualAttributeOverrides();
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state", virtualAttributeOverrides.next().getName());
- assertEquals(2, embeddedMapping.virtualAttributeOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual2() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) javaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- ListIterator<AttributeOverride> virtualAttributeOverrides = embeddedMapping.virtualAttributeOverrides();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().setVirtual(false);
- embeddedMapping.virtualAttributeOverrides().next().setVirtual(false);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- Iterator<NestableAnnotation> attributeOverrides = attributeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) javaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- embeddedMapping.virtualAttributeOverrides().next().setVirtual(false);
- embeddedMapping.virtualAttributeOverrides().next().setVirtual(false);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- attributeResource.moveSupportingAnnotation(1, 0, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- Iterator<NestableAnnotation> attributeOverrides = attributeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEntityTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEntityTests.java
deleted file mode 100644
index b722263495..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEntityTests.java
+++ /dev/null
@@ -1,2880 +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.tests.internal.context.java;
-
-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.AccessType;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.DiscriminatorType;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.core.context.InheritanceType;
-import org.eclipse.jpt.core.context.MappedSuperclass;
-import org.eclipse.jpt.core.context.NamedNativeQuery;
-import org.eclipse.jpt.core.context.NamedQuery;
-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.SecondaryTable;
-import org.eclipse.jpt.core.context.Table;
-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.java.JavaIdMapping;
-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.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.internal.context.java.JavaNullTypeMapping;
-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.DiscriminatorColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.DiscriminatorValueAnnotation;
-import org.eclipse.jpt.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.core.resource.java.IdClassAnnotation;
-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.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.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.resource.java.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.core.resource.java.TableAnnotation;
-import org.eclipse.jpt.core.resource.java.TableGeneratorAnnotation;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class JavaEntityTests extends ContextModelTestCase
-{
- private static final String ENTITY_NAME = "entityName";
- private static final String TABLE_NAME = "MY_TABLE";
- private static final String DISCRIMINATOR_VALUE = "MY_DISCRIMINATOR_VALUE";
- protected static final String SUB_TYPE_NAME = "AnnotationTestTypeChild";
- protected static final String FULLY_QUALIFIED_SUB_TYPE_NAME = PACKAGE_NAME + "." + SUB_TYPE_NAME;
-
-
- public JavaEntityTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private void createTestAbstractEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public abstract class ").append(TYPE_NAME).append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, FILE_NAME, sourceWriter);
- }
-
- private ICompilationUnit createTestEntityAnnotationOnProperty() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.ONE_TO_ONE);
- }
- @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(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address2;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity(name=\"" + ENTITY_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Table(name=\"" + TABLE_NAME + "\")");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithInheritance() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.INHERITANCE, JPA.INHERITANCE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithDiscriminatorValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.DISCRIMINATOR_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@DiscriminatorValue(value=\"" + DISCRIMINATOR_VALUE + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithSecondaryTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@SecondaryTable(name=\"foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithSecondaryTables() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@SecondaryTables({@SecondaryTable(name=\"foo\"), @SecondaryTable(name=\"bar\")})");
- }
- });
- }
-
- public void testMorphToMappedSuperclass() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = (Entity) javaPersistentType().getMapping();
- entity.getTable().setSpecifiedName("FOO");
- entity.addSpecifiedSecondaryTable(0);
- entity.addSpecifiedPrimaryKeyJoinColumn(0);
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- typeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- typeResource.addSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- entity.setSpecifiedDiscriminatorValue("asdf");
- entity.getDiscriminatorColumn().setSpecifiedName("BAR");
- entity.addTableGenerator();
- entity.addSequenceGenerator();
- entity.setIdClass("myIdClass");
- entity.addNamedNativeQuery(0);
- entity.addNamedQuery(0);
-
- javaPersistentType().setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
- assertTrue(javaPersistentType().getMapping() instanceof MappedSuperclass);
-
- assertNull(typeResource.getMappingAnnotation(EntityAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(TableAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(SecondaryTableAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(AssociationOverrideAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(InheritanceAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(DiscriminatorColumnAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNotNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = (Entity) javaPersistentType().getMapping();
- entity.getTable().setSpecifiedName("FOO");
- entity.addSpecifiedSecondaryTable(0);
- entity.addSpecifiedPrimaryKeyJoinColumn(0);
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- typeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- typeResource.addSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- entity.setSpecifiedDiscriminatorValue("asdf");
- entity.getDiscriminatorColumn().setSpecifiedName("BAR");
- entity.addTableGenerator();
- entity.addSequenceGenerator();
- entity.setIdClass("myIdClass");
- entity.addNamedNativeQuery(0);
- entity.addNamedQuery(0);
-
- javaPersistentType().setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
- assertTrue(javaPersistentType().getMapping() instanceof Embeddable);
-
- assertNull(typeResource.getMappingAnnotation(EntityAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(TableAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(SecondaryTableAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(AssociationOverrideAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(InheritanceAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(DiscriminatorColumnAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = (Entity) javaPersistentType().getMapping();
- entity.getTable().setSpecifiedName("FOO");
- entity.addSpecifiedSecondaryTable(0);
- entity.addSpecifiedPrimaryKeyJoinColumn(0);
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- typeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- typeResource.addSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- entity.setSpecifiedDiscriminatorValue("asdf");
- entity.getDiscriminatorColumn().setSpecifiedName("BAR");
- entity.addTableGenerator();
- entity.addSequenceGenerator();
- entity.setIdClass("myIdClass");
- entity.addNamedNativeQuery(0);
- entity.addNamedQuery(0);
-
- javaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertTrue(javaPersistentType().getMapping() instanceof JavaNullTypeMapping);
-
- assertNull(typeResource.getMappingAnnotation(EntityAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(TableAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(SecondaryTableAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(AssociationOverrideAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(InheritanceAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(DiscriminatorColumnAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME));
- }
-
- public void testAccessNoAnnotations() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(AccessType.FIELD, javaPersistentType().getAccess());
- }
-
- public void testAccessAnnotationsOnParent() throws Exception {
- createTestEntityAnnotationOnProperty();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
-
- JavaPersistentType childPersistentType = javaPersistentType();
- PersistentType parentPersistentType = childPersistentType.getParentPersistentType();
-
- assertEquals(AccessType.PROPERTY, parentPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, childPersistentType.getAccess());
-
- ((IdMapping) parentPersistentType.getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName("FOO");
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- typeResource.persistableProperties().next().setMappingAnnotation(null);
- //no mapping(Id) annotation, but still a Column annotation, so access should still be property
- assertEquals(AccessType.PROPERTY, parentPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, childPersistentType.getAccess());
-
- ((BasicMapping) parentPersistentType.getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName(null);
- assertEquals(AccessType.FIELD, parentPersistentType.getAccess());
- assertEquals(AccessType.FIELD, childPersistentType.getAccess());
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, parentPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, childPersistentType.getAccess());
-
- entityMappings().setSpecifiedAccess(AccessType.FIELD);
- //still accessType of PROPERTY because the java class is not specified in this orm.xml
- assertEquals(AccessType.PROPERTY, parentPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, childPersistentType.getAccess());
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- removeXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- //only parent specified in orm.xml, i think this outcome is right??
- assertEquals(AccessType.FIELD, ormPersistentType.getJavaPersistentType().getAccess());
- assertEquals(AccessType.FIELD, childPersistentType.getAccess());
-
- OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- removeXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- //both parent and child specified in orm.xml
- assertEquals(AccessType.FIELD, ormPersistentType.getJavaPersistentType().getAccess());
- assertEquals(AccessType.FIELD, childOrmPersistentType.getJavaPersistentType().getAccess());
- }
-
- public void testAccessWithXmlSettings() throws Exception {
- createTestEntityAnnotationOnProperty();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
-
- assertEquals(AccessType.PROPERTY, javaPersistentType().getAccess());
-
- ((IdMapping) javaPersistentType().getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName("FOO");
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- typeResource.persistableProperties().next().setMappingAnnotation(null);
- //no mapping(Id) annotation, but still a Column annotation, so access should still be property
- assertEquals(AccessType.PROPERTY, javaPersistentType().getAccess());
-
- ((BasicMapping) javaPersistentType().getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName(null);
- assertEquals(AccessType.FIELD, javaPersistentType().getAccess());
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, javaPersistentType().getAccess());
-
- entityMappings().setSpecifiedAccess(AccessType.FIELD);
- //still accessType of PROPERTY because the java class is not specified in this orm.xml
- assertEquals(AccessType.PROPERTY, javaPersistentType().getAccess());
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- //now class is specified in orm.xml, so entityMappings access setting wins over persistence-unit-defaults
- assertEquals(AccessType.FIELD, ormPersistentType.getJavaPersistentType().getAccess());
-
- ((OrmEntity) ormPersistentType.getMapping()).setSpecifiedAccess(AccessType.PROPERTY);
-
- //accessType should be PROPERTY now, java gets the access from xml entity if it is specified
- assertEquals(AccessType.PROPERTY, ormPersistentType.getJavaPersistentType().getAccess());
- }
-
- public void testGetSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(javaEntity().getSpecifiedName());
- }
-
- public void testGetSpecifiedName() throws Exception {
- createTestEntityWithName();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(ENTITY_NAME, javaEntity().getSpecifiedName());
- }
-
- public void testGetDefaultNameSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TYPE_NAME, javaEntity().getDefaultName());
- }
-
- public void testGetDefaultName() throws Exception {
- createTestEntityWithName();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TYPE_NAME, javaEntity().getDefaultName());
- }
-
- public void testGetNameSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TYPE_NAME, javaEntity().getName());
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithName();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(ENTITY_NAME, javaEntity().getName());
- }
-
- public void testSetSpecifiedName() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- javaEntity().setSpecifiedName("foo");
-
- assertEquals("foo", javaEntity().getSpecifiedName());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals("foo", ((EntityAnnotation) typeResource.getMappingAnnotation()).getName());
- }
-
- public void testSetSpecifiedNameNull() throws Exception {
- createTestEntityWithName();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- javaEntity().setSpecifiedName(null);
-
- assertNull(javaEntity().getSpecifiedName());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(((EntityAnnotation) typeResource.getMappingAnnotation()).getName());
- }
-
- public void testUpdateFromSpecifiedNameChangeInResourceModel() throws Exception {
- createTestEntityWithName();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EntityAnnotation entity = (EntityAnnotation) typeResource.getMappingAnnotation();
- entity.setName("foo");
-
- assertEquals("foo", javaEntity().getSpecifiedName());
- }
-
- public void testGetTableName() throws Exception {
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityWithName();
-
- assertEquals(ENTITY_NAME, javaEntity().getPrimaryTableName());
- }
-
- public void testGetTableName2() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TYPE_NAME, javaEntity().getPrimaryTableName());
- }
-
- public void testGetTableName3() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TABLE_NAME, javaEntity().getPrimaryTableName());
- }
-
- public void testSetTableNameWithNullTable() throws Exception {
- ICompilationUnit cu = createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Table table = javaEntity().getTable();
- assertEquals(TYPE_NAME, table.getName());
- assertSourceDoesNotContain("@Table", cu);
-
- table.setSpecifiedName(TABLE_NAME);
- assertSourceContains("@Table(name=\"" + TABLE_NAME + "\")", cu);
-
- assertEquals(TABLE_NAME, javaEntity().getPrimaryTableName());
- assertEquals(TABLE_NAME, table.getName());
-
- table.setSpecifiedCatalog(TABLE_NAME);
- }
-
- public void testGetInheritanceStrategy() throws Exception {
- createTestEntityWithInheritance();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(InheritanceType.TABLE_PER_CLASS, javaEntity().getInheritanceStrategy());
- }
-
- public void testGetDefaultInheritanceStrategy() throws Exception {
- createTestEntity();
- createTestSubType();
-
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNotSame(javaEntity(), javaEntity().getRootEntity());
- assertEquals(InheritanceType.SINGLE_TABLE, javaEntity().getDefaultInheritanceStrategy());
-
- //change root inheritance strategy, verify default is changed for child entity
- javaEntity().getRootEntity().setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- assertEquals(InheritanceType.SINGLE_TABLE, javaEntity().getRootEntity().getDefaultInheritanceStrategy());
- assertEquals(InheritanceType.TABLE_PER_CLASS, javaEntity().getDefaultInheritanceStrategy());
- assertEquals(InheritanceType.TABLE_PER_CLASS, javaEntity().getInheritanceStrategy());
- assertNull(javaEntity().getSpecifiedInheritanceStrategy());
- }
-
- public void testGetSpecifiedInheritanceStrategy() throws Exception {
- createTestEntityWithInheritance();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(InheritanceType.TABLE_PER_CLASS, javaEntity().getSpecifiedInheritanceStrategy());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- InheritanceAnnotation inheritance = (InheritanceAnnotation) typeResource.getSupportingAnnotation(InheritanceAnnotation.ANNOTATION_NAME);
-
- inheritance.setStrategy(org.eclipse.jpt.core.resource.java.InheritanceType.JOINED);
-
- assertEquals(InheritanceType.JOINED, javaEntity().getSpecifiedInheritanceStrategy());
-
- inheritance.setStrategy(null);
-
- assertNull(javaEntity().getSpecifiedInheritanceStrategy());
- }
-
- public void testSetSpecifiedInheritanceStrategy() throws Exception {
- createTestEntityWithInheritance();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(InheritanceType.TABLE_PER_CLASS, javaEntity().getSpecifiedInheritanceStrategy());
-
- javaEntity().setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
-
- assertEquals(InheritanceType.JOINED, javaEntity().getSpecifiedInheritanceStrategy());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- InheritanceAnnotation inheritance = (InheritanceAnnotation) typeResource.getSupportingAnnotation(InheritanceAnnotation.ANNOTATION_NAME);
- assertEquals(org.eclipse.jpt.core.resource.java.InheritanceType.JOINED, inheritance.getStrategy());
-
- }
-
- public void testGetDiscriminatorValue() throws Exception {
- createTestEntityWithDiscriminatorValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(DISCRIMINATOR_VALUE, javaEntity().getDiscriminatorValue());
- }
-
- public void testGetDefaultDiscriminatorValue() throws Exception {
- createTestEntityWithDiscriminatorValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(javaEntity().getName(), javaEntity().getDefaultDiscriminatorValue());
-
- javaEntity().getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.INTEGER);
- assertNull(javaEntity().getDefaultDiscriminatorValue());
- }
-
- public void testGetSpecifiedDiscriminatorValue() throws Exception {
- createTestEntityWithDiscriminatorValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(DISCRIMINATOR_VALUE, javaEntity().getSpecifiedDiscriminatorValue());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- DiscriminatorValueAnnotation discriminatorValue = (DiscriminatorValueAnnotation) typeResource.getSupportingAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME);
-
- discriminatorValue.setValue("foo");
-
- assertEquals("foo", javaEntity().getSpecifiedDiscriminatorValue());
-
- discriminatorValue.setValue(null);
-
- assertNull(javaEntity().getSpecifiedDiscriminatorValue());
- assertNull(typeResource.getSupportingAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testSetSpecifiedDiscriminatorValue() throws Exception {
- createTestEntityWithDiscriminatorValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(DISCRIMINATOR_VALUE, javaEntity().getSpecifiedDiscriminatorValue());
-
- javaEntity().setSpecifiedDiscriminatorValue("foo");
-
- assertEquals("foo", javaEntity().getSpecifiedDiscriminatorValue());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- DiscriminatorValueAnnotation discriminatorValue = (DiscriminatorValueAnnotation) typeResource.getSupportingAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME);
- assertEquals("foo", discriminatorValue.getValue());
- }
-
- public void testSecondaryTables() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<JavaSecondaryTable> secondaryTables = javaEntity().secondaryTables();
-
- assertTrue(secondaryTables.hasNext());
- assertEquals("foo", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
- }
-
- public void testSecondaryTablesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(0, entity.secondaryTablesSize());
-
- ((SecondaryTableAnnotation) typeResource.addSupportingAnnotation(0, SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((SecondaryTableAnnotation) typeResource.addSupportingAnnotation(1, SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((SecondaryTableAnnotation) typeResource.addSupportingAnnotation(2, SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME)).setName("BAZ");
-
- assertEquals(3, entity.secondaryTablesSize());
- }
-
- public void testSpecifiedSecondaryTables() throws Exception {
- createTestEntityWithSecondaryTables();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<JavaSecondaryTable> specifiedSecondaryTables = javaEntity().specifiedSecondaryTables();
-
- assertTrue(specifiedSecondaryTables.hasNext());
- assertEquals("foo", specifiedSecondaryTables.next().getName());
- assertEquals("bar", specifiedSecondaryTables.next().getName());
- assertFalse(specifiedSecondaryTables.hasNext());
- }
-
- public void testSpecifiedSecondaryTablesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(0, entity.specifiedSecondaryTablesSize());
-
- ((SecondaryTableAnnotation) typeResource.addSupportingAnnotation(0, SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((SecondaryTableAnnotation) typeResource.addSupportingAnnotation(1, SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((SecondaryTableAnnotation) typeResource.addSupportingAnnotation(2, SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME)).setName("BAZ");
-
- assertEquals(3, entity.specifiedSecondaryTablesSize());
- }
-
- public void testAddSpecifiedSecondaryTable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- javaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("FOO");
- javaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("BAR");
- javaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- Iterator<NestableAnnotation> secondaryTables = typeResource.supportingAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME);
-
- assertEquals("BAZ", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
- assertEquals("BAR", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
- assertEquals("FOO", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
- assertFalse(secondaryTables.hasNext());
- }
-
- public void testAddSpecifiedSecondaryTable2() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- javaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("FOO");
- javaEntity().addSpecifiedSecondaryTable(1).setSpecifiedName("BAR");
- javaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- Iterator<NestableAnnotation> secondaryTables = typeResource.supportingAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME);
-
- assertEquals("BAZ", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
- assertEquals("FOO", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
- assertEquals("BAR", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
- assertFalse(secondaryTables.hasNext());
- }
-
- public void testAddSpecifiedSecondaryTablePreservePkJoinColumns() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable specifiedSecondaryTable = javaEntity().addSpecifiedSecondaryTable(0);
- specifiedSecondaryTable.setSpecifiedName("FOO");
- specifiedSecondaryTable.setSpecifiedCatalog("CATALOG");
- specifiedSecondaryTable.setSpecifiedSchema("SCHEMA");
- specifiedSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("PK_NAME");
-
- //add another specified secondary table, pkJoinColumns from first should be saved.
- SecondaryTable specifiedSecondaryTable2 = javaEntity().addSpecifiedSecondaryTable(1);
- specifiedSecondaryTable2.setSpecifiedName("BAR");
-
-
- Iterator<SecondaryTable> secondaryTables = javaEntity().secondaryTables();
- SecondaryTable secondaryTable = secondaryTables.next();
- assertEquals(secondaryTable, specifiedSecondaryTable);
- assertEquals("FOO", secondaryTable.getName());
- assertEquals("CATALOG", secondaryTable.getCatalog());
- assertEquals("SCHEMA", secondaryTable.getSchema());
- assertEquals(1, secondaryTable.specifiedPrimaryKeyJoinColumnsSize());
- PrimaryKeyJoinColumn pkJoinColumn = secondaryTable.specifiedPrimaryKeyJoinColumns().next();
- assertEquals("PK_NAME", pkJoinColumn.getName());
-
- secondaryTable = secondaryTables.next();
- assertEquals(secondaryTable, specifiedSecondaryTable2);
- assertEquals("BAR", secondaryTable.getName());
- assertEquals(0, secondaryTable.specifiedPrimaryKeyJoinColumnsSize());
-
- }
-
- public void testRemoveSpecifiedSecondaryTable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- javaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("FOO");
- javaEntity().addSpecifiedSecondaryTable(1).setSpecifiedName("BAR");
- javaEntity().addSpecifiedSecondaryTable(2).setSpecifiedName("BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(3, CollectionTools.size(typeResource.supportingAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME)));
-
- javaEntity().removeSpecifiedSecondaryTable(1);
-
- Iterator<NestableAnnotation> secondaryTableResources = typeResource.supportingAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME);
- assertEquals("FOO", ((SecondaryTableAnnotation) secondaryTableResources.next()).getName());
- assertEquals("BAZ", ((SecondaryTableAnnotation) secondaryTableResources.next()).getName());
- assertFalse(secondaryTableResources.hasNext());
-
- Iterator<SecondaryTable> secondaryTables = javaEntity().secondaryTables();
- assertEquals("FOO", secondaryTables.next().getName());
- assertEquals("BAZ", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
-
- javaEntity().removeSpecifiedSecondaryTable(1);
- secondaryTableResources = typeResource.supportingAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME);
- assertEquals("FOO", ((SecondaryTableAnnotation) secondaryTableResources.next()).getName());
- assertFalse(secondaryTableResources.hasNext());
-
- secondaryTables = javaEntity().secondaryTables();
- assertEquals("FOO", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
-
- javaEntity().removeSpecifiedSecondaryTable(0);
- secondaryTableResources = typeResource.supportingAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME);
- assertFalse(secondaryTableResources.hasNext());
- secondaryTables = javaEntity().secondaryTables();
- assertFalse(secondaryTables.hasNext());
-
- assertNull(typeResource.getSupportingAnnotation(SecondaryTablesAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedSecondaryTable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- entity.addSpecifiedSecondaryTable(0).setSpecifiedName("FOO");
- entity.addSpecifiedSecondaryTable(1).setSpecifiedName("BAR");
- entity.addSpecifiedSecondaryTable(2).setSpecifiedName("BAZ");
-
- ListIterator<NestableAnnotation> javaSecondaryTables = typeResource.supportingAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME);
- assertEquals(3, CollectionTools.size(javaSecondaryTables));
-
-
- entity.moveSpecifiedSecondaryTable(2, 0);
- ListIterator<SecondaryTable> secondaryTables = entity.specifiedSecondaryTables();
- assertEquals("BAR", secondaryTables.next().getSpecifiedName());
- assertEquals("BAZ", secondaryTables.next().getSpecifiedName());
- assertEquals("FOO", secondaryTables.next().getSpecifiedName());
-
- javaSecondaryTables = typeResource.supportingAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME);
- assertEquals("BAR", ((SecondaryTableAnnotation) javaSecondaryTables.next()).getName());
- assertEquals("BAZ", ((SecondaryTableAnnotation) javaSecondaryTables.next()).getName());
- assertEquals("FOO", ((SecondaryTableAnnotation) javaSecondaryTables.next()).getName());
-
-
- entity.moveSpecifiedSecondaryTable(0, 1);
- secondaryTables = entity.specifiedSecondaryTables();
- assertEquals("BAZ", secondaryTables.next().getSpecifiedName());
- assertEquals("BAR", secondaryTables.next().getSpecifiedName());
- assertEquals("FOO", secondaryTables.next().getSpecifiedName());
-
- javaSecondaryTables = typeResource.supportingAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME);
- assertEquals("BAZ", ((SecondaryTableAnnotation) javaSecondaryTables.next()).getName());
- assertEquals("BAR", ((SecondaryTableAnnotation) javaSecondaryTables.next()).getName());
- assertEquals("FOO", ((SecondaryTableAnnotation) javaSecondaryTables.next()).getName());
- }
-
- public void testUpdateSpecifiedSecondaryTables() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- ((SecondaryTableAnnotation) typeResource.addSupportingAnnotation(0, SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((SecondaryTableAnnotation) typeResource.addSupportingAnnotation(1, SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((SecondaryTableAnnotation) typeResource.addSupportingAnnotation(2, SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME)).setName("BAZ");
-
- ListIterator<SecondaryTable> secondaryTables = entity.specifiedSecondaryTables();
- assertEquals("FOO", secondaryTables.next().getName());
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("BAZ", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- typeResource.moveSupportingAnnotation(2, 0, SecondaryTablesAnnotation.ANNOTATION_NAME);
- secondaryTables = entity.specifiedSecondaryTables();
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- typeResource.moveSupportingAnnotation(0, 1, SecondaryTablesAnnotation.ANNOTATION_NAME);
- secondaryTables = entity.specifiedSecondaryTables();
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- typeResource.removeSupportingAnnotation(1, SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME);
- secondaryTables = entity.specifiedSecondaryTables();
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- typeResource.removeSupportingAnnotation(1, SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME);
- secondaryTables = entity.specifiedSecondaryTables();
- assertEquals("BAZ", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- typeResource.removeSupportingAnnotation(0, SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME);
- secondaryTables = entity.specifiedSecondaryTables();
- assertFalse(secondaryTables.hasNext());
- }
-
- public void testAssociatedTables() throws Exception {
- createTestEntityWithSecondaryTables();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(3, CollectionTools.size(javaEntity().associatedTables()));
- Iterator<Table> associatedTables = javaEntity().associatedTables();
- Table table1 = associatedTables.next();
- SecondaryTable table2 = (SecondaryTable) associatedTables.next();
- SecondaryTable table3 = (SecondaryTable) associatedTables.next();
- assertEquals(TYPE_NAME, table1.getName());
- assertEquals("foo", table2.getName());
- assertEquals("bar", table3.getName());
- }
-
- public void testAssociatedTablesIncludingInherited() throws Exception {
- createTestEntityWithSecondaryTables();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity parentEntity = javaEntity().getRootEntity();
- assertEquals(3, CollectionTools.size(parentEntity.associatedTablesIncludingInherited()));
- Iterator<Table> associatedTables = parentEntity.associatedTablesIncludingInherited();
- Table table1 = associatedTables.next();
- SecondaryTable table2 = (SecondaryTable) associatedTables.next();
- SecondaryTable table3 = (SecondaryTable) associatedTables.next();
- assertEquals(TYPE_NAME, table1.getName());
- assertEquals("foo", table2.getName());
- assertEquals("bar", table3.getName());
-
- Entity childEntity = javaEntity();
- //TODO probably want this to be 3, since in this case the child descriptor really uses the
- //parent table because it is single table inheritance strategy. Not sure yet how to deal with this.
- assertEquals(4, CollectionTools.size(childEntity.associatedTablesIncludingInherited()));
- }
-
- public void testAssociatedTableNamesIncludingInherited() throws Exception {
- createTestEntityWithSecondaryTables();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity parentEntity = javaEntity().getRootEntity();
- assertEquals(3, CollectionTools.size(parentEntity.associatedTableNamesIncludingInherited()));
- Iterator<String> associatedTables = parentEntity.associatedTableNamesIncludingInherited();
- String table1 = associatedTables.next();
- String table2 = associatedTables.next();
- String table3 = associatedTables.next();
- assertEquals(TYPE_NAME, table1);
- assertEquals("foo", table2);
- assertEquals("bar", table3);
-
- Entity childEntity = javaEntity();
- //TODO probably want this to be 3, since in this case the child descriptor really uses the
- //parent table because it is single table inheritance strategy. Not sure yet how to deal with this.
- assertEquals(4, CollectionTools.size(childEntity.associatedTableNamesIncludingInherited()));
- }
-
- public void testAddSecondaryTableToResourceModel() throws Exception {
- createTestEntityWithName();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) typeResource.addSupportingAnnotation(0, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- secondaryTable.setName("FOO");
-
- assertEquals(1, javaEntity().secondaryTablesSize());
- assertEquals("FOO", javaEntity().secondaryTables().next().getSpecifiedName());
- assertEquals("FOO", javaEntity().secondaryTables().next().getName());
-
- SecondaryTableAnnotation secondaryTable2 = (SecondaryTableAnnotation) typeResource.addSupportingAnnotation(1, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- secondaryTable2.setName("BAR");
-
- assertEquals(2, javaEntity().secondaryTablesSize());
- ListIterator<SecondaryTable> secondaryTables = javaEntity().secondaryTables();
- assertEquals("FOO", secondaryTables.next().getSpecifiedName());
- assertEquals("BAR", secondaryTables.next().getSpecifiedName());
-
- SecondaryTableAnnotation secondaryTable3 = (SecondaryTableAnnotation) typeResource.addSupportingAnnotation(0, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- secondaryTable3.setName("BAZ");
-
- assertEquals(3, javaEntity().secondaryTablesSize());
- secondaryTables = javaEntity().secondaryTables();
- assertEquals("BAZ", secondaryTables.next().getSpecifiedName());
- assertEquals("FOO", secondaryTables.next().getSpecifiedName());
- assertEquals("BAR", secondaryTables.next().getSpecifiedName());
- }
-
- public void testRemoveSecondaryTableFromResourceModel() throws Exception {
- createTestEntityWithSecondaryTables();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- javaEntity().addSpecifiedSecondaryTable(2).setSpecifiedName("baz");
- ListIterator<SecondaryTable> secondaryTables = javaEntity().secondaryTables();
-
- assertEquals(3, javaEntity().secondaryTablesSize());
- assertEquals("foo", secondaryTables.next().getSpecifiedName());
- assertEquals("bar", secondaryTables.next().getSpecifiedName());
- assertEquals("baz", secondaryTables.next().getSpecifiedName());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- typeResource.removeSupportingAnnotation(0, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
-
- secondaryTables = javaEntity().secondaryTables();
- assertEquals(2, javaEntity().secondaryTablesSize());
- assertEquals("bar", secondaryTables.next().getSpecifiedName());
- assertEquals("baz", secondaryTables.next().getSpecifiedName());
-
- typeResource.removeSupportingAnnotation(0, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
-
- secondaryTables = javaEntity().secondaryTables();
- assertEquals(1, javaEntity().secondaryTablesSize());
- assertEquals("baz", secondaryTables.next().getSpecifiedName());
-
-
- typeResource.removeSupportingAnnotation(0, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
-
- secondaryTables = javaEntity().secondaryTables();
- assertEquals(0, javaEntity().secondaryTablesSize());
- assertFalse(secondaryTables.hasNext());
- }
-
- public void testGetSequenceGenerator() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(javaEntity().getSequenceGenerator());
- assertEquals(0, CollectionTools.size(javaEntity().getPersistenceUnit().allGenerators()));
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- typeResource.addSupportingAnnotation(JPA.SEQUENCE_GENERATOR);
-
- assertNotNull(javaEntity().getSequenceGenerator());
- assertEquals(1, typeResource.supportingAnnotationsSize());
- assertEquals(1, CollectionTools.size(javaEntity().getPersistenceUnit().allGenerators()));
-
- javaEntity().getSequenceGenerator().setName("foo");
- assertEquals(1, CollectionTools.size(javaEntity().getPersistenceUnit().allGenerators()));
- }
-
- public void testAddSequenceGenerator() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(javaEntity().getSequenceGenerator());
-
- javaEntity().addSequenceGenerator();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNotNull(typeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR));
- assertNotNull(javaEntity().getSequenceGenerator());
-
- //try adding another sequence generator, should get an IllegalStateException
- try {
- javaEntity().addSequenceGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveSequenceGenerator() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- typeResource.addSupportingAnnotation(JPA.SEQUENCE_GENERATOR);
-
- javaEntity().removeSequenceGenerator();
-
- assertNull(javaEntity().getSequenceGenerator());
- assertNull(typeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR));
-
- //try removing the sequence generator again, should get an IllegalStateException
- try {
- javaEntity().removeSequenceGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testGetTableGenerator() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(javaEntity().getTableGenerator());
- assertEquals(0, CollectionTools.size(javaEntity().getPersistenceUnit().allGenerators()));
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- typeResource.addSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- assertNotNull(javaEntity().getTableGenerator());
- assertEquals(1, typeResource.supportingAnnotationsSize());
- assertEquals(1, CollectionTools.size(javaEntity().getPersistenceUnit().allGenerators()));
-
- javaEntity().getTableGenerator().setName("foo");
- assertEquals(1, CollectionTools.size(javaEntity().getPersistenceUnit().allGenerators()));
- }
-
- public void testAddTableGenerator() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(javaEntity().getTableGenerator());
-
- javaEntity().addTableGenerator();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNotNull(typeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR));
- assertNotNull(javaEntity().getTableGenerator());
-
- //try adding another table generator, should get an IllegalStateException
- try {
- javaEntity().addTableGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveTableGenerator() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- typeResource.addSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- javaEntity().removeTableGenerator();
-
- assertNull(javaEntity().getTableGenerator());
- assertNull(typeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR));
-
- //try removing the table generator again, should get an IllegalStateException
- try {
- javaEntity().removeTableGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testGetDiscriminatorColumn() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNotNull(javaEntity().getDiscriminatorColumn());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) typeResource.addSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN);
- column.setName("foo");
-
- assertEquals("foo", javaEntity().getDiscriminatorColumn().getSpecifiedName());
-
- column.setName(null);
-
- assertNull(javaEntity().getDiscriminatorColumn().getSpecifiedName());
-
- typeResource.removeSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertNotNull(javaEntity().getDiscriminatorColumn());
- }
-
- public void testSpecifiedPrimaryKeyJoinColumns() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<JavaPrimaryKeyJoinColumn> specifiedPkJoinColumns = javaEntity().specifiedPrimaryKeyJoinColumns();
-
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- //add an annotation to the resource model and verify the context model is updated
- PrimaryKeyJoinColumnAnnotation pkJoinColumn = (PrimaryKeyJoinColumnAnnotation) typeResource.addSupportingAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- pkJoinColumn.setName("FOO");
- specifiedPkJoinColumns = javaEntity().specifiedPrimaryKeyJoinColumns();
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- pkJoinColumn = (PrimaryKeyJoinColumnAnnotation) typeResource.addSupportingAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- pkJoinColumn.setName("BAR");
- specifiedPkJoinColumns = javaEntity().specifiedPrimaryKeyJoinColumns();
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
-
- pkJoinColumn = (PrimaryKeyJoinColumnAnnotation) typeResource.addSupportingAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- pkJoinColumn.setName("BAZ");
- specifiedPkJoinColumns = javaEntity().specifiedPrimaryKeyJoinColumns();
- assertEquals("BAZ", specifiedPkJoinColumns.next().getName());
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- typeResource.moveSupportingAnnotation(1, 0, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- specifiedPkJoinColumns = javaEntity().specifiedPrimaryKeyJoinColumns();
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertEquals("BAZ", specifiedPkJoinColumns.next().getName());
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- typeResource.removeSupportingAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- specifiedPkJoinColumns = javaEntity().specifiedPrimaryKeyJoinColumns();
- assertEquals("BAZ", specifiedPkJoinColumns.next().getName());
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- typeResource.removeSupportingAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- specifiedPkJoinColumns = javaEntity().specifiedPrimaryKeyJoinColumns();
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
-
- typeResource.removeSupportingAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- specifiedPkJoinColumns = javaEntity().specifiedPrimaryKeyJoinColumns();
- assertFalse(specifiedPkJoinColumns.hasNext());
- }
-
- public void testSpecifiedPrimaryKeyJoinColumnsSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(0, javaEntity().specifiedPrimaryKeyJoinColumnsSize());
-
- javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- assertEquals(3, javaEntity().specifiedPrimaryKeyJoinColumnsSize());
- }
-
- public void testPrimaryKeyJoinColumnsSize() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- //just the default pkJoinColumn, so 1
- assertEquals(1, javaEntity().primaryKeyJoinColumnsSize());
-
- javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- //only the specified pkJoinColumns, 3
- assertEquals(3, javaEntity().primaryKeyJoinColumnsSize());
- }
-
- public void testGetDefaultPrimaryKeyJoinColumn() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNotNull(javaEntity().getDefaultPrimaryKeyJoinColumn());
-
- javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- assertNull(javaEntity().getDefaultPrimaryKeyJoinColumn());
- }
-
- public void testAddSpecifiedPrimaryKeyJoinColumn() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- Iterator<NestableAnnotation> pkJoinColumns = typeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
-
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
- assertFalse(pkJoinColumns.hasNext());
- }
-
- public void testAddSpecifiedPrimaryKeyJoinColumn2() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- javaEntity().addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- javaEntity().addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- Iterator<NestableAnnotation> pkJoinColumns = typeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
-
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
- assertFalse(pkJoinColumns.hasNext());
- }
- public void testRemoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- javaEntity().addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- javaEntity().addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(3, CollectionTools.size(typeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME)));
-
- javaEntity().removeSpecifiedPrimaryKeyJoinColumn(1);
-
- Iterator<NestableAnnotation> pkJoinColumnResources = typeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumnResources.next()).getName());
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumnResources.next()).getName());
- assertFalse(pkJoinColumnResources.hasNext());
-
- Iterator<PrimaryKeyJoinColumn> pkJoinColumns = javaEntity().specifiedPrimaryKeyJoinColumns();
- assertEquals("FOO", pkJoinColumns.next().getName());
- assertEquals("BAZ", pkJoinColumns.next().getName());
- assertFalse(pkJoinColumns.hasNext());
-
-
- javaEntity().removeSpecifiedPrimaryKeyJoinColumn(1);
- pkJoinColumnResources = typeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumnResources.next()).getName());
- assertFalse(pkJoinColumnResources.hasNext());
-
- pkJoinColumns = javaEntity().specifiedPrimaryKeyJoinColumns();
- assertEquals("FOO", pkJoinColumns.next().getName());
- assertFalse(pkJoinColumns.hasNext());
-
-
- javaEntity().removeSpecifiedPrimaryKeyJoinColumn(0);
- pkJoinColumnResources = typeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- assertFalse(pkJoinColumnResources.hasNext());
- pkJoinColumns = javaEntity().specifiedPrimaryKeyJoinColumns();
- assertFalse(pkJoinColumns.hasNext());
-
- assertNull(typeResource.getSupportingAnnotation(PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- entity.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- entity.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- entity.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- ListIterator<NestableAnnotation> javaPrimaryKeyJoinColumns = typeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- assertEquals(3, CollectionTools.size(javaPrimaryKeyJoinColumns));
-
-
- entity.moveSpecifiedPrimaryKeyJoinColumn(2, 0);
- ListIterator<PrimaryKeyJoinColumn> primaryKeyJoinColumns = entity.specifiedPrimaryKeyJoinColumns();
- assertEquals("BAR", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getSpecifiedName());
-
- javaPrimaryKeyJoinColumns = typeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) javaPrimaryKeyJoinColumns.next()).getName());
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) javaPrimaryKeyJoinColumns.next()).getName());
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) javaPrimaryKeyJoinColumns.next()).getName());
-
-
- entity.moveSpecifiedPrimaryKeyJoinColumn(0, 1);
- primaryKeyJoinColumns = entity.specifiedPrimaryKeyJoinColumns();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getSpecifiedName());
-
- javaPrimaryKeyJoinColumns = typeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) javaPrimaryKeyJoinColumns.next()).getName());
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) javaPrimaryKeyJoinColumns.next()).getName());
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) javaPrimaryKeyJoinColumns.next()).getName());
- }
-
- public void testUpdateSpecifiedPrimaryKeyJoinColumns() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- ((PrimaryKeyJoinColumnAnnotation) typeResource.addSupportingAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((PrimaryKeyJoinColumnAnnotation) typeResource.addSupportingAnnotation(1, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((PrimaryKeyJoinColumnAnnotation) typeResource.addSupportingAnnotation(2, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME)).setName("BAZ");
-
- ListIterator<PrimaryKeyJoinColumn> primaryKeyJoinColumns = entity.specifiedPrimaryKeyJoinColumns();
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- typeResource.moveSupportingAnnotation(2, 0, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- primaryKeyJoinColumns = entity.specifiedPrimaryKeyJoinColumns();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- typeResource.moveSupportingAnnotation(0, 1, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- primaryKeyJoinColumns = entity.specifiedPrimaryKeyJoinColumns();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- typeResource.removeSupportingAnnotation(1, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- primaryKeyJoinColumns = entity.specifiedPrimaryKeyJoinColumns();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- typeResource.removeSupportingAnnotation(1, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- primaryKeyJoinColumns = entity.specifiedPrimaryKeyJoinColumns();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- typeResource.removeSupportingAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- primaryKeyJoinColumns = entity.specifiedPrimaryKeyJoinColumns();
- assertFalse(primaryKeyJoinColumns.hasNext());
- }
-
- public void testPrimaryKeyJoinColumnIsVirtual() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertTrue(javaEntity().getDefaultPrimaryKeyJoinColumn().isVirtual());
-
- javaEntity().addSpecifiedPrimaryKeyJoinColumn(0);
- PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next();
- assertFalse(specifiedPkJoinColumn.isVirtual());
-
- assertNull(javaEntity().getDefaultPrimaryKeyJoinColumn());
- }
-
- public void testTableNameIsInvalid() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertFalse(javaEntity().tableNameIsInvalid(TYPE_NAME));
- assertTrue(javaEntity().tableNameIsInvalid("FOO"));
-
- javaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("BAR");
-
- assertFalse(javaEntity().tableNameIsInvalid("BAR"));
- }
-
- public void testAttributeMappingKeyAllowed() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = (Entity) javaPersistentType().getMapping();
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- }
-
- public void testOverridableAttributes() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<PersistentAttribute> overridableAttributes = javaEntity().overridableAttributes();
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testOverridableAttributeNames() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributeNames = javaEntity().overridableAttributeNames();
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testAllOverridableAttributes() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<PersistentAttribute> overridableAttributes = javaEntity().allOverridableAttributes();
- assertEquals("id", overridableAttributes.next().getName());
- assertEquals("name", overridableAttributes.next().getName());
- assertEquals("foo", overridableAttributes.next().getName());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAttributesMappedSuperclassInOrmXml() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<PersistentAttribute> overridableAttributes = javaEntity().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();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributeNames = javaEntity().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);
-
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = javaEntity().specifiedAttributeOverrides();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) typeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- specifiedAttributeOverrides = javaEntity().specifiedAttributeOverrides();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) typeResource.addSupportingAnnotation(1, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAR");
- specifiedAttributeOverrides = javaEntity().specifiedAttributeOverrides();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) typeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAZ");
- specifiedAttributeOverrides = javaEntity().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.moveSupportingAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDES);
- specifiedAttributeOverrides = javaEntity().specifiedAttributeOverrides();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- typeResource.removeSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- specifiedAttributeOverrides = javaEntity().specifiedAttributeOverrides();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- typeResource.removeSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- specifiedAttributeOverrides = javaEntity().specifiedAttributeOverrides();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- typeResource.removeSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- specifiedAttributeOverrides = javaEntity().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 = persistenceUnit().specifiedClassRefs();
- classRefs.next();
- JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
- assertEquals(SUB_TYPE_NAME, typeResource.getName());
- assertNull(typeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(AttributeOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, javaEntity.virtualAttributeOverridesSize());
- AttributeOverride virtualAttributeOverride = javaEntity.virtualAttributeOverrides().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().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.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(AttributeOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, javaEntity.virtualAttributeOverridesSize());
- virtualAttributeOverride = javaEntity.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.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(AttributeOverridesAnnotation.ANNOTATION_NAME));
-
- virtualAttributeOverride = javaEntity.virtualAttributeOverrides().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride = virtualAttributeOverride.setVirtual(false);
- assertEquals(2, javaEntity.virtualAttributeOverridesSize());
- }
-
- public void testSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(0, javaEntity().specifiedAttributeOverridesSize());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) typeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) typeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAR");
-
- assertEquals(2, javaEntity().specifiedAttributeOverridesSize());
- }
-
- public void testDefaultAttributeOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity javaEntity = javaEntity();
-
- assertEquals(3, javaEntity.virtualAttributeOverridesSize());
-
- javaEntity.virtualAttributeOverrides().next().setVirtual(false);
- assertEquals(2, javaEntity.virtualAttributeOverridesSize());
-
- javaEntity.virtualAttributeOverrides().next().setVirtual(false);
- assertEquals(1, javaEntity.virtualAttributeOverridesSize());
-
- javaEntity.virtualAttributeOverrides().next().setVirtual(false);
- assertEquals(0, javaEntity.virtualAttributeOverridesSize());
- }
-
- public void testAttributeOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity javaEntity = javaEntity();
-
- assertEquals(3, javaEntity.attributeOverridesSize());
-
- javaEntity.virtualAttributeOverrides().next().setVirtual(false);
- assertEquals(3, javaEntity.attributeOverridesSize());
-
- javaEntity.virtualAttributeOverrides().next().setVirtual(false);
- assertEquals(3, javaEntity.attributeOverridesSize());
-
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) typeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- annotation.setName("bar");
- assertEquals(4, javaEntity.attributeOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- javaEntity().virtualAttributeOverrides().next().setVirtual(false);
- javaEntity().virtualAttributeOverrides().next().setVirtual(false);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
- Iterator<NestableAnnotation> attributeOverrides = typeResource.supportingAnnotations(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);
-
- ListIterator<JavaAttributeOverride> virtualAttributeOverrides = javaEntity().virtualAttributeOverrides();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().setVirtual(false);
- javaEntity().virtualAttributeOverrides().next().setVirtual(false);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
- Iterator<NestableAnnotation> attributeOverrides = typeResource.supportingAnnotations(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);
-
- javaEntity().virtualAttributeOverrides().next().setVirtual(false);
- javaEntity().virtualAttributeOverrides().next().setVirtual(false);
- javaEntity().virtualAttributeOverrides().next().setVirtual(false);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
- assertEquals(3, CollectionTools.size(typeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME)));
-
- javaEntity().specifiedAttributeOverrides().next().setVirtual(true);
-
- Iterator<NestableAnnotation> attributeOverrideResources = typeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- assertEquals("name", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertEquals("foo", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertFalse(attributeOverrideResources.hasNext());
-
- Iterator<AttributeOverride> attributeOverrides = javaEntity().specifiedAttributeOverrides();
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- javaEntity().specifiedAttributeOverrides().next().setVirtual(true);
- attributeOverrideResources = typeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- assertEquals("foo", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertFalse(attributeOverrideResources.hasNext());
-
- attributeOverrides = javaEntity().specifiedAttributeOverrides();
- assertEquals("foo", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- javaEntity().specifiedAttributeOverrides().next().setVirtual(true);
- attributeOverrideResources = typeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- assertFalse(attributeOverrideResources.hasNext());
- attributeOverrides = javaEntity().specifiedAttributeOverrides();
- assertFalse(attributeOverrides.hasNext());
-
- assertNull(typeResource.getSupportingAnnotation(AttributeOverridesAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- javaEntity().virtualAttributeOverrides().next().setVirtual(false);
- javaEntity().virtualAttributeOverrides().next().setVirtual(false);
- javaEntity().virtualAttributeOverrides().next().setVirtual(false);
-
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- ListIterator<NestableAnnotation> javaAttributeOverrides = typeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- assertEquals(3, CollectionTools.size(javaAttributeOverrides));
-
-
- entity.moveSpecifiedAttributeOverride(2, 0);
- ListIterator<AttributeOverride> attributeOverrides = entity.specifiedAttributeOverrides();
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
-
- javaAttributeOverrides = typeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- assertEquals("name", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("foo", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("id", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
-
-
- entity.moveSpecifiedAttributeOverride(0, 1);
- attributeOverrides = entity.specifiedAttributeOverrides();
- assertEquals("foo", attributeOverrides.next().getName());
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
-
- javaAttributeOverrides = typeResource.supportingAnnotations(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);
-
- Entity entity = javaEntity();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- ((AttributeOverrideAnnotation) typeResource.addSupportingAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((AttributeOverrideAnnotation) typeResource.addSupportingAnnotation(1, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((AttributeOverrideAnnotation) typeResource.addSupportingAnnotation(2, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME)).setName("BAZ");
-
- ListIterator<AttributeOverride> attributeOverrides = entity.specifiedAttributeOverrides();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- typeResource.moveSupportingAnnotation(2, 0, AttributeOverridesAnnotation.ANNOTATION_NAME);
- attributeOverrides = entity.specifiedAttributeOverrides();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- typeResource.moveSupportingAnnotation(0, 1, AttributeOverridesAnnotation.ANNOTATION_NAME);
- attributeOverrides = entity.specifiedAttributeOverrides();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- typeResource.removeSupportingAnnotation(1, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- attributeOverrides = entity.specifiedAttributeOverrides();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- typeResource.removeSupportingAnnotation(1, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- attributeOverrides = entity.specifiedAttributeOverrides();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- typeResource.removeSupportingAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- attributeOverrides = entity.specifiedAttributeOverrides();
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testAttributeOverrideIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<AttributeOverride> virtualAttributeOverrides = javaEntity().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());
-
- javaEntity().virtualAttributeOverrides().next().setVirtual(false);
- AttributeOverride specifiedAttributeOverride = javaEntity().specifiedAttributeOverrides().next();
- assertFalse(specifiedAttributeOverride.isVirtual());
-
-
- virtualAttributeOverrides = javaEntity().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<PersistentAttribute> overridableAssociations = javaEntity().overridableAssociations();
- assertFalse(overridableAssociations.hasNext());
- }
-
- public void testOverridableAssociationNames() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociationNames = javaEntity().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 = javaEntity().allOverridableAssociationNames();
- assertEquals("address", overridableAssociationNames.next());
- assertEquals("address2", overridableAssociationNames.next());
- assertFalse(overridableAssociationNames.hasNext());
- }
-
- public void testAllOverridableAssociations() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<PersistentAttribute> overridableAssociations = javaEntity().allOverridableAssociations();
- assertEquals("address", overridableAssociations.next().getName());
- assertEquals("address2", overridableAssociations.next().getName());
- assertFalse(overridableAssociations.hasNext());
- }
-
- public void testAllOverridableAssociationsMappedSuperclassInOrmXml() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<PersistentAttribute> overridableAssociations = javaEntity().allOverridableAssociations();
- assertEquals("address", overridableAssociations.next().getName());
- assertEquals("address2", overridableAssociations.next().getName());
- assertFalse(overridableAssociations.hasNext());
- }
-
- public void testSpecifiedAssociationOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<JavaAssociationOverride> specifiedAssociationOverrides = javaEntity().specifiedAssociationOverrides();
-
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- //add an annotation to the resource model and verify the context model is updated
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) typeResource.addSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- associationOverride.setName("FOO");
- specifiedAssociationOverrides = javaEntity().specifiedAssociationOverrides();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- associationOverride = (AssociationOverrideAnnotation) typeResource.addSupportingAnnotation(1, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- associationOverride.setName("BAR");
- specifiedAssociationOverrides = javaEntity().specifiedAssociationOverrides();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- associationOverride = (AssociationOverrideAnnotation) typeResource.addSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- associationOverride.setName("BAZ");
- specifiedAssociationOverrides = javaEntity().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.moveSupportingAnnotation(1, 0, JPA.ASSOCIATION_OVERRIDES);
- specifiedAssociationOverrides = javaEntity().specifiedAssociationOverrides();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- typeResource.removeSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- specifiedAssociationOverrides = javaEntity().specifiedAssociationOverrides();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- typeResource.removeSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- specifiedAssociationOverrides = javaEntity().specifiedAssociationOverrides();
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- typeResource.removeSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- specifiedAssociationOverrides = javaEntity().specifiedAssociationOverrides();
- assertFalse(specifiedAssociationOverrides.hasNext());
- }
-
- public void testDefaultAssociationOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs();
- classRefs.next();
- JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
- assertEquals(SUB_TYPE_NAME, typeResource.getName());
- assertNull(typeResource.getSupportingAnnotation(AssociationOverrideAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(AssociationOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, javaEntity.virtualAssociationOverridesSize());
- AssociationOverride virtualAssociationOverride = javaEntity.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.getSupportingAnnotation(AssociationOverrideAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(AssociationOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, javaEntity.virtualAssociationOverridesSize());
- virtualAssociationOverride = javaEntity.virtualAssociationOverrides().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- //idMapping.getColumn().setSpecifiedName(null);
- //idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(SUB_TYPE_NAME, typeResource.getName());
- assertNull(typeResource.getSupportingAnnotation(AssociationOverrideAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(AssociationOverridesAnnotation.ANNOTATION_NAME));
-
- virtualAssociationOverride = javaEntity.virtualAssociationOverrides().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- virtualAssociationOverride = virtualAssociationOverride.setVirtual(false);
- assertEquals(1, javaEntity.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);
-
- assertEquals(0, javaEntity().specifiedAssociationOverridesSize());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- //add an annotation to the resource model and verify the context model is updated
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) typeResource.addSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- associationOverride.setName("FOO");
- associationOverride = (AssociationOverrideAnnotation) typeResource.addSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- associationOverride.setName("BAR");
-
- assertEquals(2, javaEntity().specifiedAssociationOverridesSize());
- }
-
- public void testDefaultAssociationOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity javaEntity = javaEntity();
-
- assertEquals(2, javaEntity.virtualAssociationOverridesSize());
-
- javaEntity.virtualAssociationOverrides().next().setVirtual(false);
- assertEquals(1, javaEntity.virtualAssociationOverridesSize());
-
- javaEntity.virtualAssociationOverrides().next().setVirtual(false);
- assertEquals(0, javaEntity.virtualAssociationOverridesSize());
- }
-
- public void testAssociationOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity javaEntity = javaEntity();
-
- assertEquals(2, javaEntity.associationOverridesSize());
-
- javaEntity.virtualAssociationOverrides().next().setVirtual(false);
- assertEquals(2, javaEntity.associationOverridesSize());
-
- javaEntity.virtualAssociationOverrides().next().setVirtual(false);
- assertEquals(2, javaEntity.associationOverridesSize());
-
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
- AssociationOverrideAnnotation annotation = (AssociationOverrideAnnotation) typeResource.addSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- annotation.setName("bar");
- assertEquals(3, javaEntity.associationOverridesSize());
- }
-
- public void testAssociationOverrideSetVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- javaEntity().virtualAssociationOverrides().next().setVirtual(false);
- javaEntity().virtualAssociationOverrides().next().setVirtual(false);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
- Iterator<NestableAnnotation> associationOverrides = typeResource.supportingAnnotations(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);
-
- ListIterator<JavaAssociationOverride> virtualAssociationOverrides = javaEntity().virtualAssociationOverrides();
- virtualAssociationOverrides.next();
- virtualAssociationOverrides.next().setVirtual(false);
- javaEntity().virtualAssociationOverrides().next().setVirtual(false);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
- Iterator<NestableAnnotation> associationOverrides = typeResource.supportingAnnotations(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);
-
- javaEntity().virtualAssociationOverrides().next().setVirtual(false);
- javaEntity().virtualAssociationOverrides().next().setVirtual(false);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
- assertEquals(2, CollectionTools.size(typeResource.supportingAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME)));
-
- javaEntity().specifiedAssociationOverrides().next().setVirtual(true);
-
- Iterator<NestableAnnotation> associationOverrideResources = typeResource.supportingAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME);
- assertEquals("address2", ((AssociationOverrideAnnotation) associationOverrideResources.next()).getName());
- assertFalse(associationOverrideResources.hasNext());
-
- Iterator<AssociationOverride> associationOverrides = javaEntity().specifiedAssociationOverrides();
- assertEquals("address2", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
-
- javaEntity().specifiedAssociationOverrides().next().setVirtual(true);
- associationOverrideResources = typeResource.supportingAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME);
- assertFalse(associationOverrideResources.hasNext());
- associationOverrides = javaEntity().specifiedAssociationOverrides();
- assertFalse(associationOverrides.hasNext());
-
- assertNull(typeResource.getSupportingAnnotation(AssociationOverridesAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedAssociationOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- javaEntity().virtualAssociationOverrides().next().setVirtual(false);
- javaEntity().virtualAssociationOverrides().next().setVirtual(false);
-
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- ListIterator<NestableAnnotation> javaAssociationOverrides = typeResource.supportingAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME);
- assertEquals(2, CollectionTools.size(javaAssociationOverrides));
-
-
- entity.moveSpecifiedAssociationOverride(1, 0);
- ListIterator<AssociationOverride> associationOverrides = entity.specifiedAssociationOverrides();
- assertEquals("address2", associationOverrides.next().getName());
- assertEquals("address", associationOverrides.next().getName());
-
- javaAssociationOverrides = typeResource.supportingAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME);
- assertEquals("address2", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- assertEquals("address", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
-
-
- entity.moveSpecifiedAssociationOverride(0, 1);
- associationOverrides = entity.specifiedAssociationOverrides();
- assertEquals("address", associationOverrides.next().getName());
- assertEquals("address2", associationOverrides.next().getName());
-
- javaAssociationOverrides = typeResource.supportingAnnotations(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);
-
- Entity entity = javaEntity();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- ((AssociationOverrideAnnotation) typeResource.addSupportingAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((AssociationOverrideAnnotation) typeResource.addSupportingAnnotation(1, AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((AssociationOverrideAnnotation) typeResource.addSupportingAnnotation(2, AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME)).setName("BAZ");
-
- ListIterator<AssociationOverride> associationOverrides = entity.specifiedAssociationOverrides();
- assertEquals("FOO", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- typeResource.moveSupportingAnnotation(2, 0, AssociationOverridesAnnotation.ANNOTATION_NAME);
- associationOverrides = entity.specifiedAssociationOverrides();
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- typeResource.moveSupportingAnnotation(0, 1, AssociationOverridesAnnotation.ANNOTATION_NAME);
- associationOverrides = entity.specifiedAssociationOverrides();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- typeResource.removeSupportingAnnotation(1, AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME);
- associationOverrides = entity.specifiedAssociationOverrides();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- typeResource.removeSupportingAnnotation(1, AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME);
- associationOverrides = entity.specifiedAssociationOverrides();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- typeResource.removeSupportingAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME);
- associationOverrides = entity.specifiedAssociationOverrides();
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<AssociationOverride> virtualAssociationOverrides = javaEntity().virtualAssociationOverrides();
- AssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address2", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
-
- javaEntity().virtualAssociationOverrides().next().setVirtual(false);
- AssociationOverride specifiedAssociationOverride = javaEntity().specifiedAssociationOverrides().next();
- assertFalse(specifiedAssociationOverride.isVirtual());
-
-
- virtualAssociationOverrides = javaEntity().virtualAssociationOverrides();
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address2", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
- }
-
- public void testAddNamedQuery() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- NamedQuery namedQuery = entity.addNamedQuery(0);
- namedQuery.setName("FOO");
-
- ListIterator<NestableAnnotation> javaNamedQueries = typeResource.supportingAnnotations(NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME);
- assertEquals("FOO", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
-
- NamedQuery namedQuery2 = entity.addNamedQuery(0);
- namedQuery2.setName("BAR");
-
- javaNamedQueries = typeResource.supportingAnnotations(NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME);
- assertEquals("BAR", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
-
- NamedQuery namedQuery3 = entity.addNamedQuery(1);
- namedQuery3.setName("BAZ");
-
- javaNamedQueries = typeResource.supportingAnnotations(NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME);
- assertEquals("BAR", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("BAZ", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
-
- ListIterator<NamedQuery> namedQueries = entity.namedQueries();
- assertEquals(namedQuery2, namedQueries.next());
- assertEquals(namedQuery3, namedQueries.next());
- assertEquals(namedQuery, namedQueries.next());
-
- namedQueries = entity.namedQueries();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- entity.addNamedNativeQuery(0).setName("foo");
- }
-
- public void testRemoveNamedQuery() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- entity.addNamedQuery(0).setName("FOO");
- entity.addNamedQuery(1).setName("BAR");
- entity.addNamedQuery(2).setName("BAZ");
-
- ListIterator<NestableAnnotation> javaNamedQueries = typeResource.supportingAnnotations(NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME);
- assertEquals(3, CollectionTools.size(javaNamedQueries));
-
- entity.removeNamedQuery(0);
- javaNamedQueries = typeResource.supportingAnnotations(NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME);
- assertEquals(2, CollectionTools.size(javaNamedQueries));
- javaNamedQueries = typeResource.supportingAnnotations(NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME);
- assertEquals("BAR", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("BAZ", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
-
- entity.removeNamedQuery(0);
- javaNamedQueries = typeResource.supportingAnnotations(NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME);
- assertEquals(1, CollectionTools.size(javaNamedQueries));
- javaNamedQueries = typeResource.supportingAnnotations(NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME);
- assertEquals("BAZ", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
-
- entity.removeNamedQuery(0);
- javaNamedQueries = typeResource.supportingAnnotations(NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME);
- assertEquals(0, CollectionTools.size(javaNamedQueries));
- }
-
- public void testAddNamedNativeQueryWithNamedQuery() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- entity.addNamedQuery(0).setName("FOO");
-
-
- NamedNativeQueryAnnotation nativeQuery = (NamedNativeQueryAnnotation) typeResource.addSupportingAnnotation(0, JPA.NAMED_NATIVE_QUERY, JPA.NAMED_NATIVE_QUERIES);
- nativeQuery.setName("BAR");
-
- assertEquals(1, entity.namedNativeQueriesSize());
- assertEquals("BAR", entity.namedNativeQueries().next().getName());
- }
-
- public void testAddNamedQueryWithNamedNativeQuery() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- entity.addNamedNativeQuery(0).setName("FOO");
-
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) typeResource.addSupportingAnnotation(0, JPA.NAMED_QUERY, JPA.NAMED_QUERIES);
- namedQuery.setName("BAR");
-
- assertEquals(1, entity.namedQueriesSize());
- assertEquals("BAR", entity.namedQueries().next().getName());
- }
-
- public void testMoveNamedQuery() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- entity.addNamedQuery(0).setName("FOO");
- entity.addNamedQuery(1).setName("BAR");
- entity.addNamedQuery(2).setName("BAZ");
-
- ListIterator<NestableAnnotation> javaNamedQueries = typeResource.supportingAnnotations(NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME);
- assertEquals(3, CollectionTools.size(javaNamedQueries));
-
-
- entity.moveNamedQuery(2, 0);
- ListIterator<NamedQuery> namedQueries = entity.namedQueries();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- javaNamedQueries = typeResource.supportingAnnotations(NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME);
- assertEquals("BAR", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("BAZ", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
-
-
- entity.moveNamedQuery(0, 1);
- namedQueries = entity.namedQueries();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- javaNamedQueries = typeResource.supportingAnnotations(NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME);
- assertEquals("BAZ", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("BAR", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- }
-
- public void testUpdateNamedQueries() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(0, CollectionTools.size(entity.getPersistenceUnit().allQueries()));
-
- ((NamedQueryAnnotation) typeResource.addSupportingAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((NamedQueryAnnotation) typeResource.addSupportingAnnotation(1, NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((NamedQueryAnnotation) typeResource.addSupportingAnnotation(2, NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME)).setName("BAZ");
- ListIterator<NamedQuery> namedQueries = entity.namedQueries();
- assertEquals("FOO", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(3, CollectionTools.size(entity.getPersistenceUnit().allQueries()));
-
- typeResource.moveSupportingAnnotation(2, 0, NamedQueriesAnnotation.ANNOTATION_NAME);
- namedQueries = entity.namedQueries();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- typeResource.moveSupportingAnnotation(0, 1, NamedQueriesAnnotation.ANNOTATION_NAME);
- namedQueries = entity.namedQueries();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- typeResource.removeSupportingAnnotation(1, NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME);
- namedQueries = entity.namedQueries();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(2, CollectionTools.size(entity.getPersistenceUnit().allQueries()));
-
- typeResource.removeSupportingAnnotation(1, NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME);
- namedQueries = entity.namedQueries();
- assertEquals("BAZ", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(1, CollectionTools.size(entity.getPersistenceUnit().allQueries()));
-
- typeResource.removeSupportingAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME);
- namedQueries = entity.namedQueries();
- assertFalse(namedQueries.hasNext());
- assertEquals(0, CollectionTools.size(entity.getPersistenceUnit().allQueries()));
- }
-
- public void testNamedQueriesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(0, entity.namedQueriesSize());
-
- ((NamedQueryAnnotation) typeResource.addSupportingAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((NamedQueryAnnotation) typeResource.addSupportingAnnotation(1, NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((NamedQueryAnnotation) typeResource.addSupportingAnnotation(2, NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME)).setName("BAZ");
-
- assertEquals(3, entity.namedQueriesSize());
- }
-
- public void testAddNamedNativeQuery() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- NamedNativeQuery namedNativeQuery = entity.addNamedNativeQuery(0);
- namedNativeQuery.setName("FOO");
-
- ListIterator<NestableAnnotation> javaNamedQueries = typeResource.supportingAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME);
- assertEquals("FOO", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
-
- NamedNativeQuery namedNativeQuery2 = entity.addNamedNativeQuery(0);
- namedNativeQuery2.setName("BAR");
-
- javaNamedQueries = typeResource.supportingAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME);
- assertEquals("BAR", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
-
- NamedNativeQuery namedNativeQuery3 = entity.addNamedNativeQuery(1);
- namedNativeQuery3.setName("BAZ");
-
- javaNamedQueries = typeResource.supportingAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME);
- assertEquals("BAR", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("BAZ", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
-
- ListIterator<NamedNativeQuery> namedQueries = entity.namedNativeQueries();
- assertEquals(namedNativeQuery2, namedQueries.next());
- assertEquals(namedNativeQuery3, namedQueries.next());
- assertEquals(namedNativeQuery, namedQueries.next());
-
- namedQueries = entity.namedNativeQueries();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- }
-
- public void testRemoveNamedNativeQuery() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- entity.addNamedNativeQuery(0).setName("FOO");
- entity.addNamedNativeQuery(1).setName("BAR");
- entity.addNamedNativeQuery(2).setName("BAZ");
-
- ListIterator<NestableAnnotation> javaNamedQueries = typeResource.supportingAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME);
- assertEquals(3, CollectionTools.size(javaNamedQueries));
-
- entity.removeNamedNativeQuery(0);
- javaNamedQueries = typeResource.supportingAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME);
- assertEquals(2, CollectionTools.size(javaNamedQueries));
- javaNamedQueries = typeResource.supportingAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME);
- assertEquals("BAR", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("BAZ", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
-
- entity.removeNamedNativeQuery(0);
- javaNamedQueries = typeResource.supportingAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME);
- assertEquals(1, CollectionTools.size(javaNamedQueries));
- javaNamedQueries = typeResource.supportingAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME);
- assertEquals("BAZ", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
-
- entity.removeNamedNativeQuery(0);
- javaNamedQueries = typeResource.supportingAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME);
- assertEquals(0, CollectionTools.size(javaNamedQueries));
- }
-
- public void testMoveNamedNativeQuery() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- entity.addNamedNativeQuery(0).setName("FOO");
- entity.addNamedNativeQuery(1).setName("BAR");
- entity.addNamedNativeQuery(2).setName("BAZ");
-
- ListIterator<NestableAnnotation> javaNamedQueries = typeResource.supportingAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME);
- assertEquals(3, CollectionTools.size(javaNamedQueries));
-
-
- entity.moveNamedNativeQuery(2, 0);
- ListIterator<NamedNativeQuery> namedQueries = entity.namedNativeQueries();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- javaNamedQueries = typeResource.supportingAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME);
- assertEquals("BAR", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("BAZ", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
-
-
- entity.moveNamedNativeQuery(0, 1);
- namedQueries = entity.namedNativeQueries();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- javaNamedQueries = typeResource.supportingAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME);
- assertEquals("BAZ", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("BAR", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- }
-
- public void testUpdateNamedNativeQueries() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(0, CollectionTools.size(entity.getPersistenceUnit().allQueries()));
-
- ((NamedNativeQueryAnnotation) typeResource.addSupportingAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((NamedNativeQueryAnnotation) typeResource.addSupportingAnnotation(1, NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((NamedNativeQueryAnnotation) typeResource.addSupportingAnnotation(2, NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME)).setName("BAZ");
- ListIterator<NamedNativeQuery> namedQueries = entity.namedNativeQueries();
- assertEquals("FOO", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(3, CollectionTools.size(entity.getPersistenceUnit().allQueries()));
-
- typeResource.moveSupportingAnnotation(2, 0, NamedNativeQueriesAnnotation.ANNOTATION_NAME);
- namedQueries = entity.namedNativeQueries();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- typeResource.moveSupportingAnnotation(0, 1, NamedNativeQueriesAnnotation.ANNOTATION_NAME);
- namedQueries = entity.namedNativeQueries();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- typeResource.removeSupportingAnnotation(1, NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME);
- namedQueries = entity.namedNativeQueries();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(2, CollectionTools.size(entity.getPersistenceUnit().allQueries()));
-
- typeResource.removeSupportingAnnotation(1, NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME);
- namedQueries = entity.namedNativeQueries();
- assertEquals("BAZ", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(1, CollectionTools.size(entity.getPersistenceUnit().allQueries()));
-
- typeResource.removeSupportingAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME);
- namedQueries = entity.namedNativeQueries();
- assertFalse(namedQueries.hasNext());
- assertEquals(0, CollectionTools.size(entity.getPersistenceUnit().allQueries()));
- }
-
- public void testNamedNativeQueriesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(0, entity.namedNativeQueriesSize());
-
- ((NamedNativeQueryAnnotation) typeResource.addSupportingAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((NamedNativeQueryAnnotation) typeResource.addSupportingAnnotation(1, NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((NamedNativeQueryAnnotation) typeResource.addSupportingAnnotation(2, NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME)).setName("BAZ");
-
- assertEquals(3, entity.namedNativeQueriesSize());
- }
-
- public void testUpdateIdClass() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(javaEntity().getIdClass());
- assertNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME));
-
- IdClassAnnotation idClass = (IdClassAnnotation) typeResource.addSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- assertNull(javaEntity().getIdClass());
- assertNotNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME));
-
- idClass.setValue("model.Foo");
- assertEquals("model.Foo", javaEntity().getIdClass());
- assertEquals("model.Foo", ((IdClassAnnotation) typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME)).getValue());
-
- //test setting @IdClass value to null, IdClass annotation is removed
- idClass.setValue(null);
- assertNull(javaEntity().getIdClass());
- assertNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME));
-
- //reset @IdClass value and then remove @IdClass
- idClass = (IdClassAnnotation) typeResource.addSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- idClass.setValue("model.Foo");
- typeResource.removeSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME);
-
- assertNull(javaEntity().getIdClass());
- assertNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyIdClass() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(javaEntity().getIdClass());
- assertNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME));
-
- javaEntity().setIdClass("model.Foo");
- assertEquals("model.Foo", ((IdClassAnnotation) typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME)).getValue());
- assertEquals("model.Foo", javaEntity().getIdClass());
-
- javaEntity().setIdClass(null);
- assertNull(javaEntity().getIdClass());
- assertNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetPrimaryKeyColumnNameWithAttributeOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs();
- JavaPersistentType entityPersistentType = classRefs.next().getJavaPersistentType();
- JavaEntity javaEntity = (JavaEntity) entityPersistentType.getMapping();
- JavaPersistentType mappedSuperclassPersistentType = classRefs.next().getJavaPersistentType();
-
- assertNull(javaEntity.getPrimaryKeyColumnName());
-
- mappedSuperclassPersistentType.getAttributeNamed("id").setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals("id", javaEntity.getPrimaryKeyColumnName());
-
- ((JavaIdMapping) mappedSuperclassPersistentType.getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName("MY_ID");
- assertEquals("MY_ID", javaEntity.getPrimaryKeyColumnName());
-
- JavaAttributeOverride javaAttributeOverride = javaEntity.virtualAttributeOverrides().next();
- assertEquals("id", javaAttributeOverride.getName());
-
- javaAttributeOverride = (JavaAttributeOverride) javaAttributeOverride.setVirtual(false);
- javaAttributeOverride.getColumn().setSpecifiedName("ID");
- assertEquals("ID", javaEntity.getPrimaryKeyColumnName());
- }
-
- public void testDiscriminatorValueIsAllowedConcreteClass() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertTrue(javaEntity().isDiscriminatorValueAllowed());
- }
-
- public void testDiscriminatorValueIsAllowedAbstractClass() throws Exception {
- createTestAbstractEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertFalse(javaEntity().isDiscriminatorValueAllowed());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaGeneratedValueTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaGeneratedValueTests.java
deleted file mode 100644
index 9f5600a506..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaGeneratedValueTests.java
+++ /dev/null
@@ -1,147 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.context.GeneratedValue;
-import org.eclipse.jpt.core.context.GenerationType;
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.core.resource.java.GeneratedValueAnnotation;
-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.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JavaGeneratedValueTests extends ContextModelTestCase
-{
- private static final String GENERATOR = "MY_GENERATOR";
-
- private ICompilationUnit createTestEntityWithGeneratedValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.GENERATED_VALUE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@GeneratedValue(generator=\"" + GENERATOR + "\")");
- }
- });
- }
-
- public JavaGeneratedValueTests(String name) {
- super(name);
- }
-
- public void testGetGenerator() throws Exception {
- createTestEntityWithGeneratedValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(GENERATOR, idMapping.getGeneratedValue().getGenerator());
-
- //change resource model sequenceGenerator name, verify the context model is updated
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) attributeResource.getSupportingAnnotation(JPA.GENERATED_VALUE);
-
- generatedValue.setGenerator("foo");
-
- assertEquals("foo", idMapping.getGeneratedValue().getGenerator());
- }
-
- public void testSetSpecifiedGenerator() throws Exception {
- createTestEntityWithGeneratedValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(GENERATOR, idMapping.getGeneratedValue().getGenerator());
-
- idMapping.getGeneratedValue().setSpecifiedGenerator("foo");
-
- assertEquals("foo", idMapping.getGeneratedValue().getGenerator());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) attributeResource.getSupportingAnnotation(JPA.GENERATED_VALUE);
-
- assertEquals("foo", generatedValue.getGenerator());
- }
-
- public void testSetSpecifiedNameNull() throws Exception {
- createTestEntityWithGeneratedValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(GENERATOR, idMapping.getGeneratedValue().getGenerator());
-
- idMapping.getGeneratedValue().setSpecifiedGenerator(null);
-
- assertNotNull(idMapping.getGeneratedValue());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) attributeResource.getSupportingAnnotation(JPA.GENERATED_VALUE);
-
- assertNotNull(generatedValue);
- }
-
- public void testGetStrategy() throws Exception {
- createTestEntityWithGeneratedValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(GeneratedValue.DEFAULT_STRATEGY, idMapping.getGeneratedValue().getStrategy());
-
- //change resource model sequenceGenerator name, verify the context model is updated
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) attributeResource.getSupportingAnnotation(JPA.GENERATED_VALUE);
-
- generatedValue.setStrategy(org.eclipse.jpt.core.resource.java.GenerationType.IDENTITY);
-
- assertEquals(GenerationType.IDENTITY, idMapping.getGeneratedValue().getStrategy());
- assertEquals(GeneratedValue.DEFAULT_STRATEGY, idMapping.getGeneratedValue().getDefaultStrategy());
- }
-
- public void testSetSpecifiedStrategy() throws Exception {
- createTestEntityWithGeneratedValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(GeneratedValue.DEFAULT_STRATEGY, idMapping.getGeneratedValue().getStrategy());
-
- idMapping.getGeneratedValue().setSpecifiedStrategy(GenerationType.IDENTITY);
-
- assertEquals(GenerationType.IDENTITY, idMapping.getGeneratedValue().getStrategy());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) attributeResource.getSupportingAnnotation(JPA.GENERATED_VALUE);
-
- assertEquals(org.eclipse.jpt.core.resource.java.GenerationType.IDENTITY, generatedValue.getStrategy());
-
- idMapping.getGeneratedValue().setSpecifiedStrategy(null);
-
- assertEquals(GeneratedValue.DEFAULT_STRATEGY, idMapping.getGeneratedValue().getStrategy());
- generatedValue = (GeneratedValueAnnotation) attributeResource.getSupportingAnnotation(JPA.GENERATED_VALUE);
- assertNotNull(generatedValue);
- assertNull(generatedValue.getStrategy());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaIdMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaIdMappingTests.java
deleted file mode 100644
index 159463b06e..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaIdMappingTests.java
+++ /dev/null
@@ -1,707 +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.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.BasicMapping;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-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.OneToOneMapping;
-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.TransientMapping;
-import org.eclipse.jpt.core.context.VersionMapping;
-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.GeneratedValueAnnotation;
-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.OneToManyAnnotation;
-import org.eclipse.jpt.core.resource.java.OneToOneAnnotation;
-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.resource.java.TransientAnnotation;
-import org.eclipse.jpt.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JavaIdMappingTests extends ContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithTemporal() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.TEMPORAL, JPA.TEMPORAL_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@Temporal(TemporalType.TIMESTAMP)").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithIdMappingGeneratedValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.GENERATED_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@GeneratedValue").append(CR);
- }
- });
- }
-
- public JavaIdMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) idMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.addTableGenerator();
- idMapping.addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) idMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.addTableGenerator();
- idMapping.addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) idMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.addTableGenerator();
- idMapping.addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((VersionMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ((VersionMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) idMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.addTableGenerator();
- idMapping.addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) idMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.addTableGenerator();
- idMapping.addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) idMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.addTableGenerator();
- idMapping.addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) idMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.addTableGenerator();
- idMapping.addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) idMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.addTableGenerator();
- idMapping.addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) idMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.addTableGenerator();
- idMapping.addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) idMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.addTableGenerator();
- idMapping.addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetTemporal() throws Exception {
- createTestEntityWithTemporal();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping();
-
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) idMapping.getConverter()).getTemporalType());
- }
-
- public void testSetTemporal() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping();
- assertEquals(Converter.NO_CONVERTER, idMapping.getConverter().getType());
-
- idMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TemporalAnnotation temporal = (TemporalAnnotation) attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- idMapping.setSpecifiedConverter(null);
- assertNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetTemporalUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping();
-
- assertEquals(Converter.NO_CONVERTER, idMapping.getConverter().getType());
-
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TemporalAnnotation temporal = (TemporalAnnotation) attributeResource.addSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- temporal.setValue(org.eclipse.jpt.core.resource.java.TemporalType.DATE);
-
- assertEquals(TemporalType.DATE, ((TemporalConverter) idMapping.getConverter()).getTemporalType());
-
- attributeResource.removeSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME);
-
- assertEquals(Converter.NO_CONVERTER, idMapping.getConverter().getType());
- assertFalse(idMapping.isDefault());
- assertSame(idMapping, persistentAttribute.getSpecifiedMapping());
- }
-
- public void testGetColumn() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping();
-
- assertNull(idMapping.getColumn().getSpecifiedName());
- assertEquals("id", idMapping.getColumn().getName());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN);
- column.setName("foo");
-
- assertEquals("foo", idMapping.getColumn().getSpecifiedName());
- assertEquals("foo", idMapping.getColumn().getName());
- assertEquals("id", idMapping.getColumn().getDefaultName());
- }
-
- public void testGetSequenceGenerator() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping();
- assertNull(idMapping.getSequenceGenerator());
- assertEquals(0, CollectionTools.size(idMapping.getPersistenceUnit().allGenerators()));
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(JPA.SEQUENCE_GENERATOR);
- assertNotNull(idMapping.getSequenceGenerator());
- assertEquals(1, attributeResource.supportingAnnotationsSize());
- assertEquals(1, CollectionTools.size(idMapping.getPersistenceUnit().allGenerators()));
-
- idMapping.getSequenceGenerator().setName("foo");
- assertEquals(1, CollectionTools.size(idMapping.getPersistenceUnit().allGenerators()));
- }
-
- public void testAddSequenceGenerator() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping();
-
- assertNull(idMapping.getSequenceGenerator());
-
- idMapping.addSequenceGenerator();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertNotNull(attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR));
- assertNotNull(idMapping.getSequenceGenerator());
-
- //try adding another sequence generator, should get an IllegalStateException
- try {
- idMapping.addSequenceGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveSequenceGenerator() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(JPA.SEQUENCE_GENERATOR);
-
-
- idMapping.removeSequenceGenerator();
-
- assertNull(idMapping.getSequenceGenerator());
- assertNull(attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR));
-
- //try removing the sequence generator again, should get an IllegalStateException
- try {
- idMapping.removeSequenceGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testGetTableGenerator() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping();
- assertNull(idMapping.getTableGenerator());
- assertEquals(0, CollectionTools.size(idMapping.getPersistenceUnit().allGenerators()));
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(JPA.TABLE_GENERATOR);
- assertNotNull(idMapping.getTableGenerator());
- assertEquals(1, attributeResource.supportingAnnotationsSize());
- assertEquals(1, CollectionTools.size(idMapping.getPersistenceUnit().allGenerators()));
-
- idMapping.getTableGenerator().setName("foo");
- assertEquals(1, CollectionTools.size(idMapping.getPersistenceUnit().allGenerators()));
- }
-
- public void testAddTableGenerator() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping();
-
- assertNull(idMapping.getTableGenerator());
-
- idMapping.addTableGenerator();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertNotNull(attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR));
- assertNotNull(idMapping.getTableGenerator());
-
- //try adding another table generator, should get an IllegalStateException
- try {
- idMapping.addTableGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveTableGenerator() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(JPA.TABLE_GENERATOR);
-
-
- idMapping.removeTableGenerator();
-
- assertNull(idMapping.getTableGenerator());
- assertNull(attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR));
-
- //try removing the table generator again, should get an IllegalStateException
- try {
- idMapping.removeTableGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testGetGeneratedValue() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping();
-
- assertNull(idMapping.getGeneratedValue());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(JPA.GENERATED_VALUE);
-
- assertNotNull(idMapping.getGeneratedValue());
- assertEquals(1, attributeResource.supportingAnnotationsSize());
- }
-
- public void testGetGeneratedValue2() throws Exception {
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityWithIdMappingGeneratedValue();
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertNotNull(idMapping.getGeneratedValue());
- assertEquals(1, attributeResource.supportingAnnotationsSize());
- }
-
- public void testAddGeneratedValue() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping();
-
- assertNull(idMapping.getGeneratedValue());
-
- idMapping.addGeneratedValue();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertNotNull(attributeResource.getSupportingAnnotation(JPA.GENERATED_VALUE));
- assertNotNull(idMapping.getGeneratedValue());
-
- //try adding another generated value, should get an IllegalStateException
- try {
- idMapping.addGeneratedValue();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveGeneratedValue() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addSupportingAnnotation(JPA.GENERATED_VALUE);
-
-
- idMapping.removeGeneratedValue();
-
- assertNull(idMapping.getGeneratedValue());
- assertNull(attributeResource.getSupportingAnnotation(JPA.GENERATED_VALUE));
-
- //try removing the generatedValue again, should get an IllegalStateException
- try {
- idMapping.removeGeneratedValue();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaJoinColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaJoinColumnTests.java
deleted file mode 100644
index 6147229043..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaJoinColumnTests.java
+++ /dev/null
@@ -1,511 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-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.JoinColumnAnnotation;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JavaJoinColumnTests extends ContextModelTestCase
-{
- public JavaJoinColumnTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityWithOneToOne() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidOneToOne() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne").append(CR);
- sb.append(" private Project project;").append(CR);
- }
- });
- }
-
- private void createTargetEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Project {").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int proj_id;").append(CR);
- sb.append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Project.java", sourceWriter);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
-
- assertEquals(0, oneToOneMapping.specifiedJoinColumnsSize());
- assertNull(javaJoinColumn);
-
-
- //set name in the resource model, verify context model updated
- javaJoinColumn = (JoinColumnAnnotation) attributeResource.addSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
- javaJoinColumn.setName("FOO");
- JavaJoinColumn joinColumn = oneToOneMapping.specifiedJoinColumns().next();
- assertEquals("FOO", joinColumn.getSpecifiedName());
- assertEquals("FOO", javaJoinColumn.getName());
-
- //set name to null in the resource model, annotation removed, specified join column removed
- javaJoinColumn.setName(null);
- assertEquals(0, oneToOneMapping.specifiedJoinColumnsSize());
- assertNull(attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedName() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
-
- JavaJoinColumn joinColumn = oneToOneMapping.addSpecifiedJoinColumn(0);
- //set name in the context model, verify resource model modified
- joinColumn.setSpecifiedName("foo");
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
- assertEquals("foo", joinColumn.getSpecifiedName());
- assertEquals("foo", javaJoinColumn.getName());
-
- //set name to null in the context model
- joinColumn.setSpecifiedName(null);
- assertNull(joinColumn.getSpecifiedName());
- assertNull(attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- // <attribute name>_<referenced column name>
- // or
- // <target entity name>_<referenced column name>
- public void testDefaultName() throws Exception {
- createTestEntityWithValidOneToOne();
- createTargetEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping();
- JavaJoinColumn defaultJavaJoinColumn = oneToOneMapping.getDefaultJoinColumn();
-
-// assertNull(defaultJavaJoinColumn.getDefaultName());
-//TODO test default join column name
-// //add target entity to the persistence unit, now join table name is [table name]_[target table name]
-// addXmlClassRef(PACKAGE_NAME + ".Project");
-// assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName());
-//
-// JavaPersistentTypeResource typeResource = jpaProject().javaPersistentTypeResource(FULLY_QUALIFIED_TYPE_NAME);
-// JavaPersistentAttributeResource attributeResource = typeResource.attributes().next();
-// assertNull(attributeResource.annotation(JoinTable.ANNOTATION_NAME));
-//
-// //target entity does not resolve, default name is null
-// manyToManyMapping.setSpecifiedTargetEntity("Foo");
-// assertNull(joinTable.getDefaultName());
-//
-// //default target entity does resolve, so default name is again [table name]_[target table name]
-// manyToManyMapping.setSpecifiedTargetEntity(null);
-// assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName());
-//
-// //add the join table annotation, verify default join table name is the same
-// attributeResource.addAnnotation(JoinTable.ANNOTATION_NAME);
-// assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName());
-// assertNotNull(attributeResource.annotation(JoinTable.ANNOTATION_NAME));
-//
-// //set a table on the target entity, very default join table name updates
-// manyToManyMapping.getResolvedTargetEntity().getTable().setSpecifiedName("FOO");
-// assertEquals(TYPE_NAME + "_FOO", joinTable.getDefaultName());
-//
-// //set a table on the owning entity, very default join table name updates
-// javaEntity().getTable().setSpecifiedName("BAR");
-// assertEquals("BAR_FOO", joinTable.getDefaultName());
- }
-
- public void testUpdateSpecifiedReferencedColumnName() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
-
- assertEquals(0, oneToOneMapping.specifiedJoinColumnsSize());
- assertNull(javaJoinColumn);
-
-
- //set referenced column name in the resource model, verify context model updated
- javaJoinColumn = (JoinColumnAnnotation) attributeResource.addSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
- javaJoinColumn.setName("FOO");
- javaJoinColumn.setReferencedColumnName("BAR");
- JavaJoinColumn joinColumn = oneToOneMapping.specifiedJoinColumns().next();
- assertEquals("BAR", joinColumn.getSpecifiedReferencedColumnName());
- assertEquals("BAR", javaJoinColumn.getReferencedColumnName());
-
- //set referenced column name to null in the resource model,
- javaJoinColumn.setReferencedColumnName(null);
- assertNull(joinColumn.getSpecifiedReferencedColumnName());
- assertNull("BAR", javaJoinColumn.getReferencedColumnName());
- }
-
- public void testModifySpecifiedReferencedColumnName() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
-
- JavaJoinColumn joinColumn = oneToOneMapping.addSpecifiedJoinColumn(0);
- //set referenced column name in the context model, verify resource model modified
- joinColumn.setSpecifiedName("foo");
- joinColumn.setSpecifiedReferencedColumnName("BAR");
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
- assertEquals("BAR", joinColumn.getSpecifiedReferencedColumnName());
- assertEquals("BAR", javaJoinColumn.getReferencedColumnName());
-
- //set referenced column name to null in the context model
- joinColumn.setSpecifiedReferencedColumnName(null);
- assertNull(joinColumn.getSpecifiedReferencedColumnName());
- assertNull(javaJoinColumn.getReferencedColumnName());
- }
-
- public void testDefaultReferencedColumnName() throws Exception {
- //TODO test default join column referenced column name
-
- }
-
- public void testUpdateTable() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
-
- assertEquals(0, oneToOneMapping.specifiedJoinColumnsSize());
- assertNull(javaJoinColumn);
-
-
- //set table in the resource model, verify context model updated
- javaJoinColumn = (JoinColumnAnnotation) attributeResource.addSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
- javaJoinColumn.setName("FOO");
- javaJoinColumn.setTable("BAR");
- JavaJoinColumn joinColumn = oneToOneMapping.specifiedJoinColumns().next();
- assertEquals("BAR", joinColumn.getSpecifiedTable());
- assertEquals("BAR", javaJoinColumn.getTable());
-
- //set table to null in the resource model,
- javaJoinColumn.setTable(null);
- assertNull(joinColumn.getSpecifiedTable());
- assertNull("BAR", javaJoinColumn.getTable());
- }
-
- public void testModifyTable() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
-
- JavaJoinColumn joinColumn = oneToOneMapping.addSpecifiedJoinColumn(0);
- //set table in the context model, verify resource model modified
- joinColumn.setSpecifiedName("foo");
- joinColumn.setSpecifiedTable("BAR");
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
- assertEquals("BAR", joinColumn.getSpecifiedTable());
- assertEquals("BAR", javaJoinColumn.getTable());
-
- //set table to null in the context model
- joinColumn.setSpecifiedTable(null);
- assertNull(joinColumn.getSpecifiedTable());
- assertNull(javaJoinColumn.getTable());
- }
-
- public void testDefaultTable() throws Exception {
- //TODO test default join column table
-
- }
-
- public void testUpdateUnique() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
-
- assertEquals(0, oneToOneMapping.specifiedJoinColumnsSize());
- assertNull(javaJoinColumn);
-
-
- //set unique in the resource model, verify context model updated
- javaJoinColumn = (JoinColumnAnnotation) attributeResource.addSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
- javaJoinColumn.setName("FOO");
- javaJoinColumn.setUnique(Boolean.TRUE);
- JavaJoinColumn joinColumn = oneToOneMapping.specifiedJoinColumns().next();
- assertEquals(Boolean.TRUE, joinColumn.getSpecifiedUnique());
- assertEquals(Boolean.TRUE, javaJoinColumn.getUnique());
-
- //set unique to null in the resource model,
- javaJoinColumn.setUnique(null);
- assertNull(joinColumn.getSpecifiedUnique());
- assertNull(javaJoinColumn.getUnique());
- }
-
- public void testModifyUnique() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
-
- JavaJoinColumn joinColumn = oneToOneMapping.addSpecifiedJoinColumn(0);
- //set unique in the context model, verify resource model modified
- joinColumn.setSpecifiedName("foo");
- joinColumn.setSpecifiedUnique(Boolean.TRUE);
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
- assertEquals(Boolean.TRUE, joinColumn.getSpecifiedUnique());
- assertEquals(Boolean.TRUE, javaJoinColumn.getUnique());
-
- //set unique to null in the context model
- joinColumn.setSpecifiedUnique(null);
- assertNull(joinColumn.getSpecifiedUnique());
- assertNull(javaJoinColumn.getUnique());
- }
-
- public void testUpdateNullable() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
-
- assertEquals(0, oneToOneMapping.specifiedJoinColumnsSize());
- assertNull(javaJoinColumn);
-
-
- //set nullable in the resource model, verify context model updated
- javaJoinColumn = (JoinColumnAnnotation) attributeResource.addSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
- javaJoinColumn.setName("FOO");
- javaJoinColumn.setNullable(Boolean.FALSE);
- JavaJoinColumn joinColumn = oneToOneMapping.specifiedJoinColumns().next();
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, javaJoinColumn.getNullable());
-
- //set nullable to null in the resource model,
- javaJoinColumn.setNullable(null);
- assertNull(joinColumn.getSpecifiedNullable());
- assertNull(javaJoinColumn.getNullable());
- }
-
- public void testModifyNullable() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
-
- JavaJoinColumn joinColumn = oneToOneMapping.addSpecifiedJoinColumn(0);
- //set nullable in the context model, verify resource model modified
- joinColumn.setSpecifiedName("foo");
- joinColumn.setSpecifiedNullable(Boolean.FALSE);
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, javaJoinColumn.getNullable());
-
- //set nullable to null in the context model
- joinColumn.setSpecifiedNullable(null);
- assertNull(joinColumn.getSpecifiedNullable());
- assertNull(javaJoinColumn.getNullable());
- }
-
- public void testUpdateInsertable() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
-
- assertEquals(0, oneToOneMapping.specifiedJoinColumnsSize());
- assertNull(javaJoinColumn);
-
-
- //set insertable in the resource model, verify context model updated
- javaJoinColumn = (JoinColumnAnnotation) attributeResource.addSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
- javaJoinColumn.setName("FOO");
- javaJoinColumn.setInsertable(Boolean.FALSE);
- JavaJoinColumn joinColumn = oneToOneMapping.specifiedJoinColumns().next();
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, javaJoinColumn.getInsertable());
-
- //set insertable to null in the resource model,
- javaJoinColumn.setInsertable(null);
- assertNull(joinColumn.getSpecifiedInsertable());
- assertNull(javaJoinColumn.getInsertable());
- }
-
- public void testModifyInsertable() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
-
- JavaJoinColumn joinColumn = oneToOneMapping.addSpecifiedJoinColumn(0);
- //set insertable in the context model, verify resource model modified
- joinColumn.setSpecifiedName("foo");
- joinColumn.setSpecifiedInsertable(Boolean.FALSE);
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, javaJoinColumn.getInsertable());
-
- //set insertable to null in the context model
- joinColumn.setSpecifiedInsertable(null);
- assertNull(joinColumn.getSpecifiedInsertable());
- assertNull(javaJoinColumn.getInsertable());
- }
-
- public void testUpdateUpdatable() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
-
- assertEquals(0, oneToOneMapping.specifiedJoinColumnsSize());
- assertNull(javaJoinColumn);
-
-
- //set updatable in the resource model, verify context model updated
- javaJoinColumn = (JoinColumnAnnotation) attributeResource.addSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
- javaJoinColumn.setName("FOO");
- javaJoinColumn.setUpdatable(Boolean.FALSE);
- JavaJoinColumn joinColumn = oneToOneMapping.specifiedJoinColumns().next();
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, javaJoinColumn.getUpdatable());
-
- //set updatable to null in the resource model,
- javaJoinColumn.setUpdatable(null);
- assertNull(joinColumn.getSpecifiedUpdatable());
- assertNull(javaJoinColumn.getUpdatable());
- }
-
- public void testModifyUpdatable() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
-
- JavaJoinColumn joinColumn = oneToOneMapping.addSpecifiedJoinColumn(0);
- //set updatable in the context model, verify resource model modified
- joinColumn.setSpecifiedName("foo");
- joinColumn.setSpecifiedUpdatable(Boolean.FALSE);
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, javaJoinColumn.getUpdatable());
-
- //set updatable to null in the context model
- joinColumn.setSpecifiedUpdatable(null);
- assertNull(joinColumn.getSpecifiedUpdatable());
- assertNull(javaJoinColumn.getUpdatable());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaJoinTableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaJoinTableTests.java
deleted file mode 100644
index da71cb5030..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaJoinTableTests.java
+++ /dev/null
@@ -1,963 +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.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.JoinTable;
-import org.eclipse.jpt.core.context.UniqueConstraint;
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaUniqueConstraint;
-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.JoinTableAnnotation;
-import org.eclipse.jpt.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JavaJoinTableTests extends ContextModelTestCase
-{
- public JavaJoinTableTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityWithManyToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidManyToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany").append(CR);
- sb.append(" private Collection<Project> projects;").append(CR);
- }
- });
- }
-
- private void createTargetEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Project {").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int proj_id;").append(CR);
- sb.append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Project.java", sourceWriter);
- }
- public void testUpdateSpecifiedName() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getJoinTable();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- JoinTableAnnotation javaJoinTable = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertNull(joinTable.getSpecifiedName());
- assertNull(javaJoinTable);
-
-
- //set name in the resource model, verify context model updated
- attributeResource.addSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- javaJoinTable = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- javaJoinTable.setName("FOO");
- assertEquals("FOO", joinTable.getSpecifiedName());
- assertEquals("FOO", javaJoinTable.getName());
-
- //set name to null in the resource model
- javaJoinTable.setName(null);
- assertNull(joinTable.getSpecifiedName());
- assertNull(javaJoinTable.getName());
-
- javaJoinTable.setName("FOO");
- assertEquals("FOO", joinTable.getSpecifiedName());
- assertEquals("FOO", javaJoinTable.getName());
-
- attributeResource.removeSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertNull(joinTable.getSpecifiedName());
- assertNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedName() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getJoinTable();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- JoinTableAnnotation javaJoinTable = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertNull(joinTable.getSpecifiedName());
- assertNull(javaJoinTable);
-
- //set name in the context model, verify resource model modified
- joinTable.setSpecifiedName("foo");
- javaJoinTable = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals("foo", joinTable.getSpecifiedName());
- assertEquals("foo", javaJoinTable.getName());
-
- //set name to null in the context model
- joinTable.setSpecifiedName(null);
- assertNull(joinTable.getSpecifiedName());
- assertNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- }
-
- public void testDefaultName() throws Exception {
- createTestEntityWithValidManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getJoinTable();
-
- //joinTable default name is null because targetEntity is not in the persistence unit
- assertNull(joinTable.getDefaultName());
-
- //add target entity to the persistence unit, now join table name is [table name]_[target table name]
- createTargetEntity();
- addXmlClassRef(PACKAGE_NAME + ".Project");
- assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
-
- //target entity does not resolve, default name is null
- manyToManyMapping.setSpecifiedTargetEntity("Foo");
- assertNull(joinTable.getDefaultName());
-
- //default target entity does resolve, so default name is again [table name]_[target table name]
- manyToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName());
-
- //add the join table annotation, verify default join table name is the same
- attributeResource.addSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName());
- assertNotNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
-
- //set a table on the target entity, very default join table name updates
- manyToManyMapping.getResolvedTargetEntity().getTable().setSpecifiedName("FOO");
- assertEquals(TYPE_NAME + "_FOO", joinTable.getDefaultName());
-
- //set a table on the owning entity, very default join table name updates
- javaEntity().getTable().setSpecifiedName("BAR");
- assertEquals("BAR_FOO", joinTable.getDefaultName());
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getJoinTable();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- JoinTableAnnotation javaJoinTable = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertNull(joinTable.getSpecifiedSchema());
- assertNull(javaJoinTable);
-
-
- //set schema in the resource model, verify context model updated
- attributeResource.addSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- javaJoinTable = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- javaJoinTable.setSchema("FOO");
- assertEquals("FOO", joinTable.getSpecifiedSchema());
- assertEquals("FOO", javaJoinTable.getSchema());
-
- //set schema to null in the resource model
- javaJoinTable.setSchema(null);
- assertNull(joinTable.getSpecifiedSchema());
- assertNull(javaJoinTable.getSchema());
-
- javaJoinTable.setSchema("FOO");
- assertEquals("FOO", joinTable.getSpecifiedSchema());
- assertEquals("FOO", javaJoinTable.getSchema());
-
- attributeResource.removeSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertNull(joinTable.getSpecifiedSchema());
- assertNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getJoinTable();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- JoinTableAnnotation javaJoinTable = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertNull(joinTable.getSpecifiedSchema());
- assertNull(javaJoinTable);
-
- //set schema in the context model, verify resource model modified
- joinTable.setSpecifiedSchema("foo");
- javaJoinTable = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals("foo", joinTable.getSpecifiedSchema());
- assertEquals("foo", javaJoinTable.getSchema());
-
- //set schema to null in the context model
- joinTable.setSpecifiedSchema(null);
- assertNull(joinTable.getSpecifiedSchema());
- assertNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getJoinTable();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- JoinTableAnnotation javaJoinTable = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertNull(joinTable.getSpecifiedCatalog());
- assertNull(javaJoinTable);
-
-
- //set catalog in the resource model, verify context model updated
- attributeResource.addSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- javaJoinTable = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- javaJoinTable.setCatalog("FOO");
- assertEquals("FOO", joinTable.getSpecifiedCatalog());
- assertEquals("FOO", javaJoinTable.getCatalog());
-
- //set catalog to null in the resource model
- javaJoinTable.setCatalog(null);
- assertNull(joinTable.getSpecifiedCatalog());
- assertNull(javaJoinTable.getCatalog());
-
- javaJoinTable.setCatalog("FOO");
- assertEquals("FOO", joinTable.getSpecifiedCatalog());
- assertEquals("FOO", javaJoinTable.getCatalog());
-
- attributeResource.removeSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertNull(joinTable.getSpecifiedCatalog());
- assertNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getJoinTable();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- JoinTableAnnotation javaJoinTable = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertNull(joinTable.getSpecifiedCatalog());
- assertNull(javaJoinTable);
-
- //set catalog in the context model, verify resource model modified
- joinTable.setSpecifiedCatalog("foo");
- javaJoinTable = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals("foo", joinTable.getSpecifiedCatalog());
- assertEquals("foo", javaJoinTable.getCatalog());
-
- //set catalog to null in the context model
- joinTable.setSpecifiedCatalog(null);
- assertNull(joinTable.getSpecifiedCatalog());
- assertNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getJoinTable();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
-
- JoinColumn joinColumn = joinTable.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- JoinTableAnnotation joinTableResource = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertEquals("FOO", joinTableResource.joinColumnAt(0).getName());
-
- JoinColumn joinColumn2 = joinTable.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(1).getName());
-
- JoinColumn joinColumn3 = joinTable.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.joinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(2).getName());
-
- ListIterator<JoinColumn> joinColumns = joinTable.specifiedJoinColumns();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = joinTable.specifiedJoinColumns();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getJoinTable();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- joinTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joinTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joinTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- JoinTableAnnotation joinTableResource = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals(3, joinTableResource.joinColumnsSize());
-
- joinTable.removeSpecifiedJoinColumn(0);
- assertEquals(2, joinTableResource.joinColumnsSize());
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.joinColumnAt(1).getName());
-
- joinTable.removeSpecifiedJoinColumn(0);
- assertEquals(1, joinTableResource.joinColumnsSize());
- assertEquals("BAZ", joinTableResource.joinColumnAt(0).getName());
-
- joinTable.removeSpecifiedJoinColumn(0);
- assertEquals(0, joinTableResource.joinColumnsSize());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getJoinTable();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- joinTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joinTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joinTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- JoinTableAnnotation joinTableResource = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals(3, joinTableResource.joinColumnsSize());
-
-
- joinTable.moveSpecifiedJoinColumn(2, 0);
- ListIterator<JoinColumn> joinColumns = joinTable.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());
-
-
- joinTable.moveSpecifiedJoinColumn(0, 1);
- joinColumns = joinTable.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 {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getJoinTable();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- JoinTableAnnotation joinTableResource = (JoinTableAnnotation) attributeResource.addSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- joinTableResource.addJoinColumn(0);
- joinTableResource.addJoinColumn(1);
- joinTableResource.addJoinColumn(2);
-
- joinTableResource.joinColumnAt(0).setName("FOO");
- joinTableResource.joinColumnAt(1).setName("BAR");
- joinTableResource.joinColumnAt(2).setName("BAZ");
-
- ListIterator<JoinColumn> joinColumns = joinTable.specifiedJoinColumns();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.moveJoinColumn(2, 0);
- joinColumns = joinTable.specifiedJoinColumns();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.moveJoinColumn(0, 1);
- joinColumns = joinTable.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.removeJoinColumn(1);
- joinColumns = joinTable.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.removeJoinColumn(1);
- joinColumns = joinTable.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.removeJoinColumn(0);
- assertFalse(joinTable.specifiedJoinColumns().hasNext());
- }
-
- public void testGetDefaultJoinColumn() {
- //TODO
- }
-
- public void testSpecifiedJoinColumnsSize() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getJoinTable();
-
- assertEquals(0, joinTable.specifiedJoinColumnsSize());
-
- joinTable.addSpecifiedJoinColumn(0);
- assertEquals(1, joinTable.specifiedJoinColumnsSize());
-
- joinTable.removeSpecifiedJoinColumn(0);
- assertEquals(0, joinTable.specifiedJoinColumnsSize());
- }
-
- public void testJoinColumnsSize() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getJoinTable();
-
- assertEquals(1, joinTable.joinColumnsSize());
-
- joinTable.addSpecifiedJoinColumn(0);
- assertEquals(1, joinTable.joinColumnsSize());
-
- joinTable.addSpecifiedJoinColumn(0);
- assertEquals(2, joinTable.joinColumnsSize());
-
- joinTable.removeSpecifiedJoinColumn(0);
- joinTable.removeSpecifiedJoinColumn(0);
- assertEquals(1, joinTable.joinColumnsSize());
-
- //if non-owning side of the relationship then no default join column
- manyToManyMapping.setMappedBy("foo");
- assertEquals(0, joinTable.joinColumnsSize());
- }
-
- public void testAddSpecifiedInverseJoinColumn() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getJoinTable();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
-
- JoinColumn inverseJoinColumn = joinTable.addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("FOO");
-
- JoinTableAnnotation joinTableResource = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertEquals("FOO", joinTableResource.inverseJoinColumnAt(0).getName());
-
- JoinColumn inverseJoinColumn2 = joinTable.addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", joinTableResource.inverseJoinColumnAt(0).getName());
- assertEquals("FOO", joinTableResource.inverseJoinColumnAt(1).getName());
-
- JoinColumn inverseJoinColumn3 = joinTable.addSpecifiedInverseJoinColumn(1);
- inverseJoinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", joinTableResource.inverseJoinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.inverseJoinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.inverseJoinColumnAt(2).getName());
-
- ListIterator<JoinColumn> inverseJoinColumns = joinTable.specifiedInverseJoinColumns();
- assertEquals(inverseJoinColumn2, inverseJoinColumns.next());
- assertEquals(inverseJoinColumn3, inverseJoinColumns.next());
- assertEquals(inverseJoinColumn, inverseJoinColumns.next());
-
- inverseJoinColumns = joinTable.specifiedInverseJoinColumns();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("BAZ", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedInverseJoinColumn() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getJoinTable();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- joinTable.addSpecifiedInverseJoinColumn(0).setSpecifiedName("FOO");
- joinTable.addSpecifiedInverseJoinColumn(1).setSpecifiedName("BAR");
- joinTable.addSpecifiedInverseJoinColumn(2).setSpecifiedName("BAZ");
-
- JoinTableAnnotation joinTableResource = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals(3, joinTableResource.inverseJoinColumnsSize());
-
- joinTable.removeSpecifiedInverseJoinColumn(0);
- assertEquals(2, joinTableResource.inverseJoinColumnsSize());
- assertEquals("BAR", joinTableResource.inverseJoinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.inverseJoinColumnAt(1).getName());
-
- joinTable.removeSpecifiedInverseJoinColumn(0);
- assertEquals(1, joinTableResource.inverseJoinColumnsSize());
- assertEquals("BAZ", joinTableResource.inverseJoinColumnAt(0).getName());
-
- joinTable.removeSpecifiedInverseJoinColumn(0);
- assertEquals(0, joinTableResource.inverseJoinColumnsSize());
- }
-
- public void testMoveSpecifiedInverseJoinColumn() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getJoinTable();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- joinTable.addSpecifiedInverseJoinColumn(0).setSpecifiedName("FOO");
- joinTable.addSpecifiedInverseJoinColumn(1).setSpecifiedName("BAR");
- joinTable.addSpecifiedInverseJoinColumn(2).setSpecifiedName("BAZ");
-
- JoinTableAnnotation joinTableResource = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals(3, joinTableResource.inverseJoinColumnsSize());
-
-
- joinTable.moveSpecifiedInverseJoinColumn(2, 0);
- ListIterator<JoinColumn> inverseJoinColumns = joinTable.specifiedInverseJoinColumns();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("BAZ", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
-
- assertEquals("BAR", joinTableResource.inverseJoinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.inverseJoinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.inverseJoinColumnAt(2).getName());
-
-
- joinTable.moveSpecifiedInverseJoinColumn(0, 1);
- inverseJoinColumns = joinTable.specifiedInverseJoinColumns();
- assertEquals("BAZ", inverseJoinColumns.next().getName());
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
-
- assertEquals("BAZ", joinTableResource.inverseJoinColumnAt(0).getName());
- assertEquals("BAR", joinTableResource.inverseJoinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.inverseJoinColumnAt(2).getName());
- }
-
- public void testUpdateInverseJoinColumns() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getJoinTable();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- JoinTableAnnotation joinTableResource = (JoinTableAnnotation) attributeResource.addSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- joinTableResource.addInverseJoinColumn(0);
- joinTableResource.addInverseJoinColumn(1);
- joinTableResource.addInverseJoinColumn(2);
-
- joinTableResource.inverseJoinColumnAt(0).setName("FOO");
- joinTableResource.inverseJoinColumnAt(1).setName("BAR");
- joinTableResource.inverseJoinColumnAt(2).setName("BAZ");
-
- ListIterator<JoinColumn> inverseJoinColumns = joinTable.specifiedInverseJoinColumns();
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("BAZ", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- joinTableResource.moveInverseJoinColumn(2, 0);
- inverseJoinColumns = joinTable.specifiedInverseJoinColumns();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("BAZ", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- joinTableResource.moveInverseJoinColumn(0, 1);
- inverseJoinColumns = joinTable.specifiedInverseJoinColumns();
- assertEquals("BAZ", inverseJoinColumns.next().getName());
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- joinTableResource.removeInverseJoinColumn(1);
- inverseJoinColumns = joinTable.specifiedInverseJoinColumns();
- assertEquals("BAZ", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- joinTableResource.removeInverseJoinColumn(1);
- inverseJoinColumns = joinTable.specifiedInverseJoinColumns();
- assertEquals("BAZ", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- joinTableResource.removeInverseJoinColumn(0);
- assertFalse(joinTable.specifiedInverseJoinColumns().hasNext());
- }
-
- public void testGetDefaultInverseJoinColumn() {
- //TODO
- }
-
- public void testSpecifiedInverseJoinColumnsSize() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getJoinTable();
-
- assertEquals(0, joinTable.specifiedInverseJoinColumnsSize());
-
- joinTable.addSpecifiedInverseJoinColumn(0);
- assertEquals(1, joinTable.specifiedInverseJoinColumnsSize());
-
- joinTable.removeSpecifiedInverseJoinColumn(0);
- assertEquals(0, joinTable.specifiedInverseJoinColumnsSize());
- }
-
- public void testInverseJoinColumnsSize() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getJoinTable();
-
- assertEquals(1, joinTable.inverseJoinColumnsSize());
-
- joinTable.addSpecifiedInverseJoinColumn(0);
- assertEquals(1, joinTable.inverseJoinColumnsSize());
-
- joinTable.addSpecifiedInverseJoinColumn(0);
- assertEquals(2, joinTable.inverseJoinColumnsSize());
-
- joinTable.removeSpecifiedInverseJoinColumn(0);
- joinTable.removeSpecifiedInverseJoinColumn(0);
- assertEquals(1, joinTable.inverseJoinColumnsSize());
-
- //if non-owning side of the relationship then no default join column
- manyToManyMapping.setMappedBy("foo");
- assertEquals(0, joinTable.inverseJoinColumnsSize());
- }
-
- public void testUniqueConstraints() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JoinTable joinTable = ((JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping()).getJoinTable();
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = joinTable.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) attributeResource.addSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "bar");
-
- uniqueConstraints = joinTable.uniqueConstraints();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().columnNames().next());
- assertEquals("foo", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JoinTable joinTable = ((JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping()).getJoinTable();
-
- assertEquals(0, joinTable.uniqueConstraintsSize());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) attributeResource.addSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- joinTableAnnotation.addUniqueConstraint(1).addColumnName(0, "bar");
-
- assertEquals(2, joinTable.uniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JoinTable joinTable = ((JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping()).getJoinTable();
- joinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- joinTable.addUniqueConstraint(0).addColumnName(0, "BAR");
- joinTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.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 {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JoinTable joinTable = ((JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping()).getJoinTable();
- joinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- joinTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- joinTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.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 {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JoinTable joinTable = ((JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping()).getJoinTable();
- joinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- joinTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- joinTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertEquals(3, joinTableAnnotation.uniqueConstraintsSize());
-
- joinTable.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 = joinTable.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- joinTable.removeUniqueConstraint(1);
- uniqueConstraintAnnotations = joinTableAnnotation.uniqueConstraints();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNames().next());
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- uniqueConstraints = joinTable.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- joinTable.removeUniqueConstraint(0);
- uniqueConstraintAnnotations = joinTableAnnotation.uniqueConstraints();
- assertFalse(uniqueConstraintAnnotations.hasNext());
- uniqueConstraints = joinTable.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JoinTable joinTable = ((JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping()).getJoinTable();
- joinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- joinTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- joinTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertEquals(3, joinTableAnnotation.uniqueConstraintsSize());
-
-
- joinTable.moveUniqueConstraint(2, 0);
- ListIterator<UniqueConstraint> uniqueConstraints = joinTable.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());
-
-
- joinTable.moveUniqueConstraint(0, 1);
- uniqueConstraints = joinTable.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 {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JoinTable joinTable = ((JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping()).getJoinTable();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) attributeResource.addSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- joinTableAnnotation.addUniqueConstraint(0).addColumnName("FOO");
- joinTableAnnotation.addUniqueConstraint(1).addColumnName("BAR");
- joinTableAnnotation.addUniqueConstraint(2).addColumnName("BAZ");
-
-
- ListIterator<UniqueConstraint> uniqueConstraints = joinTable.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);
- uniqueConstraints = joinTable.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);
- uniqueConstraints = joinTable.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);
- uniqueConstraints = joinTable.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.removeUniqueConstraint(1);
- uniqueConstraints = joinTable.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.removeUniqueConstraint(0);
- uniqueConstraints = joinTable.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToManyMappingTests.java
deleted file mode 100644
index d515236b80..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToManyMappingTests.java
+++ /dev/null
@@ -1,963 +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.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.BasicMapping;
-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.OneToOneMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-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.JavaPersistentType;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.resource.java.BasicAnnotation;
-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.JoinTableAnnotation;
-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.OneToManyAnnotation;
-import org.eclipse.jpt.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.core.resource.java.OrderByAnnotation;
-import org.eclipse.jpt.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class JavaManyToManyMappingTests extends ContextModelTestCase
-{
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
- private ICompilationUnit createTestEntityWithCollectionManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private Collection addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
- private ICompilationUnit createTestEntityWithNonCollectionManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private Address addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestDepartment() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append("import java.util.Map;");
- sb.append(CR);
- sb.append("import ").append(JPA.MANY_TO_MANY).append(";");
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Department").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private Map<Integer, Employee> employees;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Department.java", sourceWriter);
- }
-
- private void createTestEmployee() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Employee").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int empId;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Employee.java", sourceWriter);
- }
-
- public JavaManyToManyMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.setOrderBy("asdf");
- manyToManyMapping.getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.setOrderBy("asdf");
- manyToManyMapping.getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertNull(persistentAttribute.getSpecifiedMapping());
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.setOrderBy("asdf");
- manyToManyMapping.getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.setOrderBy("asdf");
- manyToManyMapping.getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.setOrderBy("asdf");
- manyToManyMapping.getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.setOrderBy("asdf");
- manyToManyMapping.getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.setOrderBy("asdf");
- manyToManyMapping.getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.setOrderBy("asdf");
- manyToManyMapping.getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.setOrderBy("asdf");
- manyToManyMapping.getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.setOrderBy("asdf");
- manyToManyMapping.getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateSpecifiedTargetEntity() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation();
-
- assertNull(manyToManyMapping.getSpecifiedTargetEntity());
- assertNull(manyToMany.getTargetEntity());
-
- //set target entity in the resource model, verify context model updated
- manyToMany.setTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", manyToManyMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", manyToMany.getTargetEntity());
-
- //set target entity to null in the resource model
- manyToMany.setTargetEntity(null);
- assertNull(manyToManyMapping.getSpecifiedTargetEntity());
- assertNull(manyToMany.getTargetEntity());
- }
-
- public void testModifySpecifiedTargetEntity() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation();
-
- assertNull(manyToManyMapping.getSpecifiedTargetEntity());
- assertNull(manyToMany.getTargetEntity());
-
- //set target entity in the context model, verify resource model updated
- manyToManyMapping.setSpecifiedTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", manyToManyMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", manyToMany.getTargetEntity());
-
- //set target entity to null in the context model
- manyToManyMapping.setSpecifiedTargetEntity(null);
- assertNull(manyToManyMapping.getSpecifiedTargetEntity());
- assertNull(manyToMany.getTargetEntity());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation();
-
- assertNull(manyToManyMapping.getSpecifiedFetch());
- assertNull(manyToMany.getFetch());
-
- //set fetch in the resource model, verify context model updated
- manyToMany.setFetch(org.eclipse.jpt.core.resource.java.FetchType.EAGER);
- assertEquals(FetchType.EAGER, manyToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.core.resource.java.FetchType.EAGER, manyToMany.getFetch());
-
- manyToMany.setFetch(org.eclipse.jpt.core.resource.java.FetchType.LAZY);
- assertEquals(FetchType.LAZY, manyToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.core.resource.java.FetchType.LAZY, manyToMany.getFetch());
-
-
- //set fetch to null in the resource model
- manyToMany.setFetch(null);
- assertNull(manyToManyMapping.getSpecifiedFetch());
- assertNull(manyToMany.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation();
-
- assertNull(manyToManyMapping.getSpecifiedFetch());
- assertNull(manyToMany.getFetch());
-
- //set fetch in the context model, verify resource model updated
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(FetchType.EAGER, manyToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.core.resource.java.FetchType.EAGER, manyToMany.getFetch());
-
- manyToManyMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, manyToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.core.resource.java.FetchType.LAZY, manyToMany.getFetch());
-
-
- //set fetch to null in the context model
- manyToManyMapping.setSpecifiedFetch(null);
- assertNull(manyToManyMapping.getSpecifiedFetch());
- assertNull(manyToMany.getFetch());
- }
-
- public void testUpdateMappedBy() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation();
-
- assertNull(manyToManyMapping.getMappedBy());
- assertNull(manyToMany.getMappedBy());
-
- //set mappedBy in the resource model, verify context model updated
- manyToMany.setMappedBy("newMappedBy");
- assertEquals("newMappedBy", manyToManyMapping.getMappedBy());
- assertEquals("newMappedBy", manyToMany.getMappedBy());
-
- //set mappedBy to null in the resource model
- manyToMany.setMappedBy(null);
- assertNull(manyToManyMapping.getMappedBy());
- assertNull(manyToMany.getMappedBy());
- }
-
- public void testModifyMappedBy() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation();
-
- assertNull(manyToManyMapping.getMappedBy());
- assertNull(manyToMany.getMappedBy());
-
- //set mappedBy in the context model, verify resource model updated
- manyToManyMapping.setMappedBy("newTargetEntity");
- assertEquals("newTargetEntity", manyToManyMapping.getMappedBy());
- assertEquals("newTargetEntity", manyToMany.getMappedBy());
-
- //set mappedBy to null in the context model
- manyToManyMapping.setMappedBy(null);
- assertNull(manyToManyMapping.getMappedBy());
- assertNull(manyToMany.getMappedBy());
- }
-
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames = manyToManyMapping.candidateMappedByAttributeNames();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames = manyToManyMapping.candidateMappedByAttributeNames();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames = manyToManyMapping.candidateMappedByAttributeNames();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
- }
-
- public void testDefaultTargetEntity() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit, default still set, handled by validation
- assertEquals(PACKAGE_NAME + ".Address", manyToManyMapping.getDefaultTargetEntity());
-
- //add targetEntity to the persistence unit
- addXmlClassRef(PACKAGE_NAME + ".Address");
- assertEquals(PACKAGE_NAME + ".Address", manyToManyMapping.getDefaultTargetEntity());
-
- //test default still the same when specified target entity it set
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- assertEquals(PACKAGE_NAME + ".Address", manyToManyMapping.getDefaultTargetEntity());
-
- ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- JavaPersistentType addressPersistentType = addressClassRef.getJavaPersistentType();
-
- //test target is not an Entity, default target entity still exists, this case handled with validation
- addressPersistentType.setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertEquals(PACKAGE_NAME + ".Address", manyToManyMapping.getDefaultTargetEntity());
- }
-
- public void testDefaultTargetEntityCollectionType() throws Exception {
- createTestEntityWithCollectionManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- assertNull(manyToManyMapping.getDefaultTargetEntity());
- }
-
- public void testDefaultTargetEntityNonCollectionType() throws Exception {
- createTestEntityWithNonCollectionManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- assertNull(manyToManyMapping.getDefaultTargetEntity());
- }
-
- public void testTargetEntity() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- assertEquals(PACKAGE_NAME + ".Address", manyToManyMapping.getTargetEntity());
-
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- assertEquals("foo", manyToManyMapping.getTargetEntity());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals(PACKAGE_NAME + ".Address", manyToManyMapping.getTargetEntity());
- }
-
- public void testResolvedTargetEntity() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit
- assertNull(manyToManyMapping.getResolvedTargetEntity());
-
- //add targetEntity to the persistence unit, now target entity should resolve
- createTestTargetEntityAddress();
- addXmlClassRef(PACKAGE_NAME + ".Address");
- ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- TypeMapping addressTypeMapping = addressClassRef.getJavaPersistentType().getMapping();
- assertEquals(addressTypeMapping, manyToManyMapping.getResolvedTargetEntity());
-
- //test default still the same when specified target entity it set
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- assertNull(manyToManyMapping.getResolvedTargetEntity());
-
-
- manyToManyMapping.setSpecifiedTargetEntity(PACKAGE_NAME + ".Address");
- assertEquals(addressTypeMapping, manyToManyMapping.getResolvedTargetEntity());
-
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals(addressTypeMapping, manyToManyMapping.getResolvedTargetEntity());
- }
-
-
- public void testUpdateMapKey() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertNull(manyToManyMapping.getMapKey());
- assertNull(attributeResource.getSupportingAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- attributeResource.addSupportingAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(manyToManyMapping.getMapKey());
- MapKeyAnnotation mapKey = (MapKeyAnnotation) attributeResource.getSupportingAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNotNull(mapKey);
-
- //set mapKey name in the resource model, verify context model updated
- mapKey.setName("myMapKey");
- assertEquals("myMapKey", manyToManyMapping.getMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey name to null in the resource model
- mapKey.setName(null);
- assertNull(manyToManyMapping.getMapKey());
- assertNull(mapKey.getName());
-
- mapKey.setName("myMapKey");
- attributeResource.removeSupportingAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(manyToManyMapping.getMapKey());
- assertNull(attributeResource.getSupportingAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKey() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertNull(manyToManyMapping.getMapKey());
- assertNull(attributeResource.getSupportingAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- manyToManyMapping.setMapKey("myMapKey");
- MapKeyAnnotation mapKey = (MapKeyAnnotation) attributeResource.getSupportingAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertEquals("myMapKey", manyToManyMapping.getMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey to null in the context model
- manyToManyMapping.setMapKey(null);
- assertNull(manyToManyMapping.getMapKey());
- assertNull(attributeResource.getSupportingAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateOrderBy() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertNull(manyToManyMapping.getOrderBy());
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set orderBy in the resource model, verify context model updated
- attributeResource.addSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- OrderByAnnotation orderBy = (OrderByAnnotation) attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- orderBy.setValue("newOrderBy");
- assertEquals("newOrderBy", manyToManyMapping.getOrderBy());
- assertEquals("newOrderBy", orderBy.getValue());
-
- //set orderBy to null in the resource model
- attributeResource.removeSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertNull(manyToManyMapping.getOrderBy());
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyOrderBy() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertNull(manyToManyMapping.getOrderBy());
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set mappedBy in the context model, verify resource model updated
- manyToManyMapping.setOrderBy("newOrderBy");
- assertEquals("newOrderBy", manyToManyMapping.getOrderBy());
- OrderByAnnotation orderBy = (OrderByAnnotation) attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertEquals("newOrderBy", orderBy.getValue());
-
- //set mappedBy to null in the context model
- manyToManyMapping.setOrderBy(null);
- assertNull(manyToManyMapping.getOrderBy());
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateNoOrdering() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertTrue(manyToManyMapping.isNoOrdering());
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set orderBy in the resource model, verify context model updated
- attributeResource.addSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isNoOrdering());
-
- OrderByAnnotation orderBy = (OrderByAnnotation) attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- orderBy.setValue("newOrderBy");
- assertFalse(manyToManyMapping.isNoOrdering());
-
- //set orderBy to null in the resource model
- attributeResource.removeSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertTrue(manyToManyMapping.isNoOrdering());
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyNoOrdering() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertTrue(manyToManyMapping.isNoOrdering());
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
-// manyToManyMapping.setNoOrdering(false); //this does nothing
-// //set mappedBy in the context model, verify resource model updated
-// manyToManyMapping.setOrderBy("newOrderBy");
-// assertEquals("newOrderBy", manyToManyMapping.getOrderBy());
-// OrderBy orderBy = (OrderBy) attributeResource.annotation(OrderBy.ANNOTATION_NAME);
-// assertEquals("newOrderBy", orderBy.getValue());
-//
-// //set mappedBy to null in the context model
-// manyToManyMapping.setOrderBy(null);
-// assertNull(manyToManyMapping.getOrderBy());
-// assertNull(attributeResource.annotation(OrderBy.ANNOTATION_NAME));
- }
-
- public void testUpdatePkOrdering() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertFalse(manyToManyMapping.isPkOrdering());
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set orderBy in the resource model, verify context model updated
- attributeResource.addSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertTrue(manyToManyMapping.isPkOrdering());
-
- OrderByAnnotation orderBy = (OrderByAnnotation) attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- orderBy.setValue("newOrderBy");
- assertFalse(manyToManyMapping.isPkOrdering());
-
- //set orderBy to null in the resource model
- attributeResource.removeSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isPkOrdering());
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateCustomOrdering() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertFalse(manyToManyMapping.isCustomOrdering());
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set orderBy in the resource model, verify context model updated
- attributeResource.addSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isCustomOrdering());
-
- OrderByAnnotation orderBy = (OrderByAnnotation) attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- orderBy.setValue("newOrderBy");
- assertTrue(manyToManyMapping.isCustomOrdering());
-
- //set orderBy to null in the resource model
- attributeResource.removeSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isCustomOrdering());
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testDefaultTargetEntityForMap() throws Exception {
- createTestEmployee();
- createTestDepartment();
- addXmlClassRef(PACKAGE_NAME + ".Department");
- addXmlClassRef(PACKAGE_NAME + ".Employee");
-
- JavaPersistentType departmentPersistentType = javaPersistentType();
- ManyToManyMapping employeesMapping = (ManyToManyMapping) departmentPersistentType.getAttributeNamed("employees").getSpecifiedMapping();
- assertEquals(PACKAGE_NAME + ".Employee", employeesMapping.getTargetEntity());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToOneMappingTests.java
deleted file mode 100644
index 7bc46eca6c..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToOneMappingTests.java
+++ /dev/null
@@ -1,886 +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.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.BasicMapping;
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.core.context.JoinColumn;
-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.OneToOneMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-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.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.resource.java.BasicAnnotation;
-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.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JoinColumnsAnnotation;
-import org.eclipse.jpt.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class JavaManyToOneMappingTests extends ContextModelTestCase
-{
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithCollectionManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private Collection address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithGenericizedCollectionManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- public JavaManyToOneMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- manyToOneMapping.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- manyToOneMapping.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertNull(persistentAttribute.getSpecifiedMapping());
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- manyToOneMapping.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- manyToOneMapping.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- manyToOneMapping.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- manyToOneMapping.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- manyToOneMapping.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- manyToOneMapping.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- manyToOneMapping.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- manyToOneMapping.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateSpecifiedTargetEntity() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation();
-
- assertNull(manyToOneMapping.getSpecifiedTargetEntity());
- assertNull(manyToOne.getTargetEntity());
-
- //set target entity in the resource model, verify context model updated
- manyToOne.setTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", manyToOneMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", manyToOne.getTargetEntity());
-
- //set target entity to null in the resource model
- manyToOne.setTargetEntity(null);
- assertNull(manyToOneMapping.getSpecifiedTargetEntity());
- assertNull(manyToOne.getTargetEntity());
- }
-
- public void testModifySpecifiedTargetEntity() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation();
-
- assertNull(manyToOneMapping.getSpecifiedTargetEntity());
- assertNull(manyToOne.getTargetEntity());
-
- //set target entity in the context model, verify resource model updated
- manyToOneMapping.setSpecifiedTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", manyToOneMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", manyToOne.getTargetEntity());
-
- //set target entity to null in the context model
- manyToOneMapping.setSpecifiedTargetEntity(null);
- assertNull(manyToOneMapping.getSpecifiedTargetEntity());
- assertNull(manyToOne.getTargetEntity());
- }
-
- public void testUpdateSpecifiedOptional() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation();
-
- assertNull(manyToOneMapping.getSpecifiedOptional());
- assertNull(manyToOne.getOptional());
-
- //set optional in the resource model, verify context model updated
- manyToOne.setOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, manyToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.TRUE, manyToOne.getOptional());
-
- manyToOne.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, manyToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.FALSE, manyToOne.getOptional());
-
-
- //set optional to null in the resource model
- manyToOne.setOptional(null);
- assertNull(manyToOneMapping.getSpecifiedOptional());
- assertNull(manyToOne.getOptional());
- }
-
- public void testModifySpecifiedOptional() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation();
-
- assertNull(manyToOneMapping.getSpecifiedOptional());
- assertNull(manyToOne.getOptional());
-
- //set optional in the context model, verify resource model updated
- manyToOneMapping.setSpecifiedOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, manyToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.TRUE, manyToOne.getOptional());
-
- manyToOneMapping.setSpecifiedOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, manyToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.FALSE, manyToOne.getOptional());
-
-
- //set optional to null in the context model
- manyToOneMapping.setSpecifiedOptional(null);
- assertNull(manyToOneMapping.getSpecifiedOptional());
- assertNull(manyToOne.getOptional());
- }
-
-
- public void testSpecifiedJoinColumns() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- ListIterator<JavaJoinColumn> specifiedJoinColumns = manyToOneMapping.specifiedJoinColumns();
-
- assertFalse(specifiedJoinColumns.hasNext());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- //add an annotation to the resource model and verify the context model is updated
- JoinColumnAnnotation joinColumn = (JoinColumnAnnotation) attributeResource.addSupportingAnnotation(0, JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- joinColumn.setName("FOO");
- specifiedJoinColumns = manyToOneMapping.specifiedJoinColumns();
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
- joinColumn = (JoinColumnAnnotation) attributeResource.addSupportingAnnotation(0, JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- joinColumn.setName("BAR");
- specifiedJoinColumns = manyToOneMapping.specifiedJoinColumns();
- assertEquals("BAR", specifiedJoinColumns.next().getName());
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
-
- joinColumn = (JoinColumnAnnotation) attributeResource.addSupportingAnnotation(0, JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- joinColumn.setName("BAZ");
- specifiedJoinColumns = manyToOneMapping.specifiedJoinColumns();
- assertEquals("BAZ", specifiedJoinColumns.next().getName());
- assertEquals("BAR", specifiedJoinColumns.next().getName());
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- attributeResource.moveSupportingAnnotation(1, 0, JPA.JOIN_COLUMNS);
- specifiedJoinColumns = manyToOneMapping.specifiedJoinColumns();
- assertEquals("BAR", specifiedJoinColumns.next().getName());
- assertEquals("BAZ", specifiedJoinColumns.next().getName());
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
- attributeResource.removeSupportingAnnotation(0, JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- specifiedJoinColumns = manyToOneMapping.specifiedJoinColumns();
- assertEquals("BAZ", specifiedJoinColumns.next().getName());
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
- attributeResource.removeSupportingAnnotation(0, JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- specifiedJoinColumns = manyToOneMapping.specifiedJoinColumns();
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
-
- attributeResource.removeSupportingAnnotation(0, JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- specifiedJoinColumns = manyToOneMapping.specifiedJoinColumns();
- assertFalse(specifiedJoinColumns.hasNext());
- }
-
- public void testGetDefaultJoin() {
- //TODO
- }
-
- public void testSpecifiedJoinColumnsSize() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- assertEquals(0, manyToOneMapping.specifiedJoinColumnsSize());
-
- manyToOneMapping.addSpecifiedJoinColumn(0);
- assertEquals(1, manyToOneMapping.specifiedJoinColumnsSize());
-
- manyToOneMapping.removeSpecifiedJoinColumn(0);
- assertEquals(0, manyToOneMapping.specifiedJoinColumnsSize());
- }
-
- public void testJoinColumnsSize() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- assertEquals(1, manyToOneMapping.joinColumnsSize());
-
- manyToOneMapping.addSpecifiedJoinColumn(0);
- assertEquals(1, manyToOneMapping.joinColumnsSize());
-
- manyToOneMapping.addSpecifiedJoinColumn(0);
- assertEquals(2, manyToOneMapping.joinColumnsSize());
-
- manyToOneMapping.removeSpecifiedJoinColumn(0);
- manyToOneMapping.removeSpecifiedJoinColumn(0);
- assertEquals(1, manyToOneMapping.joinColumnsSize());
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- manyToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- manyToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("BAR");
- manyToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- Iterator<NestableAnnotation> joinColumns = attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
-
- assertEquals("BAZ", ((JoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("BAR", ((JoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumns.next()).getName());
- assertFalse(joinColumns.hasNext());
- }
-
- public void testAddSpecifiedJoinColumn2() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- manyToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- manyToOneMapping.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- manyToOneMapping.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- Iterator<NestableAnnotation> joinColumns = attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
-
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("BAR", ((JoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("BAZ", ((JoinColumnAnnotation) joinColumns.next()).getName());
- assertFalse(joinColumns.hasNext());
- }
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- manyToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- manyToOneMapping.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- manyToOneMapping.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertEquals(3, CollectionTools.size(attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME)));
-
- manyToOneMapping.removeSpecifiedJoinColumn(1);
-
- Iterator<NestableAnnotation> joinColumnResources = attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumnResources.next()).getName());
- assertEquals("BAZ", ((JoinColumnAnnotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- Iterator<JoinColumn> joinColumns = manyToOneMapping.specifiedJoinColumns();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
-
- manyToOneMapping.removeSpecifiedJoinColumn(1);
- joinColumnResources = attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- joinColumns = manyToOneMapping.specifiedJoinColumns();
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
-
- manyToOneMapping.removeSpecifiedJoinColumn(0);
- joinColumnResources = attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
- assertFalse(joinColumnResources.hasNext());
- joinColumns = manyToOneMapping.specifiedJoinColumns();
- assertFalse(joinColumns.hasNext());
-
- assertNull(attributeResource.getSupportingAnnotation(JoinColumnsAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- manyToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- manyToOneMapping.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- manyToOneMapping.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourcePersistentAttribute attributeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next();
-
- ListIterator<NestableAnnotation> javaJoinColumns = attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
- assertEquals(3, CollectionTools.size(javaJoinColumns));
-
-
- manyToOneMapping.moveSpecifiedJoinColumn(2, 0);
- ListIterator<JoinColumn> primaryKeyJoinColumns = manyToOneMapping.specifiedJoinColumns();
- assertEquals("BAR", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getSpecifiedName());
-
- javaJoinColumns = attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
- assertEquals("BAR", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("BAZ", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
-
-
- manyToOneMapping.moveSpecifiedJoinColumn(0, 1);
- primaryKeyJoinColumns = manyToOneMapping.specifiedJoinColumns();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getSpecifiedName());
-
- javaJoinColumns = attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
- assertEquals("BAZ", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("BAR", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- }
-
- public void testUpdateSpecifiedJoinColumns() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JavaResourcePersistentAttribute attributeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next();
-
- ((JoinColumnAnnotation) attributeResource.addSupportingAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((JoinColumnAnnotation) attributeResource.addSupportingAnnotation(1, JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((JoinColumnAnnotation) attributeResource.addSupportingAnnotation(2, JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME)).setName("BAZ");
-
- ListIterator<JoinColumn> joinColumns = manyToOneMapping.specifiedJoinColumns();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- attributeResource.moveSupportingAnnotation(2, 0, JoinColumnsAnnotation.ANNOTATION_NAME);
- joinColumns = manyToOneMapping.specifiedJoinColumns();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- attributeResource.moveSupportingAnnotation(0, 1, JoinColumnsAnnotation.ANNOTATION_NAME);
- joinColumns = manyToOneMapping.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- attributeResource.removeSupportingAnnotation(1, JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
- joinColumns = manyToOneMapping.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- attributeResource.removeSupportingAnnotation(1, JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
- joinColumns = manyToOneMapping.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- attributeResource.removeSupportingAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
- joinColumns = manyToOneMapping.specifiedJoinColumns();
- assertFalse(joinColumns.hasNext());
- }
- public void testJoinColumnIsVirtual() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- assertTrue(manyToOneMapping.getDefaultJoinColumn().isVirtual());
-
- manyToOneMapping.addSpecifiedJoinColumn(0);
- JoinColumn specifiedJoinColumn = manyToOneMapping.specifiedJoinColumns().next();
- assertFalse(specifiedJoinColumn.isVirtual());
-
- assertNull(manyToOneMapping.getDefaultJoinColumn());
- }
-
- public void testDefaultTargetEntity() throws Exception {
- createTestEntityWithValidManyToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit, default still set, handled by validation
- assertEquals(PACKAGE_NAME + ".Address", manyToOneMapping.getDefaultTargetEntity());
-
- //add targetEntity to the persistence unit
- addXmlClassRef(PACKAGE_NAME + ".Address");
- assertEquals(PACKAGE_NAME + ".Address", manyToOneMapping.getDefaultTargetEntity());
-
- //test default still the same when specified target entity it set
- manyToOneMapping.setSpecifiedTargetEntity("foo");
- assertEquals(PACKAGE_NAME + ".Address", manyToOneMapping.getDefaultTargetEntity());
-
- ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- JavaPersistentType addressPersistentType = addressClassRef.getJavaPersistentType();
-
- //test target is not an Entity, default target entity still exists, this case handled with validation
- addressPersistentType.setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertEquals(PACKAGE_NAME + ".Address", manyToOneMapping.getDefaultTargetEntity());
- }
-
- public void testDefaultTargetEntityCollectionType() throws Exception {
- createTestEntityWithCollectionManyToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- assertNull(manyToOneMapping.getDefaultTargetEntity());
- }
-
- public void testDefaultTargetEntityGenericizedCollectionType() throws Exception {
- createTestEntityWithGenericizedCollectionManyToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- assertNull(manyToOneMapping.getDefaultTargetEntity());
- }
-
- public void testTargetEntity() throws Exception {
- createTestEntityWithValidManyToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- assertEquals(PACKAGE_NAME + ".Address", manyToOneMapping.getTargetEntity());
-
- manyToOneMapping.setSpecifiedTargetEntity("foo");
- assertEquals("foo", manyToOneMapping.getTargetEntity());
-
- manyToOneMapping.setSpecifiedTargetEntity(null);
- assertEquals(PACKAGE_NAME + ".Address", manyToOneMapping.getTargetEntity());
- }
-
- public void testResolvedTargetEntity() throws Exception {
- createTestEntityWithValidManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit
- assertNull(manyToOneMapping.getResolvedTargetEntity());
-
- //add targetEntity to the persistence unit, now target entity should resolve
- createTestTargetEntityAddress();
- addXmlClassRef(PACKAGE_NAME + ".Address");
- ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- TypeMapping addressTypeMapping = addressClassRef.getJavaPersistentType().getMapping();
- assertEquals(addressTypeMapping, manyToOneMapping.getResolvedTargetEntity());
-
- //test default still the same when specified target entity it set
- manyToOneMapping.setSpecifiedTargetEntity("foo");
- assertNull(manyToOneMapping.getResolvedTargetEntity());
-
-
- manyToOneMapping.setSpecifiedTargetEntity(PACKAGE_NAME + ".Address");
- assertEquals(addressTypeMapping, manyToOneMapping.getResolvedTargetEntity());
-
-
- manyToOneMapping.setSpecifiedTargetEntity(null);
- assertEquals(addressTypeMapping, manyToOneMapping.getResolvedTargetEntity());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaMappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaMappedSuperclassTests.java
deleted file mode 100644
index 8991ebee5f..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaMappedSuperclassTests.java
+++ /dev/null
@@ -1,245 +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.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.Embeddable;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.MappedSuperclass;
-import org.eclipse.jpt.core.internal.context.java.JavaNullTypeMapping;
-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.resource.java.MappedSuperclassAnnotation;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JavaMappedSuperclassTests extends ContextModelTestCase
-{
-
- 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");
- }
- });
- }
-
-
- public JavaMappedSuperclassTests(String name) {
- super(name);
- }
-
- public void testMorphToEntity() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping();
- mappedSuperclass.setIdClass("myIdClass");
-
- javaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
- assertTrue(javaPersistentType().getMapping() instanceof Entity);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- assertNull(typeResource.getMappingAnnotation(MappedSuperclassAnnotation.ANNOTATION_NAME));
- assertNotNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddable() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping();
- mappedSuperclass.setIdClass("myIdClass");
-
- javaPersistentType().setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
- assertTrue(javaPersistentType().getMapping() instanceof Embeddable);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- assertNull(typeResource.getMappingAnnotation(MappedSuperclassAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToNull() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping();
- mappedSuperclass.setIdClass("myIdClass");
-
- javaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertTrue(javaPersistentType().getMapping() instanceof JavaNullTypeMapping);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- assertNull(typeResource.getMappingAnnotation(MappedSuperclassAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- }
-
-
- public void testMappedSuperclass() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertTrue(javaPersistentType().getMapping() instanceof MappedSuperclass);
- }
-
- public void testOverridableAttributeNames() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping();
- Iterator<String> overridableAttributeNames = mappedSuperclass.overridableAttributeNames();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testOverridableAssociationNames() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping();
- Iterator<String> overridableAssociationNames = mappedSuperclass.overridableAssociationNames();
- assertFalse(overridableAssociationNames.hasNext());
- }
-
- public void testTableNameIsInvalid() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping();
-
- assertFalse(mappedSuperclass.tableNameIsInvalid(FULLY_QUALIFIED_TYPE_NAME));
- assertFalse(mappedSuperclass.tableNameIsInvalid("FOO"));
- }
-
- public void testAssociatedTables() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping();
-
- assertFalse(mappedSuperclass.associatedTables().hasNext());
- }
-
- public void testAssociatedTablesIncludingInherited() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping();
-
- assertFalse(mappedSuperclass.associatedTablesIncludingInherited().hasNext());
- }
-
- public void testAssociatedTableNamesIncludingInherited() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping();
-
- assertFalse(mappedSuperclass.associatedTableNamesIncludingInherited().hasNext());
- }
-
- public void testAllOverridableAttributeNames() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping();
- Iterator<String> overridableAttributeNames = mappedSuperclass.overridableAttributeNames();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- //TODO need to create a subclass mappedSuperclass and test this
- public void testAllOverridableAssociationNames() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping();
- Iterator<String> overridableAssociationNames = mappedSuperclass.overridableAssociationNames();
- assertFalse(overridableAssociationNames.hasNext());
- }
-
- public void testAttributeMappingKeyAllowed() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping();
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- }
-
- public void testUpdateIdClass() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping();
-
- assertNull(mappedSuperclass.getIdClass());
- assertNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME));
-
- IdClassAnnotation idClass = (IdClassAnnotation) typeResource.addSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- assertNull(mappedSuperclass.getIdClass());
- assertNotNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME));
-
- idClass.setValue("model.Foo");
- assertEquals("model.Foo", mappedSuperclass.getIdClass());
- assertEquals("model.Foo", ((IdClassAnnotation) typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME)).getValue());
-
- //test setting @IdClass value to null, IdClass annotation is removed
- idClass.setValue(null);
- assertNull(mappedSuperclass.getIdClass());
- assertNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME));
-
- //reset @IdClass value and then remove @IdClass
- idClass = (IdClassAnnotation) typeResource.addSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- idClass.setValue("model.Foo");
- typeResource.removeSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME);
-
- assertNull(mappedSuperclass.getIdClass());
- assertNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyIdClass() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping();
-
- assertNull(mappedSuperclass.getIdClass());
- assertNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME));
-
- mappedSuperclass.setIdClass("model.Foo");
- assertEquals("model.Foo", ((IdClassAnnotation) typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME)).getValue());
- assertEquals("model.Foo", mappedSuperclass.getIdClass());
-
- mappedSuperclass.setIdClass(null);
- assertNull(mappedSuperclass.getIdClass());
- assertNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaNamedNativeQueryTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaNamedNativeQueryTests.java
deleted file mode 100644
index 1ed5f7fa7c..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaNamedNativeQueryTests.java
+++ /dev/null
@@ -1,424 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.NamedNativeQuery;
-import org.eclipse.jpt.core.context.QueryHint;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.NamedNativeQueryAnnotation;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JavaNamedNativeQueryTests extends ContextModelTestCase
-{
- private static final String QUERY_NAME = "QUERY_NAME";
- private static final String QUERY_QUERY = "MY_QUERY";
-
- private ICompilationUnit createTestEntityWithNamedNativeQuery() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.NAMED_NATIVE_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@NamedNativeQuery(name=\"" + QUERY_NAME + "\", query=\"" + QUERY_QUERY + "\")");
- }
- });
- }
-
-
-
- public JavaNamedNativeQueryTests(String name) {
- super(name);
- }
-
- public void testUpdateName() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(QUERY_NAME, javaNamedNativeQuery.getName());
- assertEquals(QUERY_NAME, namedNativeQuery.getName());
-
- //set name to null in the resource model
- javaNamedNativeQuery.setName(null);
- assertNull(javaNamedNativeQuery.getName());
- assertNull(namedNativeQuery.getName());
-
- //set name in the resource model, verify context model updated
- javaNamedNativeQuery.setName("foo");
- assertEquals("foo", javaNamedNativeQuery.getName());
- assertEquals("foo", namedNativeQuery.getName());
- }
-
- public void testModifyName() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = javaEntity();
- NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(QUERY_NAME, javaNamedNativeQuery.getName());
- assertEquals(QUERY_NAME, namedNativeQuery.getName());
-
- //set name to null in the context model
- namedNativeQuery.setName(null);
- assertNull(javaNamedNativeQuery.getName());
- assertNull(namedNativeQuery.getName());
-
- //set name in the context model, verify resource model updated
- namedNativeQuery.setName("foo");
- assertEquals("foo", javaNamedNativeQuery.getName());
- assertEquals("foo", namedNativeQuery.getName());
- }
-
- public void testUpdateQuery() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(QUERY_QUERY, javaNamedNativeQuery.getQuery());
- assertEquals(QUERY_QUERY, namedNativeQuery.getQuery());
-
- //set name to null in the resource model
- javaNamedNativeQuery.setQuery(null);
- assertNull(javaNamedNativeQuery.getQuery());
- assertNull(namedNativeQuery.getQuery());
-
- //set name in the resource model, verify context model updated
- javaNamedNativeQuery.setQuery("foo");
- assertEquals("foo", javaNamedNativeQuery.getQuery());
- assertEquals("foo", namedNativeQuery.getQuery());
- }
-
- public void testModifyQuery() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = javaEntity();
- NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(QUERY_QUERY, javaNamedNativeQuery.getQuery());
- assertEquals(QUERY_QUERY, namedNativeQuery.getQuery());
-
- //set name to null in the context model
- namedNativeQuery.setQuery(null);
- assertNull(javaNamedNativeQuery.getQuery());
- assertNull(namedNativeQuery.getQuery());
-
- //set name in the context model, verify resource model updated
- namedNativeQuery.setQuery("foo");
- assertEquals("foo", javaNamedNativeQuery.getQuery());
- assertEquals("foo", namedNativeQuery.getQuery());
- }
-
-
- public void testAddHint() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = javaEntity();
- NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
-
- QueryHint queryHint = namedNativeQuery.addHint(0);
- ormResource().save(null);
- queryHint.setName("FOO");
- ormResource().save(null);
-
- assertEquals("FOO", javaNamedNativeQuery.hintAt(0).getName());
-
- QueryHint queryHint2 = namedNativeQuery.addHint(0);
- ormResource().save(null);
- queryHint2.setName("BAR");
- ormResource().save(null);
-
- assertEquals("BAR", javaNamedNativeQuery.hintAt(0).getName());
- assertEquals("FOO", javaNamedNativeQuery.hintAt(1).getName());
-
- QueryHint queryHint3 = namedNativeQuery.addHint(1);
- ormResource().save(null);
- queryHint3.setName("BAZ");
- ormResource().save(null);
-
- assertEquals("BAR", javaNamedNativeQuery.hintAt(0).getName());
- assertEquals("BAZ", javaNamedNativeQuery.hintAt(1).getName());
- assertEquals("FOO", javaNamedNativeQuery.hintAt(2).getName());
-
- ListIterator<QueryHint> hints = namedNativeQuery.hints();
- assertEquals(queryHint2, hints.next());
- assertEquals(queryHint3, hints.next());
- assertEquals(queryHint, hints.next());
-
- hints = namedNativeQuery.hints();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- }
-
- public void testRemoveHint() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = javaEntity();
- NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- namedNativeQuery.addHint(0).setName("FOO");
- namedNativeQuery.addHint(1).setName("BAR");
- namedNativeQuery.addHint(2).setName("BAZ");
-
- assertEquals(3, javaNamedNativeQuery.hintsSize());
-
- namedNativeQuery.removeHint(0);
- assertEquals(2, javaNamedNativeQuery.hintsSize());
- assertEquals("BAR", javaNamedNativeQuery.hintAt(0).getName());
- assertEquals("BAZ", javaNamedNativeQuery.hintAt(1).getName());
-
- namedNativeQuery.removeHint(0);
- assertEquals(1, javaNamedNativeQuery.hintsSize());
- assertEquals("BAZ", javaNamedNativeQuery.hintAt(0).getName());
-
- namedNativeQuery.removeHint(0);
- assertEquals(0, javaNamedNativeQuery.hintsSize());
- }
-
- public void testMoveHint() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = javaEntity();
- NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- namedNativeQuery.addHint(0).setName("FOO");
- namedNativeQuery.addHint(1).setName("BAR");
- namedNativeQuery.addHint(2).setName("BAZ");
-
- assertEquals(3, javaNamedNativeQuery.hintsSize());
-
-
- namedNativeQuery.moveHint(2, 0);
- ListIterator<QueryHint> hints = namedNativeQuery.hints();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
-
- assertEquals("BAR", javaNamedNativeQuery.hintAt(0).getName());
- assertEquals("BAZ", javaNamedNativeQuery.hintAt(1).getName());
- assertEquals("FOO", javaNamedNativeQuery.hintAt(2).getName());
-
-
- namedNativeQuery.moveHint(0, 1);
- hints = namedNativeQuery.hints();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
-
- assertEquals("BAZ", javaNamedNativeQuery.hintAt(0).getName());
- assertEquals("BAR", javaNamedNativeQuery.hintAt(1).getName());
- assertEquals("FOO", javaNamedNativeQuery.hintAt(2).getName());
- }
-
- public void testUpdateHints() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = javaEntity();
- NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- javaNamedNativeQuery.addHint(0);
- javaNamedNativeQuery.addHint(1);
- javaNamedNativeQuery.addHint(2);
-
- javaNamedNativeQuery.hintAt(0).setName("FOO");
- javaNamedNativeQuery.hintAt(1).setName("BAR");
- javaNamedNativeQuery.hintAt(2).setName("BAZ");
-
- ListIterator<QueryHint> hints = namedNativeQuery.hints();
- assertEquals("FOO", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertFalse(hints.hasNext());
-
- javaNamedNativeQuery.moveHint(2, 0);
- hints = namedNativeQuery.hints();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- javaNamedNativeQuery.moveHint(0, 1);
- hints = namedNativeQuery.hints();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- javaNamedNativeQuery.removeHint(1);
- hints = namedNativeQuery.hints();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- javaNamedNativeQuery.removeHint(1);
- hints = namedNativeQuery.hints();
- assertEquals("BAZ", hints.next().getName());
- assertFalse(hints.hasNext());
-
- javaNamedNativeQuery.removeHint(0);
- assertFalse(namedNativeQuery.hints().hasNext());
- }
-
- public void testHintsSize() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = javaEntity();
-
- NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next();
- assertEquals(0, namedNativeQuery.hintsSize());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
-
- javaNamedNativeQuery.addHint(0);
- assertEquals(1, namedNativeQuery.hintsSize());
-
- javaNamedNativeQuery.addHint(0);
- assertEquals(2, namedNativeQuery.hintsSize());
-
- javaNamedNativeQuery.removeHint(0);
- javaNamedNativeQuery.removeHint(0);
- assertEquals(0, namedNativeQuery.hintsSize());
- }
-
- public void testUpdateResultClass() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(null, javaNamedNativeQuery.getResultClass());
- assertEquals(null, namedNativeQuery.getResultClass());
-
- //set name in the resource model, verify context model updated
- javaNamedNativeQuery.setResultClass("foo");
- assertEquals("foo", javaNamedNativeQuery.getResultClass());
- assertEquals("foo", namedNativeQuery.getResultClass());
-
- //set name to null in the resource model
- javaNamedNativeQuery.setResultClass(null);
- assertNull(javaNamedNativeQuery.getResultClass());
- assertNull(namedNativeQuery.getResultClass());
- }
-
- public void testModifyResultClass() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = javaEntity();
- NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(null, javaNamedNativeQuery.getResultClass());
- assertEquals(null, namedNativeQuery.getResultClass());
-
- //set name in the context model, verify resource model updated
- namedNativeQuery.setResultClass("foo");
- assertEquals("foo", javaNamedNativeQuery.getResultClass());
- assertEquals("foo", namedNativeQuery.getResultClass());
-
- //set name to null in the context model
- namedNativeQuery.setResultClass(null);
- assertNull(javaNamedNativeQuery.getResultClass());
- assertNull(namedNativeQuery.getResultClass());
- }
-
- public void testUpdateResultSetMapping() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(null, javaNamedNativeQuery.getResultSetMapping());
- assertEquals(null, namedNativeQuery.getResultSetMapping());
-
- //set name in the resource model, verify context model updated
- javaNamedNativeQuery.setResultSetMapping("foo");
- assertEquals("foo", javaNamedNativeQuery.getResultSetMapping());
- assertEquals("foo", namedNativeQuery.getResultSetMapping());
-
- //set name to null in the resource model
- javaNamedNativeQuery.setResultSetMapping(null);
- assertNull(javaNamedNativeQuery.getResultSetMapping());
- assertNull(namedNativeQuery.getResultSetMapping());
- }
-
- public void testModifyResultSetMapping() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = javaEntity();
- NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(null, javaNamedNativeQuery.getResultSetMapping());
- assertEquals(null, namedNativeQuery.getResultSetMapping());
-
- //set name in the context model, verify resource model updated
- namedNativeQuery.setResultSetMapping("foo");
- assertEquals("foo", javaNamedNativeQuery.getResultSetMapping());
- assertEquals("foo", namedNativeQuery.getResultSetMapping());
-
- //set name to null in the context model
- namedNativeQuery.setResultSetMapping(null);
- assertNull(javaNamedNativeQuery.getResultSetMapping());
- assertNull(namedNativeQuery.getResultSetMapping());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaNamedQueryTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaNamedQueryTests.java
deleted file mode 100644
index e792f45a10..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaNamedQueryTests.java
+++ /dev/null
@@ -1,323 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.NamedQuery;
-import org.eclipse.jpt.core.context.QueryHint;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JavaNamedQueryTests extends ContextModelTestCase
-{
- private static final String QUERY_NAME = "QUERY_NAME";
- private static final String QUERY_QUERY = "MY_QUERY";
-
- private ICompilationUnit createTestEntityWithNamedQuery() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.NAMED_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@NamedQuery(name=\"" + QUERY_NAME + "\", query=\"" + QUERY_QUERY + "\")");
- }
- });
- }
-
-
-
- public JavaNamedQueryTests(String name) {
- super(name);
- }
-
- public void testUpdateName() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- NamedQuery namedQuery = entity.namedQueries().next();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(QUERY_NAME, javaNamedQuery.getName());
- assertEquals(QUERY_NAME, namedQuery.getName());
-
- //set name to null in the resource model
- javaNamedQuery.setName(null);
- assertNull(javaNamedQuery.getName());
- assertNull(namedQuery.getName());
-
- //set name in the resource model, verify context model updated
- javaNamedQuery.setName("foo");
- assertEquals("foo", javaNamedQuery.getName());
- assertEquals("foo", namedQuery.getName());
- }
-
- public void testModifyName() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = javaEntity();
- NamedQuery namedQuery = entity.namedQueries().next();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(QUERY_NAME, javaNamedQuery.getName());
- assertEquals(QUERY_NAME, namedQuery.getName());
-
- //set name to null in the context model
- namedQuery.setName(null);
- assertNull(javaNamedQuery.getName());
- assertNull(namedQuery.getName());
-
- //set name in the context model, verify resource model updated
- namedQuery.setName("foo");
- assertEquals("foo", javaNamedQuery.getName());
- assertEquals("foo", namedQuery.getName());
- }
-
- public void testUpdateQuery() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- NamedQuery namedQuery = entity.namedQueries().next();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(QUERY_QUERY, javaNamedQuery.getQuery());
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
-
- //set name to null in the resource model
- javaNamedQuery.setQuery(null);
- assertNull(javaNamedQuery.getQuery());
- assertNull(namedQuery.getQuery());
-
- //set name in the resource model, verify context model updated
- javaNamedQuery.setQuery("foo");
- assertEquals("foo", javaNamedQuery.getQuery());
- assertEquals("foo", namedQuery.getQuery());
- }
-
- public void testModifyQuery() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = javaEntity();
- NamedQuery namedQuery = entity.namedQueries().next();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(QUERY_QUERY, javaNamedQuery.getQuery());
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
-
- //set name to null in the context model
- namedQuery.setQuery(null);
- assertNull(javaNamedQuery.getQuery());
- assertNull(namedQuery.getQuery());
-
- //set name in the context model, verify resource model updated
- namedQuery.setQuery("foo");
- assertEquals("foo", javaNamedQuery.getQuery());
- assertEquals("foo", namedQuery.getQuery());
- }
-
-
- public void testAddHint() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = javaEntity();
- NamedQuery namedQuery = entity.namedQueries().next();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME);
-
-
- QueryHint queryHint = namedQuery.addHint(0);
- queryHint.setName("FOO");
-
- assertEquals("FOO", javaNamedQuery.hintAt(0).getName());
-
- QueryHint queryHint2 = namedQuery.addHint(0);
- queryHint2.setName("BAR");
-
- assertEquals("BAR", javaNamedQuery.hintAt(0).getName());
- assertEquals("FOO", javaNamedQuery.hintAt(1).getName());
-
- QueryHint queryHint3 = namedQuery.addHint(1);
- queryHint3.setName("BAZ");
-
- assertEquals("BAR", javaNamedQuery.hintAt(0).getName());
- assertEquals("BAZ", javaNamedQuery.hintAt(1).getName());
- assertEquals("FOO", javaNamedQuery.hintAt(2).getName());
-
- ListIterator<QueryHint> hints = namedQuery.hints();
- assertEquals(queryHint2, hints.next());
- assertEquals(queryHint3, hints.next());
- assertEquals(queryHint, hints.next());
-
- hints = namedQuery.hints();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- }
-
- public void testRemoveHint() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = javaEntity();
- NamedQuery namedQuery = entity.namedQueries().next();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME);
-
- namedQuery.addHint(0).setName("FOO");
- namedQuery.addHint(1).setName("BAR");
- namedQuery.addHint(2).setName("BAZ");
-
- assertEquals(3, javaNamedQuery.hintsSize());
-
- namedQuery.removeHint(0);
- assertEquals(2, javaNamedQuery.hintsSize());
- assertEquals("BAR", javaNamedQuery.hintAt(0).getName());
- assertEquals("BAZ", javaNamedQuery.hintAt(1).getName());
-
- namedQuery.removeHint(0);
- assertEquals(1, javaNamedQuery.hintsSize());
- assertEquals("BAZ", javaNamedQuery.hintAt(0).getName());
-
- namedQuery.removeHint(0);
- assertEquals(0, javaNamedQuery.hintsSize());
- }
-
- public void testMoveHint() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = javaEntity();
- NamedQuery namedQuery = entity.namedQueries().next();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME);
-
- namedQuery.addHint(0).setName("FOO");
- namedQuery.addHint(1).setName("BAR");
- namedQuery.addHint(2).setName("BAZ");
-
- assertEquals(3, javaNamedQuery.hintsSize());
-
-
- namedQuery.moveHint(2, 0);
- ListIterator<QueryHint> hints = namedQuery.hints();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
-
- assertEquals("BAR", javaNamedQuery.hintAt(0).getName());
- assertEquals("BAZ", javaNamedQuery.hintAt(1).getName());
- assertEquals("FOO", javaNamedQuery.hintAt(2).getName());
-
-
- namedQuery.moveHint(0, 1);
- hints = namedQuery.hints();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
-
- assertEquals("BAZ", javaNamedQuery.hintAt(0).getName());
- assertEquals("BAR", javaNamedQuery.hintAt(1).getName());
- assertEquals("FOO", javaNamedQuery.hintAt(2).getName());
- }
-
- public void testUpdateHints() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = javaEntity();
- NamedQuery namedQuery = entity.namedQueries().next();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME);
-
- javaNamedQuery.addHint(0);
- javaNamedQuery.addHint(1);
- javaNamedQuery.addHint(2);
-
- javaNamedQuery.hintAt(0).setName("FOO");
- javaNamedQuery.hintAt(1).setName("BAR");
- javaNamedQuery.hintAt(2).setName("BAZ");
-
- ListIterator<QueryHint> hints = namedQuery.hints();
- assertEquals("FOO", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertFalse(hints.hasNext());
-
- javaNamedQuery.moveHint(2, 0);
- hints = namedQuery.hints();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- javaNamedQuery.moveHint(0, 1);
- hints = namedQuery.hints();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- javaNamedQuery.removeHint(1);
- hints = namedQuery.hints();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- javaNamedQuery.removeHint(1);
- hints = namedQuery.hints();
- assertEquals("BAZ", hints.next().getName());
- assertFalse(hints.hasNext());
-
- javaNamedQuery.removeHint(0);
- assertFalse(namedQuery.hints().hasNext());
- }
-
- public void testHintsSize() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = javaEntity();
-
- NamedQuery namedQuery = entity.namedQueries().next();
- assertEquals(0, namedQuery.hintsSize());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME);
-
-
- javaNamedQuery.addHint(0);
- assertEquals(1, namedQuery.hintsSize());
-
- javaNamedQuery.addHint(0);
- assertEquals(2, namedQuery.hintsSize());
-
- javaNamedQuery.removeHint(0);
- javaNamedQuery.removeHint(0);
- assertEquals(0, namedQuery.hintsSize());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToManyMappingTests.java
deleted file mode 100644
index 22cfeb0917..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToManyMappingTests.java
+++ /dev/null
@@ -1,939 +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.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.BasicMapping;
-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.OneToOneMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-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.JavaPersistentType;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.resource.java.BasicAnnotation;
-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.JoinTableAnnotation;
-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.OneToManyAnnotation;
-import org.eclipse.jpt.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.core.resource.java.OrderByAnnotation;
-import org.eclipse.jpt.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class JavaOneToManyMappingTests extends ContextModelTestCase
-{
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithCollectionOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private Collection addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
- private ICompilationUnit createTestEntityWithNonCollectionOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private Address addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestDepartment() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append("import java.util.Map;");
- sb.append(CR);
- sb.append("import ").append(JPA.ONE_TO_MANY).append(";");
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Department").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private Map<Integer, Employee> employees;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Department.java", sourceWriter);
- }
-
- private void createTestEmployee() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Employee").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int empId;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Employee.java", sourceWriter);
- }
-
- public JavaOneToManyMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setOrderBy("asdf");
- oneToManyMapping.getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setOrderBy("asdf");
- oneToManyMapping.getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertNull(persistentAttribute.getSpecifiedMapping());
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setOrderBy("asdf");
- oneToManyMapping.getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setOrderBy("asdf");
- oneToManyMapping.getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setOrderBy("asdf");
- oneToManyMapping.getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setOrderBy("asdf");
- oneToManyMapping.getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setOrderBy("asdf");
- oneToManyMapping.getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setOrderBy("asdf");
- oneToManyMapping.getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setOrderBy("asdf");
- oneToManyMapping.getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setOrderBy("asdf");
- oneToManyMapping.getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
-
- public void testUpdateSpecifiedTargetEntity() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation();
-
- assertNull(oneToManyMapping.getSpecifiedTargetEntity());
- assertNull(oneToMany.getTargetEntity());
-
- //set target entity in the resource model, verify context model updated
- oneToMany.setTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", oneToManyMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", oneToMany.getTargetEntity());
-
- //set target entity to null in the resource model
- oneToMany.setTargetEntity(null);
- assertNull(oneToManyMapping.getSpecifiedTargetEntity());
- assertNull(oneToMany.getTargetEntity());
- }
-
- public void testModifySpecifiedTargetEntity() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation();
-
- assertNull(oneToManyMapping.getSpecifiedTargetEntity());
- assertNull(oneToMany.getTargetEntity());
-
- //set target entity in the context model, verify resource model updated
- oneToManyMapping.setSpecifiedTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", oneToManyMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", oneToMany.getTargetEntity());
-
- //set target entity to null in the context model
- oneToManyMapping.setSpecifiedTargetEntity(null);
- assertNull(oneToManyMapping.getSpecifiedTargetEntity());
- assertNull(oneToMany.getTargetEntity());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation();
-
- assertNull(oneToManyMapping.getSpecifiedFetch());
- assertNull(oneToMany.getFetch());
-
- //set fetch in the resource model, verify context model updated
- oneToMany.setFetch(org.eclipse.jpt.core.resource.java.FetchType.EAGER);
- assertEquals(FetchType.EAGER, oneToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.core.resource.java.FetchType.EAGER, oneToMany.getFetch());
-
- oneToMany.setFetch(org.eclipse.jpt.core.resource.java.FetchType.LAZY);
- assertEquals(FetchType.LAZY, oneToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.core.resource.java.FetchType.LAZY, oneToMany.getFetch());
-
-
- //set fetch to null in the resource model
- oneToMany.setFetch(null);
- assertNull(oneToManyMapping.getSpecifiedFetch());
- assertNull(oneToMany.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation();
-
- assertNull(oneToManyMapping.getSpecifiedFetch());
- assertNull(oneToMany.getFetch());
-
- //set fetch in the context model, verify resource model updated
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(FetchType.EAGER, oneToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.core.resource.java.FetchType.EAGER, oneToMany.getFetch());
-
- oneToManyMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, oneToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.core.resource.java.FetchType.LAZY, oneToMany.getFetch());
-
-
- //set fetch to null in the context model
- oneToManyMapping.setSpecifiedFetch(null);
- assertNull(oneToManyMapping.getSpecifiedFetch());
- assertNull(oneToMany.getFetch());
- }
-
- public void testUpdateMappedBy() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation();
-
- assertNull(oneToManyMapping.getMappedBy());
- assertNull(oneToMany.getMappedBy());
-
- //set mappedBy in the resource model, verify context model updated
- oneToMany.setMappedBy("newMappedBy");
- assertEquals("newMappedBy", oneToManyMapping.getMappedBy());
- assertEquals("newMappedBy", oneToMany.getMappedBy());
-
- //set mappedBy to null in the resource model
- oneToMany.setMappedBy(null);
- assertNull(oneToManyMapping.getMappedBy());
- assertNull(oneToMany.getMappedBy());
- }
-
- public void testModifyMappedBy() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation();
-
- assertNull(oneToManyMapping.getMappedBy());
- assertNull(oneToMany.getMappedBy());
-
- //set mappedBy in the context model, verify resource model updated
- oneToManyMapping.setMappedBy("newTargetEntity");
- assertEquals("newTargetEntity", oneToManyMapping.getMappedBy());
- assertEquals("newTargetEntity", oneToMany.getMappedBy());
-
- //set mappedBy to null in the context model
- oneToManyMapping.setMappedBy(null);
- assertNull(oneToManyMapping.getMappedBy());
- assertNull(oneToMany.getMappedBy());
- }
-
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames = oneToManyMapping.candidateMappedByAttributeNames();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames = oneToManyMapping.candidateMappedByAttributeNames();
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames = oneToManyMapping.candidateMappedByAttributeNames();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
- }
-
- public void testDefaultTargetEntity() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit, default still set, handled by validation
- assertEquals(PACKAGE_NAME + ".Address", oneToManyMapping.getDefaultTargetEntity());
-
- //add targetEntity to the persistence unit
- addXmlClassRef(PACKAGE_NAME + ".Address");
- assertEquals(PACKAGE_NAME + ".Address", oneToManyMapping.getDefaultTargetEntity());
-
- //test default still the same when specified target entity it set
- oneToManyMapping.setSpecifiedTargetEntity("foo");
- assertEquals(PACKAGE_NAME + ".Address", oneToManyMapping.getDefaultTargetEntity());
-
- ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- JavaPersistentType addressPersistentType = addressClassRef.getJavaPersistentType();
-
- //test target is not an Entity, default target entity still exists, this case handled with validation
- addressPersistentType.setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertEquals(PACKAGE_NAME + ".Address", oneToManyMapping.getDefaultTargetEntity());
- }
-
- public void testDefaultTargetEntityCollectionType() throws Exception {
- createTestEntityWithCollectionOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- assertNull(oneToManyMapping.getDefaultTargetEntity());
- }
-
- public void testDefaultTargetEntityNonCollectionType() throws Exception {
- createTestEntityWithNonCollectionOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- assertNull(oneToManyMapping.getDefaultTargetEntity());
- }
-
- public void testTargetEntity() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- assertEquals(PACKAGE_NAME + ".Address", oneToManyMapping.getTargetEntity());
-
- oneToManyMapping.setSpecifiedTargetEntity("foo");
- assertEquals("foo", oneToManyMapping.getTargetEntity());
-
- oneToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals(PACKAGE_NAME + ".Address", oneToManyMapping.getTargetEntity());
- }
-
- public void testResolvedTargetEntity() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit
- assertNull(oneToManyMapping.getResolvedTargetEntity());
-
- //add targetEntity to the persistence unit, now target entity should resolve
- createTestTargetEntityAddress();
- addXmlClassRef(PACKAGE_NAME + ".Address");
- ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- TypeMapping addressTypeMapping = addressClassRef.getJavaPersistentType().getMapping();
- assertEquals(addressTypeMapping, oneToManyMapping.getResolvedTargetEntity());
-
- //test default still the same when specified target entity it set
- oneToManyMapping.setSpecifiedTargetEntity("foo");
- assertNull(oneToManyMapping.getResolvedTargetEntity());
-
-
- oneToManyMapping.setSpecifiedTargetEntity(PACKAGE_NAME + ".Address");
- assertEquals(addressTypeMapping, oneToManyMapping.getResolvedTargetEntity());
-
-
- oneToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals(addressTypeMapping, oneToManyMapping.getResolvedTargetEntity());
- }
-
-
- public void testUpdateMapKey() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertNull(oneToManyMapping.getMapKey());
- assertNull(attributeResource.getSupportingAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- attributeResource.addSupportingAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(oneToManyMapping.getMapKey());
- MapKeyAnnotation mapKey = (MapKeyAnnotation) attributeResource.getSupportingAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNotNull(mapKey);
-
- //set mapKey name in the resource model, verify context model updated
- mapKey.setName("myMapKey");
- assertEquals("myMapKey", oneToManyMapping.getMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey name to null in the resource model
- mapKey.setName(null);
- assertNull(oneToManyMapping.getMapKey());
- assertNull(mapKey.getName());
-
- mapKey.setName("myMapKey");
- attributeResource.removeSupportingAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(oneToManyMapping.getMapKey());
- assertNull(attributeResource.getSupportingAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKey() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertNull(oneToManyMapping.getMapKey());
- assertNull(attributeResource.getSupportingAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- oneToManyMapping.setMapKey("myMapKey");
- MapKeyAnnotation mapKey = (MapKeyAnnotation) attributeResource.getSupportingAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertEquals("myMapKey", oneToManyMapping.getMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey to null in the context model
- oneToManyMapping.setMapKey(null);
- assertNull(oneToManyMapping.getMapKey());
- assertNull(attributeResource.getSupportingAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateOrderBy() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertNull(oneToManyMapping.getOrderBy());
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set orderBy in the resource model, verify context model updated
- attributeResource.addSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- OrderByAnnotation orderBy = (OrderByAnnotation) attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- orderBy.setValue("newOrderBy");
- assertEquals("newOrderBy", oneToManyMapping.getOrderBy());
- assertEquals("newOrderBy", orderBy.getValue());
-
- //set orderBy to null in the resource model
- attributeResource.removeSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertNull(oneToManyMapping.getOrderBy());
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyOrderBy() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertNull(oneToManyMapping.getOrderBy());
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set mappedBy in the context model, verify resource model updated
- oneToManyMapping.setOrderBy("newOrderBy");
- assertEquals("newOrderBy", oneToManyMapping.getOrderBy());
- OrderByAnnotation orderBy = (OrderByAnnotation) attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertEquals("newOrderBy", orderBy.getValue());
-
- //set mappedBy to null in the context model
- oneToManyMapping.setOrderBy(null);
- assertNull(oneToManyMapping.getOrderBy());
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateNoOrdering() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertTrue(oneToManyMapping.isNoOrdering());
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set orderBy in the resource model, verify context model updated
- attributeResource.addSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isNoOrdering());
-
- OrderByAnnotation orderBy = (OrderByAnnotation) attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- orderBy.setValue("newOrderBy");
- assertFalse(oneToManyMapping.isNoOrdering());
-
- //set orderBy to null in the resource model
- attributeResource.removeSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertTrue(oneToManyMapping.isNoOrdering());
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdatePkOrdering() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertFalse(oneToManyMapping.isPkOrdering());
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set orderBy in the resource model, verify context model updated
- attributeResource.addSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertTrue(oneToManyMapping.isPkOrdering());
-
- OrderByAnnotation orderBy = (OrderByAnnotation) attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- orderBy.setValue("newOrderBy");
- assertFalse(oneToManyMapping.isPkOrdering());
-
- //set orderBy to null in the resource model
- attributeResource.removeSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isPkOrdering());
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateCustomOrdering() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertFalse(oneToManyMapping.isCustomOrdering());
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set orderBy in the resource model, verify context model updated
- attributeResource.addSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isCustomOrdering());
-
- OrderByAnnotation orderBy = (OrderByAnnotation) attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- orderBy.setValue("newOrderBy");
- assertTrue(oneToManyMapping.isCustomOrdering());
-
- //set orderBy to null in the resource model
- attributeResource.removeSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isCustomOrdering());
- assertNull(attributeResource.getSupportingAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testDefaultTargetEntityForMap() throws Exception {
- createTestEmployee();
- createTestDepartment();
- addXmlClassRef(PACKAGE_NAME + ".Department");
- addXmlClassRef(PACKAGE_NAME + ".Employee");
-
- JavaPersistentType departmentPersistentType = javaPersistentType();
- OneToManyMapping employeesMapping = (OneToManyMapping) departmentPersistentType.getAttributeNamed("employees").getSpecifiedMapping();
- assertEquals(PACKAGE_NAME + ".Employee", employeesMapping.getTargetEntity());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToOneMappingTests.java
deleted file mode 100644
index bca0afa544..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToOneMappingTests.java
+++ /dev/null
@@ -1,1292 +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.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.BasicMapping;
-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.JoinColumn;
-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.OneToOneMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-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.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.resource.java.BasicAnnotation;
-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.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JoinColumnsAnnotation;
-import org.eclipse.jpt.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnsAnnotation;
-import org.eclipse.jpt.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class JavaOneToOneMappingTests extends ContextModelTestCase
-{
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
-
- private ICompilationUnit createTestEntityWithOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithCollectionOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Collection address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithGenericizedCollectionOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- public JavaOneToOneMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertNull(persistentAttribute.getSpecifiedMapping());
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
-
- public void testUpdateSpecifiedTargetEntity() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation();
-
- assertNull(oneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOne.getTargetEntity());
-
- //set target entity in the resource model, verify context model updated
- oneToOne.setTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", oneToOneMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", oneToOne.getTargetEntity());
-
- //set target entity to null in the resource model
- oneToOne.setTargetEntity(null);
- assertNull(oneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOne.getTargetEntity());
- }
-
- public void testModifySpecifiedTargetEntity() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation();
-
- assertNull(oneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOne.getTargetEntity());
-
- //set target entity in the context model, verify resource model updated
- oneToOneMapping.setSpecifiedTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", oneToOneMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", oneToOne.getTargetEntity());
-
- //set target entity to null in the context model
- oneToOneMapping.setSpecifiedTargetEntity(null);
- assertNull(oneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOne.getTargetEntity());
- }
-
- public void testUpdateMappedBy() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation();
-
- assertNull(oneToOneMapping.getMappedBy());
- assertNull(oneToOne.getMappedBy());
-
- //set mappedBy in the resource model, verify context model updated
- oneToOne.setMappedBy("newMappedBy");
- assertEquals("newMappedBy", oneToOneMapping.getMappedBy());
- assertEquals("newMappedBy", oneToOne.getMappedBy());
-
- //set mappedBy to null in the resource model
- oneToOne.setMappedBy(null);
- assertNull(oneToOneMapping.getMappedBy());
- assertNull(oneToOne.getMappedBy());
- }
-
- public void testModifyMappedBy() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation();
-
- assertNull(oneToOneMapping.getMappedBy());
- assertNull(oneToOne.getMappedBy());
-
- //set mappedBy in the context model, verify resource model updated
- oneToOneMapping.setMappedBy("newTargetEntity");
- assertEquals("newTargetEntity", oneToOneMapping.getMappedBy());
- assertEquals("newTargetEntity", oneToOne.getMappedBy());
-
- //set mappedBy to null in the context model
- oneToOneMapping.setMappedBy(null);
- assertNull(oneToOneMapping.getMappedBy());
- assertNull(oneToOne.getMappedBy());
- }
-
- public void testUpdateSpecifiedOptional() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation();
-
- assertNull(oneToOneMapping.getSpecifiedOptional());
- assertNull(oneToOne.getOptional());
-
- //set optional in the resource model, verify context model updated
- oneToOne.setOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, oneToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.TRUE, oneToOne.getOptional());
-
- oneToOne.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, oneToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.FALSE, oneToOne.getOptional());
-
-
- //set optional to null in the resource model
- oneToOne.setOptional(null);
- assertNull(oneToOneMapping.getSpecifiedOptional());
- assertNull(oneToOne.getOptional());
- }
-
- public void testModifySpecifiedOptional() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation();
-
- assertNull(oneToOneMapping.getSpecifiedOptional());
- assertNull(oneToOne.getOptional());
-
- //set optional in the context model, verify resource model updated
- oneToOneMapping.setSpecifiedOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, oneToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.TRUE, oneToOne.getOptional());
-
- oneToOneMapping.setSpecifiedOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, oneToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.FALSE, oneToOne.getOptional());
-
-
- //set optional to null in the context model
- oneToOneMapping.setSpecifiedOptional(null);
- assertNull(oneToOneMapping.getSpecifiedOptional());
- assertNull(oneToOne.getOptional());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation();
-
- assertNull(oneToOneMapping.getSpecifiedFetch());
- assertNull(oneToOne.getFetch());
-
- //set fetch in the resource model, verify context model updated
- oneToOne.setFetch(org.eclipse.jpt.core.resource.java.FetchType.EAGER);
- assertEquals(FetchType.EAGER, oneToOneMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.core.resource.java.FetchType.EAGER, oneToOne.getFetch());
-
- oneToOne.setFetch(org.eclipse.jpt.core.resource.java.FetchType.LAZY);
- assertEquals(FetchType.LAZY, oneToOneMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.core.resource.java.FetchType.LAZY, oneToOne.getFetch());
-
-
- //set fetch to null in the resource model
- oneToOne.setFetch(null);
- assertNull(oneToOneMapping.getSpecifiedFetch());
- assertNull(oneToOne.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation();
-
- assertNull(oneToOneMapping.getSpecifiedFetch());
- assertNull(oneToOne.getFetch());
-
- //set fetch in the context model, verify resource model updated
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(FetchType.EAGER, oneToOneMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.core.resource.java.FetchType.EAGER, oneToOne.getFetch());
-
- oneToOneMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, oneToOneMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.core.resource.java.FetchType.LAZY, oneToOne.getFetch());
-
-
- //set fetch to null in the context model
- oneToOneMapping.setSpecifiedFetch(null);
- assertNull(oneToOneMapping.getSpecifiedFetch());
- assertNull(oneToOne.getFetch());
- }
-
- public void testSpecifiedJoinColumns() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- ListIterator<JavaJoinColumn> specifiedJoinColumns = oneToOneMapping.specifiedJoinColumns();
-
- assertFalse(specifiedJoinColumns.hasNext());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- //add an annotation to the resource model and verify the context model is updated
- JoinColumnAnnotation joinColumn = (JoinColumnAnnotation) attributeResource.addSupportingAnnotation(0, JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- joinColumn.setName("FOO");
- specifiedJoinColumns = oneToOneMapping.specifiedJoinColumns();
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
- joinColumn = (JoinColumnAnnotation) attributeResource.addSupportingAnnotation(0, JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- joinColumn.setName("BAR");
- specifiedJoinColumns = oneToOneMapping.specifiedJoinColumns();
- assertEquals("BAR", specifiedJoinColumns.next().getName());
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
-
- joinColumn = (JoinColumnAnnotation) attributeResource.addSupportingAnnotation(0, JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- joinColumn.setName("BAZ");
- specifiedJoinColumns = oneToOneMapping.specifiedJoinColumns();
- assertEquals("BAZ", specifiedJoinColumns.next().getName());
- assertEquals("BAR", specifiedJoinColumns.next().getName());
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- attributeResource.moveSupportingAnnotation(1, 0, JPA.JOIN_COLUMNS);
- specifiedJoinColumns = oneToOneMapping.specifiedJoinColumns();
- assertEquals("BAR", specifiedJoinColumns.next().getName());
- assertEquals("BAZ", specifiedJoinColumns.next().getName());
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
- attributeResource.removeSupportingAnnotation(0, JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- specifiedJoinColumns = oneToOneMapping.specifiedJoinColumns();
- assertEquals("BAZ", specifiedJoinColumns.next().getName());
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
- attributeResource.removeSupportingAnnotation(0, JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- specifiedJoinColumns = oneToOneMapping.specifiedJoinColumns();
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
-
- attributeResource.removeSupportingAnnotation(0, JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- specifiedJoinColumns = oneToOneMapping.specifiedJoinColumns();
- assertFalse(specifiedJoinColumns.hasNext());
- }
-
- public void testGetDefaultJoin() {
- //TODO
- }
-
- public void testSpecifiedJoinColumnsSize() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- assertEquals(0, oneToOneMapping.specifiedJoinColumnsSize());
-
- oneToOneMapping.addSpecifiedJoinColumn(0);
- assertEquals(1, oneToOneMapping.specifiedJoinColumnsSize());
-
- oneToOneMapping.removeSpecifiedJoinColumn(0);
- assertEquals(0, oneToOneMapping.specifiedJoinColumnsSize());
- }
-
- public void testJoinColumnsSize() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- assertEquals(1, oneToOneMapping.joinColumnsSize());
-
- oneToOneMapping.addSpecifiedJoinColumn(0);
- assertEquals(1, oneToOneMapping.joinColumnsSize());
-
- oneToOneMapping.addSpecifiedJoinColumn(0);
- assertEquals(2, oneToOneMapping.joinColumnsSize());
-
- oneToOneMapping.removeSpecifiedJoinColumn(0);
- oneToOneMapping.removeSpecifiedJoinColumn(0);
- assertEquals(1, oneToOneMapping.joinColumnsSize());
-
- //if non-owning side of the relationship then no default join column
- oneToOneMapping.setMappedBy("foo");
- assertEquals(0, oneToOneMapping.joinColumnsSize());
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- oneToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- oneToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("BAR");
- oneToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- Iterator<NestableAnnotation> joinColumns = attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
-
- assertEquals("BAZ", ((JoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("BAR", ((JoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumns.next()).getName());
- assertFalse(joinColumns.hasNext());
- }
-
- public void testAddSpecifiedJoinColumn2() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- oneToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- oneToOneMapping.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- oneToOneMapping.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- Iterator<NestableAnnotation> joinColumns = attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
-
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("BAR", ((JoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("BAZ", ((JoinColumnAnnotation) joinColumns.next()).getName());
- assertFalse(joinColumns.hasNext());
- }
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- oneToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- oneToOneMapping.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- oneToOneMapping.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertEquals(3, CollectionTools.size(attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME)));
-
- oneToOneMapping.removeSpecifiedJoinColumn(1);
-
- Iterator<NestableAnnotation> joinColumnResources = attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumnResources.next()).getName());
- assertEquals("BAZ", ((JoinColumnAnnotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- Iterator<JoinColumn> joinColumns = oneToOneMapping.specifiedJoinColumns();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
-
- oneToOneMapping.removeSpecifiedJoinColumn(1);
- joinColumnResources = attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- joinColumns = oneToOneMapping.specifiedJoinColumns();
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
-
- oneToOneMapping.removeSpecifiedJoinColumn(0);
- joinColumnResources = attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
- assertFalse(joinColumnResources.hasNext());
- joinColumns = oneToOneMapping.specifiedJoinColumns();
- assertFalse(joinColumns.hasNext());
-
- assertNull(attributeResource.getSupportingAnnotation(JoinColumnsAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- oneToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- oneToOneMapping.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- oneToOneMapping.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourcePersistentAttribute attributeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next();
-
- ListIterator<NestableAnnotation> javaJoinColumns = attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
- assertEquals(3, CollectionTools.size(javaJoinColumns));
-
-
- oneToOneMapping.moveSpecifiedJoinColumn(2, 0);
- ListIterator<JoinColumn> primaryKeyJoinColumns = oneToOneMapping.specifiedJoinColumns();
- assertEquals("BAR", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getSpecifiedName());
-
- javaJoinColumns = attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
- assertEquals("BAR", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("BAZ", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
-
-
- oneToOneMapping.moveSpecifiedJoinColumn(0, 1);
- primaryKeyJoinColumns = oneToOneMapping.specifiedJoinColumns();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getSpecifiedName());
-
- javaJoinColumns = attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
- assertEquals("BAZ", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("BAR", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- }
-
- public void testUpdateSpecifiedJoinColumns() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JavaResourcePersistentAttribute attributeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next();
-
- ((JoinColumnAnnotation) attributeResource.addSupportingAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((JoinColumnAnnotation) attributeResource.addSupportingAnnotation(1, JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((JoinColumnAnnotation) attributeResource.addSupportingAnnotation(2, JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME)).setName("BAZ");
-
- ListIterator<JoinColumn> joinColumns = oneToOneMapping.specifiedJoinColumns();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- attributeResource.moveSupportingAnnotation(2, 0, JoinColumnsAnnotation.ANNOTATION_NAME);
- joinColumns = oneToOneMapping.specifiedJoinColumns();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- attributeResource.moveSupportingAnnotation(0, 1, JoinColumnsAnnotation.ANNOTATION_NAME);
- joinColumns = oneToOneMapping.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- attributeResource.removeSupportingAnnotation(1, JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
- joinColumns = oneToOneMapping.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- attributeResource.removeSupportingAnnotation(1, JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
- joinColumns = oneToOneMapping.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- attributeResource.removeSupportingAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME);
- joinColumns = oneToOneMapping.specifiedJoinColumns();
- assertFalse(joinColumns.hasNext());
- }
-
- public void testJoinColumnIsVirtual() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- assertTrue(oneToOneMapping.getDefaultJoinColumn().isVirtual());
-
- oneToOneMapping.addSpecifiedJoinColumn(0);
- JoinColumn specifiedJoinColumn = oneToOneMapping.specifiedJoinColumns().next();
- assertFalse(specifiedJoinColumn.isVirtual());
-
- assertNull(oneToOneMapping.getDefaultJoinColumn());
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames = oneToOneMapping.candidateMappedByAttributeNames();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- attributeNames = oneToOneMapping.candidateMappedByAttributeNames();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames = oneToOneMapping.candidateMappedByAttributeNames();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
- }
-
- public void testDefaultTargetEntity() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit, default still set, handled by validation
- assertEquals(PACKAGE_NAME + ".Address", oneToOneMapping.getDefaultTargetEntity());
-
- //add targetEntity to the persistence unit
- addXmlClassRef(PACKAGE_NAME + ".Address");
- assertEquals(PACKAGE_NAME + ".Address", oneToOneMapping.getDefaultTargetEntity());
-
- //test default still the same when specified target entity it set
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- assertEquals(PACKAGE_NAME + ".Address", oneToOneMapping.getDefaultTargetEntity());
-
- ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- JavaPersistentType addressPersistentType = addressClassRef.getJavaPersistentType();
-
- //test target is not an Entity, default target entity still exists, this case handled with validation
- addressPersistentType.setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertEquals(PACKAGE_NAME + ".Address", oneToOneMapping.getDefaultTargetEntity());
- }
-
- public void testDefaultTargetEntityCollectionType() throws Exception {
- createTestEntityWithCollectionOneToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- assertNull(oneToOneMapping.getDefaultTargetEntity());
- }
-
- public void testDefaultTargetEntityGenericizedCollectionType() throws Exception {
- createTestEntityWithGenericizedCollectionOneToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- assertNull(oneToOneMapping.getDefaultTargetEntity());
- }
-
- public void testTargetEntity() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- assertEquals(PACKAGE_NAME + ".Address", oneToOneMapping.getTargetEntity());
-
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- assertEquals("foo", oneToOneMapping.getTargetEntity());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- assertEquals(PACKAGE_NAME + ".Address", oneToOneMapping.getTargetEntity());
- }
-
- public void testResolvedTargetEntity() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit
- assertNull(oneToOneMapping.getResolvedTargetEntity());
-
- //add targetEntity to the persistence unit, now target entity should resolve
- createTestTargetEntityAddress();
- addXmlClassRef(PACKAGE_NAME + ".Address");
- ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- TypeMapping addressTypeMapping = addressClassRef.getJavaPersistentType().getMapping();
- assertEquals(addressTypeMapping, oneToOneMapping.getResolvedTargetEntity());
-
- //test default still the same when specified target entity it set
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- assertNull(oneToOneMapping.getResolvedTargetEntity());
-
-
- oneToOneMapping.setSpecifiedTargetEntity(PACKAGE_NAME + ".Address");
- assertEquals(addressTypeMapping, oneToOneMapping.getResolvedTargetEntity());
-
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- assertEquals(addressTypeMapping, oneToOneMapping.getResolvedTargetEntity());
- }
-
- public void testPrimaryKeyJoinColumns() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- ListIterator<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns = oneToOneMapping.primaryKeyJoinColumns();
-
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- //add an annotation to the resource model and verify the context model is updated
- PrimaryKeyJoinColumnAnnotation joinColumn = (PrimaryKeyJoinColumnAnnotation) attributeResource.addSupportingAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- joinColumn.setName("FOO");
- primaryKeyJoinColumns = oneToOneMapping.primaryKeyJoinColumns();
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- joinColumn = (PrimaryKeyJoinColumnAnnotation) attributeResource.addSupportingAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- joinColumn.setName("BAR");
- primaryKeyJoinColumns = oneToOneMapping.primaryKeyJoinColumns();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
-
- joinColumn = (PrimaryKeyJoinColumnAnnotation) attributeResource.addSupportingAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- joinColumn.setName("BAZ");
- primaryKeyJoinColumns = oneToOneMapping.primaryKeyJoinColumns();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- attributeResource.moveSupportingAnnotation(1, 0, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- primaryKeyJoinColumns = oneToOneMapping.primaryKeyJoinColumns();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- attributeResource.removeSupportingAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- primaryKeyJoinColumns = oneToOneMapping.primaryKeyJoinColumns();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- attributeResource.removeSupportingAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- primaryKeyJoinColumns = oneToOneMapping.primaryKeyJoinColumns();
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
-
- attributeResource.removeSupportingAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- primaryKeyJoinColumns = oneToOneMapping.primaryKeyJoinColumns();
- assertFalse(primaryKeyJoinColumns.hasNext());
- }
-
- public void testPrimaryKeyJoinColumnsSize() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- assertEquals(0, oneToOneMapping.primaryKeyJoinColumnsSize());
-
- oneToOneMapping.addPrimaryKeyJoinColumn(0);
- assertEquals(1, oneToOneMapping.primaryKeyJoinColumnsSize());
-
- oneToOneMapping.removePrimaryKeyJoinColumn(0);
- assertEquals(0, oneToOneMapping.primaryKeyJoinColumnsSize());
- }
-
- public void testAddPrimaryKeyJoinColumn() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- oneToOneMapping.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- oneToOneMapping.addPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- oneToOneMapping.addPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- Iterator<NestableAnnotation> joinColumns = attributeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
-
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) joinColumns.next()).getName());
- assertFalse(joinColumns.hasNext());
- }
-
- public void testAddPrimaryKeyJoinColumn2() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- oneToOneMapping.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- oneToOneMapping.addPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- oneToOneMapping.addPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- Iterator<NestableAnnotation> joinColumns = attributeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
-
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) joinColumns.next()).getName());
- assertFalse(joinColumns.hasNext());
- }
-
- public void testRemovePrimaryKeyJoinColumn() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- oneToOneMapping.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- oneToOneMapping.addPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- oneToOneMapping.addPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertEquals(3, CollectionTools.size(attributeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME)));
-
- oneToOneMapping.removePrimaryKeyJoinColumn(1);
-
- Iterator<NestableAnnotation> joinColumnResources = attributeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) joinColumnResources.next()).getName());
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- Iterator<PrimaryKeyJoinColumn> joinColumns = oneToOneMapping.primaryKeyJoinColumns();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
-
- oneToOneMapping.removePrimaryKeyJoinColumn(1);
- joinColumnResources = attributeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- joinColumns = oneToOneMapping.primaryKeyJoinColumns();
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
-
- oneToOneMapping.removePrimaryKeyJoinColumn(0);
- joinColumnResources = attributeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- assertFalse(joinColumnResources.hasNext());
- joinColumns = oneToOneMapping.primaryKeyJoinColumns();
- assertFalse(joinColumns.hasNext());
-
- assertNull(attributeResource.getSupportingAnnotation(PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME));
- }
-
- public void testMovePrimaryKeyJoinColumn() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- oneToOneMapping.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- oneToOneMapping.addPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- oneToOneMapping.addPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourcePersistentAttribute attributeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next();
-
- ListIterator<NestableAnnotation> javaJoinColumns = attributeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- assertEquals(3, CollectionTools.size(javaJoinColumns));
-
-
- oneToOneMapping.movePrimaryKeyJoinColumn(2, 0);
- ListIterator<PrimaryKeyJoinColumn> primaryKeyJoinColumns = oneToOneMapping.primaryKeyJoinColumns();
- assertEquals("BAR", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getSpecifiedName());
-
- javaJoinColumns = attributeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) javaJoinColumns.next()).getName());
-
-
- oneToOneMapping.movePrimaryKeyJoinColumn(0, 1);
- primaryKeyJoinColumns = oneToOneMapping.primaryKeyJoinColumns();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getSpecifiedName());
-
- javaJoinColumns = attributeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) javaJoinColumns.next()).getName());
- }
-
- public void testUpdatePrimaryKeyJoinColumns() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JavaResourcePersistentAttribute attributeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next();
-
- ((PrimaryKeyJoinColumnAnnotation) attributeResource.addSupportingAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((PrimaryKeyJoinColumnAnnotation) attributeResource.addSupportingAnnotation(1, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((PrimaryKeyJoinColumnAnnotation) attributeResource.addSupportingAnnotation(2, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME)).setName("BAZ");
-
- ListIterator<PrimaryKeyJoinColumn> joinColumns = oneToOneMapping.primaryKeyJoinColumns();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- attributeResource.moveSupportingAnnotation(2, 0, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- joinColumns = oneToOneMapping.primaryKeyJoinColumns();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- attributeResource.moveSupportingAnnotation(0, 1, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- joinColumns = oneToOneMapping.primaryKeyJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- attributeResource.removeSupportingAnnotation(1, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- joinColumns = oneToOneMapping.primaryKeyJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- attributeResource.removeSupportingAnnotation(1, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- joinColumns = oneToOneMapping.primaryKeyJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- attributeResource.removeSupportingAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- joinColumns = oneToOneMapping.primaryKeyJoinColumns();
- assertFalse(joinColumns.hasNext());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPersistentAttributeTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPersistentAttributeTests.java
deleted file mode 100644
index 5f6c6cfa27..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPersistentAttributeTests.java
+++ /dev/null
@@ -1,215 +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.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.JavaBasicMapping;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.core.resource.java.EmbeddedAnnotation;
-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.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JavaPersistentAttributeTests extends ContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityAnnotatedField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
-
- public JavaPersistentAttributeTests(String name) {
- super(name);
- }
-
- public void testGetName() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
-
- assertEquals("id", persistentAttribute.getName());
- }
-
- public void testGetMapping() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- assertTrue(persistentAttribute.getMapping() instanceof JavaIdMapping);
-
- persistentAttribute.setSpecifiedMappingKey(null);
- assertTrue(persistentAttribute.getMapping() instanceof JavaBasicMapping);
- }
-
- public void testGetSpecifiedMapping() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- assertTrue(persistentAttribute.getSpecifiedMapping() instanceof JavaIdMapping);
-
- persistentAttribute.setSpecifiedMappingKey(null);
- assertNull(persistentAttribute.getSpecifiedMapping());
- }
-
- public void testGetSpecifiedMappingNull() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
-
- assertNull(persistentAttribute.getSpecifiedMapping());
- assertNotNull(persistentAttribute.getMapping());
- }
-
- public void testMappingKey() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
-
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
-
- persistentAttribute.setSpecifiedMappingKey(null);
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
- }
-
- public void testDefaultMappingKey() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
-
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
- }
-
- public void testSetSpecifiedMappingKey() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- assertNull(persistentAttribute.getSpecifiedMapping());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNotNull(attributeResource.getMappingAnnotation());
- assertTrue(attributeResource.getMappingAnnotation() instanceof EmbeddedAnnotation);
-
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
- assertTrue(persistentAttribute.getSpecifiedMapping() instanceof JavaEmbeddedMapping);
- }
-
- public void testSetSpecifiedMappingKey2() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNotNull(attributeResource.getMappingAnnotation());
- assertTrue(attributeResource.getMappingAnnotation() instanceof EmbeddedAnnotation);
-
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
- assertTrue(persistentAttribute.getSpecifiedMapping() instanceof JavaEmbeddedMapping);
- }
-
- public void testSetSpecifiedMappingKeyNull() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation());
- assertNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME));
-
- assertNull(persistentAttribute.getSpecifiedMapping());
- }
-
- public void testGetMappingKeyMappingChangeInResourceModel() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.setMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME);
-
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
- }
-
- public void testGetMappingKeyMappingChangeInResourceModel2() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- assertNull(persistentAttribute.getSpecifiedMapping());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.setMappingAnnotation(BasicAnnotation.ANNOTATION_NAME);
-
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getSpecifiedMapping().getKey());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPersistentTypeTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPersistentTypeTests.java
deleted file mode 100644
index b498003857..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPersistentTypeTests.java
+++ /dev/null
@@ -1,758 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jpt.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.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.resource.java.EmbeddableAnnotation;
-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.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JavaPersistentTypeTests extends ContextModelTestCase
-{
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
- private ICompilationUnit createTestEntityAnnotatedFieldAndMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestSubType() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild.java", "AnnotationTestTypeChild", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + TYPE_NAME + " ");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- });
- }
-
- private ICompilationUnit createTestSubTypeWithFieldAnnotation() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild.java", "AnnotationTestTypeChild", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + TYPE_NAME + " ");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestSubTypeWithMethodAnnotation() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild.java", "AnnotationTestTypeChild", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + TYPE_NAME + " ");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestSubTypeNonPersistent() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild.java", "AnnotationTestTypeChild", new DefaultAnnotationWriter() {
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + TYPE_NAME + " ");
- }
- });
- }
-
- private ICompilationUnit createTestSubTypePersistentExtendsNonPersistent() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild2.java", "AnnotationTestTypeChild2", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends AnnotationTestTypeChild ");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- public JavaPersistentTypeTests(String name) {
- super(name);
- }
-
- public void testGetName() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, javaPersistentType().getName());
- }
-
- public void testGetAccessNothingAnnotated() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(AccessType.FIELD, javaPersistentType().getAccess());
- }
-
- public void testAccessField() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(AccessType.FIELD, javaPersistentType().getAccess());
- }
-
- public void testAccessProperty() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(AccessType.PROPERTY, javaPersistentType().getAccess());
- }
-
- public void testAccessFieldAndMethodAnnotated() throws Exception {
- createTestEntityAnnotatedFieldAndMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(AccessType.FIELD, javaPersistentType().getAccess());
- }
-
- public void testAccessInheritance() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs();
- classRefs.next();
- ClassRef classRef = classRefs.next();
-
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessInheritance2() throws Exception {
- createTestEntityAnnotatedField();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs();
- classRefs.next();
- ClassRef classRef = classRefs.next();
-
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- public void testAccessInheritance3() throws Exception {
- createTestEntityAnnotatedField();
- createTestSubTypeWithMethodAnnotation();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs();
- classRefs.next();
- ClassRef classRef = classRefs.next();
-
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessInheritance4() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeWithFieldAnnotation();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs();
- classRefs.next();
- ClassRef classRef = classRefs.next();
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
-
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- //inherited class having annotations set wins over the default access set on persistence-unit-defaults
- public void testAccessInheritancePersistenceUnitDefaultAccess() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.FIELD);
-
- ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs();
- classRefs.next();
- ClassRef classRef = classRefs.next();
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
-
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlNoAccessNoAnnotations() throws Exception {
- OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntity();
-
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlEntityAccessNoAnnotations() throws Exception {
- OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntity();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- entityPersistentType.getMapping().setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
-
- entityPersistentType.getMapping().setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlPersistenceUnitDefaultsAccessNoAnnotations() throws Exception {
- OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntity();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlEntityPropertyAccessAndFieldAnnotations() throws Exception {
- //xml access set to property, field annotations, JavaPersistentType access is property
- OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedField();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- entityPersistentType.getMapping().setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlEntityFieldAccessAndPropertyAnnotations() throws Exception {
- //xml access set to field, property annotations, JavaPersistentType access is field
- OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedMethod();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- entityPersistentType.getMapping().setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlPersistenceUnitDefaultsAccessFieldAnnotations() throws Exception {
- OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedField();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- //inheritance wins over entity-mappings specified access
- public void testAccessXmlEntityMappingsAccessWithInheritance() throws Exception {
- OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childEntityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- createTestEntityAnnotatedMethod();
- createTestSubType();
- JavaPersistentType childJavaPersistentType = childEntityPersistentType.getJavaPersistentType();
-
- entityMappings().setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.PROPERTY, entityPersistentType.getJavaPersistentType().getAccess());
- assertEquals(AccessType.PROPERTY, childJavaPersistentType.getAccess());
- }
-
- public void testAccessXmlMetadataCompleteFieldAnnotations() throws Exception {
- //xml access set to property, so even though there are field annotations, JavaPersistentType
- //access should be property
- OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedField();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY);
- entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
-
- }
-
- public void testAccessNoXmlAccessXmlMetdataCompletePropertyAnnotations() throws Exception {
- //xml access not set, metadata complete set. JavaPersistentType access
- //is field??
- OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedMethod();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- public void testParentPersistentType() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeWithFieldAnnotation();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs();
- ClassRef classRef = classRefs.next();
- JavaPersistentType rootJavaPersistentType = classRef.getJavaPersistentType();
-
- classRef = classRefs.next();
- JavaPersistentType childJavaPersistentType = classRef.getJavaPersistentType();
-
- assertEquals(rootJavaPersistentType, childJavaPersistentType.getParentPersistentType());
- assertNull(rootJavaPersistentType.getParentPersistentType());
- }
-
- public void testParentPersistentType2() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeWithFieldAnnotation();
-
- //parent is not added to the persistenceUnit, but it should still be found
- //as the parentPersistentType because of impliedClassRefs and changes for bug 190317
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs();
- JavaPersistentType javaPersistentType = classRefs.next().getJavaPersistentType();
-
- assertNotNull(javaPersistentType.getParentPersistentType());
- }
-
- //Entity extends Non-Entity extends Entity
- public void testParentPersistentType3() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeNonPersistent();
- createTestSubTypePersistentExtendsNonPersistent();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild2");
-
- ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs();
- ClassRef classRef = classRefs.next();
- JavaPersistentType rootJavaPersistentType = classRef.getJavaPersistentType();
-
- classRef = classRefs.next();
- JavaPersistentType childJavaPersistentType = classRef.getJavaPersistentType();
-
- assertEquals(rootJavaPersistentType, childJavaPersistentType.getParentPersistentType());
- assertNull(rootJavaPersistentType.getParentPersistentType());
- }
-
- public void testInheritanceHierarchy() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeNonPersistent();
- createTestSubTypePersistentExtendsNonPersistent();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild2");
-
- ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs();
- JavaPersistentType rootJavaPersistentType = classRefs.next().getJavaPersistentType();
- JavaPersistentType childJavaPersistentType = classRefs.next().getJavaPersistentType();
-
- Iterator<PersistentType> inheritanceHierarchy = childJavaPersistentType.inheritanceHierarchy();
-
- assertEquals(childJavaPersistentType, inheritanceHierarchy.next());
- assertEquals(rootJavaPersistentType, inheritanceHierarchy.next());
- }
-
- public void testInheritanceHierarchy2() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeNonPersistent();
- createTestSubTypePersistentExtendsNonPersistent();
-
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild2");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs();
- JavaPersistentType childJavaPersistentType = classRefs.next().getJavaPersistentType();
- JavaPersistentType rootJavaPersistentType = classRefs.next().getJavaPersistentType();
-
- Iterator<PersistentType> inheritanceHierarchy = childJavaPersistentType.inheritanceHierarchy();
-
- assertEquals(childJavaPersistentType, inheritanceHierarchy.next());
- assertEquals(rootJavaPersistentType, inheritanceHierarchy.next());
- }
-
- public void testGetMapping() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, javaPersistentType().getMapping().getKey());
- }
-
- public void testGetMappingNull() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, javaPersistentType().getMapping().getKey());
- }
-
- public void testMappingKey() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, javaPersistentType().getMappingKey());
- }
-
- public void testMappingKeyNull() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, javaPersistentType().getMappingKey());
- }
-
- public void testSetMappingKey() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, javaPersistentType().getMappingKey());
-
- javaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- assertNotNull(typeResource.getMappingAnnotation());
- assertTrue(typeResource.getMappingAnnotation() instanceof EntityAnnotation);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, javaPersistentType().getMappingKey());
- }
-
- public void testSetMappingKey2() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, javaPersistentType().getMappingKey());
-
- javaPersistentType().setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- assertNotNull(typeResource.getMappingAnnotation());
- assertTrue(typeResource.getMappingAnnotation() instanceof EmbeddableAnnotation);
-
- assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, javaPersistentType().getMappingKey());
- }
-
- public void testSetMappingKeyNull() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, javaPersistentType().getMappingKey());
-
- javaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- assertNull(typeResource.getMappingAnnotation());
- assertNull(typeResource.getMappingAnnotation(EntityAnnotation.ANNOTATION_NAME));
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, javaPersistentType().getMappingKey());
- }
-
- public void testGetMappingKeyMappingChangeInResourceModel() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, javaPersistentType().getMappingKey());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- typeResource.setMappingAnnotation(EmbeddableAnnotation.ANNOTATION_NAME);
-
- assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, javaPersistentType().getMappingKey());
- }
-
- public void testGetMappingKeyMappingChangeInResourceModel2() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, javaPersistentType().getMappingKey());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- typeResource.setMappingAnnotation(EntityAnnotation.ANNOTATION_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, javaPersistentType().getMappingKey());
- }
-
- public void testIsMapped() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertTrue(javaPersistentType().isMapped());
-
- javaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertFalse(javaPersistentType().isMapped());
- }
-
- public void testAttributes() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- ListIterator<JavaPersistentAttribute> attributes = javaPersistentType().attributes();
-
- assertEquals("id", attributes.next().getName());
- assertFalse(attributes.hasNext());
- }
-
- public void testAttributes2() throws Exception {
- createTestEntityAnnotatedFieldAndMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<JavaPersistentAttribute> attributes = javaPersistentType().attributes();
-
- assertEquals("id", attributes.next().getName());
- assertEquals("name", attributes.next().getName());
- assertFalse(attributes.hasNext());
- }
-
- public void testAttributesSize() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(1, javaPersistentType().attributesSize());
- }
-
- public void testAttributesSize2() throws Exception {
- createTestEntityAnnotatedFieldAndMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, javaPersistentType().attributesSize());
- }
-
- public void testAttributeNamed() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute attribute = javaPersistentType().getAttributeNamed("id");
-
- assertEquals("id", attribute.getName());
- assertNull(javaPersistentType().getAttributeNamed("name"));
- assertNull(javaPersistentType().getAttributeNamed("foo"));
- }
-
- public void testAttributeNamed2() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute attribute = javaPersistentType().getAttributeNamed("name");
-
- assertEquals("name", attribute.getName());
-
- assertNull(javaPersistentType().getAttributeNamed("foo"));
- }
-
- public void testRenameAttribute() throws Exception {
- ICompilationUnit testType = createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<JavaPersistentAttribute> attributes = javaPersistentType().attributes();
- JavaPersistentAttribute idAttribute = attributes.next();
- JavaPersistentAttribute nameAttribute = attributes.next();
-
-
- assertEquals("id", idAttribute.getName());
- assertEquals("name", nameAttribute.getName());
-
- IField idField = testType.findPrimaryType().getField("id");
- idField.rename("id2", false, null);
-
- attributes = javaPersistentType().attributes();
- JavaPersistentAttribute nameAttribute2 = attributes.next();
- JavaPersistentAttribute id2Attribute = attributes.next();
-
- assertNotSame(idAttribute, id2Attribute);
- assertEquals("id2", id2Attribute.getName());
- assertEquals(nameAttribute, nameAttribute2);
- assertEquals("name", nameAttribute2.getName());
- assertFalse(attributes.hasNext());
- }
-
- public void testParentPersistentTypeGeneric() throws Exception {
- createTestGenericEntity();
- createTestGenericMappedSuperclass();
-
- addXmlClassRef(PACKAGE_NAME + ".Entity1");
- addXmlClassRef(PACKAGE_NAME + ".Entity2");
-
- JavaPersistentType javaPersistentType = javaPersistentType();
- assertEquals("test.Entity1", javaPersistentType.getName());
- assertNotNull(javaPersistentType.getParentPersistentType());
-
- assertEquals("test.Entity2", javaPersistentType.getParentPersistentType().getName());
- }
-
- private void createTestGenericEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Entity1 ");
- sb.append("extends Entity2<Integer> {}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Entity1.java", sourceWriter);
- }
-
- private void createTestGenericMappedSuperclass() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class Entity2<K> {}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Entity2.java", sourceWriter);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPrimaryKeyJoinColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPrimaryKeyJoinColumnTests.java
deleted file mode 100644
index 26011664a0..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPrimaryKeyJoinColumnTests.java
+++ /dev/null
@@ -1,295 +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.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.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JavaPrimaryKeyJoinColumnTests extends ContextModelTestCase
-{
- private static final String PRIMARY_KEY_JOIN_COLUMN_NAME = "MY_PRIMARY_KEY_JOIN_COLUMN";
- private static final String COLUMN_DEFINITION = "MY_COLUMN_DEFINITION";
-
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithPrimaryKeyJoinColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@PrimaryKeyJoinColumn(name=\"" + PRIMARY_KEY_JOIN_COLUMN_NAME + "\")");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
-
- public JavaPrimaryKeyJoinColumnTests(String name) {
- super(name);
- }
-
- public void testGetSpecifiedName() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next();
- assertEquals(PRIMARY_KEY_JOIN_COLUMN_NAME, specifiedPkJoinColumn.getSpecifiedName());
-
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- PrimaryKeyJoinColumnAnnotation pkJoinColumnResource = (PrimaryKeyJoinColumnAnnotation) typeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- pkJoinColumnResource.setName("FOO");
- specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next();
- assertEquals("FOO", specifiedPkJoinColumn.getName());
- }
-
- public void testGetDefaultNameNoSpecifiedPrimaryKeyJoinColumns() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn pkJoinColumn = javaEntity().getDefaultPrimaryKeyJoinColumn();
- assertEquals("id", pkJoinColumn.getDefaultName());
- }
-
- public void testGetDefaultName() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(javaEntity().getDefaultPrimaryKeyJoinColumn());
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next();
- assertEquals("id", specifiedPkJoinColumn.getDefaultName());
-
- //remove @Id annotation
- PersistentAttribute idAttribute = javaPersistentType().getAttributeNamed("id");
- idAttribute.setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
-
- assertNull(specifiedPkJoinColumn.getDefaultName());
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next();
- assertEquals(PRIMARY_KEY_JOIN_COLUMN_NAME, specifiedPkJoinColumn.getName());
- }
-
- public void testSetSpecifiedName() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next();
-
- specifiedPkJoinColumn.setSpecifiedName("foo");
- assertEquals("foo", specifiedPkJoinColumn.getSpecifiedName());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- PrimaryKeyJoinColumnAnnotation pkJoinColumn = (PrimaryKeyJoinColumnAnnotation) typeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertEquals("foo", pkJoinColumn.getName());
-
- specifiedPkJoinColumn.setSpecifiedName(null);
- assertNull(specifiedPkJoinColumn.getSpecifiedName());
- pkJoinColumn = (PrimaryKeyJoinColumnAnnotation) typeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertNull(pkJoinColumn);
- }
-
- public void testGetColumnDefinition() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next();
- assertNull(specifiedPkJoinColumn.getColumnDefinition());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) typeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN);
- column.setColumnDefinition(COLUMN_DEFINITION);
-
- assertEquals(COLUMN_DEFINITION, specifiedPkJoinColumn.getColumnDefinition());
-
- column.setColumnDefinition(null);
-
- assertNull(specifiedPkJoinColumn.getColumnDefinition());
-
- typeResource.removeSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertEquals(0, javaEntity().specifiedPrimaryKeyJoinColumnsSize());
- }
-
- public void testSetColumnDefinition() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next();
- specifiedPkJoinColumn.setColumnDefinition("foo");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) typeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertEquals("foo", column.getColumnDefinition());
-
- specifiedPkJoinColumn.setColumnDefinition(null);
- column = (PrimaryKeyJoinColumnAnnotation) typeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertNull(column.getColumnDefinition());
- }
-
- public void testGetSpecifiedReferencedColumnName() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next();
- assertNull(specifiedPkJoinColumn.getSpecifiedReferencedColumnName());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- PrimaryKeyJoinColumnAnnotation pkJoinColumnResource = (PrimaryKeyJoinColumnAnnotation) typeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- pkJoinColumnResource.setReferencedColumnName("FOO");
- specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next();
- assertEquals("FOO", specifiedPkJoinColumn.getSpecifiedReferencedColumnName());
- }
-
- public void testGetDefaultReferencedColumnNameNoSpecifiedPrimaryKeyJoinColumns() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn pkJoinColumn = javaEntity().getDefaultPrimaryKeyJoinColumn();
- assertEquals("id", pkJoinColumn.getDefaultReferencedColumnName());
- }
-
- public void testGetDefaultReferencedColumnName() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(javaEntity().getDefaultPrimaryKeyJoinColumn());
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next();
- assertEquals("id", specifiedPkJoinColumn.getDefaultReferencedColumnName());
-
-
- //remove @Id annotation
- PersistentAttribute idAttribute = javaPersistentType().getAttributeNamed("id");
- idAttribute.setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
-
- assertNull(specifiedPkJoinColumn.getDefaultReferencedColumnName());
- }
-
- public void testGetReferencedColumnName() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- PrimaryKeyJoinColumnAnnotation pkJoinColumnResource = (PrimaryKeyJoinColumnAnnotation) typeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- pkJoinColumnResource.setReferencedColumnName("FOO");
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next();
- assertEquals("FOO", specifiedPkJoinColumn.getReferencedColumnName());
- }
-
- public void testSetSpecifiedReferencedColumnName() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next();
-
- specifiedPkJoinColumn.setSpecifiedReferencedColumnName("foo");
- assertEquals("foo", specifiedPkJoinColumn.getSpecifiedReferencedColumnName());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- PrimaryKeyJoinColumnAnnotation pkJoinColumn = (PrimaryKeyJoinColumnAnnotation) typeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertEquals("foo", pkJoinColumn.getReferencedColumnName());
-
- specifiedPkJoinColumn.setSpecifiedName(null);
- specifiedPkJoinColumn.setSpecifiedReferencedColumnName(null);
- assertNull(specifiedPkJoinColumn.getSpecifiedReferencedColumnName());
- pkJoinColumn = (PrimaryKeyJoinColumnAnnotation) typeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertNull(pkJoinColumn);
- }
-
- public void testIsVirtual() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next();
- assertFalse(specifiedPkJoinColumn.isVirtual());
-
- assertNull(javaEntity().getDefaultPrimaryKeyJoinColumn());
- javaEntity().removeSpecifiedPrimaryKeyJoinColumn(0);
- assertTrue(javaEntity().getDefaultPrimaryKeyJoinColumn().isVirtual());
- }
-
- public void testIsReferencedColumnResolved() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next();
- assertFalse(specifiedPkJoinColumn.isReferencedColumnResolved());
- }
-
- public void testDbColumn() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next();
- assertNull(specifiedPkJoinColumn.getDbColumn());
- }
-
- public void testDbReferencedColumn() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next();
- assertNull(specifiedPkJoinColumn.getReferencedDbColumn());
- }
-
- public void testDbTable() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next();
- assertNull(specifiedPkJoinColumn.getDbTable());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaQueryHintTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaQueryHintTests.java
deleted file mode 100644
index 5b748e0889..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaQueryHintTests.java
+++ /dev/null
@@ -1,142 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.QueryHint;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.QueryHintAnnotation;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JavaQueryHintTests extends ContextModelTestCase
-{
- private static final String QUERY_NAME = "QUERY_NAME";
-
- private ICompilationUnit createTestEntityWithNamedQuery() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.NAMED_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@NamedQuery(name=\"" + QUERY_NAME + "\", hints=@QueryHint())");
- }
- });
- }
-
-
-
- public JavaQueryHintTests(String name) {
- super(name);
- }
-
- public void testUpdateName() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- QueryHint queryHint = entity.namedQueries().next().hints().next();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- QueryHintAnnotation javaQueryHint = ((NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME)).hints().next();
-
- assertNull(javaQueryHint.getName());
- assertNull(queryHint.getName());
-
- //set name in the resource model, verify context model updated
- javaQueryHint.setName("foo");
- assertEquals("foo", javaQueryHint.getName());
- assertEquals("foo", queryHint.getName());
-
- //set name to null in the resource model
- javaQueryHint.setName(null);
- assertNull(javaQueryHint.getName());
- assertEquals(0, entity.namedQueries().next().hintsSize());
- }
-
- public void testModifyName() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- QueryHint queryHint = entity.namedQueries().next().hints().next();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- QueryHintAnnotation javaQueryhint = ((NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME)).hints().next();
-
- assertNull(javaQueryhint.getName());
- assertNull(queryHint.getName());
-
- //set name in the context model, verify resource model updated
- queryHint.setName("foo");
- assertEquals("foo", javaQueryhint.getName());
- assertEquals("foo", queryHint.getName());
-
- //set name to null in the context model
- queryHint.setName(null);
- assertNull(javaQueryhint.getName());
- assertNull(queryHint.getName());
- }
-
- public void testUpdateValue() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- QueryHint queryHint = entity.namedQueries().next().hints().next();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- QueryHintAnnotation javaQueryhint = ((NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME)).hints().next();
-
- assertNull(javaQueryhint.getValue());
- assertNull(queryHint.getValue());
-
- //set name in the resource model, verify context model updated
- javaQueryhint.setValue("foo");
- assertEquals("foo", javaQueryhint.getValue());
- assertEquals("foo", queryHint.getValue());
-
- //set name to null in the resource model
- javaQueryhint.setValue(null);
- assertNull(javaQueryhint.getValue());
- assertEquals(0, entity.namedQueries().next().hintsSize());
- }
-
- public void testModifyValue() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = javaEntity();
- QueryHint queryHint = entity.namedQueries().next().hints().next();
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- QueryHintAnnotation javaQueryhint = ((NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME)).hints().next();
-
- assertNull(javaQueryhint.getValue());
- assertNull(queryHint.getValue());
-
- //set name in the context model, verify resource model updated
- queryHint.setValue("foo");
- assertEquals("foo", javaQueryhint.getValue());
- assertEquals("foo", queryHint.getValue());
-
- //set name to null in the context model
- queryHint.setValue(null);
- assertNull(javaQueryhint.getValue());
- assertNull(queryHint.getValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaSecondaryTableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaSecondaryTableTests.java
deleted file mode 100644
index 2381bde08a..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaSecondaryTableTests.java
+++ /dev/null
@@ -1,734 +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.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.IdMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.SecondaryTable;
-import org.eclipse.jpt.core.context.UniqueConstraint;
-import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaUniqueConstraint;
-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.SecondaryTableAnnotation;
-import org.eclipse.jpt.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class JavaSecondaryTableTests extends ContextModelTestCase
-{
- private static final String TABLE_NAME = "MY_TABLE";
-
- private ICompilationUnit createTestEntityWithSecondaryTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@SecondaryTable(name=\"" + TABLE_NAME + "\")");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithSecondaryTables() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@SecondaryTables({@SecondaryTable(name=\"foo\"), @SecondaryTable(name=\"bar\")})");
- }
- });
- }
-
-
-
-
- public JavaSecondaryTableTests(String name) {
- super(name);
- }
-
- public void testGetSpecifiedName() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = javaEntity().secondaryTables().next();
- assertEquals(TABLE_NAME, secondaryTable.getSpecifiedName());
- }
-
- public void testGetDefaultNameNull() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = javaEntity().secondaryTables().next();
- assertNull(secondaryTable.getDefaultName());
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = javaEntity().secondaryTables().next();
- assertEquals(TABLE_NAME, secondaryTable.getName());
- }
-
- public void testSetSpecifiedName() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = javaEntity().secondaryTables().next();
- secondaryTable.setSpecifiedName("foo");
-
- assertEquals("foo", javaEntity().secondaryTables().next().getSpecifiedName());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
-
- assertEquals("foo", table.getName());
- }
-
- public void testSetSpecifiedNameNull() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = javaEntity().secondaryTables().next();
- secondaryTable.setSpecifiedName(null);
-
- assertEquals(0, javaEntity().secondaryTablesSize());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- assertNull(typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE));
- }
-
- public void testUpdateFromSpecifiedNameChangeInResourceModel() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
- table.setName("foo");
-
- assertEquals("foo", javaEntity().secondaryTables().next().getSpecifiedName());
- }
-
- public void testUpdateFromSpecifiedCatalogChangeInResourceModel() throws Exception {
- createTestEntityWithSecondaryTables();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- ListIterator<NestableAnnotation> secondaryTableResources = typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- ((SecondaryTableAnnotation) secondaryTableResources.next()).setCatalog("foo");
- ((SecondaryTableAnnotation) secondaryTableResources.next()).setCatalog("bar");
-
- ListIterator<SecondaryTable> secondaryTsbles = javaEntity().secondaryTables();
- assertEquals("foo", secondaryTsbles.next().getSpecifiedCatalog());
- assertEquals("bar", secondaryTsbles.next().getSpecifiedCatalog());
- }
-
- public void testUpdateFromSpecifiedSchemaChangeInResourceModel() throws Exception {
- createTestEntityWithSecondaryTables();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- ListIterator<NestableAnnotation> secondaryTableResources = typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- ((SecondaryTableAnnotation) secondaryTableResources.next()).setSchema("foo");
- ((SecondaryTableAnnotation) secondaryTableResources.next()).setSchema("bar");
-
- ListIterator<SecondaryTable> secondaryTsbles = javaEntity().secondaryTables();
- assertEquals("foo", secondaryTsbles.next().getSpecifiedSchema());
- assertEquals("bar", secondaryTsbles.next().getSpecifiedSchema());
- }
-
- public void testGetCatalog() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
-
- table.setCatalog("myCatalog");
-
- assertEquals("myCatalog", javaEntity().secondaryTables().next().getSpecifiedCatalog());
- assertEquals("myCatalog", javaEntity().secondaryTables().next().getCatalog());
- }
-
- public void testGetDefaultCatalog() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(javaEntity().secondaryTables().next().getDefaultCatalog());
-
- javaEntity().secondaryTables().next().setSpecifiedCatalog("myCatalog");
-
- assertNull(javaEntity().secondaryTables().next().getDefaultCatalog());
- }
-
- public void testSetSpecifiedCatalog() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTable table = javaEntity().secondaryTables().next();
- table.setSpecifiedCatalog("myCatalog");
- table.setSpecifiedName(null);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
-
- assertEquals("myCatalog", tableResource.getCatalog());
-
- table.setSpecifiedCatalog(null);
- assertNull(typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE));
- }
-
- public void testGetSchema() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
-
- tableResource.setSchema("mySchema");
-
- assertEquals("mySchema", javaEntity().secondaryTables().next().getSpecifiedSchema());
- assertEquals("mySchema", javaEntity().secondaryTables().next().getSchema());
- }
-
- public void testGetDefaultSchema() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(javaEntity().secondaryTables().next().getDefaultSchema());
-
- javaEntity().secondaryTables().next().setSpecifiedSchema("mySchema");
-
- assertNull(javaEntity().secondaryTables().next().getDefaultSchema());
- }
-
- public void testSetSpecifiedSchema() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTable table = javaEntity().secondaryTables().next();
- table.setSpecifiedSchema("mySchema");
- table.setSpecifiedName(null);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
-
- assertEquals("mySchema", tableResource.getSchema());
-
- table.setSpecifiedSchema(null);
- assertNull(typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE));
- }
-
- public void testSpecifiedPrimaryKeyJoinColumns() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next();
- ListIterator<JavaPrimaryKeyJoinColumn> specifiedPkJoinColumns = secondaryTable.specifiedPrimaryKeyJoinColumns();
-
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
-
- //add an annotation to the resource model and verify the context model is updated
- PrimaryKeyJoinColumnAnnotation pkJoinColumn = tableResource.addPkJoinColumn(0);
- pkJoinColumn.setName("FOO");
- specifiedPkJoinColumns = secondaryTable.specifiedPrimaryKeyJoinColumns();
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- pkJoinColumn = tableResource.addPkJoinColumn(0);
- pkJoinColumn.setName("BAR");
- specifiedPkJoinColumns = secondaryTable.specifiedPrimaryKeyJoinColumns();
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
-
- //move an annotation to the resource model and verify the context model is updated
- tableResource.movePkJoinColumn(1, 0);
- specifiedPkJoinColumns = secondaryTable.specifiedPrimaryKeyJoinColumns();
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- tableResource.removePkJoinColumn(0);
- specifiedPkJoinColumns = secondaryTable.specifiedPrimaryKeyJoinColumns();
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- tableResource.removePkJoinColumn(0);
- specifiedPkJoinColumns = secondaryTable.specifiedPrimaryKeyJoinColumns();
- assertFalse(specifiedPkJoinColumns.hasNext());
- }
-
- public void testSpecifiedPrimaryKeyJoinColumnsSize() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next();
- assertEquals(0, secondaryTable.specifiedPrimaryKeyJoinColumnsSize());
-
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- assertEquals(3, secondaryTable.specifiedPrimaryKeyJoinColumnsSize());
- }
-
- public void testPrimaryKeyJoinColumnsSize() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next();
- //just the default pkJoinColumn, so 1
- assertEquals(1, secondaryTable.primaryKeyJoinColumnsSize());
-
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- //only the specified pkJoinColumns, 3
- assertEquals(3, secondaryTable.primaryKeyJoinColumnsSize());
- }
-
- public void testGetDefaultPrimaryKeyJoinColumn() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next();
- assertNotNull(secondaryTable.getDefaultPrimaryKeyJoinColumn());
-
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- assertNull(secondaryTable.getDefaultPrimaryKeyJoinColumn());
- }
-
- public void testPrimaryKeyJoinColumnDefaults() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next();
- PrimaryKeyJoinColumn defaultPkJoinColumn = secondaryTable.getDefaultPrimaryKeyJoinColumn();
- assertNotNull(defaultPkJoinColumn);
- assertEquals("id", defaultPkJoinColumn.getDefaultName());
- assertEquals("id", defaultPkJoinColumn.getDefaultReferencedColumnName());
-
-
- IdMapping idMapping = (IdMapping) javaEntity().getPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- assertEquals("FOO", defaultPkJoinColumn.getDefaultName());
- assertEquals("FOO", defaultPkJoinColumn.getDefaultReferencedColumnName());
-
- idMapping.getColumn().setSpecifiedName(null);
- assertEquals("id", defaultPkJoinColumn.getDefaultName());
- assertEquals("id", defaultPkJoinColumn.getDefaultReferencedColumnName());
- }
-
- public void testAddSpecifiedPrimaryKeyJoinColumn() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next();
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- Iterator<PrimaryKeyJoinColumn> specifiedPkJoinColumns = secondaryTable.specifiedPrimaryKeyJoinColumns();
- assertEquals("BAZ", specifiedPkJoinColumns.next().getName());
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
- Iterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumns = tableResource.pkJoinColumns();
-
- assertEquals("BAZ", pkJoinColumns.next().getName());
- assertEquals("BAR", pkJoinColumns.next().getName());
- assertEquals("FOO", pkJoinColumns.next().getName());
- assertFalse(pkJoinColumns.hasNext());
- }
-
- public void testAddSpecifiedPrimaryKeyJoinColumn2() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next();
-
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- Iterator<PrimaryKeyJoinColumn> specifiedPkJoinColumns = secondaryTable.specifiedPrimaryKeyJoinColumns();
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertEquals("BAZ", specifiedPkJoinColumns.next().getName());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
- Iterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumns = tableResource.pkJoinColumns();
-
- assertEquals("FOO", pkJoinColumns.next().getName());
- assertEquals("BAR", pkJoinColumns.next().getName());
- assertEquals("BAZ", pkJoinColumns.next().getName());
- assertFalse(pkJoinColumns.hasNext());
- }
- public void testRemoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next();
-
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
-
- assertEquals(3, tableResource.pkJoinColumnsSize());
-
- secondaryTable.removeSpecifiedPrimaryKeyJoinColumn(1);
-
- Iterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumnResources = tableResource.pkJoinColumns();
- assertEquals("FOO", pkJoinColumnResources.next().getName());
- assertEquals("BAZ", pkJoinColumnResources.next().getName());
- assertFalse(pkJoinColumnResources.hasNext());
-
- Iterator<PrimaryKeyJoinColumn> pkJoinColumns = secondaryTable.specifiedPrimaryKeyJoinColumns();
- assertEquals("FOO", pkJoinColumns.next().getName());
- assertEquals("BAZ", pkJoinColumns.next().getName());
- assertFalse(pkJoinColumns.hasNext());
-
-
- secondaryTable.removeSpecifiedPrimaryKeyJoinColumn(1);
- pkJoinColumnResources = tableResource.pkJoinColumns();
- assertEquals("FOO", pkJoinColumnResources.next().getName());
- assertFalse(pkJoinColumnResources.hasNext());
-
- pkJoinColumns = secondaryTable.specifiedPrimaryKeyJoinColumns();
- assertEquals("FOO", pkJoinColumns.next().getName());
- assertFalse(pkJoinColumns.hasNext());
-
-
- secondaryTable.removeSpecifiedPrimaryKeyJoinColumn(0);
- pkJoinColumnResources = tableResource.pkJoinColumns();
- assertFalse(pkJoinColumnResources.hasNext());
- pkJoinColumns = secondaryTable.specifiedPrimaryKeyJoinColumns();
- assertFalse(pkJoinColumns.hasNext());
-
- assertEquals(0, tableResource.pkJoinColumnsSize());
- }
-
- public void testMoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next();
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- Iterator<PrimaryKeyJoinColumn> specifiedPkJoinColumns = secondaryTable.specifiedPrimaryKeyJoinColumns();
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertEquals("BAZ", specifiedPkJoinColumns.next().getName());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
- Iterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumns = tableResource.pkJoinColumns();
-
- assertEquals("FOO", pkJoinColumns.next().getName());
- assertEquals("BAR", pkJoinColumns.next().getName());
- assertEquals("BAZ", pkJoinColumns.next().getName());
-
-
- secondaryTable.moveSpecifiedPrimaryKeyJoinColumn(2, 0);
- pkJoinColumns = tableResource.pkJoinColumns();
-
- assertEquals("BAR", pkJoinColumns.next().getName());
- assertEquals("BAZ", pkJoinColumns.next().getName());
- assertEquals("FOO", pkJoinColumns.next().getName());
- }
-
- public void testPrimaryKeyJoinColumnGetDefaultName() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next();
- PrimaryKeyJoinColumn defaultPkJoinColumn = secondaryTable.getDefaultPrimaryKeyJoinColumn();
- assertEquals("id", defaultPkJoinColumn.getDefaultName());
-
-
- //remove @Id annotation
- PersistentAttribute idAttribute = javaPersistentType().getAttributeNamed("id");
- idAttribute.setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
-
- assertNull(defaultPkJoinColumn.getDefaultName());
- }
- public void testPrimaryKeyJoinColumnGetDefaultReferencedColumnName() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next();
- PrimaryKeyJoinColumn defaultPkJoinColumn = secondaryTable.getDefaultPrimaryKeyJoinColumn();
- assertEquals("id", defaultPkJoinColumn.getDefaultReferencedColumnName());
-
- //remove @Id annotation
- PersistentAttribute idAttribute = javaPersistentType().getAttributeNamed("id");
- idAttribute.setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
-
- assertNull(defaultPkJoinColumn.getDefaultReferencedColumnName());
- }
-
- public void testPrimaryKeyJoinColumnIsVirtual() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next();
-
- assertTrue(secondaryTable.getDefaultPrimaryKeyJoinColumn().isVirtual());
-
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0);
- PrimaryKeyJoinColumn specifiedPkJoinColumn = secondaryTable.specifiedPrimaryKeyJoinColumns().next();
- assertFalse(specifiedPkJoinColumn.isVirtual());
-
- assertNull(secondaryTable.getDefaultPrimaryKeyJoinColumn());
- }
-
-
- public void testUniqueConstraints() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next();
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = secondaryTable.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaResourcePersistentType resourcePersistentType = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourcePersistentType.getSupportingAnnotation(JPA.SECONDARY_TABLE);
- secondaryTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- secondaryTableAnnotation.addUniqueConstraint(0).addColumnName(0, "bar");
-
- uniqueConstraints = secondaryTable.uniqueConstraints();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().columnNames().next());
- assertEquals("foo", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next();
-
- assertEquals(0, secondaryTable.uniqueConstraintsSize());
-
- JavaResourcePersistentType resourcePersistentType = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourcePersistentType.getSupportingAnnotation(JPA.SECONDARY_TABLE);
- secondaryTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- secondaryTableAnnotation.addUniqueConstraint(1).addColumnName(0, "bar");
-
- assertEquals(2, secondaryTable.uniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next();
- secondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- secondaryTable.addUniqueConstraint(0).addColumnName(0, "BAR");
- secondaryTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourcePersistentType resourcePersistentType = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourcePersistentType.getSupportingAnnotation(JPA.SECONDARY_TABLE);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = secondaryTableAnnotation.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 {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next();
- secondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- secondaryTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- secondaryTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourcePersistentType resourcePersistentType = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourcePersistentType.getSupportingAnnotation(JPA.SECONDARY_TABLE);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = secondaryTableAnnotation.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 {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next();
- secondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- secondaryTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- secondaryTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourcePersistentType resourcePersistentType = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourcePersistentType.getSupportingAnnotation(JPA.SECONDARY_TABLE);
-
- assertEquals(3, secondaryTableAnnotation.uniqueConstraintsSize());
-
- secondaryTable.removeUniqueConstraint(1);
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = secondaryTableAnnotation.uniqueConstraints();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNames().next());
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- Iterator<UniqueConstraint> uniqueConstraints = secondaryTable.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- secondaryTable.removeUniqueConstraint(1);
- uniqueConstraintAnnotations = secondaryTableAnnotation.uniqueConstraints();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNames().next());
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- uniqueConstraints = secondaryTable.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- secondaryTable.removeUniqueConstraint(0);
- uniqueConstraintAnnotations = secondaryTableAnnotation.uniqueConstraints();
- assertFalse(uniqueConstraintAnnotations.hasNext());
- uniqueConstraints = secondaryTable.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next();
- secondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- secondaryTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- secondaryTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourcePersistentType resourcePersistentType = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourcePersistentType.getSupportingAnnotation(JPA.SECONDARY_TABLE);
-
- assertEquals(3, secondaryTableAnnotation.uniqueConstraintsSize());
-
-
- secondaryTable.moveUniqueConstraint(2, 0);
- ListIterator<UniqueConstraint> uniqueConstraints = secondaryTable.uniqueConstraints();
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = secondaryTableAnnotation.uniqueConstraints();
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNames().next());
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNames().next());
-
-
- secondaryTable.moveUniqueConstraint(0, 1);
- uniqueConstraints = secondaryTable.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
-
- uniqueConstraintAnnotations = secondaryTableAnnotation.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNames().next());
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNames().next());
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNames().next());
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next();
- JavaResourcePersistentType resourcePersistentType = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourcePersistentType.getSupportingAnnotation(JPA.SECONDARY_TABLE);
-
- secondaryTableAnnotation.addUniqueConstraint(0).addColumnName("FOO");
- secondaryTableAnnotation.addUniqueConstraint(1).addColumnName("BAR");
- secondaryTableAnnotation.addUniqueConstraint(2).addColumnName("BAZ");
-
-
- ListIterator<UniqueConstraint> uniqueConstraints = secondaryTable.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableAnnotation.moveUniqueConstraint(2, 0);
- uniqueConstraints = secondaryTable.uniqueConstraints();
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableAnnotation.moveUniqueConstraint(0, 1);
- uniqueConstraints = secondaryTable.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableAnnotation.removeUniqueConstraint(1);
- uniqueConstraints = secondaryTable.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableAnnotation.removeUniqueConstraint(1);
- uniqueConstraints = secondaryTable.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableAnnotation.removeUniqueConstraint(0);
- uniqueConstraints = secondaryTable.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaSequenceGeneratorTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaSequenceGeneratorTests.java
deleted file mode 100644
index 1b59d80f84..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaSequenceGeneratorTests.java
+++ /dev/null
@@ -1,255 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.context.Generator;
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.core.context.SequenceGenerator;
-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.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JavaSequenceGeneratorTests extends ContextModelTestCase
-{
- private static final String SEQUENCE_GENERATOR_NAME = "MY_SEQUENCE_GENERATOR";
-
-
- private ICompilationUnit createTestEntityWithSequenceGenerator() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SEQUENCE_GENERATOR, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@SequenceGenerator(name=\"" + SEQUENCE_GENERATOR_NAME + "\")");
- }
- });
- }
-
- public JavaSequenceGeneratorTests(String name) {
- super(name);
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(SEQUENCE_GENERATOR_NAME, idMapping.getSequenceGenerator().getName());
-
- //change resource model sequenceGenerator name, verify the context model is updated
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR);
-
- sequenceGenerator.setName("foo");
-
- assertEquals("foo", idMapping.getSequenceGenerator().getName());
- }
-
- public void testSetName() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(SEQUENCE_GENERATOR_NAME, idMapping.getSequenceGenerator().getName());
-
- idMapping.getSequenceGenerator().setName("foo");
-
- assertEquals("foo", idMapping.getSequenceGenerator().getName());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR);
-
- assertEquals("foo", sequenceGenerator.getName());
- }
-
- public void testSetSpecifiedNameNull() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(SEQUENCE_GENERATOR_NAME, idMapping.getSequenceGenerator().getName());
-
- idMapping.getSequenceGenerator().setName(null);
-
- assertNull(idMapping.getSequenceGenerator());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR);
-
- assertNull(sequenceGenerator);
- }
-
- public void testGetInitialValue() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(SequenceGenerator.DEFAULT_INITIAL_VALUE, idMapping.getSequenceGenerator().getInitialValue());
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR);
-
- sequenceGenerator.setInitialValue(Integer.valueOf(82));
-
- assertEquals(Integer.valueOf(82), idMapping.getSequenceGenerator().getInitialValue());
- assertEquals(Integer.valueOf(82), idMapping.getSequenceGenerator().getSpecifiedInitialValue());
- }
-
- public void testGetDefaultInitialValue() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(SequenceGenerator.DEFAULT_INITIAL_VALUE, idMapping.getSequenceGenerator().getDefaultInitialValue());
-
- idMapping.getSequenceGenerator().setSpecifiedInitialValue(Integer.valueOf(82));
-
- assertEquals(SequenceGenerator.DEFAULT_INITIAL_VALUE, idMapping.getSequenceGenerator().getDefaultInitialValue());
- assertEquals(Integer.valueOf(82), idMapping.getSequenceGenerator().getSpecifiedInitialValue());
- }
-
- public void testSetSpecifiedInitialValue() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getSequenceGenerator().setSpecifiedInitialValue(Integer.valueOf(20));
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR);
-
- assertEquals(Integer.valueOf(20), sequenceGenerator.getInitialValue());
-
- idMapping.getSequenceGenerator().setName(null);
- idMapping.getSequenceGenerator().setSpecifiedInitialValue(null);
- assertNull(attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR));
- }
-
- public void testGetAllocationSize() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(Generator.DEFAULT_ALLOCATION_SIZE, idMapping.getSequenceGenerator().getAllocationSize());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR);
-
- sequenceGenerator.setAllocationSize(Integer.valueOf(20));
-
- assertEquals(Integer.valueOf(20), idMapping.getSequenceGenerator().getAllocationSize());
- assertEquals(Integer.valueOf(20), idMapping.getSequenceGenerator().getSpecifiedAllocationSize());
- }
-
- public void testGetDefaultAllocationSize() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(Generator.DEFAULT_ALLOCATION_SIZE, idMapping.getSequenceGenerator().getDefaultAllocationSize());
-
- idMapping.getSequenceGenerator().setSpecifiedAllocationSize(Integer.valueOf(20));
-
- assertEquals(Generator.DEFAULT_ALLOCATION_SIZE, idMapping.getSequenceGenerator().getDefaultAllocationSize());
- assertEquals(Integer.valueOf(20), idMapping.getSequenceGenerator().getSpecifiedAllocationSize());
- }
-
- public void testSetSpecifiedAllocationSize() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getSequenceGenerator().setSpecifiedAllocationSize(Integer.valueOf(25));
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR);
-
- assertEquals(Integer.valueOf(25), sequenceGenerator.getAllocationSize());
-
- idMapping.getSequenceGenerator().setName(null);
- idMapping.getSequenceGenerator().setSpecifiedAllocationSize(null);
- assertNull(attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR));
- }
-
-
-
- public void testGetSequenceName() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getSequenceGenerator().getSequenceName());
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR);
-
- sequenceGenerator.setSequenceName("mySequenceName");
-
- assertEquals("mySequenceName", idMapping.getSequenceGenerator().getSequenceName());
- assertEquals("mySequenceName", idMapping.getSequenceGenerator().getSpecifiedSequenceName());
- }
-
- public void testGetDefaultSequenceName() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getSequenceGenerator().getDefaultSequenceName());
-
- idMapping.getSequenceGenerator().setSpecifiedSequenceName("mySequenceName");
-
- assertNull(idMapping.getSequenceGenerator().getDefaultSequenceName());
- assertEquals("mySequenceName", idMapping.getSequenceGenerator().getSpecifiedSequenceName());
- }
-
- public void testSetSpecifiedSequenceName() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getSequenceGenerator().setSpecifiedSequenceName("mySequenceName");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR);
-
- assertEquals("mySequenceName", sequenceGenerator.getSequenceName());
-
- idMapping.getSequenceGenerator().setName(null);
- idMapping.getSequenceGenerator().setSpecifiedSequenceName(null);
- assertNull(attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTableGeneratorTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTableGeneratorTests.java
deleted file mode 100644
index c1bf515f3a..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTableGeneratorTests.java
+++ /dev/null
@@ -1,700 +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.tests.internal.context.java;
-
-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.Generator;
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.core.context.TableGenerator;
-import org.eclipse.jpt.core.context.UniqueConstraint;
-import org.eclipse.jpt.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-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.TableGeneratorAnnotation;
-import org.eclipse.jpt.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JavaTableGeneratorTests extends ContextModelTestCase
-{
- private static final String TABLE_GENERATOR_NAME = "MY_TABLE_GENERATOR";
-
- private ICompilationUnit createTestEntityWithTableGenerator() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TABLE_GENERATOR, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@TableGenerator(name=\"" + TABLE_GENERATOR_NAME + "\")");
- }
- });
- }
-
- public JavaTableGeneratorTests(String name) {
- super(name);
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(TABLE_GENERATOR_NAME, idMapping.getTableGenerator().getName());
-
- //change resource model tableGenerator name, verify the context model is updated
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.setName("foo");
-
- assertEquals("foo", idMapping.getTableGenerator().getName());
- }
-
- public void testSetName() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(TABLE_GENERATOR_NAME, idMapping.getTableGenerator().getName());
-
- idMapping.getTableGenerator().setName("foo");
-
- assertEquals("foo", idMapping.getTableGenerator().getName());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals("foo", tableGenerator.getName());
- }
-
- public void testSetSpecifiedNameNull() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(TABLE_GENERATOR_NAME, idMapping.getTableGenerator().getName());
-
- idMapping.getTableGenerator().setName(null);
-
- assertNull(idMapping.getTableGenerator());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- assertNull(tableGenerator);
- }
-
- public void testGetCatalog() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getTableGenerator().getCatalog());
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.setCatalog("myCatalog");
-
- assertEquals("myCatalog", idMapping.getTableGenerator().getCatalog());
- assertEquals("myCatalog", idMapping.getTableGenerator().getSpecifiedCatalog());
- }
-
- public void testGetDefaultCatalog() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getTableGenerator().getDefaultCatalog());
-
- idMapping.getTableGenerator().setSpecifiedCatalog("myCatalog");
-
- assertNull(idMapping.getTableGenerator().getDefaultCatalog());
- assertEquals("myCatalog", idMapping.getTableGenerator().getSpecifiedCatalog());
- }
-
- public void testSetSpecifiedCatalog() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getTableGenerator().setSpecifiedCatalog("myCatalog");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals("myCatalog", tableGenerator.getCatalog());
-
- idMapping.getTableGenerator().setName(null);
- idMapping.getTableGenerator().setSpecifiedCatalog(null);
- assertNull(attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR));
- }
-
- public void testGetSchema() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getTableGenerator().getSchema());
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.setSchema("mySchema");
-
- assertEquals("mySchema", idMapping.getTableGenerator().getSchema());
- assertEquals("mySchema", idMapping.getTableGenerator().getSpecifiedSchema());
- }
-
- public void testGetDefaultSchema() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getTableGenerator().getDefaultSchema());
-
- idMapping.getTableGenerator().setSpecifiedSchema("mySchema");
-
- assertNull(idMapping.getTableGenerator().getDefaultSchema());
- assertEquals("mySchema", idMapping.getTableGenerator().getSpecifiedSchema());
- }
-
- public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception {
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
-
- createTestEntityWithTableGenerator();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- IdMapping idMapping = (IdMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getTableGenerator().getDefaultSchema());
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO");
- assertEquals("FOO", idMapping.getTableGenerator().getDefaultSchema());
-
- entityMappings().setSpecifiedSchema("BAR");
- assertEquals("BAR", idMapping.getTableGenerator().getDefaultSchema());
-
- ormEntity.getTable().setSpecifiedSchema("XML_SCHEMA");
- assertEquals("BAR", idMapping.getTableGenerator().getDefaultSchema());
-
- entityMappings().removeOrmPersistentType(0);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- //default schema taken from persistence-unit-defaults not entity-mappings since the entity is not in an orm.xml file
- assertEquals("FOO", ((IdMapping) javaPersistentType().getAttributeNamed("id").getMapping()).getTableGenerator().getDefaultSchema());
- }
-
- public void testSetSpecifiedSchema() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getTableGenerator().setSpecifiedSchema("mySchema");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals("mySchema", tableGenerator.getSchema());
-
- idMapping.getTableGenerator().setName(null);
- idMapping.getTableGenerator().setSpecifiedSchema(null);
- assertNull(attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR));
- }
-
- public void testGetPkColumnName() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getTableGenerator().getPkColumnName());
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.setPkColumnName("myPkColumnName");
-
- assertEquals("myPkColumnName", idMapping.getTableGenerator().getPkColumnName());
- assertEquals("myPkColumnName", idMapping.getTableGenerator().getSpecifiedPkColumnName());
- }
-
- public void testGetDefaultPkColumnName() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getTableGenerator().getDefaultPkColumnName());
-
- idMapping.getTableGenerator().setSpecifiedPkColumnName("myPkColumnName");
-
- assertNull(idMapping.getTableGenerator().getDefaultPkColumnName());
- assertEquals("myPkColumnName", idMapping.getTableGenerator().getSpecifiedPkColumnName());
- }
-
- public void testSetSpecifiedPkColumnName() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getTableGenerator().setSpecifiedPkColumnName("myPkColumnName");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals("myPkColumnName", tableGenerator.getPkColumnName());
-
- idMapping.getTableGenerator().setName(null);
- idMapping.getTableGenerator().setSpecifiedPkColumnName(null);
- assertNull(attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR));
- }
-
- public void testGetValueColumnName() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getTableGenerator().getValueColumnName());
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.setValueColumnName("myValueColumnName");
-
- assertEquals("myValueColumnName", idMapping.getTableGenerator().getValueColumnName());
- assertEquals("myValueColumnName", idMapping.getTableGenerator().getSpecifiedValueColumnName());
- }
-
- public void testGetDefaultValueColumnName() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getTableGenerator().getDefaultValueColumnName());
-
- idMapping.getTableGenerator().setSpecifiedValueColumnName("myValueColumnName");
-
- assertNull(idMapping.getTableGenerator().getDefaultValueColumnName());
- assertEquals("myValueColumnName", idMapping.getTableGenerator().getSpecifiedValueColumnName());
- }
-
- public void testSetSpecifiedValueColumnName() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getTableGenerator().setSpecifiedValueColumnName("myValueColumnName");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals("myValueColumnName", tableGenerator.getValueColumnName());
-
- idMapping.getTableGenerator().setName(null);
- idMapping.getTableGenerator().setSpecifiedValueColumnName(null);
- assertNull(attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR));
- }
-
- public void testGetPkColumnValue() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getTableGenerator().getPkColumnValue());
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.setPkColumnValue("myPkColumnValue");
-
- assertEquals("myPkColumnValue", idMapping.getTableGenerator().getPkColumnValue());
- assertEquals("myPkColumnValue", idMapping.getTableGenerator().getSpecifiedPkColumnValue());
- }
-
- public void testGetDefaultPkColumnValue() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getTableGenerator().getDefaultPkColumnValue());
-
- idMapping.getTableGenerator().setSpecifiedPkColumnValue("myPkColumnValue");
-
- assertNull(idMapping.getTableGenerator().getDefaultPkColumnValue());
- assertEquals("myPkColumnValue", idMapping.getTableGenerator().getSpecifiedPkColumnValue());
- }
-
- public void testSetSpecifiedPkColumnValue() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getTableGenerator().setSpecifiedPkColumnValue("myPkColumnValue");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals("myPkColumnValue", tableGenerator.getPkColumnValue());
-
- idMapping.getTableGenerator().setName(null);
- idMapping.getTableGenerator().setSpecifiedPkColumnValue(null);
- assertNull(attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR));
- }
-
- public void testGetInitialValue() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(TableGenerator.DEFAULT_INITIAL_VALUE, idMapping.getTableGenerator().getInitialValue());
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.setInitialValue(Integer.valueOf(82));
-
- assertEquals(Integer.valueOf(82), idMapping.getTableGenerator().getInitialValue());
- assertEquals(Integer.valueOf(82), idMapping.getTableGenerator().getSpecifiedInitialValue());
- }
-
- public void testGetDefaultInitialValue() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(TableGenerator.DEFAULT_INITIAL_VALUE, idMapping.getTableGenerator().getDefaultInitialValue());
-
- idMapping.getTableGenerator().setSpecifiedInitialValue(Integer.valueOf(82));
-
- assertEquals(TableGenerator.DEFAULT_INITIAL_VALUE, idMapping.getTableGenerator().getDefaultInitialValue());
- assertEquals(Integer.valueOf(82), idMapping.getTableGenerator().getSpecifiedInitialValue());
- }
-
- public void testSetSpecifiedInitialValue() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getTableGenerator().setSpecifiedInitialValue(Integer.valueOf(20));
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals(Integer.valueOf(20), tableGenerator.getInitialValue());
-
- idMapping.getTableGenerator().setName(null);
- idMapping.getTableGenerator().setSpecifiedInitialValue(null);
- assertNull(attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR));
- }
-
- public void testGetAllocationSize() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(Generator.DEFAULT_ALLOCATION_SIZE, idMapping.getTableGenerator().getAllocationSize());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.setAllocationSize(Integer.valueOf(20));
-
- assertEquals(Integer.valueOf(20), idMapping.getTableGenerator().getAllocationSize());
- assertEquals(Integer.valueOf(20), idMapping.getTableGenerator().getSpecifiedAllocationSize());
- }
-
- public void testGetDefaultAllocationSize() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(Generator.DEFAULT_ALLOCATION_SIZE, idMapping.getTableGenerator().getDefaultAllocationSize());
-
- idMapping.getTableGenerator().setSpecifiedAllocationSize(Integer.valueOf(20));
-
- assertEquals(Generator.DEFAULT_ALLOCATION_SIZE, idMapping.getTableGenerator().getDefaultAllocationSize());
- assertEquals(Integer.valueOf(20), idMapping.getTableGenerator().getSpecifiedAllocationSize());
- }
-
- public void testSetSpecifiedAllocationSize() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getTableGenerator().setSpecifiedAllocationSize(Integer.valueOf(25));
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals(Integer.valueOf(25), tableGenerator.getAllocationSize());
-
- idMapping.getTableGenerator().setName(null);
- idMapping.getTableGenerator().setSpecifiedAllocationSize(null);
- assertNull(attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR));
- }
-
-
- public void testUniqueConstraints() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- TableGenerator tableGenerator = ((IdMapping) javaPersistentType().getAttributeNamed("id").getMapping()).getTableGenerator();
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = tableGenerator.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
- tableGeneratorAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- tableGeneratorAnnotation.addUniqueConstraint(0).addColumnName(0, "bar");
-
- uniqueConstraints = tableGenerator.uniqueConstraints();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().columnNames().next());
- assertEquals("foo", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- TableGenerator tableGenerator = ((IdMapping) javaPersistentType().getAttributeNamed("id").getMapping()).getTableGenerator();
-
- assertEquals(0, tableGenerator.uniqueConstraintsSize());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
- tableGeneratorAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- tableGeneratorAnnotation.addUniqueConstraint(1).addColumnName(0, "bar");
-
- assertEquals(2, tableGenerator.uniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- TableGenerator tableGenerator = ((IdMapping) javaPersistentType().getAttributeNamed("id").getMapping()).getTableGenerator();
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "BAR");
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = tableGeneratorAnnotation.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 {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- TableGenerator tableGenerator = ((IdMapping) javaPersistentType().getAttributeNamed("id").getMapping()).getTableGenerator();
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- tableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR");
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = tableGeneratorAnnotation.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 {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- TableGenerator tableGenerator = ((IdMapping) javaPersistentType().getAttributeNamed("id").getMapping()).getTableGenerator();
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- tableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR");
- tableGenerator.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals(3, tableGeneratorAnnotation.uniqueConstraintsSize());
-
- tableGenerator.removeUniqueConstraint(1);
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = tableGeneratorAnnotation.uniqueConstraints();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNames().next());
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- Iterator<UniqueConstraint> uniqueConstraints = tableGenerator.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- tableGenerator.removeUniqueConstraint(1);
- uniqueConstraintAnnotations = tableGeneratorAnnotation.uniqueConstraints();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNames().next());
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- uniqueConstraints = tableGenerator.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- tableGenerator.removeUniqueConstraint(0);
- uniqueConstraintAnnotations = tableGeneratorAnnotation.uniqueConstraints();
- assertFalse(uniqueConstraintAnnotations.hasNext());
- uniqueConstraints = tableGenerator.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- TableGenerator tableGenerator = ((IdMapping) javaPersistentType().getAttributeNamed("id").getMapping()).getTableGenerator();
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- tableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR");
- tableGenerator.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals(3, tableGeneratorAnnotation.uniqueConstraintsSize());
-
-
- tableGenerator.moveUniqueConstraint(2, 0);
- ListIterator<UniqueConstraint> uniqueConstraints = tableGenerator.uniqueConstraints();
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = tableGeneratorAnnotation.uniqueConstraints();
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNames().next());
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNames().next());
-
-
- tableGenerator.moveUniqueConstraint(0, 1);
- uniqueConstraints = tableGenerator.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
-
- uniqueConstraintAnnotations = tableGeneratorAnnotation.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNames().next());
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNames().next());
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNames().next());
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- TableGenerator tableGenerator = ((IdMapping) javaPersistentType().getAttributeNamed("id").getMapping()).getTableGenerator();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- tableGeneratorAnnotation.addUniqueConstraint(0).addColumnName("FOO");
- tableGeneratorAnnotation.addUniqueConstraint(1).addColumnName("BAR");
- tableGeneratorAnnotation.addUniqueConstraint(2).addColumnName("BAZ");
-
-
- ListIterator<UniqueConstraint> uniqueConstraints = tableGenerator.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorAnnotation.moveUniqueConstraint(2, 0);
- uniqueConstraints = tableGenerator.uniqueConstraints();
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorAnnotation.moveUniqueConstraint(0, 1);
- uniqueConstraints = tableGenerator.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorAnnotation.removeUniqueConstraint(1);
- uniqueConstraints = tableGenerator.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorAnnotation.removeUniqueConstraint(1);
- uniqueConstraints = tableGenerator.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorAnnotation.removeUniqueConstraint(0);
- uniqueConstraints = tableGenerator.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTableTests.java
deleted file mode 100644
index 6efb7411cc..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTableTests.java
+++ /dev/null
@@ -1,546 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.core.context.UniqueConstraint;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-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.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JavaTableTests extends ContextModelTestCase
-{
- private static final String TABLE_NAME = "MY_TABLE";
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Table(name=\"" + TABLE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestSubType() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild.java", "AnnotationTestTypeChild", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + TYPE_NAME + " ");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- });
- }
-
-
-
- public JavaTableTests(String name) {
- super(name);
- }
-
- public void testGetSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(javaEntity().getTable().getSpecifiedName());
- }
-
- public void testGetSpecifiedName() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TABLE_NAME, javaEntity().getTable().getSpecifiedName());
- }
-
- public void testGetDefaultNameSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TYPE_NAME, javaEntity().getTable().getDefaultName());
- }
-
- public void testGetDefaultName() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TYPE_NAME, javaEntity().getTable().getDefaultName());
-
- //test that setting the java entity name will change the table default name
- javaEntity().setSpecifiedName("foo");
- assertEquals("foo", javaEntity().getTable().getDefaultName());
- }
-
- public void testGetDefaultNameSingleTableInheritance() throws Exception {
- createTestEntity();
- createTestSubType();
-
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNotSame(javaEntity(), javaEntity().getRootEntity());
- assertEquals(TYPE_NAME, javaEntity().getTable().getDefaultName());
- assertEquals(TYPE_NAME, javaEntity().getRootEntity().getTable().getDefaultName());
-
- //test that setting the root java entity name will change the table default name of the child
- javaEntity().getRootEntity().setSpecifiedName("foo");
- assertEquals("foo", javaEntity().getTable().getDefaultName());
- }
-
- public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception {
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
-
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- JavaEntity javaEntity = ormEntity.getJavaEntity();
-
- assertNull(javaEntity.getTable().getDefaultSchema());
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO");
- assertEquals("FOO", javaEntity.getTable().getDefaultSchema());
-
- entityMappings().setSpecifiedSchema("BAR");
- assertEquals("BAR", javaEntity.getTable().getDefaultSchema());
-
- ormEntity.getTable().setSpecifiedSchema("XML_SCHEMA");
- assertEquals("BAR", javaEntity.getTable().getDefaultSchema());
-
- entityMappings().removeOrmPersistentType(0);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- //default schema taken from persistence-unit-defaults not entity-mappings since the entity is not in an orm.xml file
- assertEquals("FOO", javaEntity().getTable().getDefaultSchema());
-
- IFile file = ormResource().getFile();
- //remove the mapping file reference from the persistence.xml. default schema
- //should still come from persistence-unit-defaults because of implied mapped-file-ref
- xmlPersistenceUnit().getMappingFiles().remove(mappingFileRef);
- assertEquals("FOO", javaEntity().getTable().getDefaultSchema());
-
- file.delete(true, null);
- assertNull(javaEntity().getTable().getDefaultSchema());
- }
-
- public void testGetNameSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TYPE_NAME, javaEntity().getTable().getName());
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TABLE_NAME, javaEntity().getTable().getName());
- }
-
- public void testSetSpecifiedName() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- javaEntity().getTable().setSpecifiedName("foo");
-
- assertEquals("foo", javaEntity().getTable().getSpecifiedName());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
-
- assertEquals("foo", table.getName());
- }
-
- public void testSetSpecifiedNameNull() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- javaEntity().getTable().setSpecifiedName(null);
-
- assertNull(javaEntity().getTable().getSpecifiedName());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
-
- assertNull(table);
- }
-
- public void testUpdateFromSpecifiedNameChangeInResourceModel() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
- table.setName("foo");
-
- assertEquals("foo", javaEntity().getTable().getSpecifiedName());
-
- typeResource.removeSupportingAnnotation(JPA.TABLE);
- assertNull(javaEntity().getTable().getSpecifiedName());
- }
-
- public void testGetCatalog() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
-
- table.setCatalog("myCatalog");
-
- assertEquals("myCatalog", javaEntity().getTable().getSpecifiedCatalog());
- assertEquals("myCatalog", javaEntity().getTable().getCatalog());
- }
-
- public void testGetDefaultCatalog() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(javaEntity().getTable().getDefaultCatalog());
-
- javaEntity().getTable().setSpecifiedCatalog("myCatalog");
-
- assertNull(javaEntity().getTable().getDefaultCatalog());
- }
-
- public void testUpdateDefaultCatalogFromPersistenceUnitDefaults() throws Exception {
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
-
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- JavaEntity javaEntity = ormEntity.getJavaEntity();
-
- assertNull(javaEntity.getTable().getDefaultCatalog());
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("FOO");
- assertEquals("FOO", javaEntity.getTable().getDefaultCatalog());
-
- entityMappings().setSpecifiedCatalog("BAR");
- assertEquals("BAR", javaEntity.getTable().getDefaultCatalog());
-
- ormEntity.getTable().setSpecifiedCatalog("XML_CATALOG");
- assertEquals("BAR", javaEntity.getTable().getDefaultCatalog());
-
- entityMappings().removeOrmPersistentType(0);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- //default catalog taken from persistence-unite-defaults not entity-mappings since the entity is not in an orm.xml file
- assertEquals("FOO", javaEntity().getTable().getDefaultCatalog());
-
- IFile file = ormResource().getFile();
- //remove the mapping file reference from the persistence.xml. default schema
- //should still come from persistence-unit-defaults because of implied mapped-file-ref
- xmlPersistenceUnit().getMappingFiles().remove(mappingFileRef);
- assertEquals("FOO", javaEntity().getTable().getDefaultCatalog());
-
- file.delete(true, null);
- assertNull(javaEntity().getTable().getDefaultCatalog());
- }
-
- public void testSetSpecifiedCatalog() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Table table = javaEntity().getTable();
- table.setSpecifiedCatalog("myCatalog");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- TableAnnotation tableResource = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
-
- assertEquals("myCatalog", tableResource.getCatalog());
-
- table.setSpecifiedCatalog(null);
- assertNull(typeResource.getSupportingAnnotation(JPA.TABLE));
- }
-
- public void testGetSchema() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
-
- table.setSchema("mySchema");
-
- assertEquals("mySchema", javaEntity().getTable().getSpecifiedSchema());
- assertEquals("mySchema", javaEntity().getTable().getSchema());
- }
-
- public void testGetDefaultSchema() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(javaEntity().getTable().getDefaultSchema());
-
- javaEntity().getTable().setSpecifiedSchema("mySchema");
-
- assertNull(javaEntity().getTable().getDefaultSchema());
- }
-
- public void testSetSpecifiedSchema() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Table table = javaEntity().getTable();
- table.setSpecifiedSchema("mySchema");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- TableAnnotation tableResource = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
-
- assertEquals("mySchema", tableResource.getSchema());
-
- table.setSpecifiedSchema(null);
- assertNull(typeResource.getSupportingAnnotation(JPA.TABLE));
- }
-
- public void testUniqueConstraints() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = javaEntity().getTable().uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- TableAnnotation tableAnnotation = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
- tableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- tableAnnotation.addUniqueConstraint(0).addColumnName(0, "bar");
-
- uniqueConstraints = javaEntity().getTable().uniqueConstraints();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().columnNames().next());
- assertEquals("foo", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(0, javaEntity().getTable().uniqueConstraintsSize());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- TableAnnotation tableAnnotation = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
- tableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- tableAnnotation.addUniqueConstraint(1).addColumnName(0, "bar");
-
- assertEquals(2, javaEntity().getTable().uniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Table table = javaEntity().getTable();
- table.addUniqueConstraint(0).addColumnName(0, "FOO");
- table.addUniqueConstraint(0).addColumnName(0, "BAR");
- table.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- TableAnnotation tableAnnotation = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = tableAnnotation.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 {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Table table = javaEntity().getTable();
- table.addUniqueConstraint(0).addColumnName(0, "FOO");
- table.addUniqueConstraint(1).addColumnName(0, "BAR");
- table.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- TableAnnotation tableAnnotation = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = tableAnnotation.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 {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Table table = javaEntity().getTable();
- table.addUniqueConstraint(0).addColumnName(0, "FOO");
- table.addUniqueConstraint(1).addColumnName(0, "BAR");
- table.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- TableAnnotation tableAnnotation = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
-
- assertEquals(3, tableAnnotation.uniqueConstraintsSize());
-
- table.removeUniqueConstraint(1);
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = tableAnnotation.uniqueConstraints();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNames().next());
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- Iterator<UniqueConstraint> uniqueConstraints = table.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- table.removeUniqueConstraint(1);
- uniqueConstraintAnnotations = tableAnnotation.uniqueConstraints();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNames().next());
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- uniqueConstraints = table.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- table.removeUniqueConstraint(0);
- uniqueConstraintAnnotations = tableAnnotation.uniqueConstraints();
- assertFalse(uniqueConstraintAnnotations.hasNext());
- uniqueConstraints = table.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Table table = javaEntity().getTable();
- table.addUniqueConstraint(0).addColumnName(0, "FOO");
- table.addUniqueConstraint(1).addColumnName(0, "BAR");
- table.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- TableAnnotation tableAnnotation = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
-
- assertEquals(3, tableAnnotation.uniqueConstraintsSize());
-
-
- table.moveUniqueConstraint(2, 0);
- ListIterator<UniqueConstraint> uniqueConstraints = table.uniqueConstraints();
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = tableAnnotation.uniqueConstraints();
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNames().next());
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNames().next());
-
-
- table.moveUniqueConstraint(0, 1);
- uniqueConstraints = table.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
-
- uniqueConstraintAnnotations = tableAnnotation.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNames().next());
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNames().next());
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNames().next());
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Table table = javaEntity().getTable();
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- TableAnnotation tableAnnotation = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
-
- tableAnnotation.addUniqueConstraint(0).addColumnName("FOO");
- tableAnnotation.addUniqueConstraint(1).addColumnName("BAR");
- tableAnnotation.addUniqueConstraint(2).addColumnName("BAZ");
-
-
- ListIterator<UniqueConstraint> uniqueConstraints = table.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableAnnotation.moveUniqueConstraint(2, 0);
- uniqueConstraints = table.uniqueConstraints();
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableAnnotation.moveUniqueConstraint(0, 1);
- uniqueConstraints = table.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableAnnotation.removeUniqueConstraint(1);
- uniqueConstraints = table.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableAnnotation.removeUniqueConstraint(1);
- uniqueConstraints = table.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableAnnotation.removeUniqueConstraint(0);
- uniqueConstraints = table.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTransientMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTransientMappingTests.java
deleted file mode 100644
index 9ac65c6d5d..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTransientMappingTests.java
+++ /dev/null
@@ -1,248 +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.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.BasicMapping;
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-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.OneToOneMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.TransientMapping;
-import org.eclipse.jpt.core.context.VersionMapping;
-import org.eclipse.jpt.core.resource.java.BasicAnnotation;
-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.OneToManyAnnotation;
-import org.eclipse.jpt.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JavaTransientMappingTests extends ContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithTransientMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TRANSIENT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Transient").append(CR);
- }
- });
- }
-
- public JavaTransientMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- }
-
- public void testTransientMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getSpecifiedMapping();
-
- assertNotNull(transientMapping);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaVersionMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaVersionMappingTests.java
deleted file mode 100644
index ea4c798558..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaVersionMappingTests.java
+++ /dev/null
@@ -1,398 +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.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.BasicMapping;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-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.OneToOneMapping;
-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.TransientMapping;
-import org.eclipse.jpt.core.context.VersionMapping;
-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.OneToManyAnnotation;
-import org.eclipse.jpt.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JavaVersionMappingTests extends ContextModelTestCase
-{
- private ICompilationUnit createTestEntityWithVersionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.VERSION);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithTemporal() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.VERSION, JPA.TEMPORAL, JPA.TEMPORAL_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version").append(CR);
- sb.append("@Temporal(TemporalType.TIMESTAMP)").append(CR);
- }
- });
- }
-
- public JavaVersionMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) versionMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) versionMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) versionMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((IdMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ((IdMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) versionMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) versionMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) versionMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) versionMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) versionMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) versionMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) versionMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
-
- public void testGetTemporal() throws Exception {
- createTestEntityWithTemporal();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getSpecifiedMapping();
-
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) versionMapping.getConverter()).getTemporalType());
- }
-
- public void testSetTemporal() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getSpecifiedMapping();
- assertEquals(Converter.NO_CONVERTER, versionMapping.getConverter().getType());
-
- versionMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TemporalAnnotation temporal = (TemporalAnnotation) attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- versionMapping.setSpecifiedConverter(null);
- assertNull(attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetTemporalUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getSpecifiedMapping();
-
- assertEquals(Converter.NO_CONVERTER, versionMapping.getConverter().getType());
-
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TemporalAnnotation temporal = (TemporalAnnotation) attributeResource.addSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- temporal.setValue(org.eclipse.jpt.core.resource.java.TemporalType.DATE);
-
- assertEquals(TemporalType.DATE, ((TemporalConverter) versionMapping.getConverter()).getTemporalType());
-
- attributeResource.removeSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME);
-
- assertEquals(Converter.NO_CONVERTER, versionMapping.getConverter().getType());
- assertFalse(versionMapping.isDefault());
- assertSame(versionMapping, persistentAttribute.getSpecifiedMapping());
- }
-
- public void testGetColumn() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = javaPersistentType().attributes().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getSpecifiedMapping();
-
- assertNull(versionMapping.getColumn().getSpecifiedName());
- assertEquals("id", versionMapping.getColumn().getName());
-
- JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN);
- column.setName("foo");
-
- assertEquals("foo", versionMapping.getColumn().getSpecifiedName());
- assertEquals("foo", versionMapping.getColumn().getName());
- assertEquals("id", versionMapping.getColumn().getDefaultName());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JptCoreContextJavaModelTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JptCoreContextJavaModelTests.java
deleted file mode 100644
index 26e0df5cc6..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JptCoreContextJavaModelTests.java
+++ /dev/null
@@ -1,62 +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.core.tests.internal.context.java;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JptCoreContextJavaModelTests extends TestCase
-{
- public static Test suite() {
- return suite(true);
- }
-
- public static Test suite(boolean all) {
- TestSuite suite = new TestSuite(JptCoreContextJavaModelTests.class.getName());
- suite.addTestSuite(JavaAssociationOverrideTests.class);
- suite.addTestSuite(JavaAttributeOverrideTests.class);
- suite.addTestSuite(JavaBasicMappingTests.class);
- suite.addTestSuite(JavaColumnTests.class);
- suite.addTestSuite(JavaDiscriminatorColumnTests.class);
- suite.addTestSuite(JavaEmbeddableTests.class);
- suite.addTestSuite(JavaEmbeddedIdMappingTests.class);
- suite.addTestSuite(JavaEmbeddedMappingTests.class);
- suite.addTestSuite(JavaEntityTests.class);
- suite.addTestSuite(JavaGeneratedValueTests.class);
- suite.addTestSuite(JavaIdMappingTests.class);
- suite.addTestSuite(JavaJoinColumnTests.class);
- suite.addTestSuite(JavaJoinTableTests.class);
- suite.addTestSuite(JavaMappedSuperclassTests.class);
- suite.addTestSuite(JavaManyToManyMappingTests.class);
- suite.addTestSuite(JavaManyToOneMappingTests.class);
- suite.addTestSuite(JavaNamedQueryTests.class);
- suite.addTestSuite(JavaNamedNativeQueryTests.class);
- suite.addTestSuite(JavaQueryHintTests.class);
- suite.addTestSuite(JavaOneToManyMappingTests.class);
- suite.addTestSuite(JavaOneToOneMappingTests.class);
- suite.addTestSuite(JavaPersistentTypeTests.class);
- suite.addTestSuite(JavaPersistentAttributeTests.class);
- suite.addTestSuite(JavaPrimaryKeyJoinColumnTests.class);
- suite.addTestSuite(JavaSecondaryTableTests.class);
- suite.addTestSuite(JavaSequenceGeneratorTests.class);
- suite.addTestSuite(JavaTableGeneratorTests.class);
- suite.addTestSuite(JavaTableTests.class);
- suite.addTestSuite(JavaTransientMappingTests.class);
- suite.addTestSuite(JavaVersionMappingTests.class);
- return suite;
- }
-
- private JptCoreContextJavaModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/EntityMappingsTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/EntityMappingsTests.java
deleted file mode 100644
index cc8b88427b..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/EntityMappingsTests.java
+++ /dev/null
@@ -1,1067 +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.core.tests.internal.context.orm;
-
-import java.util.ListIterator;
-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.SequenceGenerator;
-import org.eclipse.jpt.core.context.TableGenerator;
-import org.eclipse.jpt.core.context.orm.OrmNamedNativeQuery;
-import org.eclipse.jpt.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.core.context.orm.OrmSequenceGenerator;
-import org.eclipse.jpt.core.context.orm.OrmTableGenerator;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-public class EntityMappingsTests extends ContextModelTestCase
-{
- public EntityMappingsTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- public void testGetVersion() throws Exception {
- assertEquals("1.0", entityMappings().getVersion());
- }
-
- public void testUpdateDescription() throws Exception {
- assertNull(entityMappings().getDescription());
- assertNull(ormResource().getEntityMappings().getDescription());
-
- //set description in the resource model, verify context model updated
- ormResource().getEntityMappings().setDescription("newDescription");
- assertEquals("newDescription", entityMappings().getDescription());
- assertEquals("newDescription", ormResource().getEntityMappings().getDescription());
-
- //set description to null in the resource model
- ormResource().getEntityMappings().setDescription(null);
- assertNull(entityMappings().getDescription());
- assertNull(ormResource().getEntityMappings().getDescription());
- }
-
- public void testModifyDescription() throws Exception {
- assertNull(entityMappings().getDescription());
- assertNull(ormResource().getEntityMappings().getDescription());
-
- //set description in the context model, verify resource model modified
- entityMappings().setDescription("newDescription");
- assertEquals("newDescription", entityMappings().getDescription());
- assertEquals("newDescription", ormResource().getEntityMappings().getDescription());
-
- //set description to null in the context model
- entityMappings().setDescription(null);
- assertNull(entityMappings().getDescription());
- assertNull(ormResource().getEntityMappings().getDescription());
- }
-
- public void testUpdatePackage() throws Exception {
- assertNull(entityMappings().getPackage());
- assertNull(ormResource().getEntityMappings().getPackage());
-
- //set package in the resource model, verify context model updated
- ormResource().getEntityMappings().setPackage("foo.model");
- assertEquals("foo.model", entityMappings().getPackage());
- assertEquals("foo.model", ormResource().getEntityMappings().getPackage());
-
- //set package to null in the resource model
- ormResource().getEntityMappings().setPackage(null);
- assertNull(entityMappings().getPackage());
- assertNull(ormResource().getEntityMappings().getPackage());
- }
-
- public void testModifyPackage() throws Exception {
- assertNull(entityMappings().getPackage());
- assertNull(ormResource().getEntityMappings().getPackage());
-
- //set package in the context model, verify resource model modified
- entityMappings().setPackage("foo.model");
- assertEquals("foo.model", entityMappings().getPackage());
- assertEquals("foo.model", ormResource().getEntityMappings().getPackage());
-
- //set package to null in the context model
- entityMappings().setPackage(null);
- assertNull(entityMappings().getPackage());
- assertNull(ormResource().getEntityMappings().getPackage());
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- assertNull(entityMappings().getSpecifiedSchema());
- assertNull(ormResource().getEntityMappings().getSchema());
-
- //set schema in the resource model, verify context model updated
- ormResource().getEntityMappings().setSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", entityMappings().getSpecifiedSchema());
- assertEquals("MY_SCHEMA", ormResource().getEntityMappings().getSchema());
-
- //set schema to null in the resource model
- ormResource().getEntityMappings().setSchema(null);
- assertNull(entityMappings().getSpecifiedSchema());
- assertNull(ormResource().getEntityMappings().getSchema());
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- assertNull(entityMappings().getSpecifiedSchema());
- assertNull(ormResource().getEntityMappings().getSchema());
-
- //set schema in the context model, verify resource model modified
- entityMappings().setSpecifiedSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", entityMappings().getSpecifiedSchema());
- assertEquals("MY_SCHEMA", ormResource().getEntityMappings().getSchema());
-
- //set schema to null in the context model
- entityMappings().setSpecifiedSchema(null);
- assertNull(entityMappings().getSpecifiedSchema());
- assertNull(ormResource().getEntityMappings().getSchema());
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- assertNull(entityMappings().getSpecifiedCatalog());
- assertNull(ormResource().getEntityMappings().getCatalog());
-
- //set catalog in the resource model, verify context model updated
- ormResource().getEntityMappings().setCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", entityMappings().getSpecifiedCatalog());
- assertEquals("MY_CATALOG", ormResource().getEntityMappings().getCatalog());
-
- //set catalog to null in the resource model
- ormResource().getEntityMappings().setCatalog(null);
- assertNull(entityMappings().getSpecifiedCatalog());
- assertNull(ormResource().getEntityMappings().getCatalog());
- }
-
- public void testUpdateDefaultSchema() throws Exception {
- assertNull(entityMappings().getDefaultSchema());
- assertNull(entityMappings().getSpecifiedSchema());
- assertNull(ormResource().getEntityMappings().getSchema());
-
- ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults persistenceUnitDefaults = OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults();
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(persistenceUnitDefaults);
- persistenceUnitDefaults.setSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", entityMappings().getDefaultSchema());
- assertNull(entityMappings().getSpecifiedSchema());
- assertNull(ormResource().getEntityMappings().getSchema());
- assertEquals("MY_SCHEMA", ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
-
- persistenceUnitDefaults.setSchema(null);
- assertNull(entityMappings().getDefaultSchema());
- assertNull(entityMappings().getSpecifiedSchema());
- assertNull(ormResource().getEntityMappings().getSchema());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
- }
-
- public void testUpdateSchema() throws Exception {
- assertNull(entityMappings().getDefaultSchema());
- assertNull(entityMappings().getSchema());
- assertNull(entityMappings().getSpecifiedSchema());
- assertNull(ormResource().getEntityMappings().getSchema());
-
- ormResource().getEntityMappings().setSchema("MY_SCHEMA");
- assertNull(entityMappings().getDefaultSchema());
- assertEquals("MY_SCHEMA", entityMappings().getSchema());
- assertEquals("MY_SCHEMA", entityMappings().getSpecifiedSchema());
- assertEquals("MY_SCHEMA", ormResource().getEntityMappings().getSchema());
-
- ormResource().getEntityMappings().setSchema(null);
- assertNull(entityMappings().getDefaultSchema());
- assertNull(entityMappings().getSchema());
- assertNull(entityMappings().getSpecifiedSchema());
- assertNull(ormResource().getEntityMappings().getSchema());
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("DEFAULT_SCHEMA");
- assertEquals("DEFAULT_SCHEMA", entityMappings().getDefaultSchema());
- assertEquals("DEFAULT_SCHEMA", entityMappings().getSchema());
- assertNull(entityMappings().getSpecifiedSchema());
- assertNull(ormResource().getEntityMappings().getSchema());
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema(null);
- assertNull(entityMappings().getDefaultSchema());
- assertNull(entityMappings().getSchema());
- assertNull(entityMappings().getSpecifiedSchema());
- assertNull(ormResource().getEntityMappings().getSchema());
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- assertNull(entityMappings().getSpecifiedCatalog());
- assertNull(ormResource().getEntityMappings().getCatalog());
-
- //set catalog in the context model, verify resource model modified
- entityMappings().setSpecifiedCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", entityMappings().getSpecifiedCatalog());
- assertEquals("MY_CATALOG", ormResource().getEntityMappings().getCatalog());
-
- //set catalog to null in the context model
- entityMappings().setSpecifiedCatalog(null);
- assertNull(entityMappings().getSpecifiedCatalog());
- assertNull(ormResource().getEntityMappings().getCatalog());
- }
-
- public void testUpdateDefaultCatalog() throws Exception {
- assertNull(entityMappings().getDefaultCatalog());
- assertNull(entityMappings().getSpecifiedCatalog());
- assertNull(ormResource().getEntityMappings().getCatalog());
-
- ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults persistenceUnitDefaults = OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults();
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(persistenceUnitDefaults);
- persistenceUnitDefaults.setCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", entityMappings().getDefaultCatalog());
- assertNull(entityMappings().getSpecifiedCatalog());
- assertNull(ormResource().getEntityMappings().getCatalog());
- assertEquals("MY_CATALOG", ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
-
- persistenceUnitDefaults.setCatalog(null);
- assertNull(entityMappings().getDefaultCatalog());
- assertNull(entityMappings().getSpecifiedCatalog());
- assertNull(ormResource().getEntityMappings().getCatalog());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
- }
-
- public void testUpdateCatalog() throws Exception {
- assertNull(entityMappings().getDefaultCatalog());
- assertNull(entityMappings().getCatalog());
- assertNull(entityMappings().getSpecifiedCatalog());
- assertNull(ormResource().getEntityMappings().getCatalog());
-
- ormResource().getEntityMappings().setCatalog("MY_CATALOG");
- assertNull(entityMappings().getDefaultCatalog());
- assertEquals("MY_CATALOG", entityMappings().getCatalog());
- assertEquals("MY_CATALOG", entityMappings().getSpecifiedCatalog());
- assertEquals("MY_CATALOG", ormResource().getEntityMappings().getCatalog());
-
- ormResource().getEntityMappings().setCatalog(null);
- assertNull(entityMappings().getDefaultCatalog());
- assertNull(entityMappings().getCatalog());
- assertNull(entityMappings().getSpecifiedCatalog());
- assertNull(ormResource().getEntityMappings().getCatalog());
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("DEFAULT_CATALOG");
- assertEquals("DEFAULT_CATALOG", entityMappings().getDefaultCatalog());
- assertEquals("DEFAULT_CATALOG", entityMappings().getCatalog());
- assertNull(entityMappings().getSpecifiedCatalog());
- assertNull(ormResource().getEntityMappings().getCatalog());
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog(null);
- assertNull(entityMappings().getDefaultCatalog());
- assertNull(entityMappings().getCatalog());
- assertNull(entityMappings().getSpecifiedCatalog());
- assertNull(ormResource().getEntityMappings().getCatalog());
- }
-
- public void testUpdateSpecifiedAccess() throws Exception {
- assertNull(entityMappings().getSpecifiedAccess());
- assertNull(ormResource().getEntityMappings().getAccess());
-
- //set access in the resource model, verify context model updated
- ormResource().getEntityMappings().setAccess(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, entityMappings().getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, ormResource().getEntityMappings().getAccess());
-
- //set access to null in the resource model
- ormResource().getEntityMappings().setAccess(null);
- assertNull(entityMappings().getSpecifiedAccess());
- assertNull(ormResource().getEntityMappings().getAccess());
- }
-
- public void testModifySpecifiedAccess() throws Exception {
- assertNull(entityMappings().getSpecifiedAccess());
- assertNull(ormResource().getEntityMappings().getAccess());
-
- //set access in the context model, verify resource model modified
- entityMappings().setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, entityMappings().getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, ormResource().getEntityMappings().getAccess());
-
- //set access to null in the context model
- entityMappings().setSpecifiedAccess(null);
- assertNull(entityMappings().getSpecifiedAccess());
- assertNull(ormResource().getEntityMappings().getAccess());
- }
-
- public void testUpdateDefaultAccess() throws Exception {
- assertNull(entityMappings().getDefaultAccess());
- assertNull(entityMappings().getSpecifiedAccess());
- assertNull(ormResource().getEntityMappings().getAccess());
-
- ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults persistenceUnitDefaults = OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults();
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(persistenceUnitDefaults);
- persistenceUnitDefaults.setAccess(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, entityMappings().getDefaultAccess());
- assertNull(entityMappings().getSpecifiedAccess());
- assertNull(ormResource().getEntityMappings().getAccess());
-
- persistenceUnitDefaults.setAccess(org.eclipse.jpt.core.resource.orm.AccessType.FIELD);
- assertEquals(AccessType.FIELD, entityMappings().getDefaultAccess());
- assertNull(entityMappings().getSpecifiedAccess());
- assertNull(ormResource().getEntityMappings().getAccess());
-
- persistenceUnitDefaults.setAccess(null);
- assertNull(entityMappings().getDefaultAccess());
- assertNull(entityMappings().getSpecifiedAccess());
- assertNull(ormResource().getEntityMappings().getAccess());
- }
-
- public void testUpdateAccess() throws Exception {
- assertNull(entityMappings().getAccess());
- assertNull(entityMappings().getDefaultAccess());
- assertNull(entityMappings().getSpecifiedAccess());
- assertNull(ormResource().getEntityMappings().getAccess());
-
- ormResource().getEntityMappings().setAccess(org.eclipse.jpt.core.resource.orm.AccessType.FIELD);
- assertNull(entityMappings().getDefaultAccess());
- assertEquals(AccessType.FIELD, entityMappings().getAccess());
- assertEquals(AccessType.FIELD, entityMappings().getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.FIELD, ormResource().getEntityMappings().getAccess());
-
- ormResource().getEntityMappings().setAccess(null);
- assertNull(entityMappings().getAccess());
- assertNull(entityMappings().getDefaultAccess());
- assertNull(entityMappings().getSpecifiedAccess());
- assertNull(ormResource().getEntityMappings().getAccess());
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, entityMappings().getDefaultAccess());
- assertEquals(AccessType.FIELD, entityMappings().getAccess());
- assertNull(entityMappings().getSpecifiedAccess());
- assertNull(ormResource().getEntityMappings().getAccess());
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(null);
- assertNull(entityMappings().getDefaultAccess());
- assertNull(entityMappings().getAccess());
- assertNull(entityMappings().getSpecifiedAccess());
- assertNull(ormResource().getEntityMappings().getAccess());
- }
-
-
- public void testUpdateOrmPersistentTypes() throws Exception {
- assertFalse(entityMappings().ormPersistentTypes().hasNext());
- assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(ormResource().getEntityMappings().getEntities().isEmpty());
- assertTrue(ormResource().getEntityMappings().getEmbeddables().isEmpty());
-
- //add embeddable in the resource model, verify context model updated
- XmlEmbeddable embeddable = OrmFactory.eINSTANCE.createXmlEmbeddable();
- ormResource().getEntityMappings().getEmbeddables().add(embeddable);
- embeddable.setClassName("model.Foo");
- assertTrue(entityMappings().ormPersistentTypes().hasNext());
- assertEquals("model.Foo", entityMappings().ormPersistentTypes().next().getMapping().getClass_());
- assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(ormResource().getEntityMappings().getEntities().isEmpty());
- assertFalse(ormResource().getEntityMappings().getEmbeddables().isEmpty());
- assertEquals("model.Foo", ormResource().getEntityMappings().getEmbeddables().get(0).getClassName());
-
- //add entity in the resource model, verify context model updated
- XmlEntity entity = OrmFactory.eINSTANCE.createXmlEntity();
- ormResource().getEntityMappings().getEntities().add(entity);
- entity.setClassName("model.Foo2");
- assertTrue(entityMappings().ormPersistentTypes().hasNext());
- assertEquals("model.Foo2", entityMappings().ormPersistentTypes().next().getMapping().getClass_());
- assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
- assertFalse(ormResource().getEntityMappings().getEntities().isEmpty());
- assertFalse(ormResource().getEntityMappings().getEmbeddables().isEmpty());
- assertEquals("model.Foo2", ormResource().getEntityMappings().getEntities().get(0).getClassName());
-
- //add mapped-superclass in the resource model, verify context model updated
- XmlMappedSuperclass mappedSuperclass = OrmFactory.eINSTANCE.createXmlMappedSuperclass();
- ormResource().getEntityMappings().getMappedSuperclasses().add(mappedSuperclass);
- mappedSuperclass.setClassName("model.Foo3");
- assertTrue(entityMappings().ormPersistentTypes().hasNext());
- assertEquals("model.Foo3", entityMappings().ormPersistentTypes().next().getMapping().getClass_());
- assertFalse(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
- assertFalse(ormResource().getEntityMappings().getEntities().isEmpty());
- assertFalse(ormResource().getEntityMappings().getEmbeddables().isEmpty());
- assertEquals("model.Foo3", ormResource().getEntityMappings().getMappedSuperclasses().get(0).getClassName());
- }
-
-
- public void testAddOrmPersistentType() throws Exception {
- assertFalse(entityMappings().ormPersistentTypes().hasNext());
- assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(ormResource().getEntityMappings().getEntities().isEmpty());
- assertTrue(ormResource().getEntityMappings().getEmbeddables().isEmpty());
-
- //add embeddable in the context model, verify resource model modified
- entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- assertTrue(entityMappings().ormPersistentTypes().hasNext());
- assertEquals("model.Foo", entityMappings().ormPersistentTypes().next().getMapping().getClass_());
- assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, entityMappings().ormPersistentTypes().next().getMapping().getKey());
- assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(ormResource().getEntityMappings().getEntities().isEmpty());
- assertFalse(ormResource().getEntityMappings().getEmbeddables().isEmpty());
- assertEquals("model.Foo", ormResource().getEntityMappings().getEmbeddables().get(0).getClassName());
-
- //add entity in the context model, verify resource model modified
- entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- assertTrue(entityMappings().ormPersistentTypes().hasNext());
- assertEquals("model.Foo2", entityMappings().ormPersistentTypes().next().getMapping().getClass_());
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, entityMappings().ormPersistentTypes().next().getMapping().getKey());
- assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
- assertFalse(ormResource().getEntityMappings().getEntities().isEmpty());
- assertFalse(ormResource().getEntityMappings().getEmbeddables().isEmpty());
- assertEquals("model.Foo2", ormResource().getEntityMappings().getEntities().get(0).getClassName());
-
- //add mapped-superclass in the context model, verify resource model modified
- entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo3");
- assertTrue(entityMappings().ormPersistentTypes().hasNext());
- assertEquals("model.Foo3", entityMappings().ormPersistentTypes().next().getMapping().getClass_());
- assertEquals(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, entityMappings().ormPersistentTypes().next().getMapping().getKey());
- assertFalse(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
- assertFalse(ormResource().getEntityMappings().getEntities().isEmpty());
- assertFalse(ormResource().getEntityMappings().getEmbeddables().isEmpty());
- assertEquals("model.Foo3", ormResource().getEntityMappings().getMappedSuperclasses().get(0).getClassName());
- }
-
- public void testRemoveOrmPersistentType() throws Exception {
- assertFalse(entityMappings().ormPersistentTypes().hasNext());
- assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(ormResource().getEntityMappings().getEntities().isEmpty());
- assertTrue(ormResource().getEntityMappings().getEmbeddables().isEmpty());
-
- entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo3");
-
- //remove ormPersistentType from the context model, verify resource model modified
- entityMappings().removeOrmPersistentType(1);
- assertFalse(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(ormResource().getEntityMappings().getEntities().isEmpty());
- assertFalse(ormResource().getEntityMappings().getEmbeddables().isEmpty());
-
- entityMappings().removeOrmPersistentType(1);
- assertFalse(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(ormResource().getEntityMappings().getEntities().isEmpty());
- assertTrue(ormResource().getEntityMappings().getEmbeddables().isEmpty());
-
- entityMappings().removeOrmPersistentType(0);
- assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(ormResource().getEntityMappings().getEntities().isEmpty());
- assertTrue(ormResource().getEntityMappings().getEmbeddables().isEmpty());
- }
-
- public void testUpdateTableGenerators() throws Exception {
- assertEquals(0, entityMappings().tableGeneratorsSize());
- assertEquals(0, ormResource().getEntityMappings().getTableGenerators().size());
- assertEquals(0, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators()));
-
- XmlTableGenerator tableGeneratorResource = OrmFactory.eINSTANCE.createXmlTableGeneratorImpl();
- ormResource().getEntityMappings().getTableGenerators().add(tableGeneratorResource);
- tableGeneratorResource.setName("FOO");
-
- TableGenerator tableGenerator = entityMappings().tableGenerators().next();
- assertEquals("FOO", tableGenerator.getName());
- assertEquals(1, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators()));
-
- XmlTableGenerator tableGeneratorResource2 = OrmFactory.eINSTANCE.createXmlTableGeneratorImpl();
- ormResource().getEntityMappings().getTableGenerators().add(0, tableGeneratorResource2);
- tableGeneratorResource2.setName("BAR");
-
- ListIterator<OrmTableGenerator> tableGenerators = entityMappings().tableGenerators();
- assertEquals("BAR", tableGenerators.next().getName());
- assertEquals("FOO", tableGenerators.next().getName());
- assertFalse(tableGenerators.hasNext());
- assertEquals(2, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators()));
-
- XmlTableGenerator tableGeneratorResource3 = OrmFactory.eINSTANCE.createXmlTableGeneratorImpl();
- ormResource().getEntityMappings().getTableGenerators().add(1, tableGeneratorResource3);
- tableGeneratorResource3.setName("BAZ");
-
- tableGenerators = entityMappings().tableGenerators();
- assertEquals("BAR", tableGenerators.next().getName());
- assertEquals("BAZ", tableGenerators.next().getName());
- assertEquals("FOO", tableGenerators.next().getName());
- assertFalse(tableGenerators.hasNext());
- assertEquals(3, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators()));
-
- ormResource().getEntityMappings().getTableGenerators().move(2, 0);
- tableGenerators = entityMappings().tableGenerators();
- assertEquals("BAZ", tableGenerators.next().getName());
- assertEquals("FOO", tableGenerators.next().getName());
- assertEquals("BAR", tableGenerators.next().getName());
- assertFalse(tableGenerators.hasNext());
- assertEquals(3, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators()));
-
- ormResource().getEntityMappings().getTableGenerators().remove(0);
- tableGenerators = entityMappings().tableGenerators();
- assertEquals("FOO", tableGenerators.next().getName());
- assertEquals("BAR", tableGenerators.next().getName());
- assertFalse(tableGenerators.hasNext());
- assertEquals(2, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators()));
-
- ormResource().getEntityMappings().getTableGenerators().remove(1);
- tableGenerators = entityMappings().tableGenerators();
- assertEquals("FOO", tableGenerators.next().getName());
- assertFalse(tableGenerators.hasNext());
- assertEquals(1, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators()));
-
- ormResource().getEntityMappings().getTableGenerators().clear();
- tableGenerators = entityMappings().tableGenerators();
- assertFalse(tableGenerators.hasNext());
- assertEquals(0, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators()));
- }
-
- public void testAddTableGenerator() throws Exception {
- assertEquals(0, entityMappings().tableGeneratorsSize());
- assertEquals(0, ormResource().getEntityMappings().getTableGenerators().size());
- entityMappings().addTableGenerator(0).setName("FOO");
-
- assertEquals("FOO", ormResource().getEntityMappings().getTableGenerators().get(0).getName());
-
- entityMappings().addTableGenerator(0).setName("BAR");
- assertEquals("BAR", ormResource().getEntityMappings().getTableGenerators().get(0).getName());
- assertEquals("FOO", ormResource().getEntityMappings().getTableGenerators().get(1).getName());
- assertEquals(2, ormResource().getEntityMappings().getTableGenerators().size());
-
- ListIterator<OrmTableGenerator> tableGenerators = entityMappings().tableGenerators();
- assertEquals("BAR", tableGenerators.next().getName());
- assertEquals("FOO", tableGenerators.next().getName());
- assertFalse(tableGenerators.hasNext());
- }
-
- public void testRemoveTableGenerator() throws Exception {
- assertEquals(0, entityMappings().tableGeneratorsSize());
- assertEquals(0, ormResource().getEntityMappings().getTableGenerators().size());
-
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- tableGenerator.setName("FOO");
- TableGenerator tableGenerator2 = entityMappings().addTableGenerator(1);
- tableGenerator2.setName("BAR");
- TableGenerator tableGenerator3 = entityMappings().addTableGenerator(2);
- tableGenerator3.setName("BAZ");
- assertEquals("FOO", ormResource().getEntityMappings().getTableGenerators().get(0).getName());
- assertEquals("BAR", ormResource().getEntityMappings().getTableGenerators().get(1).getName());
- assertEquals("BAZ", ormResource().getEntityMappings().getTableGenerators().get(2).getName());
- assertEquals(3, ormResource().getEntityMappings().getTableGenerators().size());
-
- entityMappings().removeTableGenerator(0);
- assertEquals("BAR", ormResource().getEntityMappings().getTableGenerators().get(0).getName());
- assertEquals("BAZ", ormResource().getEntityMappings().getTableGenerators().get(1).getName());
-
- ListIterator<OrmTableGenerator> tableGenerators = entityMappings().tableGenerators();
- OrmTableGenerator xmlTableGenerator = tableGenerators.next();
- assertEquals("BAR", xmlTableGenerator.getName());
- assertEquals(tableGenerator2, xmlTableGenerator);
- xmlTableGenerator = tableGenerators.next();
- assertEquals("BAZ", xmlTableGenerator.getName());
- assertEquals(tableGenerator3, xmlTableGenerator);
- assertFalse(tableGenerators.hasNext());
-
-
- entityMappings().removeTableGenerator(1);
- assertEquals("BAR", ormResource().getEntityMappings().getTableGenerators().get(0).getName());
- tableGenerators = entityMappings().tableGenerators();
- xmlTableGenerator = tableGenerators.next();
- assertEquals("BAR", xmlTableGenerator.getName());
- assertEquals(tableGenerator2, xmlTableGenerator);
- assertFalse(tableGenerators.hasNext());
-
-
- entityMappings().removeTableGenerator(0);
- assertEquals(0, ormResource().getEntityMappings().getTableGenerators().size());
- tableGenerators = entityMappings().tableGenerators();
- assertFalse(tableGenerators.hasNext());
- }
-
- public void testMoveTableGenerator() throws Exception {
- assertEquals(0, entityMappings().tableGeneratorsSize());
- assertEquals(0, ormResource().getEntityMappings().getTableGenerators().size());
-
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- tableGenerator.setName("FOO");
- TableGenerator tableGenerator2 = entityMappings().addTableGenerator(1);
- tableGenerator2.setName("BAR");
- TableGenerator tableGenerator3 = entityMappings().addTableGenerator(2);
- tableGenerator3.setName("BAZ");
- assertEquals("FOO", ormResource().getEntityMappings().getTableGenerators().get(0).getName());
- assertEquals("BAR", ormResource().getEntityMappings().getTableGenerators().get(1).getName());
- assertEquals("BAZ", ormResource().getEntityMappings().getTableGenerators().get(2).getName());
- assertEquals(3, ormResource().getEntityMappings().getTableGenerators().size());
-
- entityMappings().moveTableGenerator(2, 0);
- assertEquals("BAR", ormResource().getEntityMappings().getTableGenerators().get(0).getName());
- assertEquals("BAZ", ormResource().getEntityMappings().getTableGenerators().get(1).getName());
- assertEquals("FOO", ormResource().getEntityMappings().getTableGenerators().get(2).getName());
- assertEquals(3, ormResource().getEntityMappings().getTableGenerators().size());
-
- entityMappings().moveTableGenerator(0, 2);
- assertEquals("FOO", ormResource().getEntityMappings().getTableGenerators().get(0).getName());
- assertEquals("BAR", ormResource().getEntityMappings().getTableGenerators().get(1).getName());
- assertEquals("BAZ", ormResource().getEntityMappings().getTableGenerators().get(2).getName());
- assertEquals(3, ormResource().getEntityMappings().getTableGenerators().size());
- }
-
- public void testTableGeneratorsSize() throws Exception {
- assertEquals(0, entityMappings().tableGeneratorsSize());
- assertEquals(0, ormResource().getEntityMappings().getTableGenerators().size());
-
-
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- tableGenerator.setName("FOO");
- TableGenerator tableGenerator2 = entityMappings().addTableGenerator(1);
- tableGenerator2.setName("BAR");
- TableGenerator tableGenerator3 = entityMappings().addTableGenerator(2);
- tableGenerator3.setName("BAZ");
-
- assertEquals(3, entityMappings().tableGeneratorsSize());
-
- ormResource().getEntityMappings().getTableGenerators().remove(0);
- assertEquals(2, entityMappings().tableGeneratorsSize());
- }
-
- public void testUpdateSequenceGenerators() throws Exception {
- assertEquals(0, entityMappings().sequenceGeneratorsSize());
- assertEquals(0, ormResource().getEntityMappings().getSequenceGenerators().size());
- assertEquals(0, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators()));
-
- XmlSequenceGenerator sequenceGeneratorResource = OrmFactory.eINSTANCE.createXmlSequenceGeneratorImpl();
- ormResource().getEntityMappings().getSequenceGenerators().add(sequenceGeneratorResource);
- sequenceGeneratorResource.setName("FOO");
-
- SequenceGenerator sequenceGenerator = entityMappings().sequenceGenerators().next();
- assertEquals("FOO", sequenceGenerator.getName());
- assertEquals(1, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators()));
-
- XmlSequenceGenerator sequenceGeneratorResource2 = OrmFactory.eINSTANCE.createXmlSequenceGeneratorImpl();
- ormResource().getEntityMappings().getSequenceGenerators().add(0, sequenceGeneratorResource2);
- sequenceGeneratorResource2.setName("BAR");
-
- ListIterator<OrmSequenceGenerator> sequenceGenerators = entityMappings().sequenceGenerators();
- assertEquals("BAR", sequenceGenerators.next().getName());
- assertEquals("FOO", sequenceGenerators.next().getName());
- assertFalse(sequenceGenerators.hasNext());
- assertEquals(2, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators()));
-
- XmlSequenceGenerator sequenceGeneratorResource3 = OrmFactory.eINSTANCE.createXmlSequenceGeneratorImpl();
- ormResource().getEntityMappings().getSequenceGenerators().add(1, sequenceGeneratorResource3);
- sequenceGeneratorResource3.setName("BAZ");
-
- sequenceGenerators = entityMappings().sequenceGenerators();
- assertEquals("BAR", sequenceGenerators.next().getName());
- assertEquals("BAZ", sequenceGenerators.next().getName());
- assertEquals("FOO", sequenceGenerators.next().getName());
- assertFalse(sequenceGenerators.hasNext());
- assertEquals(3, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators()));
-
- ormResource().getEntityMappings().getSequenceGenerators().move(2, 0);
- sequenceGenerators = entityMappings().sequenceGenerators();
- assertEquals("BAZ", sequenceGenerators.next().getName());
- assertEquals("FOO", sequenceGenerators.next().getName());
- assertEquals("BAR", sequenceGenerators.next().getName());
- assertFalse(sequenceGenerators.hasNext());
-
- ormResource().getEntityMappings().getSequenceGenerators().remove(0);
- sequenceGenerators = entityMappings().sequenceGenerators();
- assertEquals("FOO", sequenceGenerators.next().getName());
- assertEquals("BAR", sequenceGenerators.next().getName());
- assertFalse(sequenceGenerators.hasNext());
- assertEquals(2, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators()));
-
- ormResource().getEntityMappings().getSequenceGenerators().remove(1);
- sequenceGenerators = entityMappings().sequenceGenerators();
- assertEquals("FOO", sequenceGenerators.next().getName());
- assertFalse(sequenceGenerators.hasNext());
- assertEquals(1, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators()));
-
- ormResource().getEntityMappings().getSequenceGenerators().clear();
- sequenceGenerators = entityMappings().sequenceGenerators();
- assertFalse(sequenceGenerators.hasNext());
- assertEquals(0, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators()));
- }
-
- public void testAddSequenceGenerator() throws Exception {
- assertEquals(0, entityMappings().sequenceGeneratorsSize());
- assertEquals(0, ormResource().getEntityMappings().getSequenceGenerators().size());
-
- entityMappings().addSequenceGenerator(0).setName("FOO");
-
- assertEquals("FOO", ormResource().getEntityMappings().getSequenceGenerators().get(0).getName());
-
- entityMappings().addSequenceGenerator(0).setName("BAR");
- assertEquals("BAR", ormResource().getEntityMappings().getSequenceGenerators().get(0).getName());
- assertEquals("FOO", ormResource().getEntityMappings().getSequenceGenerators().get(1).getName());
- assertEquals(2, ormResource().getEntityMappings().getSequenceGenerators().size());
-
- ListIterator<OrmSequenceGenerator> sequenceGenerators = entityMappings().sequenceGenerators();
- assertEquals("BAR", sequenceGenerators.next().getName());
- assertEquals("FOO", sequenceGenerators.next().getName());
- assertFalse(sequenceGenerators.hasNext());
- }
-
- public void testRemoveSequenceGenerator() throws Exception {
- assertEquals(0, entityMappings().sequenceGeneratorsSize());
- assertEquals(0, ormResource().getEntityMappings().getSequenceGenerators().size());
-
- SequenceGenerator sequenceGenerator = entityMappings().addSequenceGenerator(0);
- sequenceGenerator.setName("FOO");
- SequenceGenerator sequenceGenerator2 = entityMappings().addSequenceGenerator(1);
- sequenceGenerator2.setName("BAR");
- SequenceGenerator sequenceGenerator3 = entityMappings().addSequenceGenerator(2);
- sequenceGenerator3.setName("BAZ");
- assertEquals("FOO", ormResource().getEntityMappings().getSequenceGenerators().get(0).getName());
- assertEquals("BAR", ormResource().getEntityMappings().getSequenceGenerators().get(1).getName());
- assertEquals("BAZ", ormResource().getEntityMappings().getSequenceGenerators().get(2).getName());
- assertEquals(3, ormResource().getEntityMappings().getSequenceGenerators().size());
-
- entityMappings().removeSequenceGenerator(0);
- assertEquals("BAR", ormResource().getEntityMappings().getSequenceGenerators().get(0).getName());
- assertEquals("BAZ", ormResource().getEntityMappings().getSequenceGenerators().get(1).getName());
-
- ListIterator<OrmSequenceGenerator> sequenceGenerators = entityMappings().sequenceGenerators();
- SequenceGenerator xmlSequenceGenerator = sequenceGenerators.next();
- assertEquals("BAR", xmlSequenceGenerator.getName());
- assertEquals(sequenceGenerator2, xmlSequenceGenerator);
- xmlSequenceGenerator = sequenceGenerators.next();
- assertEquals("BAZ", xmlSequenceGenerator.getName());
- assertEquals(sequenceGenerator3, xmlSequenceGenerator);
- assertFalse(sequenceGenerators.hasNext());
-
-
- entityMappings().removeSequenceGenerator(1);
- assertEquals("BAR", ormResource().getEntityMappings().getSequenceGenerators().get(0).getName());
- sequenceGenerators = entityMappings().sequenceGenerators();
- xmlSequenceGenerator = sequenceGenerators.next();
- assertEquals("BAR", xmlSequenceGenerator.getName());
- assertEquals(sequenceGenerator2, xmlSequenceGenerator);
- assertFalse(sequenceGenerators.hasNext());
-
-
- entityMappings().removeSequenceGenerator(0);
- assertEquals(0, ormResource().getEntityMappings().getSequenceGenerators().size());
- sequenceGenerators = entityMappings().sequenceGenerators();
- assertFalse(sequenceGenerators.hasNext());
- }
-
- public void testMoveSequenceGenerator() throws Exception {
- assertEquals(0, entityMappings().sequenceGeneratorsSize());
- assertEquals(0, ormResource().getEntityMappings().getSequenceGenerators().size());
-
- SequenceGenerator sequenceGenerator = entityMappings().addSequenceGenerator(0);
- sequenceGenerator.setName("FOO");
- SequenceGenerator sequenceGenerator2 = entityMappings().addSequenceGenerator(1);
- sequenceGenerator2.setName("BAR");
- SequenceGenerator sequenceGenerator3 = entityMappings().addSequenceGenerator(2);
- sequenceGenerator3.setName("BAZ");
- assertEquals("FOO", ormResource().getEntityMappings().getSequenceGenerators().get(0).getName());
- assertEquals("BAR", ormResource().getEntityMappings().getSequenceGenerators().get(1).getName());
- assertEquals("BAZ", ormResource().getEntityMappings().getSequenceGenerators().get(2).getName());
- assertEquals(3, ormResource().getEntityMappings().getSequenceGenerators().size());
-
- entityMappings().moveSequenceGenerator(2, 0);
- assertEquals("BAR", ormResource().getEntityMappings().getSequenceGenerators().get(0).getName());
- assertEquals("BAZ", ormResource().getEntityMappings().getSequenceGenerators().get(1).getName());
- assertEquals("FOO", ormResource().getEntityMappings().getSequenceGenerators().get(2).getName());
- assertEquals(3, ormResource().getEntityMappings().getSequenceGenerators().size());
-
- entityMappings().moveSequenceGenerator(0, 2);
- assertEquals("FOO", ormResource().getEntityMappings().getSequenceGenerators().get(0).getName());
- assertEquals("BAR", ormResource().getEntityMappings().getSequenceGenerators().get(1).getName());
- assertEquals("BAZ", ormResource().getEntityMappings().getSequenceGenerators().get(2).getName());
- assertEquals(3, ormResource().getEntityMappings().getSequenceGenerators().size());
-
- }
-
- public void testSequenceGeneratorsSize() throws Exception {
- assertEquals(0, entityMappings().sequenceGeneratorsSize());
- assertEquals(0, ormResource().getEntityMappings().getSequenceGenerators().size());
-
-
- SequenceGenerator sequenceGenerator = entityMappings().addSequenceGenerator(0);
- sequenceGenerator.setName("FOO");
- SequenceGenerator sequenceGenerator2 = entityMappings().addSequenceGenerator(1);
- sequenceGenerator2.setName("BAR");
- SequenceGenerator sequenceGenerator3 = entityMappings().addSequenceGenerator(2);
- sequenceGenerator3.setName("BAZ");
-
- assertEquals(3, entityMappings().sequenceGeneratorsSize());
-
- ormResource().getEntityMappings().getSequenceGenerators().remove(0);
- assertEquals(2, entityMappings().sequenceGeneratorsSize());
- }
-
-
- public void testAddNamedQuery() throws Exception {
- OrmNamedQuery namedQuery = entityMappings().addNamedQuery(0);
- namedQuery.setName("FOO");
-
- assertEquals("FOO", ormResource().getEntityMappings().getNamedQueries().get(0).getName());
-
- OrmNamedQuery namedQuery2 = entityMappings().addNamedQuery(0);
- namedQuery2.setName("BAR");
-
- assertEquals("BAR", ormResource().getEntityMappings().getNamedQueries().get(0).getName());
- assertEquals("FOO", ormResource().getEntityMappings().getNamedQueries().get(1).getName());
-
- OrmNamedQuery namedQuery3 = entityMappings().addNamedQuery(1);
- namedQuery3.setName("BAZ");
-
- assertEquals("BAR", ormResource().getEntityMappings().getNamedQueries().get(0).getName());
- assertEquals("BAZ", ormResource().getEntityMappings().getNamedQueries().get(1).getName());
- assertEquals("FOO", ormResource().getEntityMappings().getNamedQueries().get(2).getName());
-
- ListIterator<OrmNamedQuery> namedQueries = entityMappings().namedQueries();
- assertEquals(namedQuery2, namedQueries.next());
- assertEquals(namedQuery3, namedQueries.next());
- assertEquals(namedQuery, namedQueries.next());
-
- namedQueries = entityMappings().namedQueries();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- }
-
- public void testRemoveNamedQuery() throws Exception {
- entityMappings().addNamedQuery(0).setName("FOO");
- entityMappings().addNamedQuery(1).setName("BAR");
- entityMappings().addNamedQuery(2).setName("BAZ");
-
- assertEquals(3, ormResource().getEntityMappings().getNamedQueries().size());
-
- entityMappings().removeNamedQuery(0);
- assertEquals(2, ormResource().getEntityMappings().getNamedQueries().size());
- assertEquals("BAR", ormResource().getEntityMappings().getNamedQueries().get(0).getName());
- assertEquals("BAZ", ormResource().getEntityMappings().getNamedQueries().get(1).getName());
-
- entityMappings().removeNamedQuery(0);
- assertEquals(1, ormResource().getEntityMappings().getNamedQueries().size());
- assertEquals("BAZ", ormResource().getEntityMappings().getNamedQueries().get(0).getName());
-
- entityMappings().removeNamedQuery(0);
- assertEquals(0, ormResource().getEntityMappings().getNamedQueries().size());
- }
-
- public void testMoveNamedQuery() throws Exception {
- entityMappings().addNamedQuery(0).setName("FOO");
- entityMappings().addNamedQuery(1).setName("BAR");
- entityMappings().addNamedQuery(2).setName("BAZ");
-
- assertEquals(3, ormResource().getEntityMappings().getNamedQueries().size());
-
-
- entityMappings().moveNamedQuery(2, 0);
- ListIterator<OrmNamedQuery> namedQueries = entityMappings().namedQueries();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- assertEquals("BAR", ormResource().getEntityMappings().getNamedQueries().get(0).getName());
- assertEquals("BAZ", ormResource().getEntityMappings().getNamedQueries().get(1).getName());
- assertEquals("FOO", ormResource().getEntityMappings().getNamedQueries().get(2).getName());
-
-
- entityMappings().moveNamedQuery(0, 1);
- namedQueries = entityMappings().namedQueries();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- assertEquals("BAZ", ormResource().getEntityMappings().getNamedQueries().get(0).getName());
- assertEquals("BAR", ormResource().getEntityMappings().getNamedQueries().get(1).getName());
- assertEquals("FOO", ormResource().getEntityMappings().getNamedQueries().get(2).getName());
- }
-
- public void testUpdateNamedQueries() throws Exception {
- assertEquals(0, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries()));
-
- ormResource().getEntityMappings().getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery());
- ormResource().getEntityMappings().getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery());
- ormResource().getEntityMappings().getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery());
-
- ormResource().getEntityMappings().getNamedQueries().get(0).setName("FOO");
- ormResource().getEntityMappings().getNamedQueries().get(1).setName("BAR");
- ormResource().getEntityMappings().getNamedQueries().get(2).setName("BAZ");
-
- ListIterator<OrmNamedQuery> namedQueries = entityMappings().namedQueries();
- assertEquals("FOO", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(3, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries()));
-
- ormResource().getEntityMappings().getNamedQueries().move(2, 0);
- namedQueries = entityMappings().namedQueries();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- ormResource().getEntityMappings().getNamedQueries().move(0, 1);
- namedQueries = entityMappings().namedQueries();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- ormResource().getEntityMappings().getNamedQueries().remove(1);
- namedQueries = entityMappings().namedQueries();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(2, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries()));
-
- ormResource().getEntityMappings().getNamedQueries().remove(1);
- namedQueries = entityMappings().namedQueries();
- assertEquals("BAZ", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(1, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries()));
-
- ormResource().getEntityMappings().getNamedQueries().remove(0);
- assertFalse(entityMappings().namedQueries().hasNext());
- assertEquals(0, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries()));
- }
-
- public void testAddNamedNativeQuery() throws Exception {
- OrmNamedNativeQuery namedNativeQuery = entityMappings().addNamedNativeQuery(0);
- namedNativeQuery.setName("FOO");
-
- assertEquals("FOO", ormResource().getEntityMappings().getNamedNativeQueries().get(0).getName());
-
- OrmNamedNativeQuery namedNativeQuery2 = entityMappings().addNamedNativeQuery(0);
- namedNativeQuery2.setName("BAR");
-
- assertEquals("BAR", ormResource().getEntityMappings().getNamedNativeQueries().get(0).getName());
- assertEquals("FOO", ormResource().getEntityMappings().getNamedNativeQueries().get(1).getName());
-
- OrmNamedNativeQuery namedNativeQuery3 = entityMappings().addNamedNativeQuery(1);
- namedNativeQuery3.setName("BAZ");
-
- assertEquals("BAR", ormResource().getEntityMappings().getNamedNativeQueries().get(0).getName());
- assertEquals("BAZ", ormResource().getEntityMappings().getNamedNativeQueries().get(1).getName());
- assertEquals("FOO", ormResource().getEntityMappings().getNamedNativeQueries().get(2).getName());
-
- ListIterator<OrmNamedNativeQuery> namedNativeQueries = entityMappings().namedNativeQueries();
- assertEquals(namedNativeQuery2, namedNativeQueries.next());
- assertEquals(namedNativeQuery3, namedNativeQueries.next());
- assertEquals(namedNativeQuery, namedNativeQueries.next());
-
- namedNativeQueries = entityMappings().namedNativeQueries();
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
- }
-
- public void testRemoveNamedNativeQuery() throws Exception {
- entityMappings().addNamedNativeQuery(0).setName("FOO");
- entityMappings().addNamedNativeQuery(1).setName("BAR");
- entityMappings().addNamedNativeQuery(2).setName("BAZ");
-
- assertEquals(3, ormResource().getEntityMappings().getNamedNativeQueries().size());
-
- entityMappings().removeNamedNativeQuery(0);
- assertEquals(2, ormResource().getEntityMappings().getNamedNativeQueries().size());
- assertEquals("BAR", ormResource().getEntityMappings().getNamedNativeQueries().get(0).getName());
- assertEquals("BAZ", ormResource().getEntityMappings().getNamedNativeQueries().get(1).getName());
-
- entityMappings().removeNamedNativeQuery(0);
- assertEquals(1, ormResource().getEntityMappings().getNamedNativeQueries().size());
- assertEquals("BAZ", ormResource().getEntityMappings().getNamedNativeQueries().get(0).getName());
-
- entityMappings().removeNamedNativeQuery(0);
- assertEquals(0, ormResource().getEntityMappings().getNamedNativeQueries().size());
- }
-
- public void testMoveNamedNativeQuery() throws Exception {
- entityMappings().addNamedNativeQuery(0).setName("FOO");
- entityMappings().addNamedNativeQuery(1).setName("BAR");
- entityMappings().addNamedNativeQuery(2).setName("BAZ");
-
- assertEquals(3, ormResource().getEntityMappings().getNamedNativeQueries().size());
-
-
- entityMappings().moveNamedNativeQuery(2, 0);
- ListIterator<OrmNamedNativeQuery> namedNativeQueries = entityMappings().namedNativeQueries();
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
-
- assertEquals("BAR", ormResource().getEntityMappings().getNamedNativeQueries().get(0).getName());
- assertEquals("BAZ", ormResource().getEntityMappings().getNamedNativeQueries().get(1).getName());
- assertEquals("FOO", ormResource().getEntityMappings().getNamedNativeQueries().get(2).getName());
-
-
- entityMappings().moveNamedNativeQuery(0, 1);
- namedNativeQueries = entityMappings().namedNativeQueries();
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
-
- assertEquals("BAZ", ormResource().getEntityMappings().getNamedNativeQueries().get(0).getName());
- assertEquals("BAR", ormResource().getEntityMappings().getNamedNativeQueries().get(1).getName());
- assertEquals("FOO", ormResource().getEntityMappings().getNamedNativeQueries().get(2).getName());
- }
-
- public void testUpdateNamedNativeQueries() throws Exception {
- assertEquals(0, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries()));
-
- ormResource().getEntityMappings().getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery());
- ormResource().getEntityMappings().getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery());
- ormResource().getEntityMappings().getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery());
-
- ormResource().getEntityMappings().getNamedNativeQueries().get(0).setName("FOO");
- ormResource().getEntityMappings().getNamedNativeQueries().get(1).setName("BAR");
- ormResource().getEntityMappings().getNamedNativeQueries().get(2).setName("BAZ");
-
- ListIterator<OrmNamedNativeQuery> namedNativeQueries = entityMappings().namedNativeQueries();
- assertEquals("FOO", namedNativeQueries.next().getName());
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
- assertEquals(3, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries()));
-
- ormResource().getEntityMappings().getNamedNativeQueries().move(2, 0);
- namedNativeQueries = entityMappings().namedNativeQueries();
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
-
- ormResource().getEntityMappings().getNamedNativeQueries().move(0, 1);
- namedNativeQueries = entityMappings().namedNativeQueries();
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
-
- ormResource().getEntityMappings().getNamedNativeQueries().remove(1);
- namedNativeQueries = entityMappings().namedNativeQueries();
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
- assertEquals(2, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries()));
-
- ormResource().getEntityMappings().getNamedNativeQueries().remove(1);
- namedNativeQueries = entityMappings().namedNativeQueries();
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
- assertEquals(1, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries()));
-
- ormResource().getEntityMappings().getNamedNativeQueries().remove(0);
- assertFalse(entityMappings().namedNativeQueries().hasNext());
- assertEquals(0, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries()));
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/JptCoreOrmContextModelTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/JptCoreOrmContextModelTests.java
deleted file mode 100644
index 2c98ed8e0b..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/JptCoreOrmContextModelTests.java
+++ /dev/null
@@ -1,66 +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.core.tests.internal.context.orm;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JptCoreOrmContextModelTests extends TestCase
-{
- public static Test suite() {
- return suite(true);
- }
-
- public static Test suite(boolean all) {
- TestSuite suite = new TestSuite(JptCoreOrmContextModelTests.class.getName());
- suite.addTestSuite(OrmXmlTests.class);
- suite.addTestSuite(EntityMappingsTests.class);
- suite.addTestSuite(PersistenceUnitMetadataTests.class);
- suite.addTestSuite(PersistenceUnitDefaultsTests.class);
- suite.addTestSuite(OrmPersistentAttributeTests.class);
- suite.addTestSuite(OrmPersistentTypeTests.class);
- suite.addTestSuite(OrmAssociationOverrideTests.class);
- suite.addTestSuite(OrmAttributeOverrideTests.class);
- suite.addTestSuite(OrmBasicMappingTests.class);
- suite.addTestSuite(OrmCascadeTests.class);
- suite.addTestSuite(OrmColumnTests.class);
- suite.addTestSuite(OrmDiscriminatorColumnTests.class);
- suite.addTestSuite(OrmIdMappingTests.class);
- suite.addTestSuite(OrmEmbeddableTests.class);
- suite.addTestSuite(OrmEmbeddedMappingTests.class);
- suite.addTestSuite(OrmEmbeddedIdMappingTests.class);
- suite.addTestSuite(OrmEntityTests.class);
- suite.addTestSuite(OrmGeneratedValueTests.class);
- suite.addTestSuite(OrmJoinColumnTests.class);
- suite.addTestSuite(OrmJoinTableTests.class);
- suite.addTestSuite(OrmMappedSuperclassTests.class);
- suite.addTestSuite(OrmManyToManyMappingTests.class);
- suite.addTestSuite(OrmManyToOneMappingTests.class);
- suite.addTestSuite(OrmNamedQueryTests.class);
- suite.addTestSuite(OrmNamedNativeQueryTests.class);
- suite.addTestSuite(OrmOneToManyMappingTests.class);
- suite.addTestSuite(OrmOneToOneMappingTests.class);
- suite.addTestSuite(OrmPrimaryKeyJoinColumnTests.class);
- suite.addTestSuite(OrmQueryHintTests.class);
- suite.addTestSuite(OrmSecondaryTableTests.class);
- suite.addTestSuite(OrmSequenceGeneratorTests.class);
- suite.addTestSuite(OrmTableGeneratorTests.class);
- suite.addTestSuite(OrmTableTests.class);
- suite.addTestSuite(OrmTransientMappingTests.class);
- suite.addTestSuite(OrmVersionMappingTests.class);
- return suite;
- }
-
- private JptCoreOrmContextModelTests() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmAssociationOverrideTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmAssociationOverrideTests.java
deleted file mode 100644
index 5ab76feb9a..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmAssociationOverrideTests.java
+++ /dev/null
@@ -1,255 +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.tests.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-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.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-
-public class OrmAssociationOverrideTests extends ContextModelTestCase
-{
- public OrmAssociationOverrideTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl());
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
- OrmAssociationOverride ormAssociationOverride = ormEntity.specifiedAssociationOverrides().next();
-
- assertNull(ormAssociationOverride.getName());
- assertNull(xmlAssociationOverride.getName());
- assertTrue(ormEntity.associationOverrides().hasNext());
- assertFalse(entityResource.getAssociationOverrides().isEmpty());
-
- //set name in the resource model, verify context model updated
- xmlAssociationOverride.setName("FOO");
- assertEquals("FOO", ormAssociationOverride.getName());
- assertEquals("FOO", xmlAssociationOverride.getName());
-
- //set name to null in the resource model
- xmlAssociationOverride.setName(null);
- assertNull(ormAssociationOverride.getName());
- assertNull(xmlAssociationOverride.getName());
-
- xmlAssociationOverride.setName("FOO");
- assertEquals("FOO", ormAssociationOverride.getName());
- assertEquals("FOO", xmlAssociationOverride.getName());
-
- entityResource.getAssociationOverrides().remove(0);
- assertFalse(ormEntity.associationOverrides().hasNext());
- assertTrue(entityResource.getAssociationOverrides().isEmpty());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl());
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
- OrmAssociationOverride ormAssociationOverride = ormEntity.specifiedAssociationOverrides().next();
-
- assertNull(ormAssociationOverride.getName());
- assertNull(xmlAssociationOverride.getName());
-
- //set name in the context model, verify resource model modified
- ormAssociationOverride.setName("foo");
- assertEquals("foo", ormAssociationOverride.getName());
- assertEquals("foo", xmlAssociationOverride.getName());
-
- //set name to null in the context model
- ormAssociationOverride.setName(null);
- assertNull(ormAssociationOverride.getName());
- assertNull(entityResource.getAssociationOverrides().get(0).getName());
- }
-
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl());
- OrmAssociationOverride ormAssociationOverride = ormEntity.specifiedAssociationOverrides().next();
-
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
-
- OrmJoinColumn joinColumn = ormAssociationOverride.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(0).getName());
-
- OrmJoinColumn joinColumn2 = ormAssociationOverride.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(1).getName());
-
- OrmJoinColumn joinColumn3 = ormAssociationOverride.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(1).getName());
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(2).getName());
-
- ListIterator<OrmJoinColumn> joinColumns = ormAssociationOverride.specifiedJoinColumns();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = ormAssociationOverride.specifiedJoinColumns();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl());
- OrmAssociationOverride ormAssociationOverride = ormEntity.specifiedAssociationOverrides().next();
-
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
-
- ormAssociationOverride.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- ormAssociationOverride.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- ormAssociationOverride.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, xmlAssociationOverride.getJoinColumns().size());
-
- ormAssociationOverride.removeSpecifiedJoinColumn(0);
- assertEquals(2, xmlAssociationOverride.getJoinColumns().size());
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(1).getName());
-
- ormAssociationOverride.removeSpecifiedJoinColumn(0);
- assertEquals(1, xmlAssociationOverride.getJoinColumns().size());
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(0).getName());
-
- ormAssociationOverride.removeSpecifiedJoinColumn(0);
- assertEquals(0, xmlAssociationOverride.getJoinColumns().size());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl());
- OrmAssociationOverride ormAssociationOverride = ormEntity.specifiedAssociationOverrides().next();
-
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
-
- ormAssociationOverride.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- ormAssociationOverride.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- ormAssociationOverride.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, xmlAssociationOverride.getJoinColumns().size());
-
-
- ormAssociationOverride.moveSpecifiedJoinColumn(2, 0);
- ListIterator<OrmJoinColumn> joinColumns = ormAssociationOverride.specifiedJoinColumns();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(1).getName());
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(2).getName());
-
-
- ormAssociationOverride.moveSpecifiedJoinColumn(0, 1);
- joinColumns = ormAssociationOverride.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(1).getName());
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(2).getName());
- }
-
- public void testUpdateJoinColumns() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl());
- OrmAssociationOverride ormAssociationOverride = ormEntity.specifiedAssociationOverrides().next();
-
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
-
- xmlAssociationOverride.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumnImpl());
- xmlAssociationOverride.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumnImpl());
- xmlAssociationOverride.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumnImpl());
-
- xmlAssociationOverride.getJoinColumns().get(0).setName("FOO");
- xmlAssociationOverride.getJoinColumns().get(1).setName("BAR");
- xmlAssociationOverride.getJoinColumns().get(2).setName("BAZ");
-
- ListIterator<OrmJoinColumn> joinColumns = ormAssociationOverride.specifiedJoinColumns();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().move(2, 0);
- joinColumns = ormAssociationOverride.specifiedJoinColumns();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().move(0, 1);
- joinColumns = ormAssociationOverride.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().remove(1);
- joinColumns = ormAssociationOverride.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().remove(1);
- joinColumns = ormAssociationOverride.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().remove(0);
- assertFalse(ormAssociationOverride.specifiedJoinColumns().hasNext());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmAttributeOverrideTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmAttributeOverrideTests.java
deleted file mode 100644
index f511d12f58..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmAttributeOverrideTests.java
+++ /dev/null
@@ -1,96 +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.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-
-public class OrmAttributeOverrideTests extends ContextModelTestCase
-{
- public OrmAttributeOverrideTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- XmlAttributeOverride attributeOverrideResource = entityResource.getAttributeOverrides().get(0);
- OrmAttributeOverride ormAttributeOverride = ormEntity.specifiedAttributeOverrides().next();
-
- assertNull(ormAttributeOverride.getName());
- assertNull(attributeOverrideResource.getName());
- assertTrue(ormEntity.attributeOverrides().hasNext());
- assertFalse(entityResource.getAttributeOverrides().isEmpty());
-
- //set name in the resource model, verify context model updated
- attributeOverrideResource.setName("FOO");
- assertEquals("FOO", ormAttributeOverride.getName());
- assertEquals("FOO", attributeOverrideResource.getName());
-
- //set name to null in the resource model
- attributeOverrideResource.setName(null);
- assertNull(ormAttributeOverride.getName());
- assertNull(attributeOverrideResource.getName());
-
- attributeOverrideResource.setName("FOO");
- assertEquals("FOO", ormAttributeOverride.getName());
- assertEquals("FOO", attributeOverrideResource.getName());
-
- entityResource.getAttributeOverrides().remove(0);
- assertFalse(ormEntity.attributeOverrides().hasNext());
- assertTrue(entityResource.getAttributeOverrides().isEmpty());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- XmlAttributeOverride attributeOverrideResource = entityResource.getAttributeOverrides().get(0);
- OrmAttributeOverride ormAttributeOverride = ormEntity.specifiedAttributeOverrides().next();
-
- assertNull(ormAttributeOverride.getName());
- assertNull(attributeOverrideResource.getName());
-
- //set name in the context model, verify resource model modified
- ormAttributeOverride.setName("foo");
- assertEquals("foo", ormAttributeOverride.getName());
- assertEquals("foo", attributeOverrideResource.getName());
-
- //set name to null in the context model
- ormAttributeOverride.setName(null);
- assertNull(ormAttributeOverride.getName());
- assertNull(entityResource.getAttributeOverrides().get(0).getName());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmBasicMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmBasicMappingTests.java
deleted file mode 100644
index a6d0ba55d9..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmBasicMappingTests.java
+++ /dev/null
@@ -1,708 +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.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.BasicMapping;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-import org.eclipse.jpt.core.context.EnumType;
-import org.eclipse.jpt.core.context.EnumeratedConverter;
-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.OneToOneMapping;
-import org.eclipse.jpt.core.context.TemporalConverter;
-import org.eclipse.jpt.core.context.TemporalType;
-import org.eclipse.jpt.core.context.TransientMapping;
-import org.eclipse.jpt.core.context.VersionMapping;
-import org.eclipse.jpt.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmColumn;
-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.XmlBasic;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class OrmBasicMappingTests extends ContextModelTestCase
-{
- public OrmBasicMappingTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- private ICompilationUnit createTestEntityBasicMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, JPA.FETCH_TYPE, JPA.COLUMN, JPA.LOB, JPA.TEMPORAL, JPA.TEMPORAL_TYPE, JPA.ENUMERATED, JPA.ENUM_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic(fetch=FetchType.LAZY, optional=false)");
- sb.append(CR);
- sb.append(" @Column(name=\"MY_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\", length=5, precision=6, scale=7)");
- sb.append(CR);
- sb.append(" @Lob");
- sb.append(CR);
- sb.append(" @Temporal(TemporalType.TIMESTAMP)");
- sb.append(CR);
- sb.append(" @Enumerated(EnumType.STRING)");
- }
- });
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertEquals("basicMapping", ormBasicMapping.getName());
- assertEquals("basicMapping", basicResource.getName());
-
- //set name in the resource model, verify context model updated
- basicResource.setName("newName");
- assertEquals("newName", ormBasicMapping.getName());
- assertEquals("newName", basicResource.getName());
-
- //set name to null in the resource model
- basicResource.setName(null);
- assertNull(ormBasicMapping.getName());
- assertNull(basicResource.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertEquals("basicMapping", ormBasicMapping.getName());
- assertEquals("basicMapping", basicResource.getName());
-
- //set name in the context model, verify resource model updated
- ormBasicMapping.setName("newName");
- assertEquals("newName", ormBasicMapping.getName());
- assertEquals("newName", basicResource.getName());
-
- //set name to null in the context model
- ormBasicMapping.setName(null);
- assertNull(ormBasicMapping.getName());
- assertNull(basicResource.getName());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getSpecifiedFetch());
- assertNull(basicResource.getFetch());
-
- //set fetch in the resource model, verify context model updated
- basicResource.setFetch(org.eclipse.jpt.core.resource.orm.FetchType.EAGER);
- assertEquals(FetchType.EAGER, ormBasicMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.core.resource.orm.FetchType.EAGER, basicResource.getFetch());
-
- basicResource.setFetch(org.eclipse.jpt.core.resource.orm.FetchType.LAZY);
- assertEquals(FetchType.LAZY, ormBasicMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.core.resource.orm.FetchType.LAZY, basicResource.getFetch());
-
- //set fetch to null in the resource model
- basicResource.setFetch(null);
- assertNull(ormBasicMapping.getSpecifiedFetch());
- assertNull(basicResource.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getSpecifiedFetch());
- assertNull(basicResource.getFetch());
-
- //set fetch in the context model, verify resource model updated
- ormBasicMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(org.eclipse.jpt.core.resource.orm.FetchType.EAGER, basicResource.getFetch());
- assertEquals(FetchType.EAGER, ormBasicMapping.getSpecifiedFetch());
-
- ormBasicMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(org.eclipse.jpt.core.resource.orm.FetchType.LAZY, basicResource.getFetch());
- assertEquals(FetchType.LAZY, ormBasicMapping.getSpecifiedFetch());
-
- //set fetch to null in the context model
- ormBasicMapping.setSpecifiedFetch(null);
- assertNull(basicResource.getFetch());
- assertNull(ormBasicMapping.getSpecifiedFetch());
- }
-
- public void testUpdateSpecifiedEnumerated() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getSpecifiedConverter());
- assertNull(basicResource.getEnumerated());
-
- //set enumerated in the resource model, verify context model updated
- basicResource.setEnumerated(org.eclipse.jpt.core.resource.orm.EnumType.ORDINAL);
- assertEquals(EnumType.ORDINAL, ((EnumeratedConverter) ormBasicMapping.getConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.core.resource.orm.EnumType.ORDINAL, basicResource.getEnumerated());
-
- basicResource.setEnumerated(org.eclipse.jpt.core.resource.orm.EnumType.STRING);
- assertEquals(EnumType.STRING, ((EnumeratedConverter) ormBasicMapping.getConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.core.resource.orm.EnumType.STRING, basicResource.getEnumerated());
-
- //set enumerated to null in the resource model
- basicResource.setEnumerated(null);
- assertNull(ormBasicMapping.getSpecifiedConverter());
- assertNull(basicResource.getEnumerated());
- }
-
- public void testModifySpecifiedEnumerated() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getSpecifiedConverter());
- assertNull(basicResource.getEnumerated());
-
- //set enumerated in the context model, verify resource model updated
- ormBasicMapping.setSpecifiedConverter(Converter.ENUMERATED_CONVERTER);
- ((EnumeratedConverter) ormBasicMapping.getConverter()).setSpecifiedEnumType(EnumType.ORDINAL);
- assertEquals(org.eclipse.jpt.core.resource.orm.EnumType.ORDINAL, basicResource.getEnumerated());
- assertEquals(EnumType.ORDINAL, ((EnumeratedConverter) ormBasicMapping.getConverter()).getSpecifiedEnumType());
-
- ((EnumeratedConverter) ormBasicMapping.getConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.core.resource.orm.EnumType.STRING, basicResource.getEnumerated());
- assertEquals(EnumType.STRING, ((EnumeratedConverter) ormBasicMapping.getConverter()).getSpecifiedEnumType());
-
- //set enumerated to null in the context model
- ormBasicMapping.setSpecifiedConverter(null);
- assertNull(basicResource.getEnumerated());
- assertNull(ormBasicMapping.getSpecifiedConverter());
- }
-
- public void testUpdateSpecifiedOptional() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getSpecifiedOptional());
- assertNull(basicResource.getOptional());
-
- //set enumerated in the resource model, verify context model updated
- basicResource.setOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormBasicMapping.getSpecifiedOptional());
- assertEquals(Boolean.TRUE, basicResource.getOptional());
-
- basicResource.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormBasicMapping.getSpecifiedOptional());
- assertEquals(Boolean.FALSE, basicResource.getOptional());
-
- //set enumerated to null in the resource model
- basicResource.setOptional(null);
- assertNull(ormBasicMapping.getSpecifiedOptional());
- assertNull(basicResource.getOptional());
- }
-
- public void testModifySpecifiedOptional() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getSpecifiedOptional());
- assertNull(basicResource.getOptional());
-
- //set enumerated in the context model, verify resource model updated
- ormBasicMapping.setSpecifiedOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, basicResource.getOptional());
- assertEquals(Boolean.TRUE, ormBasicMapping.getSpecifiedOptional());
-
- ormBasicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, basicResource.getOptional());
- assertEquals(Boolean.FALSE, ormBasicMapping.getSpecifiedOptional());
-
- //set enumerated to null in the context model
- ormBasicMapping.setSpecifiedOptional(null);
- assertNull(basicResource.getOptional());
- assertNull(ormBasicMapping.getSpecifiedOptional());
- }
-
- public void testUpdateSpecifiedLob() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getSpecifiedConverter());
- assertFalse(basicResource.isLob());
-
- //set lob in the resource model, verify context model updated
- basicResource.setLob(true);
- assertEquals(Converter.LOB_CONVERTER, ormBasicMapping.getConverter().getType());
- assertTrue(basicResource.isLob());
-
- //set lob to null in the resource model
- basicResource.setLob(false);
- assertNull(ormBasicMapping.getSpecifiedConverter());
- assertFalse(basicResource.isLob());
- }
-
- public void testModifySpecifiedLob() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getSpecifiedConverter());
- assertFalse(basicResource.isLob());
-
- //set lob in the context model, verify resource model updated
- ormBasicMapping.setSpecifiedConverter(Converter.LOB_CONVERTER);
- assertTrue(basicResource.isLob());
- assertEquals(Converter.LOB_CONVERTER, ormBasicMapping.getConverter().getType());
-
- //set lob to false in the context model
- ormBasicMapping.setSpecifiedConverter(null);
- assertFalse(basicResource.isLob());
- assertNull(ormBasicMapping.getSpecifiedConverter());
- }
-
- public void testUpdateTemporal() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getSpecifiedConverter());
- assertNull(basicResource.getTemporal());
-
- //set temporal in the resource model, verify context model updated
- basicResource.setTemporal(org.eclipse.jpt.core.resource.orm.TemporalType.DATE);
- assertEquals(TemporalType.DATE, ((TemporalConverter) ormBasicMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.core.resource.orm.TemporalType.DATE, basicResource.getTemporal());
-
- basicResource.setTemporal(org.eclipse.jpt.core.resource.orm.TemporalType.TIME);
- assertEquals(TemporalType.TIME, ((TemporalConverter) ormBasicMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.core.resource.orm.TemporalType.TIME, basicResource.getTemporal());
-
- basicResource.setTemporal(org.eclipse.jpt.core.resource.orm.TemporalType.TIMESTAMP);
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) ormBasicMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.core.resource.orm.TemporalType.TIMESTAMP, basicResource.getTemporal());
-
- //set temporal to null in the resource model
- basicResource.setTemporal(null);
- assertNull(ormBasicMapping.getSpecifiedConverter());
- assertNull(basicResource.getTemporal());
- }
-
- public void testModifyTemporal() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getSpecifiedConverter());
- assertNull(basicResource.getTemporal());
-
- //set temporal in the context model, verify resource model updated
- ormBasicMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) ormBasicMapping.getSpecifiedConverter()).setTemporalType(TemporalType.DATE);
- assertEquals(org.eclipse.jpt.core.resource.orm.TemporalType.DATE, basicResource.getTemporal());
- assertEquals(TemporalType.DATE, ((TemporalConverter) ormBasicMapping.getSpecifiedConverter()).getTemporalType());
-
- ((TemporalConverter) ormBasicMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.core.resource.orm.TemporalType.TIME, basicResource.getTemporal());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ormBasicMapping.getSpecifiedConverter()).getTemporalType());
-
- ((TemporalConverter) ormBasicMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIMESTAMP);
- assertEquals(org.eclipse.jpt.core.resource.orm.TemporalType.TIMESTAMP, basicResource.getTemporal());
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) ormBasicMapping.getSpecifiedConverter()).getTemporalType());
-
- //set temporal to null in the context model
- ormBasicMapping.setSpecifiedConverter(null);
- assertNull(basicResource.getTemporal());
- assertNull(ormBasicMapping.getSpecifiedConverter());
- }
-
- //TODO test defaults
- //TODO test overriding java mapping with a different mapping type in xml
-
-
- public void testBasicMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityBasicMapping();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "foo");
- assertEquals(2, ormPersistentType.virtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("foo", ormBasicMapping.getName());
- assertNull(ormBasicMapping.getSpecifiedConverter());
- assertNull(ormBasicMapping.getSpecifiedFetch());
- assertNull(ormBasicMapping.getSpecifiedOptional());
- assertEquals(FetchType.EAGER, ormBasicMapping.getFetch());
- assertEquals(Boolean.TRUE, ormBasicMapping.getOptional());
-
-
- OrmColumn ormColumn = ormBasicMapping.getColumn();
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
-
- assertEquals("foo", ormColumn.getDefaultName());
- assertEquals(Boolean.FALSE, ormColumn.getDefaultUnique());
- assertEquals(Boolean.TRUE, ormColumn.getDefaultNullable());
- assertEquals(Boolean.TRUE, ormColumn.getDefaultInsertable());
- assertEquals(Boolean.TRUE, ormColumn.getDefaultUpdatable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getDefaultTable());
- assertEquals(Integer.valueOf(255), ormColumn.getDefaultLength());
- assertEquals(Integer.valueOf(0), ormColumn.getDefaultPrecision());
- assertEquals(Integer.valueOf(0), ormColumn.getDefaultScale());
- }
-
- //@Basic(fetch=FetchType.LAZY, optional=false)
- //@Column(name="MY_COLUMN", unique=true, nullable=false, insertable=false, updatable=false,
- // columnDefinition="COLUMN_DEFINITION", table="MY_TABLE", length=5, precision=6, scale=7)");
- //@Column(
- //@Lob
- //@Temporal(TemporalType.TIMESTAMP)
- //@Enumerated(EnumType.STRING)
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(2, ormPersistentType.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- assertEquals("id", ormBasicMapping.getName());
- assertEquals(Converter.ENUMERATED_CONVERTER, ormBasicMapping.getConverter().getType());
- assertEquals(EnumType.STRING, ((EnumeratedConverter) ormBasicMapping.getConverter()).getEnumType());
- assertEquals(FetchType.LAZY, ormBasicMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, ormBasicMapping.getSpecifiedOptional());
-
- OrmColumn ormColumn = ormBasicMapping.getColumn();
- assertEquals("MY_COLUMN", ormColumn.getSpecifiedName());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", ormColumn.getColumnDefinition());
- assertEquals("MY_TABLE", ormColumn.getSpecifiedTable());
- assertEquals(Integer.valueOf(5), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(6), ormColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(7), ormColumn.getSpecifiedScale());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(2, ormPersistentType.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- assertEquals("id", ormBasicMapping.getName());
- assertEquals(Converter.NO_CONVERTER, ormBasicMapping.getConverter().getType());
- assertEquals(FetchType.EAGER, ormBasicMapping.getSpecifiedFetch());
- assertEquals(Boolean.TRUE, ormBasicMapping.getSpecifiedOptional());
-
- OrmColumn ormColumn = ormBasicMapping.getColumn();
- assertEquals("id", ormColumn.getSpecifiedName());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUnique());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedNullable());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedInsertable());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getSpecifiedTable());
- assertEquals(Integer.valueOf(255), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(0), ormColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(0), ormColumn.getSpecifiedScale());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityBasicMapping();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "id");
- assertEquals(1, ormPersistentType.virtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("id", ormBasicMapping.getName());
- assertEquals(Converter.NO_CONVERTER, ormBasicMapping.getConverter().getType());
- assertNull(ormBasicMapping.getSpecifiedFetch());
- assertNull(ormBasicMapping.getSpecifiedOptional());
- assertEquals(FetchType.EAGER, ormBasicMapping.getDefaultFetch());
- assertEquals(Boolean.TRUE, ormBasicMapping.getDefaultOptional());
-
- OrmColumn ormColumn = ormBasicMapping.getColumn();
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
-
- assertEquals("id", ormColumn.getDefaultName());
- assertEquals(Boolean.FALSE, ormColumn.getDefaultUnique());
- assertEquals(Boolean.TRUE, ormColumn.getDefaultNullable());
- assertEquals(Boolean.TRUE, ormColumn.getDefaultInsertable());
- assertEquals(Boolean.TRUE, ormColumn.getDefaultUpdatable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getDefaultTable());
- assertEquals(Integer.valueOf(255), ormColumn.getDefaultLength());
- assertEquals(Integer.valueOf(0), ormColumn.getDefaultPrecision());
- assertEquals(Integer.valueOf(0), ormColumn.getDefaultScale());
-
- }
- //3 things tested above
- //1. virtual mapping metadata complete=false - defaults are taken from the java annotations
- //2. virtual mapping metadata complete=true - defaults are taken from java defaults,annotations ignored
- //3. specified mapping (metadata complete=true/false - defaults are taken from java annotations
-
-
- public void testBasicMorphToIdMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic");
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) basicMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("basic", ormPersistentAttribute.getMapping().getName());
- assertEquals("FOO", ((IdMapping) ormPersistentAttribute.getMapping()).getColumn().getSpecifiedName());
- }
-
- public void testBasicMorphToVersionMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic");
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) basicMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("basic", ormPersistentAttribute.getMapping().getName());
- assertEquals("FOO", ((VersionMapping) ormPersistentAttribute.getMapping()).getColumn().getSpecifiedName());
- }
-
- public void testBasicMorphToTransientMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic");
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) basicMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("basic", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testBasicMorphToEmbeddedMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic");
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) basicMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("basic", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testBasicMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic");
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) basicMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals("basic", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testBasicMorphToOneToOneMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic");
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) basicMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("basic", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testBasicMorphToOneToManyMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic");
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) basicMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.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("basic", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testBasicMorphToManyToOneMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic");
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) basicMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.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("basic", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testBasicMorphToManyToManyMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic");
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) basicMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.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("basic", ormPersistentAttribute.getMapping().getName());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmCascadeTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmCascadeTests.java
deleted file mode 100644
index 88a74c4dd0..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmCascadeTests.java
+++ /dev/null
@@ -1,280 +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.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Cascade;
-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.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-
-public class OrmCascadeTests extends ContextModelTestCase
-{
- public OrmCascadeTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- public void testUpdateCascadeAll() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isAll());
- assertNull(oneToOne.getCascade());
-
- //set cascade in the resource model, verify context model does not change
- oneToOne.setCascade(OrmFactory.eINSTANCE.createCascadeTypeImpl());
- assertEquals(false, cascade.isAll());
- assertNotNull(oneToOne.getCascade());
-
- //set all in the resource model, verify context model updated
- oneToOne.getCascade().setCascadeAll(true);
- assertEquals(true, cascade.isAll());
- assertEquals(true, oneToOne.getCascade().isCascadeAll());
-
- //set all to false in the resource model
- oneToOne.getCascade().setCascadeAll(false);
- assertEquals(false, cascade.isAll());
- assertEquals(false, oneToOne.getCascade().isCascadeAll());
- }
-
- public void testModifyCascadeAll() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isAll());
- assertNull(oneToOne.getCascade());
-
- //set all in the context model, verify resource model updated
- cascade.setAll(true);
- assertEquals(true, cascade.isAll());
- assertEquals(true, oneToOne.getCascade().isCascadeAll());
-
- //set all to false in the context model
- cascade.setAll(false);
- assertEquals(false, cascade.isAll());
- assertNull(oneToOne.getCascade());
- }
-
- public void testUpdateCascadePersist() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isPersist());
- assertNull(oneToOne.getCascade());
-
- //set cascade in the resource model, verify context model does not change
- oneToOne.setCascade(OrmFactory.eINSTANCE.createCascadeTypeImpl());
- assertEquals(false, cascade.isPersist());
- assertNotNull(oneToOne.getCascade());
-
- //set Persist in the resource model, verify context model updated
- oneToOne.getCascade().setCascadePersist(true);
- assertEquals(true, cascade.isPersist());
- assertEquals(true, oneToOne.getCascade().isCascadePersist());
-
- //set Persist to false in the resource model
- oneToOne.getCascade().setCascadePersist(false);
- assertEquals(false, cascade.isPersist());
- assertEquals(false, oneToOne.getCascade().isCascadePersist());
- }
-
- public void testModifyCascadePersist() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isPersist());
- assertNull(oneToOne.getCascade());
-
- //set Persist in the context model, verify resource model updated
- cascade.setPersist(true);
- assertEquals(true, cascade.isPersist());
- assertEquals(true, oneToOne.getCascade().isCascadePersist());
-
- //set Persist to false in the context model
- cascade.setPersist(false);
- assertEquals(false, cascade.isPersist());
- assertNull(oneToOne.getCascade());
- }
-
- public void testUpdateCascadeMerge() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isMerge());
- assertNull(oneToOne.getCascade());
-
- //set cascade in the resource model, verify context model does not change
- oneToOne.setCascade(OrmFactory.eINSTANCE.createCascadeTypeImpl());
- assertEquals(false, cascade.isMerge());
- assertNotNull(oneToOne.getCascade());
-
- //set Merge in the resource model, verify context model updated
- oneToOne.getCascade().setCascadeMerge(true);
- assertEquals(true, cascade.isMerge());
- assertEquals(true, oneToOne.getCascade().isCascadeMerge());
-
- //set Merge to false in the resource model
- oneToOne.getCascade().setCascadeMerge(false);
- assertEquals(false, cascade.isMerge());
- assertEquals(false, oneToOne.getCascade().isCascadeMerge());
- }
-
- public void testModifyCascadeMerge() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isMerge());
- assertNull(oneToOne.getCascade());
-
- //set Merge in the context model, verify resource model updated
- cascade.setMerge(true);
- assertEquals(true, cascade.isMerge());
- assertEquals(true, oneToOne.getCascade().isCascadeMerge());
-
- //set Merge to false in the context model
- cascade.setMerge(false);
- assertEquals(false, cascade.isMerge());
- assertNull(oneToOne.getCascade());
- }
-
- public void testUpdateCascadeRemove() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isRemove());
- assertNull(oneToOne.getCascade());
-
- //set cascade in the resource model, verify context model does not change
- oneToOne.setCascade(OrmFactory.eINSTANCE.createCascadeTypeImpl());
- assertEquals(false, cascade.isRemove());
- assertNotNull(oneToOne.getCascade());
-
- //set Remove in the resource model, verify context model updated
- oneToOne.getCascade().setCascadeRemove(true);
- assertEquals(true, cascade.isRemove());
- assertEquals(true, oneToOne.getCascade().isCascadeRemove());
-
- //set Remove to false in the resource model
- oneToOne.getCascade().setCascadeRemove(false);
- assertEquals(false, cascade.isRemove());
- assertEquals(false, oneToOne.getCascade().isCascadeRemove());
- }
-
- public void testModifyCascadeRemove() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isRemove());
- assertNull(oneToOne.getCascade());
-
- //set Remove in the context model, verify resource model updated
- cascade.setRemove(true);
- assertEquals(true, cascade.isRemove());
- assertEquals(true, oneToOne.getCascade().isCascadeRemove());
-
- //set Remove to false in the context model
- cascade.setRemove(false);
- assertEquals(false, cascade.isRemove());
- assertNull(oneToOne.getCascade());
- }
-
- public void testUpdateCascadeRefresh() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isRefresh());
- assertNull(oneToOne.getCascade());
-
- //set cascade in the resource model, verify context model does not change
- oneToOne.setCascade(OrmFactory.eINSTANCE.createCascadeTypeImpl());
- assertEquals(false, cascade.isRefresh());
- assertNotNull(oneToOne.getCascade());
-
- //set Refresh in the resource model, verify context model updated
- oneToOne.getCascade().setCascadeRefresh(true);
- assertEquals(true, cascade.isRefresh());
- assertEquals(true, oneToOne.getCascade().isCascadeRefresh());
-
- //set Refresh to false in the resource model
- oneToOne.getCascade().setCascadeRefresh(false);
- assertEquals(false, cascade.isRefresh());
- assertEquals(false, oneToOne.getCascade().isCascadeRefresh());
- }
-
- public void testModifyCascadeRefresh() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isRefresh());
- assertNull(oneToOne.getCascade());
-
- //set Refresh in the context model, verify resource model updated
- cascade.setRefresh(true);
- assertEquals(true, cascade.isRefresh());
- assertEquals(true, oneToOne.getCascade().isCascadeRefresh());
-
- //set Refresh to false in the context model
- cascade.setRefresh(false);
- assertEquals(false, cascade.isRefresh());
- assertNull(oneToOne.getCascade());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmColumnTests.java
deleted file mode 100644
index 17b9f99c91..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmColumnTests.java
+++ /dev/null
@@ -1,838 +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.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.Column;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmColumn;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-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.resource.orm.XmlBasic;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class OrmColumnTests extends ContextModelTestCase
-{
- public OrmColumnTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedName());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumnImpl());
- basic.getColumn().setName("FOO");
- ormResource().save(null);
- assertEquals("FOO", ormColumn.getSpecifiedName());
- assertEquals("FOO", basic.getColumn().getName());
-
- //set name to null in the resource model
- basic.getColumn().setName(null);
- assertNull(ormColumn.getSpecifiedName());
- assertNull(basic.getColumn().getName());
-
- basic.getColumn().setName("FOO");
- assertEquals("FOO", ormColumn.getSpecifiedName());
- assertEquals("FOO", basic.getColumn().getName());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedName());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedName());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedName("foo");
- assertEquals("foo", ormColumn.getSpecifiedName());
- assertEquals("foo", basic.getColumn().getName());
-
- //set name to null in the context model
- ormColumn.setSpecifiedName(null);
- assertNull(ormColumn.getSpecifiedName());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateColumnDefinition() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getColumnDefinition());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumnImpl());
- basic.getColumn().setColumnDefinition("FOO");
- assertEquals("FOO", ormColumn.getColumnDefinition());
- assertEquals("FOO", basic.getColumn().getColumnDefinition());
-
- //set name to null in the resource model
- basic.getColumn().setColumnDefinition(null);
- assertNull(ormColumn.getColumnDefinition());
- assertNull(basic.getColumn().getColumnDefinition());
-
- basic.getColumn().setColumnDefinition("FOO");
- assertEquals("FOO", ormColumn.getColumnDefinition());
- assertEquals("FOO", basic.getColumn().getColumnDefinition());
-
- basic.setColumn(null);
- assertNull(ormColumn.getColumnDefinition());
- assertNull(basic.getColumn());
- }
-
- public void testModifyColumnDefinition() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getColumnDefinition());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setColumnDefinition("foo");
- assertEquals("foo", ormColumn.getColumnDefinition());
- assertEquals("foo", basic.getColumn().getColumnDefinition());
-
- //set name to null in the context model
- ormColumn.setColumnDefinition(null);
- assertNull(ormColumn.getColumnDefinition());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateSpecifiedTable() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumnImpl());
- basic.getColumn().setTable("FOO");
- assertEquals("FOO", ormColumn.getSpecifiedTable());
- assertEquals("FOO", basic.getColumn().getTable());
-
- //set name to null in the resource model
- basic.getColumn().setTable(null);
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(basic.getColumn().getTable());
-
- basic.getColumn().setTable("FOO");
- assertEquals("FOO", ormColumn.getSpecifiedTable());
- assertEquals("FOO", basic.getColumn().getTable());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedTable() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedTable("foo");
- assertEquals("foo", ormColumn.getSpecifiedTable());
- assertEquals("foo", basic.getColumn().getTable());
-
- //set name to null in the context model
- ormColumn.setSpecifiedTable(null);
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateSpecifiedNullable() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumnImpl());
- basic.getColumn().setNullable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedNullable());
- assertEquals(Boolean.TRUE, basic.getColumn().getNullable());
-
- //set name to null in the resource model
- basic.getColumn().setNullable(null);
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(basic.getColumn().getNullable());
-
- basic.getColumn().setNullable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, basic.getColumn().getNullable());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedNullable() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedNullable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, basic.getColumn().getNullable());
-
- //set name to null in the context model
- ormColumn.setSpecifiedNullable(null);
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateSpecifiedUpdatable() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumnImpl());
- basic.getColumn().setUpdatable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.TRUE, basic.getColumn().getUpdatable());
-
- //set name to null in the resource model
- basic.getColumn().setUpdatable(null);
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(basic.getColumn().getUpdatable());
-
- basic.getColumn().setUpdatable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, basic.getColumn().getUpdatable());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedUpdatable() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedUpdatable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, basic.getColumn().getUpdatable());
-
- //set name to null in the context model
- ormColumn.setSpecifiedUpdatable(null);
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateSpecifiedInsertable() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumnImpl());
- basic.getColumn().setInsertable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedInsertable());
- assertEquals(Boolean.TRUE, basic.getColumn().getInsertable());
-
- //set name to null in the resource model
- basic.getColumn().setInsertable(null);
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(basic.getColumn().getInsertable());
-
- basic.getColumn().setInsertable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, basic.getColumn().getInsertable());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedInsertable() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedInsertable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, basic.getColumn().getInsertable());
-
- //set name to null in the context model
- ormColumn.setSpecifiedInsertable(null);
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateSpecifiedUnique() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumnImpl());
- basic.getColumn().setUnique(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedUnique());
- assertEquals(Boolean.TRUE, basic.getColumn().getUnique());
-
- //set name to null in the resource model
- basic.getColumn().setUnique(null);
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(basic.getColumn().getUnique());
-
- basic.getColumn().setUnique(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, basic.getColumn().getUnique());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedUnique() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedUnique(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, basic.getColumn().getUnique());
-
- //set name to null in the context model
- ormColumn.setSpecifiedUnique(null);
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateSpecifiedLength() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumnImpl());
- basic.getColumn().setLength(Integer.valueOf(8));
- assertEquals(Integer.valueOf(8), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(8), basic.getColumn().getLength());
-
- //set name to null in the resource model
- basic.getColumn().setLength(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn().getLength());
-
- basic.getColumn().setLength(Integer.valueOf(11));
- assertEquals(Integer.valueOf(11), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(11), basic.getColumn().getLength());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedLength() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedLength(Integer.valueOf(7));
- assertEquals(Integer.valueOf(7), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(7), basic.getColumn().getLength());
-
- //set name to null in the context model
- ormColumn.setSpecifiedLength(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateSpecifiedPrecision() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumnImpl());
- basic.getColumn().setPrecision(Integer.valueOf(8));
- assertEquals(Integer.valueOf(8), ormColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(8), basic.getColumn().getPrecision());
-
- //set name to null in the resource model
- basic.getColumn().setPrecision(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn().getPrecision());
-
- basic.getColumn().setPrecision(Integer.valueOf(11));
- assertEquals(Integer.valueOf(11), ormColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(11), basic.getColumn().getPrecision());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedPrecision() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedPrecision(Integer.valueOf(7));
- assertEquals(Integer.valueOf(7), ormColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(7), basic.getColumn().getPrecision());
-
- //set name to null in the context model
- ormColumn.setSpecifiedPrecision(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateSpecifiedScale() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumnImpl());
- basic.getColumn().setScale(Integer.valueOf(8));
- assertEquals(Integer.valueOf(8), ormColumn.getSpecifiedScale());
- assertEquals(Integer.valueOf(8), basic.getColumn().getScale());
-
- //set name to null in the resource model
- basic.getColumn().setScale(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn().getScale());
-
- basic.getColumn().setScale(Integer.valueOf(11));
- assertEquals(Integer.valueOf(11), ormColumn.getSpecifiedScale());
- assertEquals(Integer.valueOf(11), basic.getColumn().getScale());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedScale() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedScale(Integer.valueOf(7));
- assertEquals(Integer.valueOf(7), ormColumn.getSpecifiedScale());
- assertEquals(Integer.valueOf(7), basic.getColumn().getScale());
-
- //set name to null in the context model
- ormColumn.setSpecifiedScale(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
- }
-
- public void testVirtualColumnDefaults() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ListIterator<OrmPersistentAttribute> attributes = ormPersistentType.virtualAttributes();
- attributes.next();
-
- //virtual attrubte in orm.xml, java attribute has no Column annotation
- OrmPersistentAttribute namePersistentAttribute = attributes.next();
- OrmBasicMapping nameVirtualMapping = (OrmBasicMapping) namePersistentAttribute.getMapping();
- OrmColumn ormColumn = nameVirtualMapping.getColumn();
- assertEquals("name", ormColumn.getSpecifiedName());
- assertEquals(TYPE_NAME, 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());
- assertEquals(Column.DEFAULT_PRECISION, ormColumn.getSpecifiedPrecision());
- assertEquals(Column.DEFAULT_SCALE, ormColumn.getSpecifiedScale());
-
- //set Column annotation in Java
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("name").getMapping();
- javaBasicMapping.getColumn().setSpecifiedName("FOO");
- javaBasicMapping.getColumn().setSpecifiedTable("FOO_TABLE");
- javaBasicMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaBasicMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaBasicMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaBasicMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- javaBasicMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- javaBasicMapping.getColumn().setSpecifiedLength(Integer.valueOf(45));
- javaBasicMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaBasicMapping.getColumn().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);
- assertEquals("name", ormColumn.getSpecifiedName());
- assertEquals(TYPE_NAME, 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());
- assertEquals(Column.DEFAULT_PRECISION, ormColumn.getSpecifiedPrecision());
- assertEquals(Column.DEFAULT_SCALE, ormColumn.getSpecifiedScale());
-
- entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.FALSE);
- assertEquals("name", ormColumn.getSpecifiedName());
- assertEquals(TYPE_NAME, 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());
- assertEquals(Column.DEFAULT_PRECISION, ormColumn.getSpecifiedPrecision());
- assertEquals(Column.DEFAULT_SCALE, ormColumn.getSpecifiedScale());
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(null);
- assertEquals("name", ormColumn.getSpecifiedName());
- assertEquals(TYPE_NAME, 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());
- assertEquals(Column.DEFAULT_PRECISION, ormColumn.getSpecifiedPrecision());
- assertEquals(Column.DEFAULT_SCALE, ormColumn.getSpecifiedScale());
-
- //set metadata-complete false, orm.xml virtual column gets setting from java annotation
- entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- 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());
- }
-
- public void testNullColumnDefaults() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute namePersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "name");
-
- OrmBasicMapping nameVirtualMapping = (OrmBasicMapping) namePersistentAttribute.getMapping();
- OrmColumn ormColumn = nameVirtualMapping.getColumn();
-
- //set Column annotation in Java
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("name").getMapping();
- javaBasicMapping.getColumn().setSpecifiedName("FOO");
- javaBasicMapping.getColumn().setSpecifiedTable("FOO_TABLE");
- javaBasicMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaBasicMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaBasicMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaBasicMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- javaBasicMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- javaBasicMapping.getColumn().setSpecifiedLength(Integer.valueOf(45));
- javaBasicMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaBasicMapping.getColumn().setSpecifiedScale(Integer.valueOf(47));
-
-
- assertEquals("name", ormColumn.getDefaultName());
- assertEquals(TYPE_NAME, ormColumn.getDefaultTable());
- assertEquals(Boolean.TRUE, ormColumn.getDefaultInsertable());
- assertEquals(Boolean.TRUE, ormColumn.getDefaultUpdatable());
- assertEquals(Boolean.TRUE, ormColumn.getDefaultNullable());
- assertEquals(Boolean.FALSE, ormColumn.getDefaultUnique());
- assertEquals(Column.DEFAULT_LENGTH, ormColumn.getDefaultLength());
- assertEquals(Column.DEFAULT_PRECISION, ormColumn.getDefaultPrecision());
- assertEquals(Column.DEFAULT_SCALE, ormColumn.getDefaultScale());
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
- }
-
- public void testVirtualColumnTable() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ListIterator<OrmPersistentAttribute> attributes = ormPersistentType.virtualAttributes();
- attributes.next();
-
- //virtual attribute in orm.xml, java attribute has no Column annotation
- OrmPersistentAttribute namePersistentAttribute = attributes.next();
- OrmBasicMapping nameVirtualMapping = (OrmBasicMapping) namePersistentAttribute.getMapping();
- OrmColumn ormColumn = nameVirtualMapping.getColumn();
-
- assertEquals(TYPE_NAME, ormColumn.getSpecifiedTable());
-
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE");
- assertEquals("ORM_TABLE", ormColumn.getSpecifiedTable());
-
- //set Column table element in Java
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("name").getMapping();
- javaBasicMapping.getColumn().setSpecifiedTable("JAVA_TABLE");
- assertEquals("JAVA_TABLE", ormColumn.getSpecifiedTable());
-
- //make name persistent attribute not virtual
- namePersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "name");
- nameVirtualMapping = (OrmBasicMapping) namePersistentAttribute.getMapping();
- ormColumn = nameVirtualMapping.getColumn();
- assertNull(ormColumn.getSpecifiedTable());
- assertEquals("ORM_TABLE", ormColumn.getDefaultTable());
-
- }
-
-//public void testUpdateDefaultNameNoJava() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlEntity xmlEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertEquals("Foo", xmlEntity.getTable().getDefaultName());
-//}
-//
-//public void testUpdateDefaultNameFromParent() throws Exception {
-// createTestEntity();
-// createTestSubType();
-//
-// OrmPersistentType parentOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-// XmlEntity parentXmlEntity = (XmlEntity) parentOrmPersistentType.getMapping();
-// XmlEntity childXmlEntity = (XmlEntity) childOrmPersistentType.getMapping();
-//
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals(TYPE_NAME, childXmlEntity.getTable().getDefaultName());
-//
-// parentXmlEntity.getTable().setSpecifiedName("FOO");
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals("FOO", childXmlEntity.getTable().getDefaultName());
-//
-// parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals("AnnotationTestTypeChild", childXmlEntity.getTable().getDefaultName());
-//}
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmDiscriminatorColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmDiscriminatorColumnTests.java
deleted file mode 100644
index 797ee87ffd..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmDiscriminatorColumnTests.java
+++ /dev/null
@@ -1,338 +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.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.DiscriminatorType;
-import org.eclipse.jpt.core.context.orm.OrmDiscriminatorColumn;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-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.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class OrmDiscriminatorColumnTests extends ContextModelTestCase
-{
- public OrmDiscriminatorColumnTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- assertNull(ormColumn.getSpecifiedName());
- assertNull(entityResource.getDiscriminatorColumn());
-
- //set name in the resource model, verify context model updated
- entityResource.setDiscriminatorColumn(OrmFactory.eINSTANCE.createXmlDiscriminatorColumn());
- entityResource.getDiscriminatorColumn().setName("FOO");
- assertEquals("FOO", ormColumn.getSpecifiedName());
- assertEquals("FOO", entityResource.getDiscriminatorColumn().getName());
-
- //set name to null in the resource model
- entityResource.getDiscriminatorColumn().setName(null);
- assertNull(ormColumn.getSpecifiedName());
- assertNull(entityResource.getDiscriminatorColumn().getName());
-
- entityResource.getDiscriminatorColumn().setName("FOO");
- assertEquals("FOO", ormColumn.getSpecifiedName());
- assertEquals("FOO", entityResource.getDiscriminatorColumn().getName());
-
- entityResource.setDiscriminatorColumn(null);
- assertNull(ormColumn.getSpecifiedName());
- assertNull(entityResource.getDiscriminatorColumn());
- }
-
- public void testModifySpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- assertNull(ormColumn.getSpecifiedName());
- assertNull(entityResource.getDiscriminatorColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedName("foo");
- assertEquals("foo", ormColumn.getSpecifiedName());
- assertEquals("foo", entityResource.getDiscriminatorColumn().getName());
-
- //set name to null in the context model
- ormColumn.setSpecifiedName(null);
- assertNull(ormColumn.getSpecifiedName());
- assertNull(entityResource.getDiscriminatorColumn());
- }
-
-// public void testUpdateDefaultNameFromJavaTable() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// XmlEntity ormEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-//
-// ormEntity.javaEntity().getTable().setSpecifiedName("Foo");
-// assertEquals("Foo", ormEntity.getTable().getDefaultName());
-//
-// ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-//
-// ormEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-// ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-//
-// ormEntity.setSpecifiedMetadataComplete(null);
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-//
-// ormEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
-// assertEquals("Foo", ormEntity.getTable().getDefaultName());
-//
-// ormEntity.getTable().setSpecifiedName("Bar");
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-// }
-//
-// public void testUpdateDefaultNameNoJava() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlEntity ormEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertEquals("Foo", ormEntity.getTable().getDefaultName());
-// }
-//
-// public void testUpdateDefaultNameFromParent() throws Exception {
-// createTestEntity();
-// createTestSubType();
-//
-// OrmPersistentType parentOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-// XmlEntity parentXmlEntity = (XmlEntity) parentOrmPersistentType.getMapping();
-// XmlEntity childXmlEntity = (XmlEntity) childOrmPersistentType.getMapping();
-//
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals(TYPE_NAME, childXmlEntity.getTable().getDefaultName());
-//
-// parentXmlEntity.getTable().setSpecifiedName("FOO");
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals("FOO", childXmlEntity.getTable().getDefaultName());
-//
-// parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals("AnnotationTestTypeChild", childXmlEntity.getTable().getDefaultName());
-// }
-
- public void testUpdateSpecifiedLength() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(entityResource.getDiscriminatorColumn());
-
- //set name in the resource model, verify context model updated
- entityResource.setDiscriminatorColumn(OrmFactory.eINSTANCE.createXmlDiscriminatorColumn());
- entityResource.getDiscriminatorColumn().setLength(Integer.valueOf(8));
- assertEquals(Integer.valueOf(8), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(8), entityResource.getDiscriminatorColumn().getLength());
-
- //set name to null in the resource model
- entityResource.getDiscriminatorColumn().setLength(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(entityResource.getDiscriminatorColumn().getLength());
-
- entityResource.getDiscriminatorColumn().setLength(Integer.valueOf(11));
- assertEquals(Integer.valueOf(11), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(11), entityResource.getDiscriminatorColumn().getLength());
-
- entityResource.setDiscriminatorColumn(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(entityResource.getDiscriminatorColumn());
- }
-
- public void testModifySpecifiedLength() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(entityResource.getDiscriminatorColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedLength(Integer.valueOf(7));
- assertEquals(Integer.valueOf(7), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(7), entityResource.getDiscriminatorColumn().getLength());
-
- //set name to null in the context model
- ormColumn.setSpecifiedLength(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(entityResource.getDiscriminatorColumn());
- }
-
- public void testUpdateSpecifiedColumnDefinition() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- assertNull(ormColumn.getColumnDefinition());
- assertNull(entityResource.getDiscriminatorColumn());
-
- //set name in the resource model, verify context model updated
- entityResource.setDiscriminatorColumn(OrmFactory.eINSTANCE.createXmlDiscriminatorColumn());
- entityResource.getDiscriminatorColumn().setColumnDefinition("FOO");
- assertEquals("FOO", ormColumn.getColumnDefinition());
- assertEquals("FOO", entityResource.getDiscriminatorColumn().getColumnDefinition());
-
- //set name to null in the resource model
- entityResource.getDiscriminatorColumn().setColumnDefinition(null);
- assertNull(ormColumn.getColumnDefinition());
- assertNull(entityResource.getDiscriminatorColumn().getColumnDefinition());
-
- entityResource.getDiscriminatorColumn().setColumnDefinition("FOO");
- assertEquals("FOO", ormColumn.getColumnDefinition());
- assertEquals("FOO", entityResource.getDiscriminatorColumn().getColumnDefinition());
-
- entityResource.setDiscriminatorColumn(null);
- assertNull(ormColumn.getColumnDefinition());
- assertNull(entityResource.getDiscriminatorColumn());
- }
-
- public void testModifySpecifiedColumnDefinition() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- assertNull(ormColumn.getColumnDefinition());
- assertNull(entityResource.getDiscriminatorColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setColumnDefinition("foo");
- assertEquals("foo", ormColumn.getColumnDefinition());
- assertEquals("foo", entityResource.getDiscriminatorColumn().getColumnDefinition());
-
- //set name to null in the context model
- ormColumn.setColumnDefinition(null);
- assertNull(ormColumn.getColumnDefinition());
- assertNull(entityResource.getDiscriminatorColumn());
- }
-
- public void testUpdateSpecifiedDiscriminatorType() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- assertNull(ormColumn.getSpecifiedDiscriminatorType());
- assertNull(entityResource.getDiscriminatorColumn());
-
- //set discriminator type in the resource model, verify context model updated
- entityResource.setDiscriminatorColumn(OrmFactory.eINSTANCE.createXmlDiscriminatorColumn());
- entityResource.getDiscriminatorColumn().setDiscriminatorType(org.eclipse.jpt.core.resource.orm.DiscriminatorType.STRING);
- assertEquals(DiscriminatorType.STRING, ormColumn.getSpecifiedDiscriminatorType());
- assertEquals(org.eclipse.jpt.core.resource.orm.DiscriminatorType.STRING, entityResource.getDiscriminatorColumn().getDiscriminatorType());
-
- //set discriminator type to null in the resource model
- entityResource.getDiscriminatorColumn().setDiscriminatorType(null);
- assertNull(ormColumn.getSpecifiedDiscriminatorType());
- assertNull(entityResource.getDiscriminatorColumn().getDiscriminatorType());
-
- entityResource.getDiscriminatorColumn().setDiscriminatorType(org.eclipse.jpt.core.resource.orm.DiscriminatorType.CHAR);
- assertEquals(DiscriminatorType.CHAR, ormColumn.getSpecifiedDiscriminatorType());
- assertEquals(org.eclipse.jpt.core.resource.orm.DiscriminatorType.CHAR, entityResource.getDiscriminatorColumn().getDiscriminatorType());
-
- entityResource.setDiscriminatorColumn(null);
- assertNull(ormColumn.getSpecifiedDiscriminatorType());
- assertNull(entityResource.getDiscriminatorColumn());
- }
-
- public void testModifySpecifiedDiscriminatorType() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- assertNull(ormColumn.getSpecifiedDiscriminatorType());
- assertNull(entityResource.getDiscriminatorColumn());
-
- //set discriminator type in the context model, verify resource model modified
- ormColumn.setSpecifiedDiscriminatorType(DiscriminatorType.STRING);
- assertEquals(DiscriminatorType.STRING, ormColumn.getSpecifiedDiscriminatorType());
- assertEquals(org.eclipse.jpt.core.resource.orm.DiscriminatorType.STRING, entityResource.getDiscriminatorColumn().getDiscriminatorType());
-
- //set discriminator type to null in the context model
- ormColumn.setSpecifiedDiscriminatorType(null);
- assertNull(ormColumn.getSpecifiedDiscriminatorType());
- assertNull(entityResource.getDiscriminatorColumn());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEmbeddableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEmbeddableTests.java
deleted file mode 100644
index c1f8207037..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEmbeddableTests.java
+++ /dev/null
@@ -1,297 +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.core.tests.internal.context.orm;
-
-import java.util.ListIterator;
-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.orm.OrmEmbeddable;
-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.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-
-public class OrmEmbeddableTests extends ContextModelTestCase
-{
- public OrmEmbeddableTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- public void testUpdateClass() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable embeddableResource = ormResource().getEntityMappings().getEmbeddables().get(0);
- assertEquals("model.Foo", ormEmbeddable.getClass_());
- assertEquals("model.Foo", embeddableResource.getClassName());
-
- //set class in the resource model, verify context model updated
- embeddableResource.setClassName("com.Bar");
- assertEquals("com.Bar", ormEmbeddable.getClass_());
- assertEquals("com.Bar", embeddableResource.getClassName());
-
- //set class to null in the resource model
- embeddableResource.setClassName(null);
- assertNull(ormEmbeddable.getClass_());
- assertNull(embeddableResource.getClassName());
- }
-
- public void testModifyClass() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable embeddableResource = ormResource().getEntityMappings().getEmbeddables().get(0);
- assertEquals("model.Foo", ormEmbeddable.getClass_());
- assertEquals("model.Foo", embeddableResource.getClassName());
-
- //set class in the context model, verify resource model modified
- ormEmbeddable.setClass("com.Bar");
- assertEquals("com.Bar", ormEmbeddable.getClass_());
- assertEquals("com.Bar", embeddableResource.getClassName());
-
- //set class to null in the context model
- ormEmbeddable.setClass(null);
- assertNull(ormEmbeddable.getClass_());
- assertNull(embeddableResource.getClassName());
- }
- //TODO add tests for setting the className when the package is set on entity-mappings
-
- public void testUpdateSpecifiedAccess() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable embeddableResource = ormResource().getEntityMappings().getEmbeddables().get(0);
- assertNull(ormEmbeddable.getSpecifiedAccess());
- assertNull(embeddableResource.getAccess());
-
- //set access in the resource model, verify context model updated
- embeddableResource.setAccess(org.eclipse.jpt.core.resource.orm.AccessType.FIELD);
- assertEquals(AccessType.FIELD, ormEmbeddable.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.FIELD, embeddableResource.getAccess());
-
- //set access to null in the resource model
- embeddableResource.setAccess(null);
- assertNull(ormEmbeddable.getSpecifiedAccess());
- assertNull(embeddableResource.getAccess());
- }
-
- public void testModifySpecifiedAccess() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable embeddableResource = ormResource().getEntityMappings().getEmbeddables().get(0);
- assertNull(ormEmbeddable.getSpecifiedAccess());
- assertNull(embeddableResource.getAccess());
-
- //set access in the context model, verify resource model modified
- ormEmbeddable.setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, ormEmbeddable.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, embeddableResource.getAccess());
-
- //set access to null in the context model
- ormEmbeddable.setSpecifiedAccess(null);
- assertNull(ormEmbeddable.getSpecifiedAccess());
- assertNull(embeddableResource.getAccess());
- }
- //TODO test default access from
- //underlying java
- //persistence-unit-defaults
- //entity-mappings
- //with xml-mapping-metadata-complete set
-
- public void testUpdateSpecifiedMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable embeddableResource = ormResource().getEntityMappings().getEmbeddables().get(0);
- assertNull(embeddableResource.getMetadataComplete());
-
- //set metadata-complete in the resource model, verify context model updated
- embeddableResource.setMetadataComplete(true);
- assertTrue(ormEmbeddable.getSpecifiedMetadataComplete());
- assertTrue(embeddableResource.getMetadataComplete());
-
- //set access to false in the resource model
- embeddableResource.setMetadataComplete(false);
- assertFalse(ormEmbeddable.getSpecifiedMetadataComplete());
- assertFalse(embeddableResource.getMetadataComplete());
-
- embeddableResource.setMetadataComplete(null);
- assertNull(ormEmbeddable.getSpecifiedMetadataComplete());
- assertNull(embeddableResource.getMetadataComplete());
- }
-
- public void testModifySpecifiedMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable embeddableResource = ormResource().getEntityMappings().getEmbeddables().get(0);
- assertNull(embeddableResource.getMetadataComplete());
-
- //set access in the context model, verify resource model modified
- ormEmbeddable.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertTrue(ormEmbeddable.getSpecifiedMetadataComplete());
- assertTrue(embeddableResource.getMetadataComplete());
-
- //set access to null in the context model
- ormEmbeddable.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertFalse(ormEmbeddable.getSpecifiedMetadataComplete());
- assertFalse(embeddableResource.getMetadataComplete());
-
- ormEmbeddable.setSpecifiedMetadataComplete(null);
- assertNull(ormEmbeddable.getSpecifiedMetadataComplete());
- assertNull(embeddableResource.getMetadataComplete());
- }
-
- public void testUpdateDefaultMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable embeddableResource = ormResource().getEntityMappings().getEmbeddables().get(0);
- assertNull(ormEmbeddable.getSpecifiedMetadataComplete());
- assertFalse(ormEmbeddable.isDefaultMetadataComplete());
- assertNull(embeddableResource.getMetadataComplete());
-
- ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertTrue(ormEmbeddable.isDefaultMetadataComplete());
- assertNull(ormEmbeddable.getSpecifiedMetadataComplete());
- assertNull(embeddableResource.getMetadataComplete());
-
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertNull(ormEmbeddable.getSpecifiedMetadataComplete());
- assertFalse(ormEmbeddable.isDefaultMetadataComplete());
- assertNull(embeddableResource.getMetadataComplete());
- }
-
- public void testUpdateMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable embeddableResource = ormResource().getEntityMappings().getEmbeddables().get(0);
- assertNull(ormEmbeddable.getSpecifiedMetadataComplete());
- assertFalse(ormEmbeddable.isMetadataComplete());
- assertNull(embeddableResource.getMetadataComplete());
-
- ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertTrue(ormEmbeddable.isMetadataComplete());
- assertNull(ormEmbeddable.getSpecifiedMetadataComplete());
- assertNull(embeddableResource.getMetadataComplete());
-
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertFalse(ormEmbeddable.isMetadataComplete());
- assertNull(ormEmbeddable.getSpecifiedMetadataComplete());
- assertNull(embeddableResource.getMetadataComplete());
- }
-
- public void testMakeEmbeddableEntity() throws Exception {
- OrmPersistentType embeddablePersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable embeddable = (OrmEmbeddable) embeddablePersistentType.getMapping();
- embeddable.setSpecifiedAccess(AccessType.PROPERTY);
- embeddable.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- embeddablePersistentType.setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
-
- XmlEntity entity = ormResource().getEntityMappings().getEntities().get(0);
- assertEquals("model.Foo", entity.getClassName());
- assertEquals(Boolean.TRUE, entity.getMetadataComplete());
- assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, entity.getAccess());
- assertNull(entity.getDiscriminatorValue());
- assertNull(entity.getName());
-
- OrmEntity ormEntity = (OrmEntity) embeddablePersistentType.getMapping();
- assertEquals("model.Foo", ormEntity.getClass_());
- assertEquals(Boolean.TRUE, ormEntity.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, ormEntity.getSpecifiedAccess());
- }
-
- //test with 2 Embeddables, make the second one an Entity so it has to move to the front of the list
- public void testMakeEmbeddableEntity2() throws Exception {
- entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo2");
- OrmPersistentType embeddablePersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable embeddable = (OrmEmbeddable) embeddablePersistentType.getMapping();
- embeddable.setSpecifiedAccess(AccessType.PROPERTY);
- embeddable.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- embeddablePersistentType.setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
-
- XmlEntity entity = ormResource().getEntityMappings().getEntities().get(0);
- assertEquals("model.Foo", entity.getClassName());
- assertEquals(Boolean.TRUE, entity.getMetadataComplete());
- assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, entity.getAccess());
- assertNull(entity.getDiscriminatorValue());
- assertNull(entity.getName());
-
- OrmEntity ormEntity = (OrmEntity) embeddablePersistentType.getMapping();
- assertEquals("model.Foo", ormEntity.getClass_());
- assertEquals(Boolean.TRUE, ormEntity.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, ormEntity.getSpecifiedAccess());
-
- ListIterator<OrmPersistentType> persistentTypes = entityMappings().ormPersistentTypes();
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey());
- assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey());
- }
-
- public void testMakeEmbeddableMappedSuperclass() throws Exception {
- OrmPersistentType embeddablePersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable embeddable = (OrmEmbeddable) embeddablePersistentType.getMapping();
- embeddable.setSpecifiedAccess(AccessType.PROPERTY);
- embeddable.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- embeddablePersistentType.setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
-
- XmlMappedSuperclass mappedSuperclass = ormResource().getEntityMappings().getMappedSuperclasses().get(0);
- assertEquals("model.Foo", mappedSuperclass.getClassName());
- assertEquals(Boolean.TRUE, mappedSuperclass.getMetadataComplete());
- assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, mappedSuperclass.getAccess());
-
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) embeddablePersistentType.getMapping();
- assertEquals("model.Foo", ormMappedSuperclass.getClass_());
- assertEquals(Boolean.TRUE, ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, ormMappedSuperclass.getSpecifiedAccess());
- }
-
- //test with 2 Embeddables, make the second one a MappedSuperclass so it has to move to the front of the list
- public void testMakeEmbeddableMappedSuperclass2() throws Exception {
- entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo2");
- OrmPersistentType embeddablePersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable embeddable = (OrmEmbeddable) embeddablePersistentType.getMapping();
- embeddable.setSpecifiedAccess(AccessType.PROPERTY);
- embeddable.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- embeddablePersistentType.setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
-
- XmlMappedSuperclass mappedSuperclass = ormResource().getEntityMappings().getMappedSuperclasses().get(0);
- assertEquals("model.Foo", mappedSuperclass.getClassName());
- assertEquals(Boolean.TRUE, mappedSuperclass.getMetadataComplete());
- assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, mappedSuperclass.getAccess());
-
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) embeddablePersistentType.getMapping();
- assertEquals("model.Foo", ormMappedSuperclass.getClass_());
- assertEquals(Boolean.TRUE, ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, ormMappedSuperclass.getSpecifiedAccess());
-
- ListIterator<OrmPersistentType> persistentTypes = entityMappings().ormPersistentTypes();
- assertEquals(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey());
- assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEmbeddedIdMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEmbeddedIdMappingTests.java
deleted file mode 100644
index bb9a105277..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEmbeddedIdMappingTests.java
+++ /dev/null
@@ -1,874 +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.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.AttributeOverride;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-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.OneToOneMapping;
-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.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.core.context.orm.OrmColumn;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedMapping;
-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.resource.orm.XmlEmbeddedId;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class OrmEmbeddedIdMappingTests extends ContextModelTestCase
-{
- private static final String ATTRIBUTE_OVERRIDE_NAME = "city";
- private static final String ATTRIBUTE_OVERRIDE_COLUMN_NAME = "E_CITY";
-
- public OrmEmbeddedIdMappingTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- private ICompilationUnit createTestEntityEmbeddedIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDED_ID, JPA.ATTRIBUTE_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @EmbeddedId");
- sb.append(CR);
- sb.append(" @AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\", column=@Column(name=\"" + ATTRIBUTE_OVERRIDE_COLUMN_NAME + "\"))");
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Column(name=\"A_STATE\")").append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
-// public void testUpdateName() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedIdMapping");
-// XmlEmbeddedIdMapping xmlEmbeddedIdMapping = (XmlEmbeddedIdMapping) ormPersistentAttribute.getMapping();
-// EmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-//
-// assertEquals("embeddedIdMapping", xmlEmbeddedIdMapping.getName());
-// assertEquals("embeddedIdMapping", embeddedIdResource.getName());
-//
-// //set name in the resource model, verify context model updated
-// embeddedIdResource.setName("newName");
-// assertEquals("newName", xmlEmbeddedIdMapping.getName());
-// assertEquals("newName", embeddedIdResource.getName());
-//
-// //set name to null in the resource model
-// embeddedIdResource.setName(null);
-// assertNull(xmlEmbeddedIdMapping.getName());
-// assertNull(embeddedIdResource.getName());
-// }
-//
-// public void testModifyName() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedIdMapping");
-// XmlEmbeddedIdMapping xmlEmbeddedIdMapping = (XmlEmbeddedIdMapping) ormPersistentAttribute.getMapping();
-// EmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-//
-// assertEquals("embeddedIdMapping", xmlEmbeddedIdMapping.getName());
-// assertEquals("embeddedIdMapping", embeddedIdResource.getName());
-//
-// //set name in the context model, verify resource model updated
-// xmlEmbeddedIdMapping.setName("newName");
-// assertEquals("newName", xmlEmbeddedIdMapping.getName());
-// assertEquals("newName", embeddedIdResource.getName());
-//
-// //set name to null in the context model
-// xmlEmbeddedIdMapping.setName(null);
-// assertNull(xmlEmbeddedIdMapping.getName());
-// assertNull(embeddedIdResource.getName());
-// }
-//
-// public void testAddSpecifiedAttributeOverride() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedIdMapping");
-// XmlEmbeddedIdMapping xmlEmbeddedIdMapping = (XmlEmbeddedIdMapping) ormPersistentAttribute.getMapping();
-// EmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-//
-// XmlAttributeOverride attributeOverride = xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(0);
-// ormResource().save(null);
-// attributeOverride.setName("FOO");
-// ormResource().save(null);
-//
-// assertEquals("FOO", embeddedIdResource.getAttributeOverrides().get(0).getName());
-//
-// XmlAttributeOverride attributeOverride2 = xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(0);
-// ormResource().save(null);
-// attributeOverride2.setName("BAR");
-// ormResource().save(null);
-//
-// assertEquals("BAR", embeddedIdResource.getAttributeOverrides().get(0).getName());
-// assertEquals("FOO", embeddedIdResource.getAttributeOverrides().get(1).getName());
-//
-// XmlAttributeOverride attributeOverride3 = xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(1);
-// ormResource().save(null);
-// attributeOverride3.setName("BAZ");
-// ormResource().save(null);
-//
-// assertEquals("BAR", embeddedIdResource.getAttributeOverrides().get(0).getName());
-// assertEquals("BAZ", embeddedIdResource.getAttributeOverrides().get(1).getName());
-// assertEquals("FOO", embeddedIdResource.getAttributeOverrides().get(2).getName());
-//
-// ListIterator<XmlAttributeOverride> attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals(attributeOverride2, attributeOverrides.next());
-// assertEquals(attributeOverride3, attributeOverrides.next());
-// assertEquals(attributeOverride, attributeOverrides.next());
-//
-// attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals("BAR", attributeOverrides.next().getName());
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertEquals("FOO", attributeOverrides.next().getName());
-// }
-//
-// public void testRemoveSpecifiedAttributeOverride() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedIdMapping");
-// XmlEmbeddedIdMapping xmlEmbeddedIdMapping = (XmlEmbeddedIdMapping) ormPersistentAttribute.getMapping();
-// EmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-//
-// xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(0).setName("FOO");
-// xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(1).setName("BAR");
-// xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(2).setName("BAZ");
-//
-// assertEquals(3, embeddedIdResource.getAttributeOverrides().size());
-//
-// xmlEmbeddedIdMapping.removeSpecifiedAttributeOverride(0);
-// assertEquals(2, embeddedIdResource.getAttributeOverrides().size());
-// assertEquals("BAR", embeddedIdResource.getAttributeOverrides().get(0).getName());
-// assertEquals("BAZ", embeddedIdResource.getAttributeOverrides().get(1).getName());
-//
-// xmlEmbeddedIdMapping.removeSpecifiedAttributeOverride(0);
-// assertEquals(1, embeddedIdResource.getAttributeOverrides().size());
-// assertEquals("BAZ", embeddedIdResource.getAttributeOverrides().get(0).getName());
-//
-// xmlEmbeddedIdMapping.removeSpecifiedAttributeOverride(0);
-// assertEquals(0, embeddedIdResource.getAttributeOverrides().size());
-// }
-//
-// public void testMoveSpecifiedAttributeOverride() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedIdMapping");
-// XmlEmbeddedIdMapping xmlEmbeddedIdMapping = (XmlEmbeddedIdMapping) ormPersistentAttribute.getMapping();
-// EmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-//
-// xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(0).setName("FOO");
-// xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(1).setName("BAR");
-// xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(2).setName("BAZ");
-//
-// assertEquals(3, embeddedIdResource.getAttributeOverrides().size());
-//
-//
-// xmlEmbeddedIdMapping.moveSpecifiedAttributeOverride(2, 0);
-// ListIterator<XmlAttributeOverride> attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals("BAR", attributeOverrides.next().getName());
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertEquals("FOO", attributeOverrides.next().getName());
-//
-// assertEquals("BAR", embeddedIdResource.getAttributeOverrides().get(0).getName());
-// assertEquals("BAZ", embeddedIdResource.getAttributeOverrides().get(1).getName());
-// assertEquals("FOO", embeddedIdResource.getAttributeOverrides().get(2).getName());
-//
-//
-// xmlEmbeddedIdMapping.moveSpecifiedAttributeOverride(0, 1);
-// attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertEquals("BAR", attributeOverrides.next().getName());
-// assertEquals("FOO", attributeOverrides.next().getName());
-//
-// assertEquals("BAZ", embeddedIdResource.getAttributeOverrides().get(0).getName());
-// assertEquals("BAR", embeddedIdResource.getAttributeOverrides().get(1).getName());
-// assertEquals("FOO", embeddedIdResource.getAttributeOverrides().get(2).getName());
-// }
-//
-// public void testUpdateAttributeOverrides() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedIdMapping");
-// XmlEmbeddedIdMapping xmlEmbeddedIdMapping = (XmlEmbeddedIdMapping) ormPersistentAttribute.getMapping();
-// EmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-//
-// embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createAttributeOverrideImpl());
-// embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createAttributeOverrideImpl());
-// embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createAttributeOverrideImpl());
-//
-// embeddedIdResource.getAttributeOverrides().get(0).setName("FOO");
-// embeddedIdResource.getAttributeOverrides().get(1).setName("BAR");
-// embeddedIdResource.getAttributeOverrides().get(2).setName("BAZ");
-//
-// ListIterator<XmlAttributeOverride> attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals("FOO", attributeOverrides.next().getName());
-// assertEquals("BAR", attributeOverrides.next().getName());
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertFalse(attributeOverrides.hasNext());
-//
-// embeddedIdResource.getAttributeOverrides().move(2, 0);
-// attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals("BAR", attributeOverrides.next().getName());
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertEquals("FOO", attributeOverrides.next().getName());
-// assertFalse(attributeOverrides.hasNext());
-//
-// embeddedIdResource.getAttributeOverrides().move(0, 1);
-// attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertEquals("BAR", attributeOverrides.next().getName());
-// assertEquals("FOO", attributeOverrides.next().getName());
-// assertFalse(attributeOverrides.hasNext());
-//
-// embeddedIdResource.getAttributeOverrides().remove(1);
-// attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertEquals("FOO", attributeOverrides.next().getName());
-// assertFalse(attributeOverrides.hasNext());
-//
-// embeddedIdResource.getAttributeOverrides().remove(1);
-// attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertFalse(attributeOverrides.hasNext());
-//
-// embeddedIdResource.getAttributeOverrides().remove(0);
-// assertFalse(xmlEmbeddedIdMapping.specifiedAttributeOverrides().hasNext());
-// }
-
- public void testEmbeddedIdMorphToIdMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId");
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- AttributeOverride attributeOverride = embeddedIdMapping.specifiedAttributeOverrides().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("embeddedId", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedIdMorphToVersionMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId");
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- AttributeOverride attributeOverride = embeddedIdMapping.specifiedAttributeOverrides().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("embeddedId", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedIdMorphToTransientMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId");
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- AttributeOverride attributeOverride = embeddedIdMapping.specifiedAttributeOverrides().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("embeddedId", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedIdMorphToBasicMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId");
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- AttributeOverride attributeOverride = embeddedIdMapping.specifiedAttributeOverrides().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("embeddedId", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedIdMorphToEmbeddedMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId");
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- AttributeOverride attributeOverride = embeddedIdMapping.specifiedAttributeOverrides().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("embeddedId", ormPersistentAttribute.getMapping().getName());
- attributeOverride = ((EmbeddedMapping) ormPersistentAttribute.getMapping()).specifiedAttributeOverrides().next();
- assertEquals("override", attributeOverride.getName());
- assertEquals("OVERRIDE_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- }
-
- public void testEmbeddedIdMorphToOneToOneMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId");
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- AttributeOverride attributeOverride = embeddedIdMapping.specifiedAttributeOverrides().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("embeddedId", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedIdMorphToOneToManyMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId");
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- AttributeOverride attributeOverride = embeddedIdMapping.specifiedAttributeOverrides().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.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("embeddedId", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedIdMorphToManyToOneMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId");
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- AttributeOverride attributeOverride = embeddedIdMapping.specifiedAttributeOverrides().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("embeddedId", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedIdMorphToManyToManyMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId");
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- AttributeOverride attributeOverride = embeddedIdMapping.specifiedAttributeOverrides().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.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("embeddedId", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
- OrmEmbeddedIdMapping ormEmbeddedMapping = (OrmEmbeddedIdMapping) ormPersistentAttribute.getMapping();
- XmlEmbeddedId embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-
- assertEquals("embeddedMapping", ormEmbeddedMapping.getName());
- assertEquals("embeddedMapping", embeddedResource.getName());
-
- //set name in the resource model, verify context model updated
- embeddedResource.setName("newName");
- assertEquals("newName", ormEmbeddedMapping.getName());
- assertEquals("newName", embeddedResource.getName());
-
- //set name to null in the resource model
- embeddedResource.setName(null);
- assertNull(ormEmbeddedMapping.getName());
- assertNull(embeddedResource.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
- OrmEmbeddedIdMapping ormEmbeddedMapping = (OrmEmbeddedIdMapping) ormPersistentAttribute.getMapping();
- XmlEmbeddedId embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-
- assertEquals("embeddedMapping", ormEmbeddedMapping.getName());
- assertEquals("embeddedMapping", embeddedResource.getName());
-
- //set name in the context model, verify resource model updated
- ormEmbeddedMapping.setName("newName");
- assertEquals("newName", ormEmbeddedMapping.getName());
- assertEquals("newName", embeddedResource.getName());
-
- //set name to null in the context model
- ormEmbeddedMapping.setName(null);
- assertNull(ormEmbeddedMapping.getName());
- assertNull(embeddedResource.getName());
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
- OrmEmbeddedIdMapping ormEmbeddedIdMapping = (OrmEmbeddedIdMapping) ormPersistentAttribute.getMapping();
- XmlEmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
-
- embeddedIdResource.getAttributeOverrides().get(0).setName("FOO");
- embeddedIdResource.getAttributeOverrides().get(1).setName("BAR");
- embeddedIdResource.getAttributeOverrides().get(2).setName("BAZ");
-
- assertEquals(3, embeddedIdResource.getAttributeOverrides().size());
-
- ormEmbeddedIdMapping.moveSpecifiedAttributeOverride(2, 0);
- ListIterator<OrmAttributeOverride> attributeOverrides = ormEmbeddedIdMapping.specifiedAttributeOverrides();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAR", embeddedIdResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAZ", embeddedIdResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", embeddedIdResource.getAttributeOverrides().get(2).getName());
-
-
- ormEmbeddedIdMapping.moveSpecifiedAttributeOverride(0, 1);
- attributeOverrides = ormEmbeddedIdMapping.specifiedAttributeOverrides();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAZ", embeddedIdResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAR", embeddedIdResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", embeddedIdResource.getAttributeOverrides().get(2).getName());
- }
-
- public void testUpdateAttributeOverrides() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
- OrmEmbeddedIdMapping ormEmbeddedIdMapping = (OrmEmbeddedIdMapping) ormPersistentAttribute.getMapping();
- XmlEmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
-
- embeddedIdResource.getAttributeOverrides().get(0).setName("FOO");
- embeddedIdResource.getAttributeOverrides().get(1).setName("BAR");
- embeddedIdResource.getAttributeOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAttributeOverride> attributeOverrides = ormEmbeddedIdMapping.specifiedAttributeOverrides();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedIdResource.getAttributeOverrides().move(2, 0);
- attributeOverrides = ormEmbeddedIdMapping.specifiedAttributeOverrides();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedIdResource.getAttributeOverrides().move(0, 1);
- attributeOverrides = ormEmbeddedIdMapping.specifiedAttributeOverrides();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedIdResource.getAttributeOverrides().remove(1);
- attributeOverrides = ormEmbeddedIdMapping.specifiedAttributeOverrides();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedIdResource.getAttributeOverrides().remove(1);
- attributeOverrides = ormEmbeddedIdMapping.specifiedAttributeOverrides();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedIdResource.getAttributeOverrides().remove(0);
- assertFalse(ormEmbeddedIdMapping.specifiedAttributeOverrides().hasNext());
- }
-
-
- public void testEmbeddedMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityEmbeddedIdMapping();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "foo");
- assertEquals(3, ormPersistentType.virtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- OrmEmbeddedIdMapping ormEmbeddedIdMapping = (OrmEmbeddedIdMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("foo", ormEmbeddedIdMapping.getName());
-
-
- assertFalse(ormEmbeddedIdMapping.specifiedAttributeOverrides().hasNext());
- assertFalse(ormEmbeddedIdMapping.virtualAttributeOverrides().hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestEntityEmbeddedIdMapping();
- createTestEmbeddableAddress();
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType persistentType2 = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //embedded mapping is virtual, specified attribute overrides should exist
- OrmEmbeddedIdMapping embeddedIdMapping = (OrmEmbeddedIdMapping) persistentType.getAttributeNamed("address").getMapping();
- assertEquals(4, embeddedIdMapping.attributeOverridesSize());
- assertEquals(0, embeddedIdMapping.virtualAttributeOverridesSize());
- assertEquals(4, embeddedIdMapping.specifiedAttributeOverridesSize());
- ListIterator<OrmAttributeOverride> specifiedAttributeOverrides = embeddedIdMapping.specifiedAttributeOverrides();
- OrmAttributeOverride attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("id", attributeOverride.getName());
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("state", attributeOverride.getName());
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("zip", attributeOverride.getName());
-
- JavaEmbeddedIdMapping javaEmbeddedIdMapping = (JavaEmbeddedIdMapping) embeddedIdMapping.getJavaPersistentAttribute().getMapping();
- javaEmbeddedIdMapping.virtualAttributeOverrides().next().setVirtual(false);
- javaEmbeddedIdMapping.specifiedAttributeOverrides().next().getColumn().setSpecifiedName("FOO_COLUMN");
- javaEmbeddedIdMapping.specifiedAttributeOverrides().next().getColumn().setSpecifiedTable("FOO_TABLE");
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) persistentType2.getJavaPersistentType().getAttributeNamed("state").getMapping();
- javaBasicMapping.getColumn().setSpecifiedName("MY_STATE_COLUMN");
- assertEquals(4, embeddedIdMapping.attributeOverridesSize());
- assertEquals(0, embeddedIdMapping.virtualAttributeOverridesSize());
- assertEquals(4, embeddedIdMapping.specifiedAttributeOverridesSize());
- specifiedAttributeOverrides = embeddedIdMapping.specifiedAttributeOverrides();
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- assertEquals("FOO_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- assertEquals("FOO_TABLE", attributeOverride.getColumn().getSpecifiedTable());
-
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("id", attributeOverride.getName());
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("state", attributeOverride.getName());
- assertEquals("MY_STATE_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("zip", attributeOverride.getName());
-
-
-
- //embedded mapping is specified, virtual attribute overrides should exist
- persistentType.getAttributeNamed("address").makeSpecified();
- embeddedIdMapping = (OrmEmbeddedIdMapping) persistentType.getAttributeNamed("address").getMapping();
- assertEquals(4, embeddedIdMapping.attributeOverridesSize());
- assertEquals(4, embeddedIdMapping.virtualAttributeOverridesSize());
- assertEquals(0, embeddedIdMapping.specifiedAttributeOverridesSize());
- ListIterator<OrmAttributeOverride> virtualAttributeOverrides = embeddedIdMapping.virtualAttributeOverrides();
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- assertEquals("city", attributeOverride.getColumn().getDefaultName());
- assertEquals(TYPE_NAME, attributeOverride.getColumn().getDefaultTable());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("state", attributeOverride.getName());
- assertEquals("MY_STATE_COLUMN", attributeOverride.getColumn().getDefaultName());
- assertEquals(TYPE_NAME, attributeOverride.getColumn().getDefaultTable());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", attributeOverride.getName());
-
- //set one of the virtual attribute overrides to specified, verify others are still virtual
- embeddedIdMapping.virtualAttributeOverrides().next().setVirtual(false);
-
- assertEquals(4, embeddedIdMapping.attributeOverridesSize());
- assertEquals(1, embeddedIdMapping.specifiedAttributeOverridesSize());
- assertEquals(3, embeddedIdMapping.virtualAttributeOverridesSize());
- assertEquals("id", embeddedIdMapping.specifiedAttributeOverrides().next().getName());
- virtualAttributeOverrides = embeddedIdMapping.virtualAttributeOverrides();
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("state", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", attributeOverride.getName());
- }
-
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityEmbeddedIdMapping();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- OrmEmbeddedIdMapping ormEmbeddedIdMapping = (OrmEmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormEmbeddedIdMapping.getName());
-
- assertEquals(4, ormEmbeddedIdMapping.specifiedAttributeOverridesSize());
- assertEquals(0, ormEmbeddedIdMapping.virtualAttributeOverridesSize());
- ListIterator<OrmAttributeOverride> ormAttributeOverrides = ormEmbeddedIdMapping.specifiedAttributeOverrides();
-
- OrmAttributeOverride ormAttributeOverride = ormAttributeOverrides.next();
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, ormAttributeOverride.getName());
- OrmColumn ormColumn = ormAttributeOverride.getColumn();
- assertEquals(ATTRIBUTE_OVERRIDE_COLUMN_NAME, ormColumn.getSpecifiedName());
-
-
- ormAttributeOverride = ormAttributeOverrides.next();
- assertEquals("id", ormAttributeOverride.getName());
- ormColumn = ormAttributeOverride.getColumn();
- assertEquals("id", ormColumn.getSpecifiedName());
-
- ormAttributeOverride = ormAttributeOverrides.next();
- assertEquals("state", ormAttributeOverride.getName());
- ormColumn = ormAttributeOverride.getColumn();
- assertEquals("A_STATE", ormColumn.getSpecifiedName());
-
- ormAttributeOverride = ormAttributeOverrides.next();
- assertEquals("zip", ormAttributeOverride.getName());
- ormColumn = ormAttributeOverride.getColumn();
- assertEquals("zip", ormColumn.getSpecifiedName());
-
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityEmbeddedIdMapping();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- //will be an OrmEmbeddedMapping instead of OrmEmbeddedIdMapping since that is the default
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormEmbeddedMapping.getName());
-
- //TODO
-// assertEquals(4, ormEmbeddedIdMapping.specifiedAttributeOverridesSize());
-// assertEquals(0, CollectionTools.size(ormEmbeddedIdMapping.defaultAttributeOverrides()));
-// ListIterator<XmlAttributeOverride> ormAttributeOverrides = ormEmbeddedIdMapping.specifiedAttributeOverrides();
-//
-// XmlAttributeOverride ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals(ATTRIBUTE_OVERRIDE_NAME, ormAttributeOverride.getName());
-// XmlColumn xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("city", xmlColumn.getSpecifiedName());
-//// assertEquals(Boolean.TRUE, xmlColumn.getSpecifiedUnique());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedNullable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedInsertable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedUpdatable());
-//// assertEquals("COLUMN_DEFINITION", xmlColumn.getColumnDefinition());
-//// assertEquals("MY_TABLE", xmlColumn.getSpecifiedTable());
-//// assertEquals(Integer.valueOf(5), xmlColumn.getSpecifiedLength());
-//// assertEquals(Integer.valueOf(6), xmlColumn.getSpecifiedPrecision());
-//// assertEquals(Integer.valueOf(7), xmlColumn.getSpecifiedScale());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("id", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("id", xmlColumn.getSpecifiedName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("state", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("state", xmlColumn.getSpecifiedName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("zip", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("zip", xmlColumn.getSpecifiedName());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "address");
- assertEquals(2, ormPersistentType.virtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- OrmEmbeddedIdMapping ormEmbeddedIdMapping = (OrmEmbeddedIdMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("address", ormEmbeddedIdMapping.getName());
-
- assertEquals(0, ormEmbeddedIdMapping.specifiedAttributeOverridesSize());
- //TODO
-// assertEquals(4, CollectionTools.size(ormEmbeddedIdMapping.defaultAttributeOverrides()));
-// ListIterator<XmlAttributeOverride> ormAttributeOverrides = ormEmbeddedIdMapping.defaultAttributeOverrides();
-//
-// XmlAttributeOverride ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals(ATTRIBUTE_OVERRIDE_NAME, ormAttributeOverride.getName());
-// XmlColumn xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("city", xmlColumn.getDefaultName());
-//// assertEquals(Boolean.TRUE, xmlColumn.getSpecifiedUnique());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedNullable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedInsertable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedUpdatable());
-//// assertEquals("COLUMN_DEFINITION", xmlColumn.getColumnDefinition());
-//// assertEquals("MY_TABLE", xmlColumn.getSpecifiedTable());
-//// assertEquals(Integer.valueOf(5), xmlColumn.getSpecifiedLength());
-//// assertEquals(Integer.valueOf(6), xmlColumn.getSpecifiedPrecision());
-//// assertEquals(Integer.valueOf(7), xmlColumn.getSpecifiedScale());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("id", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("id", xmlColumn.getDefaultName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("state", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("state", xmlColumn.getDefaultName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("zip", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("zip", xmlColumn.getDefaultName());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEmbeddedMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEmbeddedMappingTests.java
deleted file mode 100644
index 7083bc3b88..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEmbeddedMappingTests.java
+++ /dev/null
@@ -1,743 +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.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.AttributeOverride;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-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.OneToOneMapping;
-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.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.core.context.orm.OrmColumn;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedMapping;
-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.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class OrmEmbeddedMappingTests extends ContextModelTestCase
-{
- private static final String ATTRIBUTE_OVERRIDE_NAME = "city";
- private static final String ATTRIBUTE_OVERRIDE_COLUMN_NAME = "E_CITY";
-
- public OrmEmbeddedMappingTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- private ICompilationUnit createTestEntityEmbeddedMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDED, JPA.ATTRIBUTE_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @Embedded");
- sb.append(CR);
- sb.append(" @AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\", column=@Column(name=\"" + ATTRIBUTE_OVERRIDE_COLUMN_NAME + "\"))");
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Column(name=\"A_STATE\")").append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- assertEquals("embeddedMapping", ormEmbeddedMapping.getName());
- assertEquals("embeddedMapping", embeddedResource.getName());
-
- //set name in the resource model, verify context model updated
- embeddedResource.setName("newName");
- assertEquals("newName", ormEmbeddedMapping.getName());
- assertEquals("newName", embeddedResource.getName());
-
- //set name to null in the resource model
- embeddedResource.setName(null);
- assertNull(ormEmbeddedMapping.getName());
- assertNull(embeddedResource.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- assertEquals("embeddedMapping", ormEmbeddedMapping.getName());
- assertEquals("embeddedMapping", embeddedResource.getName());
-
- //set name in the context model, verify resource model updated
- ormEmbeddedMapping.setName("newName");
- assertEquals("newName", ormEmbeddedMapping.getName());
- assertEquals("newName", embeddedResource.getName());
-
- //set name to null in the context model
- ormEmbeddedMapping.setName(null);
- assertNull(ormEmbeddedMapping.getName());
- assertNull(embeddedResource.getName());
- }
-
-// public void testAddSpecifiedAttributeOverride() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
-// OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
-// XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-//
-// OrmAttributeOverride attributeOverride = ormEmbeddedMapping.addSpecifiedAttributeOverride(0);
-// attributeOverride.setName("FOO");
-//
-// assertEquals("FOO", embeddedResource.getAttributeOverrides().get(0).getName());
-//
-// OrmAttributeOverride attributeOverride2 = ormEmbeddedMapping.addSpecifiedAttributeOverride(0);
-// attributeOverride2.setName("BAR");
-//
-// assertEquals("BAR", embeddedResource.getAttributeOverrides().get(0).getName());
-// assertEquals("FOO", embeddedResource.getAttributeOverrides().get(1).getName());
-//
-// OrmAttributeOverride attributeOverride3 = ormEmbeddedMapping.addSpecifiedAttributeOverride(1);
-// attributeOverride3.setName("BAZ");
-//
-// assertEquals("BAR", embeddedResource.getAttributeOverrides().get(0).getName());
-// assertEquals("BAZ", embeddedResource.getAttributeOverrides().get(1).getName());
-// assertEquals("FOO", embeddedResource.getAttributeOverrides().get(2).getName());
-//
-// ListIterator<OrmAttributeOverride> attributeOverrides = ormEmbeddedMapping.specifiedAttributeOverrides();
-// assertEquals(attributeOverride2, attributeOverrides.next());
-// assertEquals(attributeOverride3, attributeOverrides.next());
-// assertEquals(attributeOverride, attributeOverrides.next());
-//
-// attributeOverrides = ormEmbeddedMapping.specifiedAttributeOverrides();
-// assertEquals("BAR", attributeOverrides.next().getName());
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertEquals("FOO", attributeOverrides.next().getName());
-// }
-//
-// public void testRemoveSpecifiedAttributeOverride() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
-// OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
-// XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-//
-// ormEmbeddedMapping.addSpecifiedAttributeOverride(0).setName("FOO");
-// ormEmbeddedMapping.addSpecifiedAttributeOverride(1).setName("BAR");
-// ormEmbeddedMapping.addSpecifiedAttributeOverride(2).setName("BAZ");
-//
-// assertEquals(3, embeddedResource.getAttributeOverrides().size());
-//
-// ormEmbeddedMapping.removeSpecifiedAttributeOverride(0);
-// assertEquals(2, embeddedResource.getAttributeOverrides().size());
-// assertEquals("BAR", embeddedResource.getAttributeOverrides().get(0).getName());
-// assertEquals("BAZ", embeddedResource.getAttributeOverrides().get(1).getName());
-//
-// ormEmbeddedMapping.removeSpecifiedAttributeOverride(0);
-// assertEquals(1, embeddedResource.getAttributeOverrides().size());
-// assertEquals("BAZ", embeddedResource.getAttributeOverrides().get(0).getName());
-//
-// ormEmbeddedMapping.removeSpecifiedAttributeOverride(0);
-// assertEquals(0, embeddedResource.getAttributeOverrides().size());
-// }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
-
- embeddedResource.getAttributeOverrides().get(0).setName("FOO");
- embeddedResource.getAttributeOverrides().get(1).setName("BAR");
- embeddedResource.getAttributeOverrides().get(2).setName("BAZ");
-
- assertEquals(3, embeddedResource.getAttributeOverrides().size());
-
- ormEmbeddedMapping.moveSpecifiedAttributeOverride(2, 0);
- ListIterator<OrmAttributeOverride> attributeOverrides = ormEmbeddedMapping.specifiedAttributeOverrides();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAR", embeddedResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAZ", embeddedResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", embeddedResource.getAttributeOverrides().get(2).getName());
-
-
- ormEmbeddedMapping.moveSpecifiedAttributeOverride(0, 1);
- attributeOverrides = ormEmbeddedMapping.specifiedAttributeOverrides();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAZ", embeddedResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAR", embeddedResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", embeddedResource.getAttributeOverrides().get(2).getName());
- }
-
- public void testUpdateAttributeOverrides() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
-
- embeddedResource.getAttributeOverrides().get(0).setName("FOO");
- embeddedResource.getAttributeOverrides().get(1).setName("BAR");
- embeddedResource.getAttributeOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAttributeOverride> attributeOverrides = ormEmbeddedMapping.specifiedAttributeOverrides();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().move(2, 0);
- attributeOverrides = ormEmbeddedMapping.specifiedAttributeOverrides();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().move(0, 1);
- attributeOverrides = ormEmbeddedMapping.specifiedAttributeOverrides();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().remove(1);
- attributeOverrides = ormEmbeddedMapping.specifiedAttributeOverrides();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().remove(1);
- attributeOverrides = ormEmbeddedMapping.specifiedAttributeOverrides();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().remove(0);
- assertFalse(ormEmbeddedMapping.specifiedAttributeOverrides().hasNext());
- }
-
-
- public void testEmbeddedMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityEmbeddedMapping();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "foo");
- assertEquals(3, ormPersistentType.virtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("foo", ormEmbeddedMapping.getName());
-
-
- assertFalse(ormEmbeddedMapping.specifiedAttributeOverrides().hasNext());
- assertFalse(ormEmbeddedMapping.virtualAttributeOverrides().hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestEntityEmbeddedMapping();
- createTestEmbeddableAddress();
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType persistentType2 = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //embedded mapping is virtual, specified attribute overrides should exist
- OrmEmbeddedMapping embeddedMapping = (OrmEmbeddedMapping) persistentType.getAttributeNamed("address").getMapping();
- assertEquals(4, embeddedMapping.attributeOverridesSize());
- assertEquals(0, embeddedMapping.virtualAttributeOverridesSize());
- assertEquals(4, embeddedMapping.specifiedAttributeOverridesSize());
- ListIterator<OrmAttributeOverride> specifiedAttributeOverrides = embeddedMapping.specifiedAttributeOverrides();
- OrmAttributeOverride attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("id", attributeOverride.getName());
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("state", attributeOverride.getName());
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("zip", attributeOverride.getName());
-
- JavaEmbeddedMapping javaEmbeddedMapping = (JavaEmbeddedMapping) embeddedMapping.getJavaPersistentAttribute().getMapping();
- javaEmbeddedMapping.specifiedAttributeOverrides().next().getColumn().setSpecifiedName("FOO_COLUMN");
- javaEmbeddedMapping.specifiedAttributeOverrides().next().getColumn().setSpecifiedTable("FOO_TABLE");
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) persistentType2.getJavaPersistentType().getAttributeNamed("state").getMapping();
- javaBasicMapping.getColumn().setSpecifiedName("MY_STATE_COLUMN");
- assertEquals(4, embeddedMapping.attributeOverridesSize());
- assertEquals(0, embeddedMapping.virtualAttributeOverridesSize());
- assertEquals(4, embeddedMapping.specifiedAttributeOverridesSize());
- specifiedAttributeOverrides = embeddedMapping.specifiedAttributeOverrides();
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- assertEquals("FOO_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- assertEquals("FOO_TABLE", attributeOverride.getColumn().getSpecifiedTable());
-
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("id", attributeOverride.getName());
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("state", attributeOverride.getName());
- assertEquals("MY_STATE_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("zip", attributeOverride.getName());
-
-
-
- //embedded mapping is specified, virtual attribute overrides should exist
- persistentType.getAttributeNamed("address").makeSpecified();
- ormResource().save(null);
- embeddedMapping = (OrmEmbeddedMapping) persistentType.getAttributeNamed("address").getMapping();
- assertEquals(4, embeddedMapping.attributeOverridesSize());
- assertEquals(4, embeddedMapping.virtualAttributeOverridesSize());
- assertEquals(0, embeddedMapping.specifiedAttributeOverridesSize());
- ListIterator<OrmAttributeOverride> virtualAttributeOverrides = embeddedMapping.virtualAttributeOverrides();
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- assertEquals("city", attributeOverride.getColumn().getDefaultName());
- assertEquals(TYPE_NAME, attributeOverride.getColumn().getDefaultTable());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("state", attributeOverride.getName());
- assertEquals("MY_STATE_COLUMN", attributeOverride.getColumn().getDefaultName());
- assertEquals(TYPE_NAME, attributeOverride.getColumn().getDefaultTable());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", attributeOverride.getName());
-
- //set one of the virtual attribute overrides to specified, verify others are still virtual
- embeddedMapping.virtualAttributeOverrides().next().setVirtual(false);
-
- assertEquals(4, embeddedMapping.attributeOverridesSize());
- assertEquals(1, embeddedMapping.specifiedAttributeOverridesSize());
- assertEquals(3, embeddedMapping.virtualAttributeOverridesSize());
- assertEquals("id", embeddedMapping.specifiedAttributeOverrides().next().getName());
- virtualAttributeOverrides = embeddedMapping.virtualAttributeOverrides();
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("state", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", attributeOverride.getName());
- }
-
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityEmbeddedMapping();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormEmbeddedMapping.getName());
-
- assertEquals(4, ormEmbeddedMapping.specifiedAttributeOverridesSize());
- assertEquals(0, ormEmbeddedMapping.virtualAttributeOverridesSize());
- ListIterator<OrmAttributeOverride> ormAttributeOverrides = ormEmbeddedMapping.specifiedAttributeOverrides();
-
- OrmAttributeOverride ormAttributeOverride = ormAttributeOverrides.next();
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, ormAttributeOverride.getName());
- OrmColumn ormColumn = ormAttributeOverride.getColumn();
- assertEquals(ATTRIBUTE_OVERRIDE_COLUMN_NAME, ormColumn.getSpecifiedName());
-
-
- ormAttributeOverride = ormAttributeOverrides.next();
- assertEquals("id", ormAttributeOverride.getName());
- ormColumn = ormAttributeOverride.getColumn();
- assertEquals("id", ormColumn.getSpecifiedName());
-
- ormAttributeOverride = ormAttributeOverrides.next();
- assertEquals("state", ormAttributeOverride.getName());
- ormColumn = ormAttributeOverride.getColumn();
- assertEquals("A_STATE", ormColumn.getSpecifiedName());
-
- ormAttributeOverride = ormAttributeOverrides.next();
- assertEquals("zip", ormAttributeOverride.getName());
- ormColumn = ormAttributeOverride.getColumn();
- assertEquals("zip", ormColumn.getSpecifiedName());
-
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityEmbeddedMapping();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormEmbeddedMapping.getName());
-
- //TODO
-// assertEquals(4, ormEmbeddedMapping.specifiedAttributeOverridesSize());
-// assertEquals(0, CollectionTools.size(ormEmbeddedMapping.defaultAttributeOverrides()));
-// ListIterator<XmlAttributeOverride> ormAttributeOverrides = ormEmbeddedMapping.specifiedAttributeOverrides();
-//
-// XmlAttributeOverride ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals(ATTRIBUTE_OVERRIDE_NAME, ormAttributeOverride.getName());
-// XmlColumn xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("city", xmlColumn.getSpecifiedName());
-//// assertEquals(Boolean.TRUE, xmlColumn.getSpecifiedUnique());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedNullable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedInsertable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedUpdatable());
-//// assertEquals("COLUMN_DEFINITION", xmlColumn.getColumnDefinition());
-//// assertEquals("MY_TABLE", xmlColumn.getSpecifiedTable());
-//// assertEquals(Integer.valueOf(5), xmlColumn.getSpecifiedLength());
-//// assertEquals(Integer.valueOf(6), xmlColumn.getSpecifiedPrecision());
-//// assertEquals(Integer.valueOf(7), xmlColumn.getSpecifiedScale());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("id", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("id", xmlColumn.getSpecifiedName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("state", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("state", xmlColumn.getSpecifiedName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("zip", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("zip", xmlColumn.getSpecifiedName());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "address");
- assertEquals(2, ormPersistentType.virtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("address", ormEmbeddedMapping.getName());
-
- assertEquals(0, ormEmbeddedMapping.specifiedAttributeOverridesSize());
- //TODO
-// assertEquals(4, CollectionTools.size(ormEmbeddedMapping.defaultAttributeOverrides()));
-// ListIterator<XmlAttributeOverride> ormAttributeOverrides = ormEmbeddedMapping.defaultAttributeOverrides();
-//
-// XmlAttributeOverride ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals(ATTRIBUTE_OVERRIDE_NAME, ormAttributeOverride.getName());
-// XmlColumn xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("city", xmlColumn.getDefaultName());
-//// assertEquals(Boolean.TRUE, xmlColumn.getSpecifiedUnique());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedNullable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedInsertable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedUpdatable());
-//// assertEquals("COLUMN_DEFINITION", xmlColumn.getColumnDefinition());
-//// assertEquals("MY_TABLE", xmlColumn.getSpecifiedTable());
-//// assertEquals(Integer.valueOf(5), xmlColumn.getSpecifiedLength());
-//// assertEquals(Integer.valueOf(6), xmlColumn.getSpecifiedPrecision());
-//// assertEquals(Integer.valueOf(7), xmlColumn.getSpecifiedScale());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("id", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("id", xmlColumn.getDefaultName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("state", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("state", xmlColumn.getDefaultName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("zip", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("zip", xmlColumn.getDefaultName());
- }
-
-
- public void testEmbeddedMorphToIdMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- AttributeOverride attributeOverride = embeddedMapping.specifiedAttributeOverrides().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToVersionMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- AttributeOverride attributeOverride = embeddedMapping.specifiedAttributeOverrides().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToTransientMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- AttributeOverride attributeOverride = embeddedMapping.specifiedAttributeOverrides().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToBasicMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- AttributeOverride attributeOverride = embeddedMapping.specifiedAttributeOverrides().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- AttributeOverride attributeOverride = embeddedMapping.specifiedAttributeOverrides().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- attributeOverride = ((EmbeddedIdMapping) ormPersistentAttribute.getMapping()).specifiedAttributeOverrides().next();
- assertEquals("override", attributeOverride.getName());
- assertEquals("OVERRIDE_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- }
-
- public void testEmbeddedMorphToOneToOneMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- AttributeOverride attributeOverride = embeddedMapping.specifiedAttributeOverrides().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToOneToManyMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- AttributeOverride attributeOverride = embeddedMapping.specifiedAttributeOverrides().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.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("embedded", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToManyToOneMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- AttributeOverride attributeOverride = embeddedMapping.specifiedAttributeOverrides().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.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("embedded", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToManyToManyMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- AttributeOverride attributeOverride = embeddedMapping.specifiedAttributeOverrides().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEntityTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEntityTests.java
deleted file mode 100644
index 2ec0ffca80..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEntityTests.java
+++ /dev/null
@@ -1,2224 +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.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.AccessType;
-import org.eclipse.jpt.core.context.InheritanceType;
-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.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverride;
-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.OrmMappedSuperclass;
-import org.eclipse.jpt.core.context.orm.OrmNamedNativeQuery;
-import org.eclipse.jpt.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmSecondaryTable;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class OrmEntityTests extends ContextModelTestCase
-{
-
- protected static final String CHILD_TYPE_NAME = "AnnotationTestTypeChild";
- protected static final String FULLY_QUALIFIED_CHILD_TYPE_NAME = PACKAGE_NAME + "." + CHILD_TYPE_NAME;
-
- public OrmEntityTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- private ICompilationUnit createTestEntityDefaultFieldAccess() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityFieldAccess() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityPropertyAccess() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append(CHILD_TYPE_NAME).append(" ");
- sb.append("extends ").append(TYPE_NAME).append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- private void createTestSubTypeUnmapped() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public class ").append(CHILD_TYPE_NAME).append(" ");
- sb.append("extends ").append(TYPE_NAME).append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.ONE_TO_ONE);
- }
- @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(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address2;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- private void createTestAbstractType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public abstract class ").append(TYPE_NAME).append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, FILE_NAME, sourceWriter);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedName());
- assertNull(entityResource.getName());
-
- //set name in the resource model, verify context model updated
- entityResource.setName("foo");
- assertEquals("foo", ormEntity.getSpecifiedName());
- assertEquals("foo", entityResource.getName());
-
- //set name to null in the resource model
- entityResource.setName(null);
- assertNull(ormEntity.getSpecifiedName());
- assertNull(entityResource.getName());
- }
-
- public void testModifySpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedName());
- assertNull(entityResource.getName());
-
- //set name in the context model, verify resource model modified
- ormEntity.setSpecifiedName("foo");
- assertEquals("foo", ormEntity.getSpecifiedName());
- assertEquals("foo", entityResource.getName());
-
- //set name to null in the context model
- ormEntity.setSpecifiedName(null);
- assertNull(ormEntity.getSpecifiedName());
- assertNull(entityResource.getName());
- }
-
- public void testUpdateDefaultName() throws Exception {
- createTestEntityFieldAccess();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertEquals(TYPE_NAME, ormEntity.getDefaultName());
-
- ormEntity.getJavaEntity().setSpecifiedName("Foo");
- //xml default entity name comes from java
- assertEquals("Foo", ormEntity.getDefaultName());
-
- //set class in the resource model, verify context model updated
- entityResource.setClassName("com.Bar");
- assertEquals("Bar", ormEntity.getDefaultName());
-
- //set class to null in the resource model
- entityResource.setClassName(null);
- assertNull(ormEntity.getDefaultName());
-
- entityResource.setClassName(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals("Foo", ormEntity.getDefaultName());
- entityResource.setMetadataComplete(Boolean.TRUE);
- assertEquals(TYPE_NAME, ormEntity.getDefaultName());
-
- ormEntity.getJavaEntity().setSpecifiedName("Foo1");
- assertEquals(TYPE_NAME, ormEntity.getDefaultName());
-
- entityResource.setMetadataComplete(null);
- assertEquals("Foo1", ormEntity.getDefaultName());
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertEquals("Foo", ormEntity.getName());
-
- //set class in the resource model, verify context model updated
- entityResource.setClassName("com.Bar");
- assertEquals("Bar", ormEntity.getName());
-
- entityResource.setName("Baz");
- assertEquals("Baz", ormEntity.getName());
-
- //set class to null in the resource model
- entityResource.setClassName(null);
- assertEquals("Baz", ormEntity.getName());
-
- entityResource.setName(null);
- assertNull(ormEntity.getName());
- }
-
- public void testUpdateClass() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertEquals("model.Foo", ormEntity.getClass_());
- assertEquals("model.Foo", entityResource.getClassName());
-
- //set class in the resource model, verify context model updated
- entityResource.setClassName("com.Bar");
- assertEquals("com.Bar", ormEntity.getClass_());
- assertEquals("com.Bar", entityResource.getClassName());
-
- //set class to null in the resource model
- entityResource.setClassName(null);
- assertNull(ormEntity.getClass_());
- assertNull(entityResource.getClassName());
- }
-
- public void testModifyClass() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertEquals("model.Foo", ormEntity.getClass_());
- assertEquals("model.Foo", entityResource.getClassName());
-
- //set class in the context model, verify resource model modified
- ormEntity.setClass("com.Bar");
- assertEquals("com.Bar", ormEntity.getClass_());
- assertEquals("com.Bar", entityResource.getClassName());
-
- //set class to null in the context model
- ormEntity.setClass(null);
- assertNull(ormEntity.getClass_());
- assertNull(entityResource.getClassName());
- }
- //TODO add tests for setting the className when the package is set on entity-mappings
-
- public void testUpdateSpecifiedAccess() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedAccess());
- assertNull(entityResource.getAccess());
-
- //set access in the resource model, verify context model updated
- entityResource.setAccess(org.eclipse.jpt.core.resource.orm.AccessType.FIELD);
- assertEquals(AccessType.FIELD, ormEntity.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.FIELD, entityResource.getAccess());
-
- //set access to null in the resource model
- entityResource.setAccess(null);
- assertNull(ormEntity.getSpecifiedAccess());
- assertNull(entityResource.getAccess());
- }
-
- public void testModifySpecifiedAccess() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedAccess());
- assertNull(entityResource.getAccess());
-
- //set access in the context model, verify resource model modified
- ormEntity.setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, ormEntity.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, entityResource.getAccess());
-
- //set access to null in the context model
- ormEntity.setSpecifiedAccess(null);
- assertNull(ormEntity.getSpecifiedAccess());
- assertNull(entityResource.getAccess());
- }
-
- public void testUpdateDefaultAccessFromPersistenceUnitDefaults() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedAccess());
- assertNull(ormEntity.getDefaultAccess());
- assertNull(entityResource.getAccess());
-
- ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(org.eclipse.jpt.core.resource.orm.AccessType.FIELD);
- assertEquals(AccessType.FIELD, ormEntity.getDefaultAccess());
- assertNull(ormEntity.getSpecifiedAccess());
- assertNull(entityResource.getAccess());
-
- ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, ormEntity.getDefaultAccess());
- assertNull(ormEntity.getSpecifiedAccess());
- assertNull(entityResource.getAccess());
-
- ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(null);
- assertNull(ormEntity.getSpecifiedAccess());
- assertNull(ormEntity.getDefaultAccess());
- assertNull(entityResource.getAccess());
- }
-
- public void testUpdateDefaultAccessFromJava() throws Exception {
- createTestEntityDefaultFieldAccess();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- //java has no annotations, so defaultAccess in xml is null
- assertNull(ormEntity.getDefaultAccess());
-
- entityMappings().setSpecifiedAccess(AccessType.FIELD);
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY);
- //entityMappings access wins over persistence-unit-defaults access
- assertEquals(AccessType.FIELD, ormEntity.getDefaultAccess());
-
- entityMappings().setSpecifiedAccess(null);
- //persistence-unit-defaults access used now
- assertEquals(AccessType.PROPERTY, ormEntity.getDefaultAccess());
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(null);
- assertNull(ormEntity.getDefaultAccess());
-
- ormPersistentType.getJavaPersistentType().getAttributeNamed("id").setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- //java has annotations on fields now, that should win in all cases
- assertEquals(AccessType.FIELD, ormEntity.getDefaultAccess());
-
- entityMappings().setSpecifiedAccess(AccessType.PROPERTY);
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY);
- assertEquals(AccessType.FIELD, ormEntity.getDefaultAccess());
-
- ormPersistentType.getJavaPersistentType().getAttributeNamed("id").setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertEquals(AccessType.PROPERTY, ormEntity.getDefaultAccess());
- }
-
- public void testUpdateDefaultAccessFromJavaFieldAccess() throws Exception {
- createTestEntityFieldAccess();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertEquals(AccessType.FIELD, ormEntity.getDefaultAccess());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertNull(ormEntity.getDefaultAccess());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertEquals(AccessType.FIELD, ormEntity.getDefaultAccess());
-
- entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertNull(ormEntity.getDefaultAccess());
-
- ormEntity.setSpecifiedMetadataComplete(null);
- assertNull(ormEntity.getDefaultAccess());
-
- entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertEquals(AccessType.FIELD, ormEntity.getDefaultAccess());
- }
-
- public void testUpdateDefaultAccessFromJavaPropertyAccess() throws Exception {
- createTestEntityPropertyAccess();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertEquals(AccessType.PROPERTY, ormEntity.getDefaultAccess());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertNull(ormEntity.getDefaultAccess());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertEquals(AccessType.PROPERTY, ormEntity.getDefaultAccess());
-
- entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertNull(ormEntity.getDefaultAccess());
-
- ormEntity.setSpecifiedMetadataComplete(null);
- assertNull(ormEntity.getDefaultAccess());
-
- entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertEquals(AccessType.PROPERTY, ormEntity.getDefaultAccess());
- }
-
- public void testUpdateDefaultAccessNoUnderlyingJava() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertNull(ormEntity.getDefaultAccess());
- }
-
- public void testUpdateSpecifiedMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
-
- //set metadata-complete in the resource model, verify context model updated
- entityResource.setMetadataComplete(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormEntity.getSpecifiedMetadataComplete());
- assertEquals(Boolean.TRUE, entityResource.getMetadataComplete());
-
- //set access to false in the resource model
- entityResource.setMetadataComplete(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormEntity.getSpecifiedMetadataComplete());
- assertEquals(Boolean.FALSE, entityResource.getMetadataComplete());
-
- entityResource.setMetadataComplete(null);
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
- }
-
- public void testModifySpecifiedMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
-
- //set access in the context model, verify resource model modified
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertTrue(ormEntity.getSpecifiedMetadataComplete().booleanValue());
- assertTrue(entityResource.getMetadataComplete().booleanValue());
-
- //set access to null in the context model
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertFalse(ormEntity.getSpecifiedMetadataComplete().booleanValue());
- assertFalse(entityResource.getMetadataComplete().booleanValue());
-
- ormEntity.setSpecifiedMetadataComplete(null);
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
- }
-
- public void testUpdateDefaultMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertFalse(ormEntity.isDefaultMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
-
- ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertTrue(ormEntity.isDefaultMetadataComplete());
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
-
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertFalse(ormEntity.isDefaultMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
-
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormEntity.getSpecifiedMetadataComplete());
- assertTrue(ormEntity.isDefaultMetadataComplete());
- assertTrue(ormEntity.isMetadataComplete());
- }
-
- public void testUpdateMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertFalse(ormEntity.isMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
-
- ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertTrue(ormEntity.isMetadataComplete());
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
-
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertFalse(ormEntity.isMetadataComplete());
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
- }
-
-
- public void testUpdateInheritanceStrategy() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertEquals(InheritanceType.SINGLE_TABLE, ormEntity.getInheritanceStrategy());
- assertNull(entityResource.getInheritance());
-
- //set inheritance strategy in the resource model, verify context model updated
- entityResource.setInheritance(OrmFactory.eINSTANCE.createInheritance());
- entityResource.getInheritance().setStrategy(org.eclipse.jpt.core.resource.orm.InheritanceType.TABLE_PER_CLASS);
-
- assertEquals(InheritanceType.TABLE_PER_CLASS, ormEntity.getInheritanceStrategy());
- assertEquals(org.eclipse.jpt.core.resource.orm.InheritanceType.TABLE_PER_CLASS, entityResource.getInheritance().getStrategy());
- }
-
- public void testUpdateDefaultInheritanceStrategyFromJava() throws Exception {
- createTestEntityDefaultFieldAccess();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- //no inheritance strategy specified in java so single-table is default
- assertEquals(InheritanceType.SINGLE_TABLE, ormEntity.getDefaultInheritanceStrategy());
-
- ormEntity.getJavaEntity().setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertEquals(InheritanceType.JOINED, ormEntity.getDefaultInheritanceStrategy());
-
- ormEntity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
- //inheritance tag exists in xml, so it overrides anything in java
- assertEquals(InheritanceType.SINGLE_TABLE, ormEntity.getDefaultInheritanceStrategy());
-
- ormEntity.setSpecifiedInheritanceStrategy(null);
- assertEquals(InheritanceType.JOINED, ormEntity.getDefaultInheritanceStrategy());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(InheritanceType.SINGLE_TABLE, ormEntity.getDefaultInheritanceStrategy());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertEquals(InheritanceType.JOINED, ormEntity.getDefaultInheritanceStrategy());
-
- entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- //this setting overrides the false meta-data complete found on ormEntity
- assertEquals(InheritanceType.SINGLE_TABLE, ormEntity.getDefaultInheritanceStrategy());
- }
-
- public void testUpdateDefaultInheritanceStrategyFromParent() throws Exception {
- createTestEntityDefaultFieldAccess();
- createTestSubType();
-
- OrmPersistentType parentPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmEntity parentXmlEntity = (OrmEntity) parentPersistentType.getMapping();
- OrmEntity childXmlEntity = (OrmEntity) childPersistentType.getMapping();
-
- assertEquals(parentXmlEntity, childXmlEntity.getParentEntity());
- assertEquals(InheritanceType.SINGLE_TABLE, childXmlEntity.getDefaultInheritanceStrategy());
-
- //change root inheritance strategy, verify default is changed for child entity
- parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
- assertEquals(InheritanceType.SINGLE_TABLE, parentXmlEntity.getDefaultInheritanceStrategy());
- assertEquals(InheritanceType.TABLE_PER_CLASS, childXmlEntity.getDefaultInheritanceStrategy());
- assertNull(childXmlEntity.getSpecifiedInheritanceStrategy());
-
- //set specified inheritance strategy in java and verify defaults in xml are correct
- parentXmlEntity.setSpecifiedInheritanceStrategy(null);
- parentXmlEntity.getJavaEntity().setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertEquals(InheritanceType.JOINED, parentXmlEntity.getDefaultInheritanceStrategy());
- assertEquals(InheritanceType.JOINED, childXmlEntity.getDefaultInheritanceStrategy());
- assertNull(parentXmlEntity.getSpecifiedInheritanceStrategy());
- assertNull(childXmlEntity.getSpecifiedInheritanceStrategy());
-
- entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(InheritanceType.SINGLE_TABLE, parentXmlEntity.getDefaultInheritanceStrategy());
- assertEquals(InheritanceType.SINGLE_TABLE, childXmlEntity.getDefaultInheritanceStrategy());
- }
-
- public void testUpdateSpecifiedInheritanceStrategy() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedInheritanceStrategy());
- assertNull(entityResource.getInheritance());
-
- //set strategy in the resource model, verify context model updated
- entityResource.setInheritance(OrmFactory.eINSTANCE.createInheritance());
- entityResource.getInheritance().setStrategy(org.eclipse.jpt.core.resource.orm.InheritanceType.JOINED);
- assertEquals(InheritanceType.JOINED, ormEntity.getSpecifiedInheritanceStrategy());
- assertEquals(org.eclipse.jpt.core.resource.orm.InheritanceType.JOINED, entityResource.getInheritance().getStrategy());
-
- //set strategy to null in the resource model
- entityResource.getInheritance().setStrategy(null);
- assertNull(ormEntity.getSpecifiedInheritanceStrategy());
- assertNull(entityResource.getInheritance().getStrategy());
-
- entityResource.getInheritance().setStrategy(org.eclipse.jpt.core.resource.orm.InheritanceType.SINGLE_TABLE);
- assertEquals(InheritanceType.SINGLE_TABLE, ormEntity.getSpecifiedInheritanceStrategy());
- assertEquals(org.eclipse.jpt.core.resource.orm.InheritanceType.SINGLE_TABLE, entityResource.getInheritance().getStrategy());
-
- entityResource.setInheritance(null);
- assertNull(ormEntity.getSpecifiedInheritanceStrategy());
- assertNull(entityResource.getInheritance());
- }
-
- public void testModifySpecifiedInheritanceStrategy() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedInheritanceStrategy());
- assertNull(entityResource.getInheritance());
-
- //set strategy in the context model, verify resource model modified
- ormEntity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
- assertEquals(InheritanceType.TABLE_PER_CLASS, ormEntity.getSpecifiedInheritanceStrategy());
- assertEquals(org.eclipse.jpt.core.resource.orm.InheritanceType.TABLE_PER_CLASS, entityResource.getInheritance().getStrategy());
-
- //set strategy to null in the context model
- ormEntity.setSpecifiedInheritanceStrategy(null);
- assertNull(ormEntity.getSpecifiedInheritanceStrategy());
- assertNull(entityResource.getInheritance());
- }
-
- public void testAddSpecifiedSecondaryTable() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- OrmSecondaryTable secondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- secondaryTable.setSpecifiedName("FOO");
-
- assertEquals("FOO", entityResource.getSecondaryTables().get(0).getName());
-
- OrmSecondaryTable secondaryTable2 = ormEntity.addSpecifiedSecondaryTable(0);
- secondaryTable2.setSpecifiedName("BAR");
-
- assertEquals("BAR", entityResource.getSecondaryTables().get(0).getName());
- assertEquals("FOO", entityResource.getSecondaryTables().get(1).getName());
-
- OrmSecondaryTable secondaryTable3 = ormEntity.addSpecifiedSecondaryTable(1);
- secondaryTable3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", entityResource.getSecondaryTables().get(0).getName());
- assertEquals("BAZ", entityResource.getSecondaryTables().get(1).getName());
- assertEquals("FOO", entityResource.getSecondaryTables().get(2).getName());
-
- ListIterator<OrmSecondaryTable> secondaryTables = ormEntity.specifiedSecondaryTables();
- assertEquals(secondaryTable2, secondaryTables.next());
- assertEquals(secondaryTable3, secondaryTables.next());
- assertEquals(secondaryTable, secondaryTables.next());
-
- secondaryTables = ormEntity.specifiedSecondaryTables();
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
- }
-
- public void testRemoveSpecifiedSecondaryTable() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.addSpecifiedSecondaryTable(0).setSpecifiedName("FOO");
- ormEntity.addSpecifiedSecondaryTable(1).setSpecifiedName("BAR");
- ormEntity.addSpecifiedSecondaryTable(2).setSpecifiedName("BAZ");
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getSecondaryTables().size());
-
- ormEntity.removeSpecifiedSecondaryTable(0);
- assertEquals(2, entityResource.getSecondaryTables().size());
- assertEquals("BAR", entityResource.getSecondaryTables().get(0).getName());
- assertEquals("BAZ", entityResource.getSecondaryTables().get(1).getName());
-
- ormEntity.removeSpecifiedSecondaryTable(0);
- assertEquals(1, entityResource.getSecondaryTables().size());
- assertEquals("BAZ", entityResource.getSecondaryTables().get(0).getName());
-
- ormEntity.removeSpecifiedSecondaryTable(0);
- assertEquals(0, entityResource.getSecondaryTables().size());
- }
-
- public void testMoveSpecifiedSecondaryTable() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.addSpecifiedSecondaryTable(0).setSpecifiedName("FOO");
- ormEntity.addSpecifiedSecondaryTable(1).setSpecifiedName("BAR");
- ormEntity.addSpecifiedSecondaryTable(2).setSpecifiedName("BAZ");
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getSecondaryTables().size());
-
-
- ormEntity.moveSpecifiedSecondaryTable(2, 0);
- ListIterator<OrmSecondaryTable> secondaryTables = ormEntity.specifiedSecondaryTables();
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
-
- assertEquals("BAR", entityResource.getSecondaryTables().get(0).getName());
- assertEquals("BAZ", entityResource.getSecondaryTables().get(1).getName());
- assertEquals("FOO", entityResource.getSecondaryTables().get(2).getName());
-
-
- ormEntity.moveSpecifiedSecondaryTable(0, 1);
- secondaryTables = ormEntity.specifiedSecondaryTables();
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
-
- assertEquals("BAZ", entityResource.getSecondaryTables().get(0).getName());
- assertEquals("BAR", entityResource.getSecondaryTables().get(1).getName());
- assertEquals("FOO", entityResource.getSecondaryTables().get(2).getName());
- }
-
- public void testUpdateSecondaryTables() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- entityResource.getSecondaryTables().add(OrmFactory.eINSTANCE.createXmlSecondaryTableImpl());
- entityResource.getSecondaryTables().add(OrmFactory.eINSTANCE.createXmlSecondaryTableImpl());
- entityResource.getSecondaryTables().add(OrmFactory.eINSTANCE.createXmlSecondaryTableImpl());
-
- entityResource.getSecondaryTables().get(0).setName("FOO");
- entityResource.getSecondaryTables().get(1).setName("BAR");
- entityResource.getSecondaryTables().get(2).setName("BAZ");
-
- ListIterator<OrmSecondaryTable> secondaryTables = ormEntity.specifiedSecondaryTables();
- assertEquals("FOO", secondaryTables.next().getName());
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("BAZ", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- entityResource.getSecondaryTables().move(2, 0);
- secondaryTables = ormEntity.specifiedSecondaryTables();
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- entityResource.getSecondaryTables().move(0, 1);
- secondaryTables = ormEntity.specifiedSecondaryTables();
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- entityResource.getSecondaryTables().remove(1);
- secondaryTables = ormEntity.specifiedSecondaryTables();
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- entityResource.getSecondaryTables().remove(1);
- secondaryTables = ormEntity.specifiedSecondaryTables();
- assertEquals("BAZ", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- entityResource.getSecondaryTables().remove(0);
- assertFalse(ormEntity.specifiedSecondaryTables().hasNext());
- }
-
- public void testVirtualSecondaryTables() throws Exception {
- createTestEntityFieldAccess();
- createTestSubType();
-
- OrmPersistentType parentPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmEntity parentOrmEntity = (OrmEntity) parentPersistentType.getMapping();
- OrmEntity childOrmEntity = (OrmEntity) childPersistentType.getMapping();
- JavaEntity javaEntity = childOrmEntity.getJavaEntity();
-
- JavaSecondaryTable javaSecondaryTableFoo = javaEntity.addSpecifiedSecondaryTable(0);
- javaSecondaryTableFoo.setSpecifiedName("FOO");
- OrmSecondaryTable virtualSecondaryTableFoo = childOrmEntity.virtualSecondaryTables().next();
- assertEquals("FOO", childOrmEntity.secondaryTables().next().getName());
- assertEquals("FOO", virtualSecondaryTableFoo.getName());
- assertEquals(0, virtualSecondaryTableFoo.specifiedPrimaryKeyJoinColumnsSize());
- assertEquals("id", virtualSecondaryTableFoo.getDefaultPrimaryKeyJoinColumn().getDefaultName());
- assertEquals("id", virtualSecondaryTableFoo.getDefaultPrimaryKeyJoinColumn().getDefaultReferencedColumnName());
-
- assertEquals(0, childOrmEntity.specifiedSecondaryTablesSize());
- assertEquals(1, childOrmEntity.virtualSecondaryTablesSize());
- assertEquals(1, childOrmEntity.secondaryTablesSize());
-
- javaEntity.addSpecifiedSecondaryTable(0).setSpecifiedName("BAR");
- ListIterator<OrmSecondaryTable> virtualSecondaryTables = childOrmEntity.virtualSecondaryTables();
- ListIterator<OrmSecondaryTable> secondaryTables = childOrmEntity.secondaryTables();
- assertEquals("BAR", virtualSecondaryTables.next().getName());
- assertEquals("FOO", virtualSecondaryTables.next().getName());
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
- assertEquals(0, childOrmEntity.specifiedSecondaryTablesSize());
- assertEquals(2, childOrmEntity.virtualSecondaryTablesSize());
- assertEquals(2, childOrmEntity.secondaryTablesSize());
-
- childOrmEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(0, childOrmEntity.virtualSecondaryTablesSize());
-
- childOrmEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertEquals(2, childOrmEntity.virtualSecondaryTablesSize());
-
-
- childOrmEntity.setSecondaryTablesDefinedInXml(true);
- assertEquals(0, childOrmEntity.virtualSecondaryTablesSize());
- assertEquals(2, childOrmEntity.specifiedSecondaryTablesSize());
- assertEquals(2, childOrmEntity.secondaryTablesSize());
- ListIterator<OrmSecondaryTable> specifiedSecondaryTables = childOrmEntity.specifiedSecondaryTables();
- assertEquals("BAR", specifiedSecondaryTables.next().getName());
- OrmSecondaryTable specifiedSecondaryTableFoo = specifiedSecondaryTables.next();
- assertEquals("FOO", specifiedSecondaryTableFoo.getName());
- assertEquals(0, specifiedSecondaryTableFoo.specifiedPrimaryKeyJoinColumnsSize());
- assertEquals("id", specifiedSecondaryTableFoo.getDefaultPrimaryKeyJoinColumn().getDefaultName());
- assertEquals("id", specifiedSecondaryTableFoo.getDefaultPrimaryKeyJoinColumn().getDefaultReferencedColumnName());
-
-
- childOrmEntity.removeSpecifiedSecondaryTable(0);
- assertEquals(0, childOrmEntity.virtualSecondaryTablesSize());
- assertEquals(1, childOrmEntity.specifiedSecondaryTablesSize());
- assertEquals(1, childOrmEntity.secondaryTablesSize());
- assertEquals("FOO", childOrmEntity.specifiedSecondaryTables().next().getName());
-
-
- childOrmEntity.removeSpecifiedSecondaryTable(0);
- assertEquals(0, childOrmEntity.specifiedSecondaryTablesSize());
- assertEquals(2, childOrmEntity.virtualSecondaryTablesSize());
- assertEquals(2, childOrmEntity.secondaryTablesSize());
- virtualSecondaryTables = childOrmEntity.virtualSecondaryTables();
- assertEquals("BAR", virtualSecondaryTables.next().getName());
- assertEquals("FOO", virtualSecondaryTables.next().getName());
-
-
- //add a specified secondary table to the parent, this will not affect virtual secondaryTables in child
- parentOrmEntity.addSpecifiedSecondaryTable(0).setSpecifiedName("PARENT_TABLE");
- assertEquals(2, childOrmEntity.virtualSecondaryTablesSize());
- }
-
- public void testAssociatedTables() throws Exception {
- createTestEntityFieldAccess();
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmEntity entity = (OrmEntity) persistentType.getMapping();
- assertEquals(1, CollectionTools.size(entity.associatedTables()));
-
- entity.addSpecifiedSecondaryTable(0).setSpecifiedName("FOO");
- assertEquals(2, CollectionTools.size(entity.associatedTables()));
-
- entity.addSpecifiedSecondaryTable(0).setSpecifiedName("BAR");
- assertEquals(3, CollectionTools.size(entity.associatedTables()));
- }
-
- public void testAssociatedTableNamesIncludingInherited() throws Exception {
-
- }
-
- public void testTableNameIsInvalid() throws Exception {
-
- }
-
- public void testMakeEntityEmbeddable() throws Exception {
- OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity entity = (OrmEntity) entityPersistentType.getMapping();
- entity.setSpecifiedAccess(AccessType.PROPERTY);
- entity.setSpecifiedDiscriminatorValue("DISC_VALUE");
- entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- entity.setSpecifiedMetadataComplete(Boolean.TRUE);
- entity.setSpecifiedName("ENTITY_NAME");
-
- entityPersistentType.setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
-
- XmlEmbeddable embeddable = ormResource().getEntityMappings().getEmbeddables().get(0);
- assertEquals("model.Foo", embeddable.getClassName());
- assertEquals(Boolean.TRUE, embeddable.getMetadataComplete());
- assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, embeddable.getAccess());
-
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) entityPersistentType.getMapping();
- assertEquals("model.Foo", ormEmbeddable.getClass_());
- assertEquals(Boolean.TRUE, ormEmbeddable.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, ormEmbeddable.getSpecifiedAccess());
- }
-
- //TODO test that attribute mappings are not removed when changing type mapping.
- public void testMakeEntityEmbeddable2() throws Exception {
- OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- OrmEntity entity = (OrmEntity) entityPersistentType.getMapping();
- entity.setSpecifiedAccess(AccessType.PROPERTY);
- entity.setSpecifiedDiscriminatorValue("DISC_VALUE");
- entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- entity.setSpecifiedMetadataComplete(Boolean.TRUE);
- entity.setSpecifiedName("ENTITY_NAME");
-// entityPersistentType.addSpecifiedPersistentAttribute(IMappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
-
- entityPersistentType.setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
-
- XmlEmbeddable embeddable = ormResource().getEntityMappings().getEmbeddables().get(0);
- assertEquals("model.Foo", embeddable.getClassName());
- assertEquals(Boolean.TRUE, embeddable.getMetadataComplete());
- assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, embeddable.getAccess());
-// assertEquals("basicMapping", embeddable.getAttributes().getBasics().get(0).getName());
-
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) entityPersistentType.getMapping();
- assertEquals("model.Foo", ormEmbeddable.getClass_());
- assertEquals(Boolean.TRUE, ormEmbeddable.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, ormEmbeddable.getSpecifiedAccess());
-// assertEquals("basicMapping", ormEmbeddable.persistentType().attributes().next().getName());
- }
-
- public void testMakeEntityMappedSuperclass() throws Exception {
- OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity entity = (OrmEntity) entityPersistentType.getMapping();
- entity.setSpecifiedAccess(AccessType.PROPERTY);
- entity.setSpecifiedDiscriminatorValue("DISC_VALUE");
- entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- entity.setSpecifiedMetadataComplete(Boolean.TRUE);
- entity.setSpecifiedName("ENTITY_NAME");
-
- entityPersistentType.setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
-
- XmlMappedSuperclass mappedSuperclass = ormResource().getEntityMappings().getMappedSuperclasses().get(0);
- assertEquals("model.Foo", mappedSuperclass.getClassName());
- assertEquals(Boolean.TRUE, mappedSuperclass.getMetadataComplete());
- assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, mappedSuperclass.getAccess());
-
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) entityPersistentType.getMapping();
- assertEquals("model.Foo", ormMappedSuperclass.getClass_());
- assertEquals(Boolean.TRUE, ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, ormMappedSuperclass.getSpecifiedAccess());
- }
-
- public void testMakeEntityMappedSuperclass2() throws Exception {
- entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity entity = (OrmEntity) entityPersistentType.getMapping();
- entity.setSpecifiedAccess(AccessType.PROPERTY);
- entity.setSpecifiedDiscriminatorValue("DISC_VALUE");
- entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- entity.setSpecifiedMetadataComplete(Boolean.TRUE);
- entity.setSpecifiedName("ENTITY_NAME");
-
- entityPersistentType.setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
-
- XmlMappedSuperclass mappedSuperclass = ormResource().getEntityMappings().getMappedSuperclasses().get(0);
- assertEquals("model.Foo", mappedSuperclass.getClassName());
- assertEquals(Boolean.TRUE, mappedSuperclass.getMetadataComplete());
- assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, mappedSuperclass.getAccess());
-
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) entityPersistentType.getMapping();
- assertEquals("model.Foo", ormMappedSuperclass.getClass_());
- assertEquals(Boolean.TRUE, ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, ormMappedSuperclass.getSpecifiedAccess());
- }
-
-
- public void testAddSequenceGenerator() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getSequenceGenerator());
- assertNull(entityResource.getSequenceGenerator());
-
- ormEntity.addSequenceGenerator();
-
- assertNotNull(entityResource.getSequenceGenerator());
- assertNotNull(ormEntity.getSequenceGenerator());
-
- //try adding another sequence generator, should get an IllegalStateException
- try {
- ormEntity.addSequenceGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveSequenceGenerator() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getSequenceGenerator());
- assertNull(entityResource.getSequenceGenerator());
-
- ormEntity.addSequenceGenerator();
- assertNotNull(entityResource.getSequenceGenerator());
- assertNotNull(ormEntity.getSequenceGenerator());
-
- ormEntity.removeSequenceGenerator();
-
- assertNull(ormEntity.getSequenceGenerator());
- assertNull(entityResource.getSequenceGenerator());
-
- //try removing the sequence generator again, should get an IllegalStateException
- try {
- ormEntity.removeSequenceGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testUpdateSequenceGenerator() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getSequenceGenerator());
- assertNull(entityResource.getSequenceGenerator());
- assertEquals(0, CollectionTools.size(ormEntity.getPersistenceUnit().allGenerators()));
-
- entityResource.setSequenceGenerator(OrmFactory.eINSTANCE.createXmlSequenceGeneratorImpl());
-
- assertNotNull(ormEntity.getSequenceGenerator());
- assertNotNull(entityResource.getSequenceGenerator());
- assertEquals(1, CollectionTools.size(ormEntity.getPersistenceUnit().allGenerators()));
-
- ormEntity.getSequenceGenerator().setName("foo");
- assertEquals(1, CollectionTools.size(ormEntity.getPersistenceUnit().allGenerators()));
-
- entityResource.setSequenceGenerator(null);
- assertNull(ormEntity.getSequenceGenerator());
- assertNull(entityResource.getSequenceGenerator());
- assertEquals(0, CollectionTools.size(ormEntity.getPersistenceUnit().allGenerators()));
- }
-
- public void testAddTableGenerator() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getTableGenerator());
- assertNull(entityResource.getTableGenerator());
-
- ormEntity.addTableGenerator();
-
- assertNotNull(entityResource.getTableGenerator());
- assertNotNull(ormEntity.getTableGenerator());
-
- //try adding another table generator, should get an IllegalStateException
- try {
- ormEntity.addTableGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveTableGenerator() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getTableGenerator());
- assertNull(entityResource.getTableGenerator());
-
- ormEntity.addTableGenerator();
- assertNotNull(entityResource.getTableGenerator());
- assertNotNull(ormEntity.getTableGenerator());
-
- ormEntity.removeTableGenerator();
-
- assertNull(ormEntity.getTableGenerator());
- assertNull(entityResource.getTableGenerator());
-
- //try removing the table generator again, should get an IllegalStateException
- try {
- ormEntity.removeTableGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testUpdateTableGenerator() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getTableGenerator());
- assertNull(entityResource.getTableGenerator());
- assertEquals(0, CollectionTools.size(ormEntity.getPersistenceUnit().allGenerators()));
-
- entityResource.setTableGenerator(OrmFactory.eINSTANCE.createXmlTableGeneratorImpl());
-
- assertNotNull(ormEntity.getTableGenerator());
- assertNotNull(entityResource.getTableGenerator());
- assertEquals(1, CollectionTools.size(ormEntity.getPersistenceUnit().allGenerators()));
-
- ormEntity.getTableGenerator().setName("foo");
- assertEquals(1, CollectionTools.size(ormEntity.getPersistenceUnit().allGenerators()));
-
- entityResource.setTableGenerator(null);
- assertNull(ormEntity.getTableGenerator());
- assertNull(entityResource.getTableGenerator());
- assertEquals(0, CollectionTools.size(ormEntity.getPersistenceUnit().allGenerators()));
- }
-
- public void testUpdateDiscriminatorColumn() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- assertNotNull(ormEntity.getDiscriminatorColumn());
-
- entityResource.setDiscriminatorColumn(OrmFactory.eINSTANCE.createXmlDiscriminatorColumn());
- entityResource.getDiscriminatorColumn().setName("FOO");
-
- assertEquals("FOO", ormEntity.getDiscriminatorColumn().getSpecifiedName());
- assertEquals("FOO", entityResource.getDiscriminatorColumn().getName());
-
- entityResource.getDiscriminatorColumn().setName(null);
-
- assertNull(ormEntity.getDiscriminatorColumn().getSpecifiedName());
- assertNull(entityResource.getDiscriminatorColumn().getName());
-
- entityResource.setDiscriminatorColumn(null);
-
- assertNotNull(ormEntity.getDiscriminatorColumn());
- }
-
- public void testUpdateDiscriminatorValue() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getSpecifiedDiscriminatorValue());
- assertNull(entityResource.getDiscriminatorValue());
-
- entityResource.setDiscriminatorValue("FOO");
-
- assertEquals("FOO", ormEntity.getSpecifiedDiscriminatorValue());
- assertEquals("FOO", entityResource.getDiscriminatorValue());
-
- entityResource.setDiscriminatorValue(null);
-
- assertNull(ormEntity.getSpecifiedDiscriminatorValue());
- assertNull(entityResource.getDiscriminatorValue());
- }
-
- public void testModifyDiscriminatorValue() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getSpecifiedDiscriminatorValue());
- assertNull(entityResource.getDiscriminatorValue());
-
- ormEntity.setSpecifiedDiscriminatorValue("FOO");
-
- assertEquals("FOO", ormEntity.getSpecifiedDiscriminatorValue());
- assertEquals("FOO", entityResource.getDiscriminatorValue());
-
- ormEntity.setSpecifiedDiscriminatorValue(null);
-
- assertNull(ormEntity.getSpecifiedDiscriminatorValue());
- assertNull(entityResource.getDiscriminatorValue());
- }
-
- public void testAddSpecifiedPrimaryKeyJoinColumn() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- OrmPrimaryKeyJoinColumn primaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0);
- primaryKeyJoinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", entityResource.getPrimaryKeyJoinColumns().get(0).getName());
-
- OrmPrimaryKeyJoinColumn primaryKeyJoinColumn2 = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0);
- primaryKeyJoinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", entityResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("FOO", entityResource.getPrimaryKeyJoinColumns().get(1).getName());
-
- OrmPrimaryKeyJoinColumn primaryKeyJoinColumn3 = ormEntity.addSpecifiedPrimaryKeyJoinColumn(1);
- primaryKeyJoinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", entityResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", entityResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", entityResource.getPrimaryKeyJoinColumns().get(2).getName());
-
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns = ormEntity.specifiedPrimaryKeyJoinColumns();
- assertEquals(primaryKeyJoinColumn2, primaryKeyJoinColumns.next());
- assertEquals(primaryKeyJoinColumn3, primaryKeyJoinColumns.next());
- assertEquals(primaryKeyJoinColumn, primaryKeyJoinColumns.next());
-
- primaryKeyJoinColumns = ormEntity.specifiedPrimaryKeyJoinColumns();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- ormEntity.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- ormEntity.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getPrimaryKeyJoinColumns().size());
-
- ormEntity.removeSpecifiedPrimaryKeyJoinColumn(0);
- assertEquals(2, entityResource.getPrimaryKeyJoinColumns().size());
- assertEquals("BAR", entityResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", entityResource.getPrimaryKeyJoinColumns().get(1).getName());
-
- ormEntity.removeSpecifiedPrimaryKeyJoinColumn(0);
- assertEquals(1, entityResource.getPrimaryKeyJoinColumns().size());
- assertEquals("BAZ", entityResource.getPrimaryKeyJoinColumns().get(0).getName());
-
- ormEntity.removeSpecifiedPrimaryKeyJoinColumn(0);
- assertEquals(0, entityResource.getPrimaryKeyJoinColumns().size());
- }
-
- public void testMoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- ormEntity.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- ormEntity.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getPrimaryKeyJoinColumns().size());
-
-
- ormEntity.moveSpecifiedPrimaryKeyJoinColumn(2, 0);
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns = ormEntity.specifiedPrimaryKeyJoinColumns();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
-
- assertEquals("BAR", entityResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", entityResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", entityResource.getPrimaryKeyJoinColumns().get(2).getName());
-
-
- ormEntity.moveSpecifiedPrimaryKeyJoinColumn(0, 1);
- primaryKeyJoinColumns = ormEntity.specifiedPrimaryKeyJoinColumns();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
-
- assertEquals("BAZ", entityResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAR", entityResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", entityResource.getPrimaryKeyJoinColumns().get(2).getName());
- }
-
- public void testUpdatePrimaryKeyJoinColumns() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- entityResource.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumnImpl());
- entityResource.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumnImpl());
- entityResource.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumnImpl());
-
- entityResource.getPrimaryKeyJoinColumns().get(0).setName("FOO");
- entityResource.getPrimaryKeyJoinColumns().get(1).setName("BAR");
- entityResource.getPrimaryKeyJoinColumns().get(2).setName("BAZ");
-
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns = ormEntity.specifiedPrimaryKeyJoinColumns();
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- entityResource.getPrimaryKeyJoinColumns().move(2, 0);
- primaryKeyJoinColumns = ormEntity.specifiedPrimaryKeyJoinColumns();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- entityResource.getPrimaryKeyJoinColumns().move(0, 1);
- primaryKeyJoinColumns = ormEntity.specifiedPrimaryKeyJoinColumns();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- entityResource.getPrimaryKeyJoinColumns().remove(1);
- primaryKeyJoinColumns = ormEntity.specifiedPrimaryKeyJoinColumns();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- entityResource.getPrimaryKeyJoinColumns().remove(1);
- primaryKeyJoinColumns = ormEntity.specifiedPrimaryKeyJoinColumns();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- entityResource.getPrimaryKeyJoinColumns().remove(0);
- assertFalse(ormEntity.specifiedPrimaryKeyJoinColumns().hasNext());
- }
-
- public void testDefaultPrimaryKeyJoinColumns() throws Exception {
- createTestType();
- createTestSubTypeUnmapped();
-
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- childPersistentType.getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
-
- persistentType.getAttributeNamed("id").makeSpecified(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- ((OrmEntity) persistentType.getMapping()).setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
-
- OrmEntity childEntity = (OrmEntity) childPersistentType.getMapping();
-
- assertTrue(childEntity.defaultPrimaryKeyJoinColumns().hasNext());
- assertEquals("id", childEntity.defaultPrimaryKeyJoinColumns().next().getDefaultName());
- assertEquals("id", childEntity.defaultPrimaryKeyJoinColumns().next().getDefaultReferencedColumnName());
-
- childPersistentType.getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
- persistentType.getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
-
- assertTrue(childEntity.defaultPrimaryKeyJoinColumns().hasNext());
- assertEquals("id", childEntity.defaultPrimaryKeyJoinColumns().next().getDefaultName());
- assertEquals("id", childEntity.defaultPrimaryKeyJoinColumns().next().getDefaultReferencedColumnName());
-
- OrmPrimaryKeyJoinColumn specifiedPkJoinColumn = childEntity.addSpecifiedPrimaryKeyJoinColumn(0);
- specifiedPkJoinColumn.setSpecifiedName("FOO");
- specifiedPkJoinColumn.setSpecifiedReferencedColumnName("BAR");
-
- assertFalse(childEntity.defaultPrimaryKeyJoinColumns().hasNext());
-
- //remove the pkJoinColumn from the context mode, verify context model has a default pkJoinColumn
- childEntity.removeSpecifiedPrimaryKeyJoinColumn(0);
- assertTrue(childEntity.defaultPrimaryKeyJoinColumns().hasNext());
- assertEquals("id", childEntity.defaultPrimaryKeyJoinColumns().next().getDefaultName());
- assertEquals("id", childEntity.defaultPrimaryKeyJoinColumns().next().getDefaultReferencedColumnName());
-
-
- childPersistentType.getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- persistentType.getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
-
- specifiedPkJoinColumn = childEntity.addSpecifiedPrimaryKeyJoinColumn(0);
- specifiedPkJoinColumn.setSpecifiedName("FOO");
- specifiedPkJoinColumn.setSpecifiedReferencedColumnName("BAR");
- assertFalse(childEntity.defaultPrimaryKeyJoinColumns().hasNext());
- //now remove the pkJoinColumn from the resource model, verify context model updates and has a default pkJoinColumn
- ((XmlEntity)childEntity.getResourceTypeMapping()).getPrimaryKeyJoinColumns().remove(0);
- assertTrue(childEntity.defaultPrimaryKeyJoinColumns().hasNext());
- assertEquals("id", childEntity.defaultPrimaryKeyJoinColumns().next().getDefaultName());
- assertEquals("id", childEntity.defaultPrimaryKeyJoinColumns().next().getDefaultReferencedColumnName());
- }
-
- public void testDefaultPrimaryKeyJoinColumnsFromJava() throws Exception {
- createTestEntityFieldAccess();
- createTestSubType();
-
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
-
-
- ((JavaEntity) persistentType.getJavaPersistentType().getMapping()).setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
-
- OrmEntity childEntity = (OrmEntity) childPersistentType.getMapping();
-
- assertTrue(childEntity.defaultPrimaryKeyJoinColumns().hasNext());
- assertEquals("id", childEntity.defaultPrimaryKeyJoinColumns().next().getDefaultName());
- assertEquals("id", childEntity.defaultPrimaryKeyJoinColumns().next().getDefaultReferencedColumnName());
-
- JavaEntity javaEntity = (JavaEntity) childPersistentType.getJavaPersistentType().getMapping();
- JavaPrimaryKeyJoinColumn javaPrimaryKeyJoinColumn = javaEntity.addSpecifiedPrimaryKeyJoinColumn(0);
- javaPrimaryKeyJoinColumn.setSpecifiedName("FOO");
- javaPrimaryKeyJoinColumn.setSpecifiedReferencedColumnName("BAR");
-
- JavaPrimaryKeyJoinColumn javaPrimaryKeyJoinColumn2 = javaEntity.addSpecifiedPrimaryKeyJoinColumn(1);
- javaPrimaryKeyJoinColumn2.setSpecifiedName("FOO2");
- javaPrimaryKeyJoinColumn2.setSpecifiedReferencedColumnName("BAR2");
-
- childPersistentType.getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
- persistentType.getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
-
- ListIterator<OrmPrimaryKeyJoinColumn> defaultPrimaryKeyJoinColumns = childEntity.defaultPrimaryKeyJoinColumns();
- OrmPrimaryKeyJoinColumn defaultPrimaryKeyJoinColumn = defaultPrimaryKeyJoinColumns.next();
- assertEquals("FOO", defaultPrimaryKeyJoinColumn.getName());
- assertEquals("BAR", defaultPrimaryKeyJoinColumn.getReferencedColumnName());
-
- defaultPrimaryKeyJoinColumn = defaultPrimaryKeyJoinColumns.next();
- assertEquals("FOO2", defaultPrimaryKeyJoinColumn.getName());
- assertEquals("BAR2", defaultPrimaryKeyJoinColumn.getReferencedColumnName());
- assertFalse(defaultPrimaryKeyJoinColumns.hasNext());
-
- childEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- defaultPrimaryKeyJoinColumns = childEntity.defaultPrimaryKeyJoinColumns();
- defaultPrimaryKeyJoinColumn = defaultPrimaryKeyJoinColumns.next();
- assertEquals("id", defaultPrimaryKeyJoinColumn.getDefaultName());
- assertEquals("id", defaultPrimaryKeyJoinColumn.getDefaultReferencedColumnName());
-
- assertFalse(defaultPrimaryKeyJoinColumns.hasNext());
-
- }
-
-// public void testAddSpecifiedAttributeOverride() throws Exception {
-// OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-// XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-//
-// OrmAttributeOverride attributeOverride = ormEntity.addSpecifiedAttributeOverride(0);
-// attributeOverride.setName("FOO");
-//
-// assertEquals("FOO", entityResource.getAttributeOverrides().get(0).getName());
-//
-// OrmAttributeOverride attributeOverride2 = ormEntity.addSpecifiedAttributeOverride(0);
-// attributeOverride2.setName("BAR");
-//
-// assertEquals("BAR", entityResource.getAttributeOverrides().get(0).getName());
-// assertEquals("FOO", entityResource.getAttributeOverrides().get(1).getName());
-//
-// OrmAttributeOverride attributeOverride3 = ormEntity.addSpecifiedAttributeOverride(1);
-// attributeOverride3.setName("BAZ");
-//
-// assertEquals("BAR", entityResource.getAttributeOverrides().get(0).getName());
-// assertEquals("BAZ", entityResource.getAttributeOverrides().get(1).getName());
-// assertEquals("FOO", entityResource.getAttributeOverrides().get(2).getName());
-//
-// ListIterator<OrmAttributeOverride> attributeOverrides = ormEntity.specifiedAttributeOverrides();
-// assertEquals(attributeOverride2, attributeOverrides.next());
-// assertEquals(attributeOverride3, attributeOverrides.next());
-// assertEquals(attributeOverride, attributeOverrides.next());
-//
-// attributeOverrides = ormEntity.specifiedAttributeOverrides();
-// assertEquals("BAR", attributeOverrides.next().getName());
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertEquals("FOO", attributeOverrides.next().getName());
-// }
-//
-// public void testRemoveSpecifiedAttributeOverride() throws Exception {
-// OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-//
-// ormEntity.addSpecifiedAttributeOverride(0).setName("FOO");
-// ormEntity.addSpecifiedAttributeOverride(1).setName("BAR");
-// ormEntity.addSpecifiedAttributeOverride(2).setName("BAZ");
-//
-// XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-// assertEquals(3, entityResource.getAttributeOverrides().size());
-//
-// ormEntity.removeSpecifiedAttributeOverride(0);
-// assertEquals(2, entityResource.getAttributeOverrides().size());
-// assertEquals("BAR", entityResource.getAttributeOverrides().get(0).getName());
-// assertEquals("BAZ", entityResource.getAttributeOverrides().get(1).getName());
-//
-// ormEntity.removeSpecifiedAttributeOverride(0);
-// assertEquals(1, entityResource.getAttributeOverrides().size());
-// assertEquals("BAZ", entityResource.getAttributeOverrides().get(0).getName());
-//
-// ormEntity.removeSpecifiedAttributeOverride(0);
-// assertEquals(0, entityResource.getAttributeOverrides().size());
-// }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
-
- entityResource.getAttributeOverrides().get(0).setName("FOO");
- entityResource.getAttributeOverrides().get(1).setName("BAR");
- entityResource.getAttributeOverrides().get(2).setName("BAZ");
-
- assertEquals(3, entityResource.getAttributeOverrides().size());
-
-
- ormEntity.moveSpecifiedAttributeOverride(2, 0);
- ListIterator<OrmAttributeOverride> attributeOverrides = ormEntity.specifiedAttributeOverrides();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAR", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAZ", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", entityResource.getAttributeOverrides().get(2).getName());
-
-
- ormEntity.moveSpecifiedAttributeOverride(0, 1);
- attributeOverrides = ormEntity.specifiedAttributeOverrides();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAZ", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAR", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", entityResource.getAttributeOverrides().get(2).getName());
- }
-
- public void testUpdateAttributeOverrides() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl());
-
- entityResource.getAttributeOverrides().get(0).setName("FOO");
- entityResource.getAttributeOverrides().get(1).setName("BAR");
- entityResource.getAttributeOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAttributeOverride> attributeOverrides = ormEntity.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 = ormEntity.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 = ormEntity.specifiedAttributeOverrides();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(1);
- attributeOverrides = ormEntity.specifiedAttributeOverrides();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(1);
- attributeOverrides = ormEntity.specifiedAttributeOverrides();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(0);
- assertFalse(ormEntity.specifiedAttributeOverrides().hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- OrmPersistentType persistentType2 = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
-
- OrmEntity entity = (OrmEntity) persistentType.getMapping();
-
- assertEquals(3, entity.virtualAttributeOverridesSize());
- ListIterator<OrmAttributeOverride> virtualAttributeOverrides = entity.virtualAttributeOverrides();
- OrmAttributeOverride attributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", attributeOverride.getName());
-
- entity.virtualAttributeOverrides().next().setVirtual(false);
-
- assertEquals(2, entity.virtualAttributeOverridesSize());
- virtualAttributeOverrides = entity.virtualAttributeOverrides();
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", attributeOverride.getName());
-
- entity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(2, entity.virtualAttributeOverridesSize());
- virtualAttributeOverrides = entity.virtualAttributeOverrides();
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", attributeOverride.getName());
-
- entity.specifiedAttributeOverrides().next().setVirtual(true);
- entity.setSpecifiedMetadataComplete(Boolean.FALSE);
- entity.getJavaEntity().virtualAttributeOverrides().next().setVirtual(false);
- entity.getJavaEntity().specifiedAttributeOverrides().next().getColumn().setSpecifiedName("FOO");
- assertEquals(3, entity.virtualAttributeOverridesSize());
- virtualAttributeOverrides = entity.virtualAttributeOverrides();
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", attributeOverride.getName());
- assertEquals("FOO", attributeOverride.getColumn().getSpecifiedName());//TODO specified or default?
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", attributeOverride.getName());
- assertEquals("name", attributeOverride.getColumn().getSpecifiedName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", attributeOverride.getName());
-
- persistentType2.getAttributeNamed("name").makeSpecified();
- OrmBasicMapping basicMapping = (OrmBasicMapping) persistentType2.getAttributeNamed("name").getMapping();
- basicMapping.getColumn().setSpecifiedName("MY_NAME");
-
- assertEquals(3, entity.virtualAttributeOverridesSize());
- virtualAttributeOverrides = entity.virtualAttributeOverrides();
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", attributeOverride.getName());
- assertEquals("MY_NAME", attributeOverride.getColumn().getSpecifiedName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", attributeOverride.getName());
- assertEquals("FOO", attributeOverride.getColumn().getSpecifiedName());//TODO specified or default?
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", attributeOverride.getName());
- }
-
- public void testVirtualAttributeOverridesNoJavaEntity() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
-
- OrmEntity entity = (OrmEntity) persistentType.getMapping();
-
- persistentType.getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertEquals(3, entity.virtualAttributeOverridesSize());
- ListIterator<OrmAttributeOverride> virtualAttributeOverrides = entity.virtualAttributeOverrides();
- OrmAttributeOverride attributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", attributeOverride.getName());
- }
-
- public void testAttributeOverrideColumnDefaults() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
-
- OrmEntity entity = (OrmEntity) persistentType.getMapping();
-
- entity.virtualAttributeOverrides().next().setVirtual(false);
-
- OrmAttributeOverride attributeOverride = entity.specifiedAttributeOverrides().next();
- assertEquals("id", attributeOverride.getColumn().getDefaultName());
- assertEquals(CHILD_TYPE_NAME, attributeOverride.getColumn().getDefaultTable());
-
- ((JavaEntity) persistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("FOO");
- assertEquals("id", attributeOverride.getColumn().getDefaultName());
- assertEquals("FOO", attributeOverride.getColumn().getDefaultTable());
-
- entity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals("id", attributeOverride.getColumn().getDefaultName());
- assertEquals(CHILD_TYPE_NAME, attributeOverride.getColumn().getDefaultTable());
-
- entity.setSpecifiedMetadataComplete(Boolean.FALSE);
- entity.getTable().setSpecifiedName("BAR");
- assertEquals("id", attributeOverride.getColumn().getDefaultName());
- assertEquals("BAR", attributeOverride.getColumn().getDefaultTable());
- }
-
-// public void testAddSpecifiedAssociationOverride() throws Exception {
-// OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-// XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-//
-// OrmAssociationOverride associationOverride = ormEntity.addSpecifiedAssociationOverride(0);
-// associationOverride.setName("FOO");
-//
-// assertEquals("FOO", entityResource.getAssociationOverrides().get(0).getName());
-//
-// OrmAssociationOverride associationOverride2 = ormEntity.addSpecifiedAssociationOverride(0);
-// associationOverride2.setName("BAR");
-//
-// assertEquals("BAR", entityResource.getAssociationOverrides().get(0).getName());
-// assertEquals("FOO", entityResource.getAssociationOverrides().get(1).getName());
-//
-// OrmAssociationOverride associationOverride3 = ormEntity.addSpecifiedAssociationOverride(1);
-// associationOverride3.setName("BAZ");
-//
-// assertEquals("BAR", entityResource.getAssociationOverrides().get(0).getName());
-// assertEquals("BAZ", entityResource.getAssociationOverrides().get(1).getName());
-// assertEquals("FOO", entityResource.getAssociationOverrides().get(2).getName());
-//
-// ListIterator<OrmAssociationOverride> associationOverrides = ormEntity.specifiedAssociationOverrides();
-// assertEquals(associationOverride2, associationOverrides.next());
-// assertEquals(associationOverride3, associationOverrides.next());
-// assertEquals(associationOverride, associationOverrides.next());
-//
-// associationOverrides = ormEntity.specifiedAssociationOverrides();
-// assertEquals("BAR", associationOverrides.next().getName());
-// assertEquals("BAZ", associationOverrides.next().getName());
-// assertEquals("FOO", associationOverrides.next().getName());
-// }
-//
-// public void testRemoveSpecifiedAssociationOverride() throws Exception {
-// OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-//
-// ormEntity.addSpecifiedAssociationOverride(0).setName("FOO");
-// ormEntity.addSpecifiedAssociationOverride(1).setName("BAR");
-// ormEntity.addSpecifiedAssociationOverride(2).setName("BAZ");
-//
-// XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-// assertEquals(3, entityResource.getAssociationOverrides().size());
-//
-// ormEntity.removeSpecifiedAssociationOverride(0);
-// assertEquals(2, entityResource.getAssociationOverrides().size());
-// assertEquals("BAR", entityResource.getAssociationOverrides().get(0).getName());
-// assertEquals("BAZ", entityResource.getAssociationOverrides().get(1).getName());
-//
-// ormEntity.removeSpecifiedAssociationOverride(0);
-// assertEquals(1, entityResource.getAssociationOverrides().size());
-// assertEquals("BAZ", entityResource.getAssociationOverrides().get(0).getName());
-//
-// ormEntity.removeSpecifiedAssociationOverride(0);
-// assertEquals(0, entityResource.getAssociationOverrides().size());
-// }
-
- public void testMoveSpecifiedAssociationOverride() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl());
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl());
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl());
-
- entityResource.getAssociationOverrides().get(0).setName("FOO");
- entityResource.getAssociationOverrides().get(1).setName("BAR");
- entityResource.getAssociationOverrides().get(2).setName("BAZ");
-
- assertEquals(3, entityResource.getAssociationOverrides().size());
-
-
- ormEntity.moveSpecifiedAssociationOverride(2, 0);
- ListIterator<OrmAssociationOverride> associationOverrides = ormEntity.specifiedAssociationOverrides();
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
-
- assertEquals("BAR", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals("BAZ", entityResource.getAssociationOverrides().get(1).getName());
- assertEquals("FOO", entityResource.getAssociationOverrides().get(2).getName());
-
-
- ormEntity.moveSpecifiedAssociationOverride(0, 1);
- associationOverrides = ormEntity.specifiedAssociationOverrides();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
-
- assertEquals("BAZ", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals("BAR", entityResource.getAssociationOverrides().get(1).getName());
- assertEquals("FOO", entityResource.getAssociationOverrides().get(2).getName());
- }
-
- public void testUpdateAssociationOverrides() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl());
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl());
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl());
-
- entityResource.getAssociationOverrides().get(0).setName("FOO");
- entityResource.getAssociationOverrides().get(1).setName("BAR");
- entityResource.getAssociationOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAssociationOverride> associationOverrides = ormEntity.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 = ormEntity.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 = ormEntity.specifiedAssociationOverrides();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(1);
- associationOverrides = ormEntity.specifiedAssociationOverrides();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(1);
- associationOverrides = ormEntity.specifiedAssociationOverrides();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(0);
- assertFalse(ormEntity.specifiedAssociationOverrides().hasNext());
- }
-
-
- public void testAddNamedQuery() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- OrmNamedQuery namedQuery = ormEntity.addNamedQuery(0);
- namedQuery.setName("FOO");
-
- assertEquals("FOO", entityResource.getNamedQueries().get(0).getName());
-
- OrmNamedQuery namedQuery2 = ormEntity.addNamedQuery(0);
- namedQuery2.setName("BAR");
-
- assertEquals("BAR", entityResource.getNamedQueries().get(0).getName());
- assertEquals("FOO", entityResource.getNamedQueries().get(1).getName());
-
- OrmNamedQuery namedQuery3 = ormEntity.addNamedQuery(1);
- namedQuery3.setName("BAZ");
-
- assertEquals("BAR", entityResource.getNamedQueries().get(0).getName());
- assertEquals("BAZ", entityResource.getNamedQueries().get(1).getName());
- assertEquals("FOO", entityResource.getNamedQueries().get(2).getName());
-
- ListIterator<OrmNamedQuery> namedQueries = ormEntity.namedQueries();
- assertEquals(namedQuery2, namedQueries.next());
- assertEquals(namedQuery3, namedQueries.next());
- assertEquals(namedQuery, namedQueries.next());
-
- namedQueries = ormEntity.namedQueries();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- }
-
- public void testRemoveNamedQuery() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.addNamedQuery(0).setName("FOO");
- ormEntity.addNamedQuery(1).setName("BAR");
- ormEntity.addNamedQuery(2).setName("BAZ");
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getNamedQueries().size());
-
- ormEntity.removeNamedQuery(0);
- assertEquals(2, entityResource.getNamedQueries().size());
- assertEquals("BAR", entityResource.getNamedQueries().get(0).getName());
- assertEquals("BAZ", entityResource.getNamedQueries().get(1).getName());
-
- ormEntity.removeNamedQuery(0);
- assertEquals(1, entityResource.getNamedQueries().size());
- assertEquals("BAZ", entityResource.getNamedQueries().get(0).getName());
-
- ormEntity.removeNamedQuery(0);
- assertEquals(0, entityResource.getNamedQueries().size());
- }
-
- public void testMoveNamedQuery() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.addNamedQuery(0).setName("FOO");
- ormEntity.addNamedQuery(1).setName("BAR");
- ormEntity.addNamedQuery(2).setName("BAZ");
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getNamedQueries().size());
-
-
- ormEntity.moveNamedQuery(2, 0);
- ListIterator<OrmNamedQuery> namedQueries = ormEntity.namedQueries();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- assertEquals("BAR", entityResource.getNamedQueries().get(0).getName());
- assertEquals("BAZ", entityResource.getNamedQueries().get(1).getName());
- assertEquals("FOO", entityResource.getNamedQueries().get(2).getName());
-
-
- ormEntity.moveNamedQuery(0, 1);
- namedQueries = ormEntity.namedQueries();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- assertEquals("BAZ", entityResource.getNamedQueries().get(0).getName());
- assertEquals("BAR", entityResource.getNamedQueries().get(1).getName());
- assertEquals("FOO", entityResource.getNamedQueries().get(2).getName());
- }
-
- public void testUpdateNamedQueries() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- assertEquals(0, CollectionTools.size(ormEntity.getPersistenceUnit().allQueries()));
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- entityResource.getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery());
- entityResource.getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery());
- entityResource.getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery());
- entityResource.getNamedQueries().get(0).setName("FOO");
- entityResource.getNamedQueries().get(1).setName("BAR");
- entityResource.getNamedQueries().get(2).setName("BAZ");
-
- ListIterator<OrmNamedQuery> namedQueries = ormEntity.namedQueries();
- assertEquals("FOO", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(3, CollectionTools.size(ormEntity.getPersistenceUnit().allQueries()));
-
- entityResource.getNamedQueries().move(2, 0);
- namedQueries = ormEntity.namedQueries();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- entityResource.getNamedQueries().move(0, 1);
- namedQueries = ormEntity.namedQueries();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- entityResource.getNamedQueries().remove(1);
- namedQueries = ormEntity.namedQueries();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(2, CollectionTools.size(ormEntity.getPersistenceUnit().allQueries()));
-
- entityResource.getNamedQueries().remove(1);
- namedQueries = ormEntity.namedQueries();
- assertEquals("BAZ", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(1, CollectionTools.size(ormEntity.getPersistenceUnit().allQueries()));
-
- entityResource.getNamedQueries().remove(0);
- assertFalse(ormEntity.namedQueries().hasNext());
- assertEquals(0, CollectionTools.size(ormEntity.getPersistenceUnit().allQueries()));
- }
-
- public void testAddNamedNativeQuery() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- OrmNamedNativeQuery namedNativeQuery = ormEntity.addNamedNativeQuery(0);
- namedNativeQuery.setName("FOO");
-
- assertEquals("FOO", entityResource.getNamedNativeQueries().get(0).getName());
-
- OrmNamedNativeQuery namedNativeQuery2 = ormEntity.addNamedNativeQuery(0);
- namedNativeQuery2.setName("BAR");
-
- assertEquals("BAR", entityResource.getNamedNativeQueries().get(0).getName());
- assertEquals("FOO", entityResource.getNamedNativeQueries().get(1).getName());
-
- OrmNamedNativeQuery namedNativeQuery3 = ormEntity.addNamedNativeQuery(1);
- namedNativeQuery3.setName("BAZ");
-
- assertEquals("BAR", entityResource.getNamedNativeQueries().get(0).getName());
- assertEquals("BAZ", entityResource.getNamedNativeQueries().get(1).getName());
- assertEquals("FOO", entityResource.getNamedNativeQueries().get(2).getName());
-
- ListIterator<OrmNamedNativeQuery> namedNativeQueries = ormEntity.namedNativeQueries();
- assertEquals(namedNativeQuery2, namedNativeQueries.next());
- assertEquals(namedNativeQuery3, namedNativeQueries.next());
- assertEquals(namedNativeQuery, namedNativeQueries.next());
-
- namedNativeQueries = ormEntity.namedNativeQueries();
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
- }
-
- public void testRemoveNamedNativeQuery() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.addNamedNativeQuery(0).setName("FOO");
- ormEntity.addNamedNativeQuery(1).setName("BAR");
- ormEntity.addNamedNativeQuery(2).setName("BAZ");
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getNamedNativeQueries().size());
-
- ormEntity.removeNamedNativeQuery(0);
- assertEquals(2, entityResource.getNamedNativeQueries().size());
- assertEquals("BAR", entityResource.getNamedNativeQueries().get(0).getName());
- assertEquals("BAZ", entityResource.getNamedNativeQueries().get(1).getName());
-
- ormEntity.removeNamedNativeQuery(0);
- assertEquals(1, entityResource.getNamedNativeQueries().size());
- assertEquals("BAZ", entityResource.getNamedNativeQueries().get(0).getName());
-
- ormEntity.removeNamedNativeQuery(0);
- assertEquals(0, entityResource.getNamedNativeQueries().size());
- }
-
- public void testMoveNamedNativeQuery() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.addNamedNativeQuery(0).setName("FOO");
- ormEntity.addNamedNativeQuery(1).setName("BAR");
- ormEntity.addNamedNativeQuery(2).setName("BAZ");
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getNamedNativeQueries().size());
-
-
- ormEntity.moveNamedNativeQuery(2, 0);
- ListIterator<OrmNamedNativeQuery> namedNativeQueries = ormEntity.namedNativeQueries();
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
-
- assertEquals("BAR", entityResource.getNamedNativeQueries().get(0).getName());
- assertEquals("BAZ", entityResource.getNamedNativeQueries().get(1).getName());
- assertEquals("FOO", entityResource.getNamedNativeQueries().get(2).getName());
-
-
- ormEntity.moveNamedNativeQuery(0, 1);
- namedNativeQueries = ormEntity.namedNativeQueries();
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
-
- assertEquals("BAZ", entityResource.getNamedNativeQueries().get(0).getName());
- assertEquals("BAR", entityResource.getNamedNativeQueries().get(1).getName());
- assertEquals("FOO", entityResource.getNamedNativeQueries().get(2).getName());
- }
-
- public void testUpdateNamedNativeQueries() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- assertEquals(0, CollectionTools.size(ormEntity.getPersistenceUnit().allQueries()));
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- entityResource.getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery());
- entityResource.getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery());
- entityResource.getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery());
- entityResource.getNamedNativeQueries().get(0).setName("FOO");
- entityResource.getNamedNativeQueries().get(1).setName("BAR");
- entityResource.getNamedNativeQueries().get(2).setName("BAZ");
- ListIterator<OrmNamedNativeQuery> namedNativeQueries = ormEntity.namedNativeQueries();
- assertEquals("FOO", namedNativeQueries.next().getName());
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
- assertEquals(3, CollectionTools.size(ormEntity.getPersistenceUnit().allQueries()));
-
- entityResource.getNamedNativeQueries().move(2, 0);
- namedNativeQueries = ormEntity.namedNativeQueries();
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
-
- entityResource.getNamedNativeQueries().move(0, 1);
- namedNativeQueries = ormEntity.namedNativeQueries();
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
-
- entityResource.getNamedNativeQueries().remove(1);
- namedNativeQueries = ormEntity.namedNativeQueries();
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
- assertEquals(2, CollectionTools.size(ormEntity.getPersistenceUnit().allQueries()));
-
- entityResource.getNamedNativeQueries().remove(1);
- namedNativeQueries = ormEntity.namedNativeQueries();
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
- assertEquals(1, CollectionTools.size(ormEntity.getPersistenceUnit().allQueries()));
-
- entityResource.getNamedNativeQueries().remove(0);
- assertFalse(ormEntity.namedNativeQueries().hasNext());
- assertEquals(0, CollectionTools.size(ormEntity.getPersistenceUnit().allQueries()));
- }
-
- public void testUpdateIdClass() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getIdClass());
- assertNull(entityResource.getIdClass());
-
- entityResource.setIdClass(OrmFactory.eINSTANCE.createXmlIdClass());
-
- assertNull(ormEntity.getIdClass());
- assertNotNull(entityResource.getIdClass());
-
- entityResource.getIdClass().setClassName("model.Foo");
- assertEquals("model.Foo", ormEntity.getIdClass());
- assertEquals("model.Foo", entityResource.getIdClass().getClassName());
-
- //test setting @IdClass value to null, id-class tag is not removed
- entityResource.getIdClass().setClassName(null);
- assertNull(ormEntity.getIdClass());
- assertNotNull(entityResource.getIdClass());
-
- //reset @IdClass value and then remove id-class tag
- entityResource.setIdClass(OrmFactory.eINSTANCE.createXmlIdClass());
- entityResource.getIdClass().setClassName("model.Foo");
- entityResource.setIdClass(null);
-
- assertNull(ormEntity.getIdClass());
- assertNull(entityResource.getIdClass());
- }
-
- public void testModifyIdClass() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getIdClass());
- assertNull(entityResource.getIdClass());
-
- ormEntity.setIdClass("model.Foo");
- assertEquals("model.Foo", entityResource.getIdClass().getClassName());
- assertEquals("model.Foo", ormEntity.getIdClass());
-
- ormEntity.setIdClass(null);
- assertNull(ormEntity.getIdClass());
- assertNull(entityResource.getIdClass());
- }
-
-
- public void testGetPrimaryKeyColumnNameWithAttributeOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType parentPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmEntity childXmlEntity = (OrmEntity) childPersistentType.getMapping();
-
- assertNull(childXmlEntity.getPrimaryKeyColumnName());
-
- parentPersistentType.getAttributeNamed("id").makeSpecified(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals("id", childXmlEntity.getPrimaryKeyColumnName());
-
- ((OrmIdMapping) parentPersistentType.getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName("MY_ID");
- assertEquals("MY_ID", childXmlEntity.getPrimaryKeyColumnName());
-
- //TODO once bug 228718 is fixed
-// OrmAttributeOverride ormAttributeOverride = childXmlEntity.virtualAttributeOverrides().next();
-// assertEquals("id", ormAttributeOverride.getName());
-//
-// ormAttributeOverride = (OrmAttributeOverride) ormAttributeOverride.setVirtual(false);
-// ormAttributeOverride.getColumn().setSpecifiedName("ID");
-// assertEquals("ID", childXmlEntity.getPrimaryKeyColumnName());
- }
-
-
- public void testDiscriminatorValueIsAllowedConcreteClass() throws Exception {
- createTestType();
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity entity = (OrmEntity) persistentType.getMapping();
- assertTrue(entity.isDiscriminatorValueAllowed());
- }
-
- public void testDiscriminatorValueIsAllowedAbstractClass() throws Exception {
- createTestAbstractType();
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity entity = (OrmEntity) persistentType.getMapping();
- assertFalse(entity.isDiscriminatorValueAllowed());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmGeneratedValueTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmGeneratedValueTests.java
deleted file mode 100644
index c1d0ccada3..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmGeneratedValueTests.java
+++ /dev/null
@@ -1,153 +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.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.GeneratedValue;
-import org.eclipse.jpt.core.context.GenerationType;
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.core.context.orm.OrmGeneratedValue;
-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.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.core.resource.orm.XmlId;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class OrmGeneratedValueTests extends ContextModelTestCase
-{
- public OrmGeneratedValueTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- OrmGeneratedValue ormGeneratedValue = ormIdMapping.addGeneratedValue();
- XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
- XmlGeneratedValue generatedValueResource = idResource.getGeneratedValue();
-
- //set generator in the resource model, verify context model updated
- generatedValueResource.setGenerator("FOO");
- assertEquals("FOO", ormGeneratedValue.getSpecifiedGenerator());
- assertEquals("FOO", generatedValueResource.getGenerator());
-
- //set name to null in the resource model
- generatedValueResource.setGenerator(null);
- assertNull(ormGeneratedValue.getSpecifiedGenerator());
- assertNull(generatedValueResource.getGenerator());
- }
-
- public void testModifySpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- OrmGeneratedValue ormGeneratedValue = ormIdMapping.addGeneratedValue();
- XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
- XmlGeneratedValue generatedValueResource = idResource.getGeneratedValue();
-
- //set name in the context model, verify resource model modified
- ormGeneratedValue.setSpecifiedGenerator("FOO");
- assertEquals("FOO", generatedValueResource.getGenerator());
- assertEquals("FOO", ormGeneratedValue.getSpecifiedGenerator());
-
- //set name to null in the context model
- ormGeneratedValue.setSpecifiedGenerator(null);
- assertNull(generatedValueResource.getGenerator());
- assertNull(ormGeneratedValue.getSpecifiedGenerator());
- }
-
- public void testDefaultsFromJava() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmPersistentAttribute ormIdAttribute = ormPersistentType.virtualAttributes().next();
- IdMapping ormIdMapping = (IdMapping) ormIdAttribute.getMapping();
- assertEquals(null, ormIdMapping.getGeneratedValue());
-
- IdMapping javaIdMapping = (IdMapping) ormPersistentType.getJavaPersistentType().attributes().next().getMapping();
- GeneratedValue javaGeneratedValue = javaIdMapping.addGeneratedValue();
- javaGeneratedValue.setSpecifiedGenerator("Foo");
- javaGeneratedValue.setSpecifiedStrategy(GenerationType.SEQUENCE);
-
- assertEquals("Foo", ormIdMapping.getGeneratedValue().getSpecifiedGenerator());
- assertEquals(GenerationType.SEQUENCE, ormIdMapping.getGeneratedValue().getSpecifiedStrategy());
- assertEquals("Foo", javaGeneratedValue.getSpecifiedGenerator());
- assertEquals(GenerationType.SEQUENCE, javaGeneratedValue.getSpecifiedStrategy());
-
- ormIdAttribute.makeSpecified();
- ormIdAttribute = ormPersistentType.specifiedAttributes().next();
- ormIdMapping = (IdMapping) ormIdAttribute.getMapping();
- assertEquals(null, ormIdMapping.getGeneratedValue());
- assertEquals("Foo", javaGeneratedValue.getSpecifiedGenerator());
- assertEquals(GenerationType.SEQUENCE, javaGeneratedValue.getSpecifiedStrategy());
-
- ormIdAttribute.makeVirtual();
- ormIdAttribute = ormPersistentType.virtualAttributes().next();
- ormIdMapping = (IdMapping) ormIdAttribute.getMapping();
- assertEquals("Foo", ormIdMapping.getGeneratedValue().getSpecifiedGenerator());
- assertEquals(GenerationType.SEQUENCE, ormIdMapping.getGeneratedValue().getSpecifiedStrategy());
- assertEquals("Foo", javaGeneratedValue.getSpecifiedGenerator());
- assertEquals(GenerationType.SEQUENCE, javaGeneratedValue.getSpecifiedStrategy());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmIdMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmIdMappingTests.java
deleted file mode 100644
index 0dc6c8e6c9..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmIdMappingTests.java
+++ /dev/null
@@ -1,744 +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.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.BasicMapping;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-import org.eclipse.jpt.core.context.GenerationType;
-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.OneToOneMapping;
-import org.eclipse.jpt.core.context.TemporalConverter;
-import org.eclipse.jpt.core.context.TemporalType;
-import org.eclipse.jpt.core.context.TransientMapping;
-import org.eclipse.jpt.core.context.VersionMapping;
-import org.eclipse.jpt.core.context.orm.OrmColumn;
-import org.eclipse.jpt.core.context.orm.OrmGeneratedValue;
-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.context.orm.OrmSequenceGenerator;
-import org.eclipse.jpt.core.context.orm.OrmTableGenerator;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlId;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class OrmIdMappingTests extends ContextModelTestCase
-{
- public OrmIdMappingTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- private ICompilationUnit createTestEntityIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN, JPA.TEMPORAL, JPA.TEMPORAL_TYPE, JPA.GENERATED_VALUE, JPA.GENERATION_TYPE, JPA.TABLE_GENERATOR, JPA.SEQUENCE_GENERATOR);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append(CR);
- sb.append(" @Column(name=\"MY_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\", length=5, precision=6, scale=7)");
- sb.append(CR);
- sb.append(" @Temporal(TemporalType.TIMESTAMP)");
- sb.append(CR);
- sb.append(" @GeneratedValue(strategy=GenerationType.TABLE, generator=\"myTableGenerator\")");
- sb.append(CR);
- sb.append(" @TableGenerator(name=\"myTableGenerator\", table=\"myTable\", catalog=\"myCatalog\", schema=\"mySchema\", pkColumnName=\"myPkColumnName\", valueColumnName=\"myValueColumnName\", pkColumnValue=\"myPkColumnValue\", initialValue=1, allocationSize=1)");
- sb.append(CR);
- sb.append(" @SequenceGenerator(name=\"mySequenceGenerator\")");
- }
- });
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertEquals("idMapping", ormIdMapping.getName());
- assertEquals("idMapping", idResource.getName());
-
- //set name in the resource model, verify context model updated
- idResource.setName("newName");
- assertEquals("newName", ormIdMapping.getName());
- assertEquals("newName", idResource.getName());
-
- //set name to null in the resource model
- idResource.setName(null);
- assertNull(ormIdMapping.getName());
- assertNull(idResource.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertEquals("idMapping", ormIdMapping.getName());
- assertEquals("idMapping", idResource.getName());
-
- //set name in the context model, verify resource model updated
- ormIdMapping.setName("newName");
- assertEquals("newName", ormIdMapping.getName());
- assertEquals("newName", idResource.getName());
-
- //set name to null in the context model
- ormIdMapping.setName(null);
- assertNull(ormIdMapping.getName());
- assertNull(idResource.getName());
- }
-
- public void testUpdateTemporal() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getSpecifiedConverter());
- assertNull(idResource.getTemporal());
-
- //set temporal in the resource model, verify context model updated
- idResource.setTemporal(org.eclipse.jpt.core.resource.orm.TemporalType.DATE);
- assertEquals(TemporalType.DATE, ((TemporalConverter) ormIdMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.core.resource.orm.TemporalType.DATE, idResource.getTemporal());
-
- idResource.setTemporal(org.eclipse.jpt.core.resource.orm.TemporalType.TIME);
- assertEquals(TemporalType.TIME, ((TemporalConverter) ormIdMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.core.resource.orm.TemporalType.TIME, idResource.getTemporal());
-
- idResource.setTemporal(org.eclipse.jpt.core.resource.orm.TemporalType.TIMESTAMP);
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) ormIdMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.core.resource.orm.TemporalType.TIMESTAMP, idResource.getTemporal());
-
- //set temporal to null in the resource model
- idResource.setTemporal(null);
- assertNull(ormIdMapping.getSpecifiedConverter());
- assertNull(idResource.getTemporal());
- }
-
- public void testModifyTemporal() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getSpecifiedConverter());
- assertNull(idResource.getTemporal());
-
- //set temporal in the context model, verify resource model updated
- ormIdMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) ormIdMapping.getSpecifiedConverter()).setTemporalType(TemporalType.DATE);
- assertEquals(org.eclipse.jpt.core.resource.orm.TemporalType.DATE, idResource.getTemporal());
- assertEquals(TemporalType.DATE, ((TemporalConverter) ormIdMapping.getSpecifiedConverter()).getTemporalType());
-
- ((TemporalConverter) ormIdMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.core.resource.orm.TemporalType.TIME, idResource.getTemporal());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ormIdMapping.getSpecifiedConverter()).getTemporalType());
-
- ((TemporalConverter) ormIdMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIMESTAMP);
- assertEquals(org.eclipse.jpt.core.resource.orm.TemporalType.TIMESTAMP, idResource.getTemporal());
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) ormIdMapping.getSpecifiedConverter()).getTemporalType());
-
- //set temporal to null in the context model
- ormIdMapping.setSpecifiedConverter(null);
- assertNull(idResource.getTemporal());
- assertNull(ormIdMapping.getSpecifiedConverter());
- }
-
- //TODO test defaults
- //TODO test overriding java mapping with a different mapping type in xml
-
-
- public void testAddSequenceGenerator() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getSequenceGenerator());
- assertNull(idResource.getSequenceGenerator());
-
- ormIdMapping.addSequenceGenerator();
-
- assertNotNull(idResource.getSequenceGenerator());
- assertNotNull(ormIdMapping.getSequenceGenerator());
-
- //try adding another sequence generator, should get an IllegalStateException
- try {
- ormIdMapping.addSequenceGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveSequenceGenerator() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getSequenceGenerator());
- assertNull(idResource.getSequenceGenerator());
-
- ormIdMapping.addSequenceGenerator();
- assertNotNull(idResource.getSequenceGenerator());
- assertNotNull(ormIdMapping.getSequenceGenerator());
-
- ormIdMapping.removeSequenceGenerator();
-
- assertNull(ormIdMapping.getSequenceGenerator());
- assertNull(idResource.getSequenceGenerator());
-
- //try removing the sequence generator again, should get an IllegalStateException
- try {
- ormIdMapping.removeSequenceGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testUpdateSequenceGenerator() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getSequenceGenerator());
- assertNull(idResource.getSequenceGenerator());
- assertEquals(0, CollectionTools.size(ormIdMapping.getPersistenceUnit().allGenerators()));
-
- idResource.setSequenceGenerator(OrmFactory.eINSTANCE.createXmlSequenceGeneratorImpl());
- assertNotNull(ormIdMapping.getSequenceGenerator());
- assertNotNull(idResource.getSequenceGenerator());
- assertEquals(1, CollectionTools.size(ormIdMapping.getPersistenceUnit().allGenerators()));
-
- ormIdMapping.getSequenceGenerator().setName("foo");
- assertEquals(1, CollectionTools.size(ormIdMapping.getPersistenceUnit().allGenerators()));
-
- idResource.setSequenceGenerator(null);
- assertNull(ormIdMapping.getSequenceGenerator());
- assertNull(idResource.getSequenceGenerator());
- assertEquals(0, CollectionTools.size(ormIdMapping.getPersistenceUnit().allGenerators()));
- }
-
- public void testAddTableGenerator() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getTableGenerator());
- assertNull(idResource.getTableGenerator());
-
- ormIdMapping.addTableGenerator();
-
- assertNotNull(idResource.getTableGenerator());
- assertNotNull(ormIdMapping.getTableGenerator());
-
- //try adding another table generator, should get an IllegalStateException
- try {
- ormIdMapping.addTableGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveTableGenerator() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getTableGenerator());
- assertNull(idResource.getTableGenerator());
-
- ormIdMapping.addTableGenerator();
- assertNotNull(idResource.getTableGenerator());
- assertNotNull(ormIdMapping.getTableGenerator());
-
- ormIdMapping.removeTableGenerator();
-
- assertNull(ormIdMapping.getTableGenerator());
- assertNull(idResource.getTableGenerator());
-
- //try removing the table generator again, should get an IllegalStateException
- try {
- ormIdMapping.removeTableGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testUpdateTableGenerator() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getTableGenerator());
- assertNull(idResource.getTableGenerator());
- assertEquals(0, CollectionTools.size(ormIdMapping.getPersistenceUnit().allGenerators()));
-
- idResource.setTableGenerator(OrmFactory.eINSTANCE.createXmlTableGeneratorImpl());
- assertNotNull(ormIdMapping.getTableGenerator());
- assertNotNull(idResource.getTableGenerator());
- assertEquals(1, CollectionTools.size(ormIdMapping.getPersistenceUnit().allGenerators()));
-
- ormIdMapping.getTableGenerator().setName("foo");
- assertEquals(1, CollectionTools.size(ormIdMapping.getPersistenceUnit().allGenerators()));
-
- idResource.setTableGenerator(null);
- assertNull(ormIdMapping.getTableGenerator());
- assertNull(idResource.getTableGenerator());
- assertEquals(0, CollectionTools.size(ormIdMapping.getPersistenceUnit().allGenerators()));
- }
-
- public void testAddGeneratedValue() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getGeneratedValue());
- assertNull(idResource.getGeneratedValue());
-
- ormIdMapping.addGeneratedValue();
-
- assertNotNull(idResource.getGeneratedValue());
- assertNotNull(ormIdMapping.getGeneratedValue());
-
- //try adding another sequence generator, should get an IllegalStateException
- try {
- ormIdMapping.addGeneratedValue();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveGeneratedValue() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getGeneratedValue());
- assertNull(idResource.getGeneratedValue());
-
- ormIdMapping.addGeneratedValue();
- assertNotNull(idResource.getGeneratedValue());
- assertNotNull(ormIdMapping.getGeneratedValue());
-
- ormIdMapping.removeGeneratedValue();
-
- assertNull(ormIdMapping.getGeneratedValue());
- assertNull(idResource.getGeneratedValue());
-
- //try removing the sequence generator again, should get an IllegalStateException
- try {
- ormIdMapping.removeGeneratedValue();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testUpdateGeneratedValue() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getGeneratedValue());
- assertNull(idResource.getGeneratedValue());
-
- idResource.setGeneratedValue(OrmFactory.eINSTANCE.createXmlGeneratedValueImpl());
-
- assertNotNull(ormIdMapping.getGeneratedValue());
- assertNotNull(idResource.getGeneratedValue());
-
- idResource.setGeneratedValue(null);
- assertNull(ormIdMapping.getGeneratedValue());
- assertNull(idResource.getGeneratedValue());
- }
-
-
- public void testIdMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityIdMapping();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "foo");
- assertEquals(2, ormPersistentType.virtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("foo", ormIdMapping.getName());
- assertNull(ormIdMapping.getSpecifiedConverter());
- assertNull(ormIdMapping.getGeneratedValue());
- assertNull(ormIdMapping.getSequenceGenerator());
- assertNull(ormIdMapping.getTableGenerator());
-
-
- OrmColumn ormColumn = ormIdMapping.getColumn();
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
-
- assertEquals("foo", ormColumn.getDefaultName());
- assertEquals(Boolean.FALSE, ormColumn.getDefaultUnique());
- assertEquals(Boolean.TRUE, ormColumn.getDefaultNullable());
- assertEquals(Boolean.TRUE, ormColumn.getDefaultInsertable());
- assertEquals(Boolean.TRUE, ormColumn.getDefaultUpdatable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getDefaultTable());
- assertEquals(Integer.valueOf(255), ormColumn.getDefaultLength());
- assertEquals(Integer.valueOf(0), ormColumn.getDefaultPrecision());
- assertEquals(Integer.valueOf(0), ormColumn.getDefaultScale());
- }
-
- //@Basic(fetch=FetchType.LAZY, optional=false)
- //@Column(name="MY_COLUMN", unique=true, nullable=false, insertable=false, updatable=false,
- // columnDefinition="COLUMN_DEFINITION", table="MY_TABLE", length=5, precision=6, scale=7)");
- //@Column(
- //@Lob
- //@Temporal(TemporalType.TIMESTAMP)
- //@Enumerated(EnumType.STRING)
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(2, ormPersistentType.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- assertEquals("id", ormIdMapping.getName());
- assertEquals(Converter.TEMPORAL_CONVERTER, ormIdMapping.getConverter().getType());
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) ormIdMapping.getConverter()).getTemporalType());
-
- OrmColumn ormColumn = ormIdMapping.getColumn();
- assertEquals("MY_COLUMN", ormColumn.getSpecifiedName());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", ormColumn.getColumnDefinition());
- assertEquals("MY_TABLE", ormColumn.getSpecifiedTable());
- assertEquals(Integer.valueOf(5), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(6), ormColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(7), ormColumn.getSpecifiedScale());
-
- OrmGeneratedValue ormGeneratedValue = ormIdMapping.getGeneratedValue();
- assertEquals("myTableGenerator", ormGeneratedValue.getSpecifiedGenerator());
- assertEquals(GenerationType.TABLE, ormGeneratedValue.getSpecifiedStrategy());
-
- OrmTableGenerator ormTableGenerator = ormIdMapping.getTableGenerator();
- assertEquals("myTableGenerator", ormTableGenerator.getName());
- assertEquals("myTable", ormTableGenerator.getSpecifiedTable());
- assertEquals("myCatalog", ormTableGenerator.getSpecifiedCatalog());
- assertEquals("mySchema", ormTableGenerator.getSpecifiedSchema());
- assertEquals("myPkColumnName", ormTableGenerator.getSpecifiedPkColumnName());
- assertEquals("myPkColumnValue", ormTableGenerator.getSpecifiedPkColumnValue());
- assertEquals("myValueColumnName", ormTableGenerator.getSpecifiedValueColumnName());
- assertEquals(Integer.valueOf(1), ormTableGenerator.getSpecifiedInitialValue());
- assertEquals(Integer.valueOf(1), ormTableGenerator.getSpecifiedAllocationSize());
-
- OrmSequenceGenerator ormSequenceGenerator = ormIdMapping.getSequenceGenerator();
- assertEquals("mySequenceGenerator", ormSequenceGenerator.getName());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(2, ormPersistentType.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
-
- ormPersistentAttribute.makeSpecified(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute= ormPersistentType.specifiedAttributes().next();
-
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- assertEquals("id", ormIdMapping.getName());
- assertNull(ormIdMapping.getSpecifiedConverter());
- assertNull(ormIdMapping.getGeneratedValue());
- assertNull(ormIdMapping.getSequenceGenerator());
- assertNull(ormIdMapping.getTableGenerator());
-
- OrmColumn ormColumn = ormIdMapping.getColumn();
- assertEquals("id", ormColumn.getName());
- assertEquals(Boolean.FALSE, ormColumn.getUnique());
- assertEquals(Boolean.TRUE, ormColumn.getNullable());
- assertEquals(Boolean.TRUE, ormColumn.getInsertable());
- assertEquals(Boolean.TRUE, ormColumn.getUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getTable());
- assertEquals(Integer.valueOf(255), ormColumn.getLength());
- assertEquals(Integer.valueOf(0), ormColumn.getPrecision());
- assertEquals(Integer.valueOf(0), ormColumn.getScale());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityIdMapping();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
- assertEquals(1, ormPersistentType.virtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("id", ormIdMapping.getName());
- assertNull(ormIdMapping.getSpecifiedConverter());
- assertNull(ormIdMapping.getGeneratedValue());
- assertNull(ormIdMapping.getSequenceGenerator());
- assertNull(ormIdMapping.getTableGenerator());
-
- OrmColumn ormColumn = ormIdMapping.getColumn();
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
-
- assertEquals("id", ormColumn.getDefaultName());
- assertEquals(Boolean.FALSE, ormColumn.getDefaultUnique());
- assertEquals(Boolean.TRUE, ormColumn.getDefaultNullable());
- assertEquals(Boolean.TRUE, ormColumn.getDefaultInsertable());
- assertEquals(Boolean.TRUE, ormColumn.getDefaultUpdatable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getDefaultTable());
- assertEquals(Integer.valueOf(255), ormColumn.getDefaultLength());
- assertEquals(Integer.valueOf(0), ormColumn.getDefaultPrecision());
- assertEquals(Integer.valueOf(0), ormColumn.getDefaultScale());
- }
-
- //3 things tested above
- //1. virtual mapping metadata complete=false - defaults are taken from the java annotations
- //2. virtual mapping metadata complete=true - defaults are taken from java defaults,annotations ignored
- //3. specified mapping (metadata complete=true/false - defaults are taken from java annotations
-
- public void testIdMorphToBasicMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) idMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- assertEquals("FOO", ((BasicMapping) ormPersistentAttribute.getMapping()).getColumn().getSpecifiedName());
- }
-
- public void testIdMorphToVersionMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) idMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- assertEquals("FOO", ((VersionMapping) ormPersistentAttribute.getMapping()).getColumn().getSpecifiedName());
- }
-
- public void testIdMorphToTransientMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) idMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testIdMorphToEmbeddedMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) idMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testIdMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) idMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testIdMorphToOneToOneMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) idMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testIdMorphToOneToManyMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) idMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.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("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testIdMorphToManyToOneMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) idMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.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("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testIdMorphToManyToManyMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) idMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.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("id", ormPersistentAttribute.getMapping().getName());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmJoinColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmJoinColumnTests.java
deleted file mode 100644
index 24a19dba28..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmJoinColumnTests.java
+++ /dev/null
@@ -1,506 +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.tests.internal.context.orm;
-
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJoinTable;
-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.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.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-
-public class OrmJoinColumnTests extends ContextModelTestCase
-{
- public OrmJoinColumnTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(joinColumn.getSpecifiedName());
- assertNull(joinColumnResource.getName());
-
- //set name in the resource model, verify context model updated
- joinColumnResource.setName("FOO");
- assertEquals("FOO", joinColumn.getSpecifiedName());
- assertEquals("FOO", joinColumnResource.getName());
-
- //set name to null in the resource model
- joinColumnResource.setName(null);
- assertNull(joinColumn.getSpecifiedName());
- assertNull(joinColumnResource.getName());
-
- joinColumnResource.setName("FOO");
- assertEquals("FOO", joinColumn.getSpecifiedName());
- assertEquals("FOO", joinColumnResource.getName());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.specifiedJoinColumns().hasNext());
- assertTrue(joinTableResource.getJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(joinColumn.getSpecifiedName());
- assertNull(joinColumnResource.getName());
-
- //set name in the context model, verify resource model modified
- joinColumn.setSpecifiedName("foo");
- assertEquals("foo", joinColumn.getSpecifiedName());
- assertEquals("foo", joinColumnResource.getName());
-
- //set name to null in the context model
- joinColumn.setSpecifiedName(null);
- assertNull(joinColumn.getSpecifiedName());
- assertNull(joinTableResource.getJoinColumns().get(0).getName());
- }
-
- public void testUpdateSpecifiedReferencedColumnName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(joinColumn.getSpecifiedReferencedColumnName());
- assertNull(joinColumnResource.getReferencedColumnName());
-
- //set name in the resource model, verify context model updated
- joinColumnResource.setReferencedColumnName("FOO");
- assertEquals("FOO", joinColumn.getSpecifiedReferencedColumnName());
- assertEquals("FOO", joinColumnResource.getReferencedColumnName());
-
- //set name to null in the resource model
- joinColumnResource.setReferencedColumnName(null);
- assertNull(joinColumn.getSpecifiedReferencedColumnName());
- assertNull(joinColumnResource.getReferencedColumnName());
-
- joinColumnResource.setReferencedColumnName("FOO");
- assertEquals("FOO", joinColumn.getSpecifiedReferencedColumnName());
- assertEquals("FOO", joinColumnResource.getReferencedColumnName());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.specifiedJoinColumns().hasNext());
- assertTrue(joinTableResource.getJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedReferencedColumnName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(joinColumn.getSpecifiedReferencedColumnName());
- assertNull(joinColumnResource.getReferencedColumnName());
-
- //set name in the context model, verify resource model modified
- joinColumn.setSpecifiedReferencedColumnName("foo");
- assertEquals("foo", joinColumn.getSpecifiedReferencedColumnName());
- assertEquals("foo", joinColumnResource.getReferencedColumnName());
-
- //set name to null in the context model
- joinColumn.setSpecifiedReferencedColumnName(null);
- assertNull(joinColumn.getSpecifiedReferencedColumnName());
- assertNull(joinTableResource.getJoinColumns().get(0).getReferencedColumnName());
- }
-
- public void testUpdateSpecifiedColumnDefinition() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(joinColumn.getColumnDefinition());
- assertNull(joinColumnResource.getColumnDefinition());
-
- //set name in the resource model, verify context model updated
- joinColumnResource.setColumnDefinition("FOO");
- assertEquals("FOO", joinColumn.getColumnDefinition());
- assertEquals("FOO", joinColumnResource.getColumnDefinition());
-
- //set name to null in the resource model
- joinColumnResource.setColumnDefinition(null);
- assertNull(joinColumn.getColumnDefinition());
- assertNull(joinColumnResource.getColumnDefinition());
-
- joinColumnResource.setColumnDefinition("FOO");
- assertEquals("FOO", joinColumn.getColumnDefinition());
- assertEquals("FOO", joinColumnResource.getColumnDefinition());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.specifiedJoinColumns().hasNext());
- assertTrue(joinTableResource.getJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedColumnDefinition() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(joinColumn.getColumnDefinition());
- assertNull(joinColumnResource.getColumnDefinition());
-
- //set name in the context model, verify resource model modified
- joinColumn.setColumnDefinition("foo");
- assertEquals("foo", joinColumn.getColumnDefinition());
- assertEquals("foo", joinColumnResource.getColumnDefinition());
-
- //set name to null in the context model
- joinColumn.setColumnDefinition(null);
- assertNull(joinColumn.getColumnDefinition());
- assertNull(joinTableResource.getJoinColumns().get(0).getColumnDefinition());
- }
-
- public void testUpdateSpecifiedTable() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedTable());
- assertNull(joinColumnResource.getTable());
-
- //set table in the resource model, verify context model updated
- joinColumnResource.setTable("FOO");
- assertEquals("FOO", ormJoinColumn.getSpecifiedTable());
- assertEquals("FOO", joinColumnResource.getTable());
-
- //set table to null in the resource model
- joinColumnResource.setTable(null);
- assertNull(ormJoinColumn.getSpecifiedTable());
- assertNull(joinColumnResource.getTable());
-
- joinColumnResource.setTable("FOO");
- assertEquals("FOO", ormJoinColumn.getSpecifiedTable());
- assertEquals("FOO", joinColumnResource.getTable());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.specifiedJoinColumns().hasNext());
- assertTrue(joinTableResource.getJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedTable() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedTable());
- assertNull(joinColumnResource.getTable());
-
- //set table in the context model, verify resource model modified
- ormJoinColumn.setSpecifiedTable("foo");
- assertEquals("foo", ormJoinColumn.getSpecifiedTable());
- assertEquals("foo", joinColumnResource.getTable());
-
- //set table to null in the context model
- ormJoinColumn.setSpecifiedTable(null);
- assertNull(ormJoinColumn.getSpecifiedTable());
- assertNull(joinTableResource.getJoinColumns().get(0).getTable());
- }
-
- public void testUpdateSpecifiedNullable() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedNullable());
- assertNull(joinColumnResource.getNullable());
-
- //set nullable in the resource model, verify context model updated
- joinColumnResource.setNullable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedNullable());
- assertEquals(Boolean.TRUE, joinColumnResource.getNullable());
-
- //set nullable to null in the resource model
- joinColumnResource.setNullable(null);
- assertNull(ormJoinColumn.getSpecifiedNullable());
- assertNull(joinColumnResource.getNullable());
-
- joinColumnResource.setNullable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, joinColumnResource.getNullable());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.specifiedJoinColumns().hasNext());
- assertTrue(joinTableResource.getJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedNullable() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedNullable());
- assertNull(joinColumnResource.getNullable());
-
- //set nullable in the context model, verify resource model modified
- ormJoinColumn.setSpecifiedNullable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, joinColumnResource.getNullable());
-
- //set nullable to null in the context model
- ormJoinColumn.setSpecifiedNullable(null);
- assertNull(ormJoinColumn.getSpecifiedNullable());
- assertNull(joinTableResource.getJoinColumns().get(0).getNullable());
- }
-
- public void testUpdateSpecifiedUpdatable() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedUpdatable());
- assertNull(joinColumnResource.getUpdatable());
-
- //set updatable in the resource model, verify context model updated
- joinColumnResource.setUpdatable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.TRUE, joinColumnResource.getUpdatable());
-
- //set updatable to null in the resource model
- joinColumnResource.setUpdatable(null);
- assertNull(ormJoinColumn.getSpecifiedUpdatable());
- assertNull(joinColumnResource.getUpdatable());
-
- joinColumnResource.setUpdatable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, joinColumnResource.getUpdatable());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.specifiedJoinColumns().hasNext());
- assertTrue(joinTableResource.getJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedUpdatable() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedUpdatable());
- assertNull(joinColumnResource.getUpdatable());
-
- //set updatable in the context model, verify resource model modified
- ormJoinColumn.setSpecifiedUpdatable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, joinColumnResource.getUpdatable());
-
- //set updatable to null in the context model
- ormJoinColumn.setSpecifiedUpdatable(null);
- assertNull(ormJoinColumn.getSpecifiedUpdatable());
- assertNull(joinTableResource.getJoinColumns().get(0).getUpdatable());
- }
-
- public void testUpdateSpecifiedInsertable() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedInsertable());
- assertNull(joinColumnResource.getInsertable());
-
- //set insertable in the resource model, verify context model updated
- joinColumnResource.setInsertable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.TRUE, joinColumnResource.getInsertable());
-
- //set insertable to null in the resource model
- joinColumnResource.setInsertable(null);
- assertNull(ormJoinColumn.getSpecifiedInsertable());
- assertNull(joinColumnResource.getInsertable());
-
- joinColumnResource.setInsertable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, joinColumnResource.getInsertable());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.specifiedJoinColumns().hasNext());
- assertTrue(joinTableResource.getJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedInsertable() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedInsertable());
- assertNull(joinColumnResource.getInsertable());
-
- //set insertable in the context model, verify resource model modified
- ormJoinColumn.setSpecifiedInsertable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, joinColumnResource.getInsertable());
-
- //set insertable to null in the context model
- ormJoinColumn.setSpecifiedInsertable(null);
- assertNull(ormJoinColumn.getSpecifiedInsertable());
- assertNull(joinTableResource.getJoinColumns().get(0).getInsertable());
- }
-
- public void testUpdateSpecifiedUnique() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedUnique());
- assertNull(joinColumnResource.getUnique());
-
- //set unique in the resource model, verify context model updated
- joinColumnResource.setUnique(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.TRUE, joinColumnResource.getUnique());
-
- //set unique to null in the resource model
- joinColumnResource.setUnique(null);
- assertNull(ormJoinColumn.getSpecifiedUnique());
- assertNull(joinColumnResource.getUnique());
-
- joinColumnResource.setUnique(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, joinColumnResource.getUnique());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.specifiedJoinColumns().hasNext());
- assertTrue(joinTableResource.getJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedUnique() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedUnique());
- assertNull(joinColumnResource.getUnique());
-
- //set unique in the context model, verify resource model modified
- ormJoinColumn.setSpecifiedUnique(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, joinColumnResource.getUnique());
-
- //set unique to null in the context model
- ormJoinColumn.setSpecifiedUnique(null);
- assertNull(ormJoinColumn.getSpecifiedUnique());
- assertNull(joinTableResource.getJoinColumns().get(0).getUnique());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmJoinTableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmJoinTableTests.java
deleted file mode 100644
index b4a1da69d8..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmJoinTableTests.java
+++ /dev/null
@@ -1,1156 +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.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.JavaJoinTable;
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-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.OrmJoinTable;
-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.context.orm.OrmUniqueConstraint;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class OrmJoinTableTests extends ContextModelTestCase
-{
- public OrmJoinTableTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- private ICompilationUnit createTestEntityWithValidManyToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany").append(CR);
- sb.append(" private Collection<Project> projects;").append(CR);
- sb.append("@Id").append(CR);
- }
- });
- }
-
- private void createTargetEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Project {").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int proj_id;").append(CR);
- sb.append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Project.java", sourceWriter);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
-
- assertNull(ormJoinTable.getSpecifiedName());
- assertNull(manyToMany.getJoinTable());
-
-
- //set name in the resource model, verify context model updated
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTableImpl());
- manyToMany.getJoinTable().setName("FOO");
- assertEquals("FOO", ormJoinTable.getSpecifiedName());
- assertEquals("FOO", manyToMany.getJoinTable().getName());
-
- //set name to null in the resource model
- manyToMany.getJoinTable().setName(null);
- assertNull(ormJoinTable.getSpecifiedName());
- assertNull(manyToMany.getJoinTable().getName());
-
- manyToMany.getJoinTable().setName("FOO");
- assertEquals("FOO", ormJoinTable.getSpecifiedName());
- assertEquals("FOO", manyToMany.getJoinTable().getName());
-
- manyToMany.setJoinTable(null);
- assertNull(ormJoinTable.getSpecifiedName());
- assertNull(manyToMany.getJoinTable());
- }
-
- public void testModifySpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
-
- assertNull(ormJoinTable.getSpecifiedName());
- assertNull(manyToMany.getJoinTable());
-
- //set name in the context model, verify resource model modified
- ormJoinTable.setSpecifiedName("foo");
- assertEquals("foo", ormJoinTable.getSpecifiedName());
- assertEquals("foo", manyToMany.getJoinTable().getName());
-
- //set name to null in the context model
- ormJoinTable.setSpecifiedName(null);
- assertNull(ormJoinTable.getSpecifiedName());
- assertNull(manyToMany.getJoinTable());
- }
-
- public void testVirtualJoinTable() throws Exception {
- createTestEntityWithValidManyToMany();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("projects");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(null, ormJoinTable.getSpecifiedName());
-
- createTargetEntity();
- entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Project");
-
- assertEquals(TYPE_NAME + "_Project", ormJoinTable.getSpecifiedName());
- assertNull(ormJoinTable.getSpecifiedCatalog());
- assertNull(ormJoinTable.getSpecifiedSchema());
- assertEquals(0, ormJoinTable.specifiedJoinColumnsSize());
- assertEquals(0, ormJoinTable.specifiedInverseJoinColumnsSize());
- OrmJoinColumn ormJoinColumn = ormJoinTable.getDefaultJoinColumn();
-//TODO need to test joinColumn defaults here as well as in java and all the relatioship mapping types
-// assertEquals("id_project_id", ormJoinColumn.getDefaultName());
-// assertEquals("id_project_id", ormJoinColumn.getDefaultReferencedColumnName());
- OrmJoinColumn inverseOrmJoinColumn = ormJoinTable.getDefaultInverseJoinColumn();
-// assertEquals("id_project_id", inverseOrmJoinColumn.getDefaultName());
-// assertEquals("id_project_id", inverseOrmJoinColumn.getDefaultReferencedColumnName());
-
- JavaPersistentAttribute javaPersistentAttribute = ormManyToManyMapping.getJavaPersistentAttribute();
- JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) javaPersistentAttribute.getMapping();
- JavaJoinTable javaJoinTable = javaManyToManyMapping.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 {
- createTestEntityWithValidManyToMany();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "projects");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- assertEquals(null, ormJoinTable.getDefaultName());
-
- createTargetEntity();
- OrmPersistentType targetPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Project");
- assertEquals(TYPE_NAME + "_Project", ormJoinTable.getDefaultName());
-
-
- ((JavaEntity) targetPersistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("FOO");
- assertEquals(TYPE_NAME + "_FOO", ormJoinTable.getDefaultName());
-
- ((JavaEntity) ormPersistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("BAR");
- assertEquals("BAR_FOO", ormJoinTable.getDefaultName());
-
- ormPersistentType.getJavaPersistentType().getAttributeNamed("projects").setSpecifiedMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- JavaManyToManyMapping javaManyMapping = (JavaManyToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("projects").getMapping();
- javaManyMapping.getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE");
-
- assertEquals("BAR_FOO", ormJoinTable.getDefaultName());
-
-
- //set metadata-complete to true, will ignore java annotation settings
- entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(TYPE_NAME + "_Project", ormJoinTable.getDefaultName());
-
-
- entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- //remove m-m mapping from the orm.xml file
- ormPersistentAttribute.makeVirtual();
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(null);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("projects");
- ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- ormJoinTable = ormManyToManyMapping.getJoinTable();
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals("JAVA_JOIN_TABLE", ormManyToManyMapping.getJoinTable().getSpecifiedName());//specifiedName since this is a virtual mapping now
-
- javaManyMapping.getJoinTable().setSpecifiedName(null);
- 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 testUpdateSpecifiedSchema() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
-
- assertNull(ormJoinTable.getSpecifiedSchema());
- assertNull(manyToMany.getJoinTable());
-
- //set schema in the resource model, verify context model updated
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTableImpl());
- manyToMany.getJoinTable().setSchema("FOO");
- assertEquals("FOO", ormJoinTable.getSpecifiedSchema());
- assertEquals("FOO", manyToMany.getJoinTable().getSchema());
-
- //set Schema to null in the resource model
- manyToMany.getJoinTable().setSchema(null);
- assertNull(ormJoinTable.getSpecifiedSchema());
- assertNull(manyToMany.getJoinTable().getSchema());
-
- manyToMany.getJoinTable().setSchema("FOO");
- assertEquals("FOO", ormJoinTable.getSpecifiedSchema());
- assertEquals("FOO", manyToMany.getJoinTable().getSchema());
-
- manyToMany.setJoinTable(null);
- assertNull(ormJoinTable.getSpecifiedSchema());
- assertNull(manyToMany.getJoinTable());
- }
-
-// public void testUpdateDefaultSchemaFromJavaTable() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// XmlEntity xmlEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertNull(xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.javaEntity().getTable().setSpecifiedSchema("Foo");
-// assertEquals("Foo", xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-// assertNull(xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-// xmlEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
-// assertNull(xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.setSpecifiedMetadataComplete(null);
-// assertNull(xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
-// assertEquals("Foo", xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.getTable().setSpecifiedName("Bar");
-// assertNull(xmlEntity.getTable().getDefaultSchema());
-// }
-//
-// public void testUpdateDefaultSchemaNoJava() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlEntity xmlEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertNull(xmlEntity.getTable().getDefaultSchema());
-// }
-//
-// public void testUpdateDefaultSchemaFromParent() throws Exception {
-// createTestEntity();
-// createTestSubType();
-//
-// OrmPersistentType parentOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-// XmlEntity parentXmlEntity = (XmlEntity) parentOrmPersistentType.getMapping();
-// XmlEntity childXmlEntity = (XmlEntity) childOrmPersistentType.getMapping();
-//
-// assertNull(parentXmlEntity.getTable().getDefaultSchema());
-// assertNull(childXmlEntity.getTable().getDefaultSchema());
-//
-// parentXmlEntity.getTable().setSpecifiedSchema("FOO");
-// assertNull(parentXmlEntity.getTable().getDefaultSchema());
-// assertEquals("FOO", childXmlEntity.getTable().getDefaultSchema());
-//
-// parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
-// assertNull(parentXmlEntity.getTable().getDefaultSchema());
-// assertNull(childXmlEntity.getTable().getDefaultSchema());
-// }
-//
-// public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// XmlEntity xmlEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertNull(xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema("FOO");
-// assertEquals("FOO", xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.entityMappings().setSpecifiedSchema("BAR");
-// assertEquals("BAR", xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.javaEntity().getTable().setSpecifiedSchema("JAVA_SCHEMA");
-// assertEquals("JAVA_SCHEMA", xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.getTable().setSpecifiedName("BLAH");
-// //xml entity now has a table element so default schema is not taken from java
-// assertEquals("BAR", xmlEntity.getTable().getDefaultSchema());
-//
-//
-// xmlEntity.entityMappings().setSpecifiedSchema(null);
-// assertEquals("FOO", xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema(null);
-// assertNull(xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.getTable().setSpecifiedName(null);
-// assertEquals("JAVA_SCHEMA", xmlEntity.getTable().getDefaultSchema());
-// }
-
- public void testModifySpecifiedSchema() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
-
- assertNull(ormJoinTable.getSpecifiedSchema());
- assertNull(manyToMany.getJoinTable());
-
- //set Schema in the context model, verify resource model modified
- ormJoinTable.setSpecifiedSchema("foo");
- assertEquals("foo", ormJoinTable.getSpecifiedSchema());
- assertEquals("foo", manyToMany.getJoinTable().getSchema());
-
- //set Schema to null in the context model
- ormJoinTable.setSpecifiedSchema(null);
- assertNull(ormJoinTable.getSpecifiedSchema());
- assertNull(manyToMany.getJoinTable());
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
-
- assertNull(ormJoinTable.getSpecifiedCatalog());
- assertNull(manyToMany.getJoinTable());
-
- //set Catalog in the resource model, verify context model updated
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTableImpl());
- manyToMany.getJoinTable().setCatalog("FOO");
- assertEquals("FOO", ormJoinTable.getSpecifiedCatalog());
- assertEquals("FOO", manyToMany.getJoinTable().getCatalog());
-
- //set Catalog to null in the resource model
- manyToMany.getJoinTable().setCatalog(null);
- assertNull(ormJoinTable.getSpecifiedCatalog());
- assertNull(manyToMany.getJoinTable().getCatalog());
-
- manyToMany.getJoinTable().setCatalog("FOO");
- assertEquals("FOO", ormJoinTable.getSpecifiedCatalog());
- assertEquals("FOO", manyToMany.getJoinTable().getCatalog());
-
- manyToMany.setJoinTable(null);
- assertNull(ormJoinTable.getSpecifiedCatalog());
- assertNull(manyToMany.getJoinTable());
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
-
- assertNull(ormJoinTable.getSpecifiedCatalog());
- assertNull(manyToMany.getJoinTable());
-
- //set Catalog in the context model, verify resource model modified
- ormJoinTable.setSpecifiedCatalog("foo");
- assertEquals("foo", ormJoinTable.getSpecifiedCatalog());
- assertEquals("foo", manyToMany.getJoinTable().getCatalog());
-
- //set Catalog to null in the context model
- ormJoinTable.setSpecifiedCatalog(null);
- assertNull(ormJoinTable.getSpecifiedCatalog());
- assertNull(manyToMany.getJoinTable());
- }
-
-// public void testUpdateDefaultCatalogFromJavaTable() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// XmlEntity xmlEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertNull(xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.javaEntity().getTable().setSpecifiedCatalog("Foo");
-// assertEquals("Foo", xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-// assertNull(xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-// xmlEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
-// assertNull(xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.setSpecifiedMetadataComplete(null);
-// assertNull(xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
-// assertEquals("Foo", xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.getTable().setSpecifiedName("Bar");
-// assertNull(xmlEntity.getTable().getDefaultCatalog());
-// }
-//
-// public void testUpdateDefaultCatalogNoJava() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlEntity xmlEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertNull(xmlEntity.getTable().getDefaultCatalog());
-// }
-//
-// public void testUpdateDefaultCatalogFromParent() throws Exception {
-// createTestEntity();
-// createTestSubType();
-//
-// OrmPersistentType parentOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-// XmlEntity parentXmlEntity = (XmlEntity) parentOrmPersistentType.getMapping();
-// XmlEntity childXmlEntity = (XmlEntity) childOrmPersistentType.getMapping();
-//
-// assertNull(parentXmlEntity.getTable().getDefaultCatalog());
-// assertNull(childXmlEntity.getTable().getDefaultCatalog());
-//
-// parentXmlEntity.getTable().setSpecifiedCatalog("FOO");
-// assertNull(parentXmlEntity.getTable().getDefaultCatalog());
-// assertEquals("FOO", childXmlEntity.getTable().getDefaultCatalog());
-//
-// parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
-// assertNull(parentXmlEntity.getTable().getDefaultCatalog());
-// assertNull(childXmlEntity.getTable().getDefaultCatalog());
-// }
-//
-// public void testUpdateDefaultCatalogFromPersistenceUnitDefaults() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// XmlEntity xmlEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertNull(xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog("FOO");
-// assertEquals("FOO", xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.entityMappings().setSpecifiedCatalog("BAR");
-// assertEquals("BAR", xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.javaEntity().getTable().setSpecifiedCatalog("JAVA_CATALOG");
-// assertEquals("JAVA_CATALOG", xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.getTable().setSpecifiedName("BLAH");
-// //xml entity now has a table element so default schema is not taken from java
-// assertEquals("BAR", xmlEntity.getTable().getDefaultCatalog());
-//
-//
-// xmlEntity.entityMappings().setSpecifiedCatalog(null);
-// assertEquals("FOO", xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog(null);
-// assertNull(xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.getTable().setSpecifiedName(null);
-// assertEquals("JAVA_CATALOG", xmlEntity.getTable().getDefaultCatalog());
-//}
-
-//
-// public void testUpdateName() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlEntity xmlEntity = (XmlEntity) ormPersistentType.getMapping();
-// Entity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-// assertEquals("Foo", xmlEntity.getName());
-//
-// //set class in the resource model, verify context model updated
-// entityResource.setClassName("com.Bar");
-// assertEquals("Bar", xmlEntity.getName());
-//
-// entityResource.setName("Baz");
-// assertEquals("Baz", xmlEntity.getName());
-//
-// //set class to null in the resource model
-// entityResource.setClassName(null);
-// assertEquals("Baz", xmlEntity.getName());
-//
-// entityResource.setName(null);
-// assertNull(xmlEntity.getName());
-// }
-
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
-
- OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- assertEquals("FOO", joinTableResource.getJoinColumns().get(0).getName());
-
- OrmJoinColumn joinColumn2 = ormJoinTable.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", joinTableResource.getJoinColumns().get(0).getName());
- assertEquals("FOO", joinTableResource.getJoinColumns().get(1).getName());
-
- OrmJoinColumn joinColumn3 = ormJoinTable.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", joinTableResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", joinTableResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", joinTableResource.getJoinColumns().get(2).getName());
-
- ListIterator<OrmJoinColumn> joinColumns = ormJoinTable.specifiedJoinColumns();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = ormJoinTable.specifiedJoinColumns();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
-
- ormJoinTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- ormJoinTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- ormJoinTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- assertEquals(3, joinTableResource.getJoinColumns().size());
-
- ormJoinTable.removeSpecifiedJoinColumn(0);
- assertEquals(2, joinTableResource.getJoinColumns().size());
- assertEquals("BAR", joinTableResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", joinTableResource.getJoinColumns().get(1).getName());
-
- ormJoinTable.removeSpecifiedJoinColumn(0);
- assertEquals(1, joinTableResource.getJoinColumns().size());
- assertEquals("BAZ", joinTableResource.getJoinColumns().get(0).getName());
-
- ormJoinTable.removeSpecifiedJoinColumn(0);
- assertEquals(0, joinTableResource.getJoinColumns().size());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
-
- ormJoinTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- ormJoinTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- ormJoinTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- assertEquals(3, joinTableResource.getJoinColumns().size());
-
-
- ormJoinTable.moveSpecifiedJoinColumn(2, 0);
- ListIterator<OrmJoinColumn> joinColumns = ormJoinTable.specifiedJoinColumns();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", joinTableResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", joinTableResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", joinTableResource.getJoinColumns().get(2).getName());
-
-
- ormJoinTable.moveSpecifiedJoinColumn(0, 1);
- joinColumns = ormJoinTable.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", joinTableResource.getJoinColumns().get(0).getName());
- assertEquals("BAR", joinTableResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", joinTableResource.getJoinColumns().get(2).getName());
- }
-
- public void testUpdateInverseJoinColumns() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTableImpl());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- joinTableResource.getInverseJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumnImpl());
- joinTableResource.getInverseJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumnImpl());
- joinTableResource.getInverseJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumnImpl());
-
- joinTableResource.getInverseJoinColumns().get(0).setName("FOO");
- joinTableResource.getInverseJoinColumns().get(1).setName("BAR");
- joinTableResource.getInverseJoinColumns().get(2).setName("BAZ");
-
- ListIterator<OrmJoinColumn> joinColumns = ormJoinTable.specifiedInverseJoinColumns();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getInverseJoinColumns().move(2, 0);
- joinColumns = ormJoinTable.specifiedInverseJoinColumns();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getInverseJoinColumns().move(0, 1);
- joinColumns = ormJoinTable.specifiedInverseJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getInverseJoinColumns().remove(1);
- joinColumns = ormJoinTable.specifiedInverseJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getInverseJoinColumns().remove(1);
- joinColumns = ormJoinTable.specifiedInverseJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getInverseJoinColumns().remove(0);
- assertFalse(ormJoinTable.specifiedInverseJoinColumns().hasNext());
- }
-
- public void testAddSpecifiedInverseJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
-
- OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedInverseJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- assertEquals("FOO", joinTableResource.getInverseJoinColumns().get(0).getName());
-
- OrmJoinColumn joinColumn2 = ormJoinTable.addSpecifiedInverseJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", joinTableResource.getInverseJoinColumns().get(0).getName());
- assertEquals("FOO", joinTableResource.getInverseJoinColumns().get(1).getName());
-
- OrmJoinColumn joinColumn3 = ormJoinTable.addSpecifiedInverseJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", joinTableResource.getInverseJoinColumns().get(0).getName());
- assertEquals("BAZ", joinTableResource.getInverseJoinColumns().get(1).getName());
- assertEquals("FOO", joinTableResource.getInverseJoinColumns().get(2).getName());
-
- ListIterator<OrmJoinColumn> joinColumns = ormJoinTable.specifiedInverseJoinColumns();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = ormJoinTable.specifiedInverseJoinColumns();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedInverseJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
-
- ormJoinTable.addSpecifiedInverseJoinColumn(0).setSpecifiedName("FOO");
- ormJoinTable.addSpecifiedInverseJoinColumn(1).setSpecifiedName("BAR");
- ormJoinTable.addSpecifiedInverseJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- assertEquals(3, joinTableResource.getInverseJoinColumns().size());
-
- ormJoinTable.removeSpecifiedInverseJoinColumn(0);
- assertEquals(2, joinTableResource.getInverseJoinColumns().size());
- assertEquals("BAR", joinTableResource.getInverseJoinColumns().get(0).getName());
- assertEquals("BAZ", joinTableResource.getInverseJoinColumns().get(1).getName());
-
- ormJoinTable.removeSpecifiedInverseJoinColumn(0);
- assertEquals(1, joinTableResource.getInverseJoinColumns().size());
- assertEquals("BAZ", joinTableResource.getInverseJoinColumns().get(0).getName());
-
- ormJoinTable.removeSpecifiedInverseJoinColumn(0);
- assertEquals(0, joinTableResource.getInverseJoinColumns().size());
- }
-
- public void testMoveSpecifiedInverseJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
-
- ormJoinTable.addSpecifiedInverseJoinColumn(0).setSpecifiedName("FOO");
- ormJoinTable.addSpecifiedInverseJoinColumn(1).setSpecifiedName("BAR");
- ormJoinTable.addSpecifiedInverseJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- assertEquals(3, joinTableResource.getInverseJoinColumns().size());
-
-
- ormJoinTable.moveSpecifiedInverseJoinColumn(2, 0);
- ListIterator<OrmJoinColumn> joinColumns = ormJoinTable.specifiedInverseJoinColumns();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", joinTableResource.getInverseJoinColumns().get(0).getName());
- assertEquals("BAZ", joinTableResource.getInverseJoinColumns().get(1).getName());
- assertEquals("FOO", joinTableResource.getInverseJoinColumns().get(2).getName());
-
-
- ormJoinTable.moveSpecifiedInverseJoinColumn(0, 1);
- joinColumns = ormJoinTable.specifiedInverseJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", joinTableResource.getInverseJoinColumns().get(0).getName());
- assertEquals("BAR", joinTableResource.getInverseJoinColumns().get(1).getName());
- assertEquals("FOO", joinTableResource.getInverseJoinColumns().get(2).getName());
- }
-
- public void testUpdateJoinColumns() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTableImpl());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- joinTableResource.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumnImpl());
- joinTableResource.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumnImpl());
- joinTableResource.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumnImpl());
-
- joinTableResource.getJoinColumns().get(0).setName("FOO");
- joinTableResource.getJoinColumns().get(1).setName("BAR");
- joinTableResource.getJoinColumns().get(2).setName("BAZ");
-
- ListIterator<OrmJoinColumn> joinColumns = ormJoinTable.specifiedJoinColumns();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getJoinColumns().move(2, 0);
- joinColumns = ormJoinTable.specifiedJoinColumns();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getJoinColumns().move(0, 1);
- joinColumns = ormJoinTable.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getJoinColumns().remove(1);
- joinColumns = ormJoinTable.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getJoinColumns().remove(1);
- joinColumns = ormJoinTable.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.specifiedJoinColumns().hasNext());
- }
-
-
- public void testUniqueConstraints() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTableImpl());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormJoinTable.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- joinTableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- joinTableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- uniqueConstraints = ormJoinTable.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 = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTableImpl());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- assertEquals(0, ormJoinTable.uniqueConstraintsSize());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- joinTableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- joinTableResource.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- assertEquals(2, ormJoinTable.uniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTableImpl());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- ormJoinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormJoinTable.addUniqueConstraint(0).addColumnName(0, "BAR");
- ormJoinTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = joinTableResource.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTableImpl());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- ormJoinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormJoinTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormJoinTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = joinTableResource.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTableImpl());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- ormJoinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormJoinTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormJoinTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, joinTableResource.getUniqueConstraints().size());
-
- ormJoinTable.removeUniqueConstraint(1);
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = joinTableResource.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- Iterator<OrmUniqueConstraint> uniqueConstraints = ormJoinTable.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- ormJoinTable.removeUniqueConstraint(1);
- uniqueConstraintResources = joinTableResource.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- uniqueConstraints = ormJoinTable.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- ormJoinTable.removeUniqueConstraint(0);
- uniqueConstraintResources = joinTableResource.getUniqueConstraints().listIterator();
- assertFalse(uniqueConstraintResources.hasNext());
- uniqueConstraints = ormJoinTable.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTableImpl());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- ormJoinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormJoinTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormJoinTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, joinTableResource.getUniqueConstraints().size());
-
-
- ormJoinTable.moveUniqueConstraint(2, 0);
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormJoinTable.uniqueConstraints();
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = joinTableResource.getUniqueConstraints().listIterator();
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
-
-
- ormJoinTable.moveUniqueConstraint(0, 1);
- uniqueConstraints = ormJoinTable.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
-
- uniqueConstraintResources = joinTableResource.getUniqueConstraints().listIterator();
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTableImpl());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- joinTableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "FOO");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- joinTableResource.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAR");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- joinTableResource.getUniqueConstraints().add(2, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAZ");
-
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormJoinTable.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableResource.getUniqueConstraints().move(2, 0);
- uniqueConstraints = ormJoinTable.uniqueConstraints();
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableResource.getUniqueConstraints().move(0, 1);
- uniqueConstraints = ormJoinTable.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableResource.getUniqueConstraints().remove(1);
- uniqueConstraints = ormJoinTable.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableResource.getUniqueConstraints().remove(1);
- uniqueConstraints = ormJoinTable.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableResource.getUniqueConstraints().remove(0);
- uniqueConstraints = ormJoinTable.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
- }
-
-
- public void testUniqueConstraintsFromJava() throws Exception {
- createTestEntityWithValidManyToMany();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentType.attributes().next().getMapping();
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable();
-
- assertTrue(ormManyToManyMapping.getPersistentAttribute().isVirtual());
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormJoinTable.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) ormPersistentType.getJavaPersistentType().attributes().next().getMapping();
-
- javaManyToManyMapping.getJoinTable().addUniqueConstraint(0).addColumnName(0, "FOO");
- javaManyToManyMapping.getJoinTable().addUniqueConstraint(1).addColumnName(0, "BAR");
- javaManyToManyMapping.getJoinTable().addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- uniqueConstraints = ormJoinTable.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());
-
- ormManyToManyMapping.getPersistentAttribute().makeSpecified();
-
- ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentType.attributes().next().getMapping();
- ormManyToManyMapping.getJoinTable();
- assertEquals(0, ormManyToManyMapping.getJoinTable().uniqueConstraintsSize());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToManyMappingTests.java
deleted file mode 100644
index 6507b43b0f..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToManyMappingTests.java
+++ /dev/null
@@ -1,654 +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.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.BasicMapping;
-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.JoinColumn;
-import org.eclipse.jpt.core.context.JoinTable;
-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.OneToOneMapping;
-import org.eclipse.jpt.core.context.TransientMapping;
-import org.eclipse.jpt.core.context.VersionMapping;
-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.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-
-public class OrmManyToManyMappingTests extends ContextModelTestCase
-{
- public OrmManyToManyMappingTests(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);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertEquals("manyToManyMapping", ormManyToManyMapping.getName());
- assertEquals("manyToManyMapping", manyToMany.getName());
-
- //set name in the resource model, verify context model updated
- manyToMany.setName("newName");
- assertEquals("newName", ormManyToManyMapping.getName());
- assertEquals("newName", manyToMany.getName());
-
- //set name to null in the resource model
- manyToMany.setName(null);
- assertNull(ormManyToManyMapping.getName());
- assertNull(manyToMany.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertEquals("manyToManyMapping", ormManyToManyMapping.getName());
- assertEquals("manyToManyMapping", manyToMany.getName());
-
- //set name in the context model, verify resource model updated
- ormManyToManyMapping.setName("newName");
- assertEquals("newName", ormManyToManyMapping.getName());
- assertEquals("newName", manyToMany.getName());
-
- //set name to null in the context model
- ormManyToManyMapping.setName(null);
- assertNull(ormManyToManyMapping.getName());
- assertNull(manyToMany.getName());
- }
-
- public void testUpdateTargetEntity() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedTargetEntity());
- assertNull(manyToMany.getTargetEntity());
-
- //set target entity in the resource model, verify context model updated
- manyToMany.setTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", ormManyToManyMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", manyToMany.getTargetEntity());
-
- //set target entity to null in the resource model
- manyToMany.setTargetEntity(null);
- assertNull(ormManyToManyMapping.getSpecifiedTargetEntity());
- assertNull(manyToMany.getTargetEntity());
- }
-
- public void testModifyTargetEntity() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedTargetEntity());
- assertNull(manyToMany.getTargetEntity());
-
- //set target entity in the context model, verify resource model updated
- ormManyToManyMapping.setSpecifiedTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", ormManyToManyMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", manyToMany.getTargetEntity());
-
- //set target entity to null in the context model
- ormManyToManyMapping.setSpecifiedTargetEntity(null);
- assertNull(ormManyToManyMapping.getSpecifiedTargetEntity());
- assertNull(manyToMany.getTargetEntity());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToManyResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedFetch());
- assertNull(manyToManyResource.getFetch());
-
- //set fetch in the resource model, verify context model updated
- manyToManyResource.setFetch(org.eclipse.jpt.core.resource.orm.FetchType.EAGER);
- assertEquals(FetchType.EAGER, ormManyToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.core.resource.orm.FetchType.EAGER, manyToManyResource.getFetch());
-
- manyToManyResource.setFetch(org.eclipse.jpt.core.resource.orm.FetchType.LAZY);
- assertEquals(FetchType.LAZY, ormManyToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.core.resource.orm.FetchType.LAZY, manyToManyResource.getFetch());
-
- //set fetch to null in the resource model
- manyToManyResource.setFetch(null);
- assertNull(ormManyToManyMapping.getSpecifiedFetch());
- assertNull(manyToManyResource.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToManyResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedFetch());
- assertNull(manyToManyResource.getFetch());
-
- //set fetch in the context model, verify resource model updated
- ormManyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(org.eclipse.jpt.core.resource.orm.FetchType.EAGER, manyToManyResource.getFetch());
- assertEquals(FetchType.EAGER, ormManyToManyMapping.getSpecifiedFetch());
-
- ormManyToManyMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(org.eclipse.jpt.core.resource.orm.FetchType.LAZY, manyToManyResource.getFetch());
- assertEquals(FetchType.LAZY, ormManyToManyMapping.getSpecifiedFetch());
-
- //set fetch to null in the context model
- ormManyToManyMapping.setSpecifiedFetch(null);
- assertNull(manyToManyResource.getFetch());
- assertNull(ormManyToManyMapping.getSpecifiedFetch());
- }
-
- public void testUpdateMappedBy() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getMappedBy());
- assertNull(manyToMany.getMappedBy());
-
- //set mappedBy in the resource model, verify context model updated
- manyToMany.setMappedBy("newMappedBy");
- assertEquals("newMappedBy", ormManyToManyMapping.getMappedBy());
- assertEquals("newMappedBy", manyToMany.getMappedBy());
-
- //setmappedBy to null in the resource model
- manyToMany.setMappedBy(null);
- assertNull(ormManyToManyMapping.getMappedBy());
- assertNull(manyToMany.getMappedBy());
- }
-
- public void testModifyMappedBy() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getMappedBy());
- assertNull(manyToMany.getMappedBy());
-
- //set mappedBy in the context model, verify resource model updated
- ormManyToManyMapping.setMappedBy("newMappedBy");
- assertEquals("newMappedBy", ormManyToManyMapping.getMappedBy());
- assertEquals("newMappedBy", manyToMany.getMappedBy());
-
- //set mappedBy to null in the context model
- ormManyToManyMapping.setMappedBy(null);
- assertNull(ormManyToManyMapping.getMappedBy());
- assertNull(manyToMany.getMappedBy());
- }
-
- public void testUpdateMapKey() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getMapKey());
- assertNull(manyToMany.getMapKey());
-
- //set mapKey in the resource model, verify context model does not change
- manyToMany.setMapKey(OrmFactory.eINSTANCE.createMapKeyImpl());
- assertNull(ormManyToManyMapping.getMapKey());
- assertNotNull(manyToMany.getMapKey());
-
- //set mapKey name in the resource model, verify context model updated
- manyToMany.getMapKey().setName("myMapKey");
- assertEquals("myMapKey", ormManyToManyMapping.getMapKey());
- assertEquals("myMapKey", manyToMany.getMapKey().getName());
-
- //set mapKey name to null in the resource model
- manyToMany.getMapKey().setName(null);
- assertNull(ormManyToManyMapping.getMapKey());
- assertNull(manyToMany.getMapKey().getName());
-
- manyToMany.getMapKey().setName("myMapKey");
- manyToMany.setMapKey(null);
- assertNull(ormManyToManyMapping.getMapKey());
- assertNull(manyToMany.getMapKey());
- }
-
- public void testModifyMapKey() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getMapKey());
- assertNull(manyToMany.getMapKey());
-
- //set mapKey in the context model, verify resource model updated
- ormManyToManyMapping.setMapKey("myMapKey");
- assertEquals("myMapKey", ormManyToManyMapping.getMapKey());
- assertEquals("myMapKey", manyToMany.getMapKey().getName());
-
- //set mapKey to null in the context model
- ormManyToManyMapping.setMapKey(null);
- assertNull(ormManyToManyMapping.getMapKey());
- assertNull(manyToMany.getMapKey());
- }
-
- public void testUpdateOrderBy() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getOrderBy());
- assertNull(manyToMany.getOrderBy());
-
- //set orderBy in the resource model, verify context model updated
- manyToMany.setOrderBy("newOrderBy");
- assertEquals("newOrderBy", ormManyToManyMapping.getOrderBy());
- assertEquals("newOrderBy", manyToMany.getOrderBy());
-
- //set orderBy to null in the resource model
- manyToMany.setOrderBy(null);
- assertNull(ormManyToManyMapping.getOrderBy());
- assertNull(manyToMany.getOrderBy());
- }
-
- public void testModifyOrderBy() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getOrderBy());
- assertNull(manyToMany.getOrderBy());
-
- //set mappedBy in the context model, verify resource model updated
- ormManyToManyMapping.setOrderBy("newOrderBy");
- assertEquals("newOrderBy", ormManyToManyMapping.getOrderBy());
- assertEquals("newOrderBy", manyToMany.getOrderBy());
-
- //set mappedBy to null in the context model
- ormManyToManyMapping.setOrderBy(null);
- assertNull(ormManyToManyMapping.getOrderBy());
- assertNull(manyToMany.getOrderBy());
- }
-
- public void testIsNoOrdering() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
-
- assertTrue(ormManyToManyMapping.isNoOrdering());
-
- ormManyToManyMapping.setOrderBy("foo");
- assertFalse(ormManyToManyMapping.isNoOrdering());
-
- ormManyToManyMapping.setOrderBy(null);
- assertTrue(ormManyToManyMapping.isNoOrdering());
- }
-
- public void testSetNoOrdering() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
-
- assertTrue(ormManyToManyMapping.isNoOrdering());
-
- ormManyToManyMapping.setOrderBy("foo");
- assertFalse(ormManyToManyMapping.isNoOrdering());
-
- ormManyToManyMapping.setNoOrdering(true);
- assertTrue(ormManyToManyMapping.isNoOrdering());
- assertNull(ormManyToManyMapping.getOrderBy());
- }
-//TODO
-// public boolean isOrderByPk() {
-// return "".equals(getOrderBy());
-// }
-//
-// public void setOrderByPk() {
-// setOrderBy("");
-// }
-
- public void testIsCustomOrdering() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
-
- assertFalse(ormManyToManyMapping.isCustomOrdering());
-
- ormManyToManyMapping.setOrderBy("foo");
- assertTrue(ormManyToManyMapping.isCustomOrdering());
-
- ormManyToManyMapping.setOrderBy(null);
- assertFalse(ormManyToManyMapping.isCustomOrdering());
- }
-
- public void testManyToManyMorphToIdMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany");
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.setOrderBy("customOrder");
- manyToManyMapping.setMapKey("mapKey");
- manyToManyMapping.setMappedBy("mappedBy");
- manyToManyMapping.getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = manyToManyMapping.getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- JoinColumn inverseJoinColumn = manyToManyMapping.getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("manyToMany", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testManyToManyMorphToVersionMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany");
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.setOrderBy("customOrder");
- manyToManyMapping.setMapKey("mapKey");
- manyToManyMapping.setMappedBy("mappedBy");
- manyToManyMapping.getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = manyToManyMapping.getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- JoinColumn inverseJoinColumn = manyToManyMapping.getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("manyToMany", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testManyToManyMorphToTransientMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany");
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.setOrderBy("customOrder");
- manyToManyMapping.setMapKey("mapKey");
- manyToManyMapping.setMappedBy("mappedBy");
- manyToManyMapping.getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = manyToManyMapping.getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- JoinColumn inverseJoinColumn = manyToManyMapping.getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("manyToMany", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testManyToManyMorphToEmbeddedMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany");
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.setOrderBy("customOrder");
- manyToManyMapping.setMapKey("mapKey");
- manyToManyMapping.setMappedBy("mappedBy");
- manyToManyMapping.getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = manyToManyMapping.getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- JoinColumn inverseJoinColumn = manyToManyMapping.getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("manyToMany", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testManyToManyMorphToEmbeddedIdMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany");
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.setOrderBy("customOrder");
- manyToManyMapping.setMapKey("mapKey");
- manyToManyMapping.setMappedBy("mappedBy");
- manyToManyMapping.getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = manyToManyMapping.getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- JoinColumn inverseJoinColumn = manyToManyMapping.getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals("manyToMany", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testManyToManyMorphToOneToOneMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany");
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.setOrderBy("customOrder");
- manyToManyMapping.setMapKey("mapKey");
- manyToManyMapping.setMappedBy("mappedBy");
- manyToManyMapping.getCascade().setAll(true);
- manyToManyMapping.getCascade().setMerge(true);
- manyToManyMapping.getCascade().setPersist(true);
- manyToManyMapping.getCascade().setRefresh(true);
- manyToManyMapping.getCascade().setRemove(true);
- manyToManyMapping.getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = manyToManyMapping.getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- JoinColumn inverseJoinColumn = manyToManyMapping.getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("manyToMany", ormPersistentAttribute.getMapping().getName());
- assertEquals(FetchType.EAGER, ((OneToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- assertEquals("TargetEntity", ((OneToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- assertEquals("mappedBy", ((OneToOneMapping) ormPersistentAttribute.getMapping()).getMappedBy());
- assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isAll());
- assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge());
- assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist());
- assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
- }
-
- public void testManyToManyMorphToOneToManyMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany");
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.setOrderBy("customOrder");
- manyToManyMapping.setMapKey("mapKey");
- manyToManyMapping.setMappedBy("mappedBy");
- manyToManyMapping.getCascade().setAll(true);
- manyToManyMapping.getCascade().setMerge(true);
- manyToManyMapping.getCascade().setPersist(true);
- manyToManyMapping.getCascade().setRefresh(true);
- manyToManyMapping.getCascade().setRemove(true);
- manyToManyMapping.getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = manyToManyMapping.getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- JoinColumn inverseJoinColumn = manyToManyMapping.getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(manyToManyMapping.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("manyToMany", ormPersistentAttribute.getMapping().getName());
- assertEquals(FetchType.EAGER, ((OneToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- assertEquals("TargetEntity", ((OneToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- assertEquals("mappedBy", ((OneToManyMapping) ormPersistentAttribute.getMapping()).getMappedBy());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isAll());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
- JoinTable joinTable = ((OneToManyMapping) ormPersistentAttribute.getMapping()).getJoinTable();
- assertEquals("MY_JOIN_TABLE", joinTable.getName());
- assertEquals("name", joinTable.joinColumns().next().getSpecifiedName());
- assertEquals("referenceName", joinTable.joinColumns().next().getSpecifiedReferencedColumnName());
- assertEquals("inverseName", joinTable.inverseJoinColumns().next().getSpecifiedName());
- assertEquals("inverseReferenceName", joinTable.inverseJoinColumns().next().getSpecifiedReferencedColumnName());
- }
-
- public void testManyToManyMorphToManyToOneMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany");
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.setOrderBy("customOrder");
- manyToManyMapping.setMapKey("mapKey");
- manyToManyMapping.setMappedBy("mappedBy");
- manyToManyMapping.getCascade().setAll(true);
- manyToManyMapping.getCascade().setMerge(true);
- manyToManyMapping.getCascade().setPersist(true);
- manyToManyMapping.getCascade().setRefresh(true);
- manyToManyMapping.getCascade().setRemove(true);
- manyToManyMapping.getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = manyToManyMapping.getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- JoinColumn inverseJoinColumn = manyToManyMapping.getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(manyToManyMapping.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("manyToMany", ormPersistentAttribute.getMapping().getName());
- assertEquals(FetchType.EAGER, ((ManyToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- assertEquals("TargetEntity", ((ManyToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isAll());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
- }
-
- public void testManyToManyMorphToBasicMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany");
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.setOrderBy("customOrder");
- manyToManyMapping.setMapKey("mapKey");
- manyToManyMapping.setMappedBy("mappedBy");
- manyToManyMapping.getCascade().setAll(true);
- manyToManyMapping.getCascade().setMerge(true);
- manyToManyMapping.getCascade().setPersist(true);
- manyToManyMapping.getCascade().setRefresh(true);
- manyToManyMapping.getCascade().setRemove(true);
- manyToManyMapping.getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = manyToManyMapping.getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- JoinColumn inverseJoinColumn = manyToManyMapping.getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("manyToMany", ormPersistentAttribute.getMapping().getName());
-//TODO assertEquals(FetchType.EAGER, ((IBasicMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToOneMappingTests.java
deleted file mode 100644
index ad06e23310..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToOneMappingTests.java
+++ /dev/null
@@ -1,542 +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.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.Cascade;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
-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.XmlManyToOne;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class OrmManyToOneMappingTests extends ContextModelTestCase
-{
- public OrmManyToOneMappingTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- private ICompilationUnit createTestEntityManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.JOIN_COLUMN, JPA.FETCH_TYPE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne(fetch=FetchType.LAZY, optional=false, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH})");
- sb.append(CR);
- sb.append(" @JoinColumn(name=\"MY_COLUMN\", referencedColumnName=\"MY_REFERENCED_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\")");
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping");
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- XmlManyToOne manyToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- assertEquals("manyToOneMapping", ormManyToOneMapping.getName());
- assertEquals("manyToOneMapping", manyToOne.getName());
-
- //set name in the resource model, verify context model updated
- manyToOne.setName("newName");
- assertEquals("newName", ormManyToOneMapping.getName());
- assertEquals("newName", manyToOne.getName());
-
- //set name to null in the resource model
- manyToOne.setName(null);
- assertNull(ormManyToOneMapping.getName());
- assertNull(manyToOne.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping");
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- XmlManyToOne manyToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- assertEquals("manyToOneMapping", ormManyToOneMapping.getName());
- assertEquals("manyToOneMapping", manyToOne.getName());
-
- //set name in the context model, verify resource model updated
- ormManyToOneMapping.setName("newName");
- assertEquals("newName", ormManyToOneMapping.getName());
- assertEquals("newName", manyToOne.getName());
-
- //set name to null in the context model
- ormManyToOneMapping.setName(null);
- assertNull(ormManyToOneMapping.getName());
- assertNull(manyToOne.getName());
- }
-
- public void testUpdateTargetEntity() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping");
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- XmlManyToOne manyToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- assertNull(ormManyToOneMapping.getSpecifiedTargetEntity());
- assertNull(manyToOne.getTargetEntity());
-
- //set target entity in the resource model, verify context model updated
- manyToOne.setTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", ormManyToOneMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", manyToOne.getTargetEntity());
-
- //set target entity to null in the resource model
- manyToOne.setTargetEntity(null);
- assertNull(ormManyToOneMapping.getSpecifiedTargetEntity());
- assertNull(manyToOne.getTargetEntity());
- }
-
- public void testModifyTargetEntity() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping");
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- XmlManyToOne manyToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- assertNull(ormManyToOneMapping.getSpecifiedTargetEntity());
- assertNull(manyToOne.getTargetEntity());
-
- //set target entity in the context model, verify resource model updated
- ormManyToOneMapping.setSpecifiedTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", ormManyToOneMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", manyToOne.getTargetEntity());
-
- //set target entity to null in the context model
- ormManyToOneMapping.setSpecifiedTargetEntity(null);
- assertNull(ormManyToOneMapping.getSpecifiedTargetEntity());
- assertNull(manyToOne.getTargetEntity());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping");
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- XmlManyToOne manyToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- assertNull(ormManyToOneMapping.getSpecifiedFetch());
- assertNull(manyToOneResource.getFetch());
-
- //set fetch in the resource model, verify context model updated
- manyToOneResource.setFetch(org.eclipse.jpt.core.resource.orm.FetchType.EAGER);
- assertEquals(FetchType.EAGER, ormManyToOneMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.core.resource.orm.FetchType.EAGER, manyToOneResource.getFetch());
-
- manyToOneResource.setFetch(org.eclipse.jpt.core.resource.orm.FetchType.LAZY);
- assertEquals(FetchType.LAZY, ormManyToOneMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.core.resource.orm.FetchType.LAZY, manyToOneResource.getFetch());
-
- //set fetch to null in the resource model
- manyToOneResource.setFetch(null);
- assertNull(ormManyToOneMapping.getSpecifiedFetch());
- assertNull(manyToOneResource.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping");
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- XmlManyToOne manyToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- assertNull(ormManyToOneMapping.getSpecifiedFetch());
- assertNull(manyToOneResource.getFetch());
-
- //set fetch in the context model, verify resource model updated
- ormManyToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(org.eclipse.jpt.core.resource.orm.FetchType.EAGER, manyToOneResource.getFetch());
- assertEquals(FetchType.EAGER, ormManyToOneMapping.getSpecifiedFetch());
-
- ormManyToOneMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(org.eclipse.jpt.core.resource.orm.FetchType.LAZY, manyToOneResource.getFetch());
- assertEquals(FetchType.LAZY, ormManyToOneMapping.getSpecifiedFetch());
-
- //set fetch to null in the context model
- ormManyToOneMapping.setSpecifiedFetch(null);
- assertNull(manyToOneResource.getFetch());
- assertNull(ormManyToOneMapping.getSpecifiedFetch());
- }
-
- public void testUpdateSpecifiedOptional() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping");
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- XmlManyToOne manyToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- assertNull(ormManyToOneMapping.getSpecifiedOptional());
- assertNull(manyToOneResource.getOptional());
-
- //set optional in the resource model, verify context model updated
- manyToOneResource.setOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormManyToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.TRUE, manyToOneResource.getOptional());
-
- manyToOneResource.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormManyToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.FALSE, manyToOneResource.getOptional());
-
- //set optional to null in the resource model
- manyToOneResource.setOptional(null);
- assertNull(ormManyToOneMapping.getSpecifiedOptional());
- assertNull(manyToOneResource.getOptional());
- }
-
- public void testModifySpecifiedOptional() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping");
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- XmlManyToOne manyToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- assertNull(ormManyToOneMapping.getSpecifiedOptional());
- assertNull(manyToOneResource.getOptional());
-
- //set optional in the context model, verify resource model updated
- ormManyToOneMapping.setSpecifiedOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, manyToOneResource.getOptional());
- assertEquals(Boolean.TRUE, ormManyToOneMapping.getSpecifiedOptional());
-
- ormManyToOneMapping.setSpecifiedOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, manyToOneResource.getOptional());
- assertEquals(Boolean.FALSE, ormManyToOneMapping.getSpecifiedOptional());
-
- //set optional to null in the context model
- ormManyToOneMapping.setSpecifiedOptional(null);
- assertNull(manyToOneResource.getOptional());
- assertNull(ormManyToOneMapping.getSpecifiedOptional());
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping");
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- XmlManyToOne manyToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- OrmJoinColumn joinColumn = ormManyToOneMapping.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", manyToOneResource.getJoinColumns().get(0).getName());
-
- OrmJoinColumn joinColumn2 = ormManyToOneMapping.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", manyToOneResource.getJoinColumns().get(0).getName());
- assertEquals("FOO", manyToOneResource.getJoinColumns().get(1).getName());
-
- OrmJoinColumn joinColumn3 = ormManyToOneMapping.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", manyToOneResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", manyToOneResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", manyToOneResource.getJoinColumns().get(2).getName());
-
- ListIterator<OrmJoinColumn> joinColumns = ormManyToOneMapping.specifiedJoinColumns();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = ormManyToOneMapping.specifiedJoinColumns();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping");
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- XmlManyToOne manyToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- ormManyToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- ormManyToOneMapping.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- ormManyToOneMapping.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, manyToOneResource.getJoinColumns().size());
-
- ormManyToOneMapping.removeSpecifiedJoinColumn(0);
- assertEquals(2, manyToOneResource.getJoinColumns().size());
- assertEquals("BAR", manyToOneResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", manyToOneResource.getJoinColumns().get(1).getName());
-
- ormManyToOneMapping.removeSpecifiedJoinColumn(0);
- assertEquals(1, manyToOneResource.getJoinColumns().size());
- assertEquals("BAZ", manyToOneResource.getJoinColumns().get(0).getName());
-
- ormManyToOneMapping.removeSpecifiedJoinColumn(0);
- assertEquals(0, manyToOneResource.getJoinColumns().size());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping");
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- XmlManyToOne manyToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- ormManyToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- ormManyToOneMapping.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- ormManyToOneMapping.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, manyToOneResource.getJoinColumns().size());
-
-
- ormManyToOneMapping.moveSpecifiedJoinColumn(2, 0);
- ListIterator<OrmJoinColumn> joinColumns = ormManyToOneMapping.specifiedJoinColumns();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", manyToOneResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", manyToOneResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", manyToOneResource.getJoinColumns().get(2).getName());
-
-
- ormManyToOneMapping.moveSpecifiedJoinColumn(0, 1);
- joinColumns = ormManyToOneMapping.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", manyToOneResource.getJoinColumns().get(0).getName());
- assertEquals("BAR", manyToOneResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", manyToOneResource.getJoinColumns().get(2).getName());
- }
-
-
- public void testManyToOneMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityManyToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "foo");
- assertEquals(3, ormPersistentType.virtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("foo", ormManyToOneMapping.getName());
-
- assertNull(ormManyToOneMapping.getSpecifiedFetch());
- assertNull(ormManyToOneMapping.getSpecifiedOptional());
- assertNull(ormManyToOneMapping.getSpecifiedTargetEntity());
- assertEquals(FetchType.EAGER, ormManyToOneMapping.getFetch());
- assertEquals(Boolean.TRUE, ormManyToOneMapping.getOptional());
- assertNull(ormManyToOneMapping.getTargetEntity());
-
-
- assertFalse(ormManyToOneMapping.specifiedJoinColumns().hasNext());
- //TODO default joinColumns
- //assertTrue(ormManyToOneMapping.defaultJoinColumns().hasNext());
-
-
- Cascade cascade = ormManyToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityManyToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToOneMapping.getName());
- assertEquals(FetchType.LAZY, ormManyToOneMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, ormManyToOneMapping.getSpecifiedOptional());
- assertEquals("Address", ormManyToOneMapping.getSpecifiedTargetEntity());
-
- OrmJoinColumn ormJoinColumn = ormManyToOneMapping.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());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityManyToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
-
- ormPersistentAttribute.makeSpecified(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute= ormPersistentType.specifiedAttributes().next();
-
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToOneMapping.getName());
- assertEquals(FetchType.EAGER, ormManyToOneMapping.getDefaultFetch());
- assertEquals(Boolean.TRUE, ormManyToOneMapping.getDefaultOptional());
- //TODO hmm, is this correct?
- assertEquals("test.Address", ormManyToOneMapping.getDefaultTargetEntity());
-
- //TODO default join columns in xml one-to-one
-// XmlJoinColumn ormJoinColumn = ormManyToOneMapping.specifiedJoinColumns().next();
-// //TODO java default columns name in JavaSingleRelationshipMapping.JoinColumnOwner
-// //assertEquals("address", ormJoinColumn.getSpecifiedName());
-// //assertEquals("address", ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUnique());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedNullable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedInsertable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUpdatable());
-// assertNull(ormJoinColumn.getColumnDefinition());
-// assertEquals(TYPE_NAME, ormJoinColumn.getSpecifiedTable());
-
- Cascade cascade = ormManyToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityManyToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "address");
- assertEquals(2, ormPersistentType.virtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("address", ormManyToOneMapping.getName());
- assertNull(ormManyToOneMapping.getSpecifiedFetch());
- assertNull(ormManyToOneMapping.getSpecifiedOptional());
- assertNull(ormManyToOneMapping.getSpecifiedTargetEntity());
- assertEquals(FetchType.EAGER, ormManyToOneMapping.getFetch());
- assertEquals(Boolean.TRUE, ormManyToOneMapping.getOptional());
- assertEquals("test.Address", ormManyToOneMapping.getDefaultTargetEntity());
-
- assertFalse(ormManyToOneMapping.specifiedJoinColumns().hasNext());
-
- //TODO default join columns for specified xmlManyToOne mapping
-// XmlJoinColumn ormJoinColumn = ormManyToOneMapping.defaultJoinColumns().next();
-// assertNull(ormJoinColumn.getSpecifiedName());
-// assertNull(ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertNull(ormJoinColumn.getSpecifiedUnique());
-// assertNull(ormJoinColumn.getSpecifiedNullable());
-// assertNull(ormJoinColumn.getSpecifiedInsertable());
-// assertNull(ormJoinColumn.getSpecifiedUpdatable());
-// assertNull(ormJoinColumn.getColumnDefinition());
-// assertNull(ormJoinColumn.getSpecifiedTable());
-//
-// assertEquals("address", ormJoinColumn.getDefaultName());
-// assertEquals("address", ormJoinColumn.getDefaultReferencedColumnName());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getDefaultUnique());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getDefaultNullable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getDefaultInsertable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getDefaultUpdatable());
-// assertEquals(null, ormJoinColumn.getColumnDefinition());
-// assertEquals(TYPE_NAME, ormJoinColumn.getDefaultTable());
-
- Cascade cascade = ormManyToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- }
-
- //3 things tested above
- //1. virtual mapping metadata complete=false - defaults are taken from the java annotations
- //2. virtual mapping metadata complete=true - defaults are taken from java defaults,annotations ignored
- //3. specified mapping (metadata complete=true/false - defaults are taken from java annotations
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmMappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmMappedSuperclassTests.java
deleted file mode 100644
index 176aa0c4b3..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmMappedSuperclassTests.java
+++ /dev/null
@@ -1,347 +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.core.tests.internal.context.orm;
-
-import java.util.ListIterator;
-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.orm.OrmEmbeddable;
-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.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-
-public class OrmMappedSuperclassTests extends ContextModelTestCase
-{
- public OrmMappedSuperclassTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- public void testUpdateClass() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass mappedSuperclassResource = ormResource().getEntityMappings().getMappedSuperclasses().get(0);
- assertEquals("model.Foo", ormMappedSuperclass.getClass_());
- assertEquals("model.Foo", mappedSuperclassResource.getClassName());
-
- //set class in the resource model, verify context model updated
- mappedSuperclassResource.setClassName("com.Bar");
- assertEquals("com.Bar", ormMappedSuperclass.getClass_());
- assertEquals("com.Bar", mappedSuperclassResource.getClassName());
-
- //set class to null in the resource model
- mappedSuperclassResource.setClassName(null);
- assertNull(ormMappedSuperclass.getClass_());
- assertNull(mappedSuperclassResource.getClassName());
- }
-
- public void testModifyClass() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass mappedSuperclassResource = ormResource().getEntityMappings().getMappedSuperclasses().get(0);
- assertEquals("model.Foo", ormMappedSuperclass.getClass_());
- assertEquals("model.Foo", mappedSuperclassResource.getClassName());
-
- //set class in the context model, verify resource model modified
- ormMappedSuperclass.setClass("com.Bar");
- assertEquals("com.Bar", ormMappedSuperclass.getClass_());
- assertEquals("com.Bar", mappedSuperclassResource.getClassName());
-
- //set class to null in the context model
- ormMappedSuperclass.setClass(null);
- assertNull(ormMappedSuperclass.getClass_());
- assertNull(mappedSuperclassResource.getClassName());
- }
- //TODO add tests for setting the className when the package is set on entity-mappings
-
- public void testUpdateSpecifiedAccess() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass mappedSuperclassResource = ormResource().getEntityMappings().getMappedSuperclasses().get(0);
- assertNull(ormMappedSuperclass.getSpecifiedAccess());
- assertNull(mappedSuperclassResource.getAccess());
-
- //set access in the resource model, verify context model updated
- mappedSuperclassResource.setAccess(org.eclipse.jpt.core.resource.orm.AccessType.FIELD);
- assertEquals(AccessType.FIELD, ormMappedSuperclass.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.FIELD, mappedSuperclassResource.getAccess());
-
- //set access to null in the resource model
- mappedSuperclassResource.setAccess(null);
- assertNull(ormMappedSuperclass.getSpecifiedAccess());
- assertNull(mappedSuperclassResource.getAccess());
- }
-
- public void testModifySpecifiedAccess() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass mappedSuperclassResource = ormResource().getEntityMappings().getMappedSuperclasses().get(0);
- assertNull(ormMappedSuperclass.getSpecifiedAccess());
- assertNull(mappedSuperclassResource.getAccess());
-
- //set access in the context model, verify resource model modified
- ormMappedSuperclass.setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, ormMappedSuperclass.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, mappedSuperclassResource.getAccess());
-
- //set access to null in the context model
- ormMappedSuperclass.setSpecifiedAccess(null);
- assertNull(ormMappedSuperclass.getSpecifiedAccess());
- assertNull(mappedSuperclassResource.getAccess());
- }
- //TODO test default access from
- //underlying java
- //persistence-unit-defaults
- //entity-mappings
- //with xml-mapping-metadata-complete set
-
- public void testUpdateSpecifiedMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass mappedSuperclassResource = ormResource().getEntityMappings().getMappedSuperclasses().get(0);
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
-
- //set metadata-complete in the resource model, verify context model updated
- mappedSuperclassResource.setMetadataComplete(true);
- assertTrue(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertTrue(mappedSuperclassResource.getMetadataComplete());
-
- //set access to false in the resource model
- mappedSuperclassResource.setMetadataComplete(false);
- assertFalse(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertFalse(mappedSuperclassResource.getMetadataComplete());
-
- mappedSuperclassResource.setMetadataComplete(null);
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
- }
-
- public void testModifySpecifiedMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass mappedSuperclassResource = ormResource().getEntityMappings().getMappedSuperclasses().get(0); assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
-
- //set access in the context model, verify resource model modified
- ormMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertTrue(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertTrue(mappedSuperclassResource.getMetadataComplete());
-
- //set access to null in the context model
- ormMappedSuperclass.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertFalse(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertFalse(mappedSuperclassResource.getMetadataComplete());
-
- ormMappedSuperclass.setSpecifiedMetadataComplete(null);
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
- }
-
- public void testUpdateDefaultMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass mappedSuperclassResource = ormResource().getEntityMappings().getMappedSuperclasses().get(0);
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertFalse(ormMappedSuperclass.isDefaultMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
-
- ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertTrue(ormMappedSuperclass.isDefaultMetadataComplete());
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
-
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertFalse(ormMappedSuperclass.isDefaultMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
- }
-
- public void testUpdateMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass mappedSuperclassResource = ormResource().getEntityMappings().getMappedSuperclasses().get(0);
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertFalse(ormMappedSuperclass.isMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
-
- ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertTrue(ormMappedSuperclass.isMetadataComplete());
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
-
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertFalse(ormMappedSuperclass.isMetadataComplete());
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
- }
-
-
- public void testMakeMappedSuperclassEntity() throws Exception {
- OrmPersistentType mappedSuperclassPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass mappedSuperclass = (OrmMappedSuperclass) mappedSuperclassPersistentType.getMapping();
- mappedSuperclass.setSpecifiedAccess(AccessType.PROPERTY);
- mappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- mappedSuperclassPersistentType.setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
-
- XmlEntity entity = ormResource().getEntityMappings().getEntities().get(0);
- assertEquals("model.Foo", entity.getClassName());
- assertEquals(Boolean.TRUE, entity.getMetadataComplete());
- assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, entity.getAccess());
- assertNull(entity.getDiscriminatorValue());
- assertNull(entity.getName());
-
- OrmEntity ormEntity = (OrmEntity) mappedSuperclassPersistentType.getMapping();
- assertEquals("model.Foo", ormEntity.getClass_());
- assertEquals(Boolean.TRUE, ormEntity.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, ormEntity.getSpecifiedAccess());
- }
-
- //test with 2 MappedSuperclasses, make the first one an Entity so it has to move to the end of the list
- public void testMakeMappedSuperclassEntity2() throws Exception {
- OrmPersistentType mappedSuperclassPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo2");
- OrmMappedSuperclass mappedSuperclass = (OrmMappedSuperclass) mappedSuperclassPersistentType.getMapping();
- mappedSuperclass.setSpecifiedAccess(AccessType.PROPERTY);
- mappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- mappedSuperclassPersistentType.setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
-
- XmlEntity entity = ormResource().getEntityMappings().getEntities().get(0);
- assertEquals("model.Foo", entity.getClassName());
- assertEquals(Boolean.TRUE, entity.getMetadataComplete());
- assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, entity.getAccess());
- assertNull(entity.getDiscriminatorValue());
- assertNull(entity.getName());
-
- OrmEntity ormEntity = (OrmEntity) mappedSuperclassPersistentType.getMapping();
- assertEquals("model.Foo", ormEntity.getClass_());
- assertEquals(Boolean.TRUE, ormEntity.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, ormEntity.getSpecifiedAccess());
-
- ListIterator<OrmPersistentType> persistentTypes = entityMappings().ormPersistentTypes();
- assertEquals(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey());
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey());
- }
-
- public void testMakeMappedSuperclassEmbeddable() throws Exception {
- OrmPersistentType mappedSuperclassPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass mappedSuperclass = (OrmMappedSuperclass) mappedSuperclassPersistentType.getMapping();
- mappedSuperclass.setSpecifiedAccess(AccessType.PROPERTY);
- mappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- mappedSuperclassPersistentType.setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
-
- XmlEmbeddable embeddable = ormResource().getEntityMappings().getEmbeddables().get(0);
- assertEquals("model.Foo", embeddable.getClassName());
- assertEquals(Boolean.TRUE, embeddable.getMetadataComplete());
- assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, embeddable.getAccess());
-
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) mappedSuperclassPersistentType.getMapping();
- assertEquals("model.Foo", ormEmbeddable.getClass_());
- assertEquals(Boolean.TRUE, ormEmbeddable.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, ormEmbeddable.getSpecifiedAccess());
- }
- //test with 2 MappedSuperclasses, make the first one an Embeddable so it has to move to the end of the list
- public void testMakeMappedSuperclassEmbeddable2() throws Exception {
- OrmPersistentType mappedSuperclassPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo2");
- OrmMappedSuperclass mappedSuperclass = (OrmMappedSuperclass) mappedSuperclassPersistentType.getMapping();
- mappedSuperclass.setSpecifiedAccess(AccessType.PROPERTY);
- mappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- mappedSuperclassPersistentType.setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
-
- XmlEmbeddable embeddable = ormResource().getEntityMappings().getEmbeddables().get(0);
- assertEquals("model.Foo", embeddable.getClassName());
- assertEquals(Boolean.TRUE, embeddable.getMetadataComplete());
- assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, embeddable.getAccess());
-
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) mappedSuperclassPersistentType.getMapping();
- assertEquals("model.Foo", ormEmbeddable.getClass_());
- assertEquals(Boolean.TRUE, ormEmbeddable.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, ormEmbeddable.getSpecifiedAccess());
-
- ListIterator<OrmPersistentType> persistentTypes = entityMappings().ormPersistentTypes();
- assertEquals(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey());
- assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey());
- }
-
- public void testUpdateIdClass() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass mappedSuperclassResource = ormResource().getEntityMappings().getMappedSuperclasses().get(0); assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
-
- assertNull(ormMappedSuperclass.getIdClass());
- assertNull(mappedSuperclassResource.getIdClass());
-
- mappedSuperclassResource.setIdClass(OrmFactory.eINSTANCE.createXmlIdClass());
-
- assertNull(ormMappedSuperclass.getIdClass());
- assertNotNull(mappedSuperclassResource.getIdClass());
-
- mappedSuperclassResource.getIdClass().setClassName("model.Foo");
- assertEquals("model.Foo", ormMappedSuperclass.getIdClass());
- assertEquals("model.Foo", mappedSuperclassResource.getIdClass().getClassName());
-
- //test setting @IdClass value to null, id-class tag is not removed
- mappedSuperclassResource.getIdClass().setClassName(null);
- assertNull(ormMappedSuperclass.getIdClass());
- assertNotNull(mappedSuperclassResource.getIdClass());
-
- //reset @IdClass value and then remove id-class tag
- mappedSuperclassResource.setIdClass(OrmFactory.eINSTANCE.createXmlIdClass());
- mappedSuperclassResource.getIdClass().setClassName("model.Foo");
- mappedSuperclassResource.setIdClass(null);
-
- assertNull(ormMappedSuperclass.getIdClass());
- assertNull(mappedSuperclassResource.getIdClass());
- }
-
- public void testModifyIdClass() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass mappedSuperclassResource = ormResource().getEntityMappings().getMappedSuperclasses().get(0); assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
-
- assertNull(ormMappedSuperclass.getIdClass());
- assertNull(mappedSuperclassResource.getIdClass());
-
- ormMappedSuperclass.setIdClass("model.Foo");
- assertEquals("model.Foo", mappedSuperclassResource.getIdClass().getClassName());
- assertEquals("model.Foo", ormMappedSuperclass.getIdClass());
-
- ormMappedSuperclass.setIdClass(null);
- assertNull(ormMappedSuperclass.getIdClass());
- assertNull(mappedSuperclassResource.getIdClass());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmNamedNativeQueryTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmNamedNativeQueryTests.java
deleted file mode 100644
index 84b6800528..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmNamedNativeQueryTests.java
+++ /dev/null
@@ -1,358 +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.core.tests.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmNamedNativeQuery;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmQueryHint;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-
-public class OrmNamedNativeQueryTests extends ContextModelTestCase
-{
- public OrmNamedNativeQueryTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- assertNull(ormNamedNativeQuery.getName());
- assertNull(namedNativeQueryResource.getName());
-
- //set name in the resource model, verify context model updated
- namedNativeQueryResource.setName("newName");
- assertEquals("newName", ormNamedNativeQuery.getName());
- assertEquals("newName", namedNativeQueryResource.getName());
-
- //set name to null in the resource model
- namedNativeQueryResource.setName(null);
- assertNull(ormNamedNativeQuery.getName());
- assertNull(namedNativeQueryResource.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- assertNull(ormNamedNativeQuery.getName());
- assertNull(namedNativeQueryResource.getName());
-
- //set name in the context model, verify resource model updated
- ormNamedNativeQuery.setName("newName");
- assertEquals("newName", ormNamedNativeQuery.getName());
- assertEquals("newName", namedNativeQueryResource.getName());
-
- //set name to null in the context model
- ormNamedNativeQuery.setName(null);
- assertNull(ormNamedNativeQuery.getName());
- assertNull(namedNativeQueryResource.getName());
- }
-
- public void testUpdateQuery() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- assertNull(ormNamedNativeQuery.getQuery());
- assertNull(namedNativeQueryResource.getQuery());
-
- //set name in the resource model, verify context model updated
- namedNativeQueryResource.setQuery("newName");
- assertEquals("newName", ormNamedNativeQuery.getQuery());
- assertEquals("newName", namedNativeQueryResource.getQuery());
-
- //set name to null in the resource model
- namedNativeQueryResource.setQuery(null);
- assertNull(ormNamedNativeQuery.getQuery());
- assertNull(namedNativeQueryResource.getQuery());
- }
-
- public void testModifyQuery() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- assertNull(ormNamedNativeQuery.getQuery());
- assertNull(namedNativeQueryResource.getQuery());
-
- //set name in the context model, verify resource model updated
- ormNamedNativeQuery.setQuery("newName");
- assertEquals("newName", ormNamedNativeQuery.getQuery());
- assertEquals("newName", namedNativeQueryResource.getQuery());
-
- //set name to null in the context model
- ormNamedNativeQuery.setQuery(null);
- assertNull(ormNamedNativeQuery.getQuery());
- assertNull(namedNativeQueryResource.getQuery());
- }
-
- public void testAddHint() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- OrmQueryHint queryHint = ormNamedNativeQuery.addHint(0);
- queryHint.setName("FOO");
-
- assertEquals("FOO", namedNativeQueryResource.getHints().get(0).getName());
-
- OrmQueryHint queryHint2 = ormNamedNativeQuery.addHint(0);
- queryHint2.setName("BAR");
-
- assertEquals("BAR", namedNativeQueryResource.getHints().get(0).getName());
- assertEquals("FOO", namedNativeQueryResource.getHints().get(1).getName());
-
- OrmQueryHint queryHint3 = ormNamedNativeQuery.addHint(1);
- queryHint3.setName("BAZ");
-
- assertEquals("BAR", namedNativeQueryResource.getHints().get(0).getName());
- assertEquals("BAZ", namedNativeQueryResource.getHints().get(1).getName());
- assertEquals("FOO", namedNativeQueryResource.getHints().get(2).getName());
-
- ListIterator<OrmQueryHint> queryHints = ormNamedNativeQuery.hints();
- assertEquals(queryHint2, queryHints.next());
- assertEquals(queryHint3, queryHints.next());
- assertEquals(queryHint, queryHints.next());
-
- queryHints = ormNamedNativeQuery.hints();
- assertEquals("BAR", queryHints.next().getName());
- assertEquals("BAZ", queryHints.next().getName());
- assertEquals("FOO", queryHints.next().getName());
- }
-
- public void testRemoveHint() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- ormNamedNativeQuery.addHint(0).setName("FOO");
- ormNamedNativeQuery.addHint(1).setName("BAR");
- ormNamedNativeQuery.addHint(2).setName("BAZ");
-
- assertEquals(3, namedNativeQueryResource.getHints().size());
-
- ormNamedNativeQuery.removeHint(0);
- assertEquals(2, namedNativeQueryResource.getHints().size());
- assertEquals("BAR", namedNativeQueryResource.getHints().get(0).getName());
- assertEquals("BAZ", namedNativeQueryResource.getHints().get(1).getName());
-
- ormNamedNativeQuery.removeHint(0);
- assertEquals(1, namedNativeQueryResource.getHints().size());
- assertEquals("BAZ", namedNativeQueryResource.getHints().get(0).getName());
-
- ormNamedNativeQuery.removeHint(0);
- assertEquals(0, namedNativeQueryResource.getHints().size());
- }
-
- public void testMoveHint() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- ormNamedNativeQuery.addHint(0).setName("FOO");
- ormNamedNativeQuery.addHint(1).setName("BAR");
- ormNamedNativeQuery.addHint(2).setName("BAZ");
-
- assertEquals(3, namedNativeQueryResource.getHints().size());
-
-
- ormNamedNativeQuery.moveHint(2, 0);
- ListIterator<OrmQueryHint> hints = ormNamedNativeQuery.hints();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
-
- assertEquals("BAR", namedNativeQueryResource.getHints().get(0).getName());
- assertEquals("BAZ", namedNativeQueryResource.getHints().get(1).getName());
- assertEquals("FOO", namedNativeQueryResource.getHints().get(2).getName());
-
-
- ormNamedNativeQuery.moveHint(0, 1);
- hints = ormNamedNativeQuery.hints();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
-
- assertEquals("BAZ", namedNativeQueryResource.getHints().get(0).getName());
- assertEquals("BAR", namedNativeQueryResource.getHints().get(1).getName());
- assertEquals("FOO", namedNativeQueryResource.getHints().get(2).getName());
- }
-
- public void testUpdateHints() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- namedNativeQueryResource.getHints().add(OrmFactory.eINSTANCE.createXmlQueryHint());
- namedNativeQueryResource.getHints().add(OrmFactory.eINSTANCE.createXmlQueryHint());
- namedNativeQueryResource.getHints().add(OrmFactory.eINSTANCE.createXmlQueryHint());
-
- namedNativeQueryResource.getHints().get(0).setName("FOO");
- namedNativeQueryResource.getHints().get(1).setName("BAR");
- namedNativeQueryResource.getHints().get(2).setName("BAZ");
-
- ListIterator<OrmQueryHint> hints = ormNamedNativeQuery.hints();
- assertEquals("FOO", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedNativeQueryResource.getHints().move(2, 0);
- hints = ormNamedNativeQuery.hints();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedNativeQueryResource.getHints().move(0, 1);
- hints = ormNamedNativeQuery.hints();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedNativeQueryResource.getHints().remove(1);
- hints = ormNamedNativeQuery.hints();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedNativeQueryResource.getHints().remove(1);
- hints = ormNamedNativeQuery.hints();
- assertEquals("BAZ", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedNativeQueryResource.getHints().remove(0);
- assertFalse(ormNamedNativeQuery.hints().hasNext());
- }
-
-
- public void testUpdateResultSetMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- assertEquals(null, namedNativeQueryResource.getResultSetMapping());
- assertEquals(null, ormNamedNativeQuery.getResultSetMapping());
-
- //set name in the resource model, verify context model updated
- namedNativeQueryResource.setResultSetMapping("foo");
- assertEquals("foo", namedNativeQueryResource.getResultSetMapping());
- assertEquals("foo", ormNamedNativeQuery.getResultSetMapping());
-
- //set name to null in the resource model
- namedNativeQueryResource.setResultSetMapping(null);
- assertNull(namedNativeQueryResource.getResultSetMapping());
- assertNull(ormNamedNativeQuery.getResultSetMapping());
- }
-
- public void testModifyResultSetMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- assertEquals(null, namedNativeQueryResource.getResultSetMapping());
- assertEquals(null, ormNamedNativeQuery.getResultSetMapping());
-
- //set name in the context model, verify resource model updated
- ormNamedNativeQuery.setResultSetMapping("foo");
- assertEquals("foo", namedNativeQueryResource.getResultSetMapping());
- assertEquals("foo", ormNamedNativeQuery.getResultSetMapping());
-
- //set name to null in the context model
- ormNamedNativeQuery.setResultSetMapping(null);
- assertNull(namedNativeQueryResource.getResultSetMapping());
- assertNull(ormNamedNativeQuery.getResultSetMapping());
- }
-
- public void testUpdateResultClass() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- assertEquals(null, namedNativeQueryResource.getResultClass());
- assertEquals(null, ormNamedNativeQuery.getResultClass());
-
- //set name in the resource model, verify context model updated
- namedNativeQueryResource.setResultClass("foo");
- assertEquals("foo", namedNativeQueryResource.getResultClass());
- assertEquals("foo", ormNamedNativeQuery.getResultClass());
-
- //set name to null in the resource model
- namedNativeQueryResource.setResultClass(null);
- assertNull(namedNativeQueryResource.getResultClass());
- assertNull(ormNamedNativeQuery.getResultClass());
- }
-
- public void testModifyResultClass() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- assertEquals(null, namedNativeQueryResource.getResultClass());
- assertEquals(null, ormNamedNativeQuery.getResultClass());
-
- //set name in the context model, verify resource model updated
- ormNamedNativeQuery.setResultClass("foo");
- assertEquals("foo", namedNativeQueryResource.getResultClass());
- assertEquals("foo", ormNamedNativeQuery.getResultClass());
-
- //set name to null in the context model
- ormNamedNativeQuery.setResultClass(null);
- assertNull(namedNativeQueryResource.getResultClass());
- assertNull(ormNamedNativeQuery.getResultClass());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmNamedQueryTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmNamedQueryTests.java
deleted file mode 100644
index 6825936f29..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmNamedQueryTests.java
+++ /dev/null
@@ -1,273 +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.core.tests.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmQueryHint;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlNamedQuery;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-
-public class OrmNamedQueryTests extends ContextModelTestCase
-{
- public OrmNamedQueryTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedQuery ormNamedQuery = ormEntity.addNamedQuery(0);
-
- XmlNamedQuery namedQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0);
-
- assertNull(ormNamedQuery.getName());
- assertNull(namedQueryResource.getName());
-
- //set name in the resource model, verify context model updated
- namedQueryResource.setName("newName");
- assertEquals("newName", ormNamedQuery.getName());
- assertEquals("newName", namedQueryResource.getName());
-
- //set name to null in the resource model
- namedQueryResource.setName(null);
- assertNull(ormNamedQuery.getName());
- assertNull(namedQueryResource.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedQuery ormNamedQuery = ormEntity.addNamedQuery(0);
-
- XmlNamedQuery namedQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0);
-
- assertNull(ormNamedQuery.getName());
- assertNull(namedQueryResource.getName());
-
- //set name in the context model, verify resource model updated
- ormNamedQuery.setName("newName");
- assertEquals("newName", ormNamedQuery.getName());
- assertEquals("newName", namedQueryResource.getName());
-
- //set name to null in the context model
- ormNamedQuery.setName(null);
- assertNull(ormNamedQuery.getName());
- assertNull(namedQueryResource.getName());
- }
-
- public void testUpdateQuery() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedQuery ormNamedQuery = ormEntity.addNamedQuery(0);
-
- XmlNamedQuery namedQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0);
-
- assertNull(ormNamedQuery.getQuery());
- assertNull(namedQueryResource.getQuery());
-
- //set name in the resource model, verify context model updated
- namedQueryResource.setQuery("newName");
- assertEquals("newName", ormNamedQuery.getQuery());
- assertEquals("newName", namedQueryResource.getQuery());
-
- //set name to null in the resource model
- namedQueryResource.setQuery(null);
- assertNull(ormNamedQuery.getQuery());
- assertNull(namedQueryResource.getQuery());
- }
-
- public void testModifyQuery() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedQuery ormNamedQuery = ormEntity.addNamedQuery(0);
-
- XmlNamedQuery namedQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0);
-
- assertNull(ormNamedQuery.getQuery());
- assertNull(namedQueryResource.getQuery());
-
- //set name in the context model, verify resource model updated
- ormNamedQuery.setQuery("newName");
- assertEquals("newName", ormNamedQuery.getQuery());
- assertEquals("newName", namedQueryResource.getQuery());
-
- //set name to null in the context model
- ormNamedQuery.setQuery(null);
- assertNull(ormNamedQuery.getQuery());
- assertNull(namedQueryResource.getQuery());
- }
-
- public void testAddHint() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedQuery ormNamedQuery = ormEntity.addNamedQuery(0);
-
- XmlNamedQuery namedQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0);
-
- OrmQueryHint queryHint = ormNamedQuery.addHint(0);
- queryHint.setName("FOO");
-
- assertEquals("FOO", namedQueryResource.getHints().get(0).getName());
-
- OrmQueryHint queryHint2 = ormNamedQuery.addHint(0);
- queryHint2.setName("BAR");
-
- assertEquals("BAR", namedQueryResource.getHints().get(0).getName());
- assertEquals("FOO", namedQueryResource.getHints().get(1).getName());
-
- OrmQueryHint queryHint3 = ormNamedQuery.addHint(1);
- queryHint3.setName("BAZ");
-
- assertEquals("BAR", namedQueryResource.getHints().get(0).getName());
- assertEquals("BAZ", namedQueryResource.getHints().get(1).getName());
- assertEquals("FOO", namedQueryResource.getHints().get(2).getName());
-
- ListIterator<OrmQueryHint> queryHints = ormNamedQuery.hints();
- assertEquals(queryHint2, queryHints.next());
- assertEquals(queryHint3, queryHints.next());
- assertEquals(queryHint, queryHints.next());
-
- queryHints = ormNamedQuery.hints();
- assertEquals("BAR", queryHints.next().getName());
- assertEquals("BAZ", queryHints.next().getName());
- assertEquals("FOO", queryHints.next().getName());
- }
-
- public void testRemoveHint() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedQuery ormNamedQuery = ormEntity.addNamedQuery(0);
-
- XmlNamedQuery namedQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0);
-
- ormNamedQuery.addHint(0).setName("FOO");
- ormNamedQuery.addHint(1).setName("BAR");
- ormNamedQuery.addHint(2).setName("BAZ");
-
- assertEquals(3, namedQueryResource.getHints().size());
-
- ormNamedQuery.removeHint(0);
- assertEquals(2, namedQueryResource.getHints().size());
- assertEquals("BAR", namedQueryResource.getHints().get(0).getName());
- assertEquals("BAZ", namedQueryResource.getHints().get(1).getName());
-
- ormNamedQuery.removeHint(0);
- assertEquals(1, namedQueryResource.getHints().size());
- assertEquals("BAZ", namedQueryResource.getHints().get(0).getName());
-
- ormNamedQuery.removeHint(0);
- assertEquals(0, namedQueryResource.getHints().size());
- }
-
- public void testMoveHint() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedQuery ormNamedQuery = ormEntity.addNamedQuery(0);
-
- XmlNamedQuery namedQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0);
-
- ormNamedQuery.addHint(0).setName("FOO");
- ormNamedQuery.addHint(1).setName("BAR");
- ormNamedQuery.addHint(2).setName("BAZ");
-
- assertEquals(3, namedQueryResource.getHints().size());
-
-
- ormNamedQuery.moveHint(2, 0);
- ListIterator<OrmQueryHint> hints = ormNamedQuery.hints();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
-
- assertEquals("BAR", namedQueryResource.getHints().get(0).getName());
- assertEquals("BAZ", namedQueryResource.getHints().get(1).getName());
- assertEquals("FOO", namedQueryResource.getHints().get(2).getName());
-
-
- ormNamedQuery.moveHint(0, 1);
- hints = ormNamedQuery.hints();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
-
- assertEquals("BAZ", namedQueryResource.getHints().get(0).getName());
- assertEquals("BAR", namedQueryResource.getHints().get(1).getName());
- assertEquals("FOO", namedQueryResource.getHints().get(2).getName());
- }
-
- public void testUpdateHints() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedQuery ormNamedQuery = ormEntity.addNamedQuery(0);
-
- XmlNamedQuery namedQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0);
-
- namedQueryResource.getHints().add(OrmFactory.eINSTANCE.createXmlQueryHint());
- namedQueryResource.getHints().add(OrmFactory.eINSTANCE.createXmlQueryHint());
- namedQueryResource.getHints().add(OrmFactory.eINSTANCE.createXmlQueryHint());
-
- namedQueryResource.getHints().get(0).setName("FOO");
- namedQueryResource.getHints().get(1).setName("BAR");
- namedQueryResource.getHints().get(2).setName("BAZ");
-
- ListIterator<OrmQueryHint> hints = ormNamedQuery.hints();
- assertEquals("FOO", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryResource.getHints().move(2, 0);
- hints = ormNamedQuery.hints();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryResource.getHints().move(0, 1);
- hints = ormNamedQuery.hints();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryResource.getHints().remove(1);
- hints = ormNamedQuery.hints();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryResource.getHints().remove(1);
- hints = ormNamedQuery.hints();
- assertEquals("BAZ", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryResource.getHints().remove(0);
- assertFalse(ormNamedQuery.hints().hasNext());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToManyMappingTests.java
deleted file mode 100644
index 22225dfef0..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToManyMappingTests.java
+++ /dev/null
@@ -1,655 +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.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.BasicMapping;
-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.JoinColumn;
-import org.eclipse.jpt.core.context.JoinTable;
-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.OneToOneMapping;
-import org.eclipse.jpt.core.context.TransientMapping;
-import org.eclipse.jpt.core.context.VersionMapping;
-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.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-
-public class OrmOneToManyMappingTests extends ContextModelTestCase
-{
- public OrmOneToManyMappingTests(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);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertEquals("oneToManyMapping", ormOneToManyMapping.getName());
- assertEquals("oneToManyMapping", oneToMany.getName());
-
- //set name in the resource model, verify context model updated
- oneToMany.setName("newName");
- assertEquals("newName", ormOneToManyMapping.getName());
- assertEquals("newName", oneToMany.getName());
-
- //set name to null in the resource model
- oneToMany.setName(null);
- assertNull(ormOneToManyMapping.getName());
- assertNull(oneToMany.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertEquals("oneToManyMapping", ormOneToManyMapping.getName());
- assertEquals("oneToManyMapping", oneToMany.getName());
-
- //set name in the context model, verify resource model updated
- ormOneToManyMapping.setName("newName");
- assertEquals("newName", ormOneToManyMapping.getName());
- assertEquals("newName", oneToMany.getName());
-
- //set name to null in the context model
- ormOneToManyMapping.setName(null);
- assertNull(ormOneToManyMapping.getName());
- assertNull(oneToMany.getName());
- }
-
- public void testUpdateTargetEntity() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedTargetEntity());
- assertNull(oneToMany.getTargetEntity());
-
- //set target entity in the resource model, verify context model updated
- oneToMany.setTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", ormOneToManyMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", oneToMany.getTargetEntity());
-
- //set target entity to null in the resource model
- oneToMany.setTargetEntity(null);
- assertNull(ormOneToManyMapping.getSpecifiedTargetEntity());
- assertNull(oneToMany.getTargetEntity());
- }
-
- public void testModifyTargetEntity() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedTargetEntity());
- assertNull(oneToMany.getTargetEntity());
-
- //set target entity in the context model, verify resource model updated
- ormOneToManyMapping.setSpecifiedTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", ormOneToManyMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", oneToMany.getTargetEntity());
-
- //set target entity to null in the context model
- ormOneToManyMapping.setSpecifiedTargetEntity(null);
- assertNull(ormOneToManyMapping.getSpecifiedTargetEntity());
- assertNull(oneToMany.getTargetEntity());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToManyResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedFetch());
- assertNull(oneToManyResource.getFetch());
-
- //set fetch in the resource model, verify context model updated
- oneToManyResource.setFetch(org.eclipse.jpt.core.resource.orm.FetchType.EAGER);
- assertEquals(FetchType.EAGER, ormOneToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.core.resource.orm.FetchType.EAGER, oneToManyResource.getFetch());
-
- oneToManyResource.setFetch(org.eclipse.jpt.core.resource.orm.FetchType.LAZY);
- assertEquals(FetchType.LAZY, ormOneToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.core.resource.orm.FetchType.LAZY, oneToManyResource.getFetch());
-
- //set fetch to null in the resource model
- oneToManyResource.setFetch(null);
- assertNull(ormOneToManyMapping.getSpecifiedFetch());
- assertNull(oneToManyResource.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToManyResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedFetch());
- assertNull(oneToManyResource.getFetch());
-
- //set fetch in the context model, verify resource model updated
- ormOneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(org.eclipse.jpt.core.resource.orm.FetchType.EAGER, oneToManyResource.getFetch());
- assertEquals(FetchType.EAGER, ormOneToManyMapping.getSpecifiedFetch());
-
- ormOneToManyMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(org.eclipse.jpt.core.resource.orm.FetchType.LAZY, oneToManyResource.getFetch());
- assertEquals(FetchType.LAZY, ormOneToManyMapping.getSpecifiedFetch());
-
- //set fetch to null in the context model
- ormOneToManyMapping.setSpecifiedFetch(null);
- assertNull(oneToManyResource.getFetch());
- assertNull(ormOneToManyMapping.getSpecifiedFetch());
- }
-
- public void testUpdateMappedBy() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getMappedBy());
- assertNull(oneToMany.getMappedBy());
-
- //set mappedBy in the resource model, verify context model updated
- oneToMany.setMappedBy("newMappedBy");
- assertEquals("newMappedBy", ormOneToManyMapping.getMappedBy());
- assertEquals("newMappedBy", oneToMany.getMappedBy());
-
- //setmappedBy to null in the resource model
- oneToMany.setMappedBy(null);
- assertNull(ormOneToManyMapping.getMappedBy());
- assertNull(oneToMany.getMappedBy());
- }
-
- public void testModifyMappedBy() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getMappedBy());
- assertNull(oneToMany.getMappedBy());
-
- //set mappedBy in the context model, verify resource model updated
- ormOneToManyMapping.setMappedBy("newMappedBy");
- assertEquals("newMappedBy", ormOneToManyMapping.getMappedBy());
- assertEquals("newMappedBy", oneToMany.getMappedBy());
-
- //set mappedBy to null in the context model
- ormOneToManyMapping.setMappedBy(null);
- assertNull(ormOneToManyMapping.getMappedBy());
- assertNull(oneToMany.getMappedBy());
- }
-
-
- public void testUpdateMapKey() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getMapKey());
- assertNull(oneToMany.getMapKey());
-
- //set mapKey in the resource model, verify context model does not change
- oneToMany.setMapKey(OrmFactory.eINSTANCE.createMapKeyImpl());
- assertNull(ormOneToManyMapping.getMapKey());
- assertNotNull(oneToMany.getMapKey());
-
- //set mapKey name in the resource model, verify context model updated
- oneToMany.getMapKey().setName("myMapKey");
- assertEquals("myMapKey", ormOneToManyMapping.getMapKey());
- assertEquals("myMapKey", oneToMany.getMapKey().getName());
-
- //set mapKey name to null in the resource model
- oneToMany.getMapKey().setName(null);
- assertNull(ormOneToManyMapping.getMapKey());
- assertNull(oneToMany.getMapKey().getName());
-
- oneToMany.getMapKey().setName("myMapKey");
- oneToMany.setMapKey(null);
- assertNull(ormOneToManyMapping.getMapKey());
- assertNull(oneToMany.getMapKey());
- }
-
- public void testModifyMapKey() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getMapKey());
- assertNull(oneToMany.getMapKey());
-
- //set mapKey in the context model, verify resource model updated
- ormOneToManyMapping.setMapKey("myMapKey");
- assertEquals("myMapKey", ormOneToManyMapping.getMapKey());
- assertEquals("myMapKey", oneToMany.getMapKey().getName());
-
- //set mapKey to null in the context model
- ormOneToManyMapping.setMapKey(null);
- assertNull(ormOneToManyMapping.getMapKey());
- assertNull(oneToMany.getMapKey());
- }
-
- public void testUpdateOrderBy() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getOrderBy());
- assertNull(oneToMany.getOrderBy());
-
- //set orderBy in the resource model, verify context model updated
- oneToMany.setOrderBy("newOrderBy");
- assertEquals("newOrderBy", ormOneToManyMapping.getOrderBy());
- assertEquals("newOrderBy", oneToMany.getOrderBy());
-
- //set orderBy to null in the resource model
- oneToMany.setOrderBy(null);
- assertNull(ormOneToManyMapping.getOrderBy());
- assertNull(oneToMany.getOrderBy());
- }
-
- public void testModifyOrderBy() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getOrderBy());
- assertNull(oneToMany.getOrderBy());
-
- //set mappedBy in the context model, verify resource model updated
- ormOneToManyMapping.setOrderBy("newOrderBy");
- assertEquals("newOrderBy", ormOneToManyMapping.getOrderBy());
- assertEquals("newOrderBy", oneToMany.getOrderBy());
-
- //set mappedBy to null in the context model
- ormOneToManyMapping.setOrderBy(null);
- assertNull(ormOneToManyMapping.getOrderBy());
- assertNull(oneToMany.getOrderBy());
- }
-
- public void testIsNoOrdering() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
-
- assertTrue(ormOneToManyMapping.isNoOrdering());
-
- ormOneToManyMapping.setOrderBy("foo");
- assertFalse(ormOneToManyMapping.isNoOrdering());
-
- ormOneToManyMapping.setOrderBy(null);
- assertTrue(ormOneToManyMapping.isNoOrdering());
- }
-
- public void testSetNoOrdering() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
-
- assertTrue(ormOneToManyMapping.isNoOrdering());
-
- ormOneToManyMapping.setOrderBy("foo");
- assertFalse(ormOneToManyMapping.isNoOrdering());
-
- ormOneToManyMapping.setNoOrdering(true);
- assertTrue(ormOneToManyMapping.isNoOrdering());
- assertNull(ormOneToManyMapping.getOrderBy());
- }
-//TODO
-// public boolean isOrderByPk() {
-// return "".equals(getOrderBy());
-// }
-//
-// public void setOrderByPk() {
-// setOrderBy("");
-// }
-
- public void testIsCustomOrdering() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
-
- assertFalse(ormOneToManyMapping.isCustomOrdering());
-
- ormOneToManyMapping.setOrderBy("foo");
- assertTrue(ormOneToManyMapping.isCustomOrdering());
-
- ormOneToManyMapping.setOrderBy(null);
- assertFalse(ormOneToManyMapping.isCustomOrdering());
- }
-
- public void testOneToManyMorphToIdMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.setOrderBy("customOrder");
- oneToManyMapping.setMapKey("mapKey");
- oneToManyMapping.setMappedBy("mappedBy");
- oneToManyMapping.getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = oneToManyMapping.getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- JoinColumn inverseJoinColumn = oneToManyMapping.getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("oneToMany", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToManyMorphToVersionMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.setOrderBy("customOrder");
- oneToManyMapping.setMapKey("mapKey");
- oneToManyMapping.setMappedBy("mappedBy");
- oneToManyMapping.getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = oneToManyMapping.getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- JoinColumn inverseJoinColumn = oneToManyMapping.getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("oneToMany", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToManyMorphToTransientMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.setOrderBy("customOrder");
- oneToManyMapping.setMapKey("mapKey");
- oneToManyMapping.setMappedBy("mappedBy");
- oneToManyMapping.getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = oneToManyMapping.getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- JoinColumn inverseJoinColumn = oneToManyMapping.getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("oneToMany", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToManyMorphToEmbeddedMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.setOrderBy("customOrder");
- oneToManyMapping.setMapKey("mapKey");
- oneToManyMapping.setMappedBy("mappedBy");
- oneToManyMapping.getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = oneToManyMapping.getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- JoinColumn inverseJoinColumn = oneToManyMapping.getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("oneToMany", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToManyMorphToEmbeddedIdMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.setOrderBy("customOrder");
- oneToManyMapping.setMapKey("mapKey");
- oneToManyMapping.setMappedBy("mappedBy");
- oneToManyMapping.getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = oneToManyMapping.getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- JoinColumn inverseJoinColumn = oneToManyMapping.getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals("oneToMany", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToManyMorphToOneToOneMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.setOrderBy("customOrder");
- oneToManyMapping.setMapKey("mapKey");
- oneToManyMapping.setMappedBy("mappedBy");
- oneToManyMapping.getCascade().setAll(true);
- oneToManyMapping.getCascade().setMerge(true);
- oneToManyMapping.getCascade().setPersist(true);
- oneToManyMapping.getCascade().setRefresh(true);
- oneToManyMapping.getCascade().setRemove(true);
- oneToManyMapping.getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = oneToManyMapping.getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- JoinColumn inverseJoinColumn = oneToManyMapping.getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("oneToMany", ormPersistentAttribute.getMapping().getName());
- assertEquals(FetchType.EAGER, ((OneToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- assertEquals("TargetEntity", ((OneToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- assertEquals("mappedBy", ((OneToOneMapping) ormPersistentAttribute.getMapping()).getMappedBy());
- assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isAll());
- assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge());
- assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist());
- assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
- }
-
- public void testOneToManyMorphToManyToManyMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.setOrderBy("customOrder");
- oneToManyMapping.setMapKey("mapKey");
- oneToManyMapping.setMappedBy("mappedBy");
- oneToManyMapping.getCascade().setAll(true);
- oneToManyMapping.getCascade().setMerge(true);
- oneToManyMapping.getCascade().setPersist(true);
- oneToManyMapping.getCascade().setRefresh(true);
- oneToManyMapping.getCascade().setRemove(true);
- oneToManyMapping.getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = oneToManyMapping.getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- JoinColumn inverseJoinColumn = oneToManyMapping.getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(oneToManyMapping.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("oneToMany", ormPersistentAttribute.getMapping().getName());
- assertEquals(FetchType.EAGER, ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- assertEquals("TargetEntity", ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- assertEquals("mappedBy", ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getMappedBy());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isAll());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
- JoinTable joinTable = ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getJoinTable();
- assertEquals("MY_JOIN_TABLE", joinTable.getName());
- assertEquals("name", joinTable.joinColumns().next().getSpecifiedName());
- assertEquals("referenceName", joinTable.joinColumns().next().getSpecifiedReferencedColumnName());
- assertEquals("inverseName", joinTable.inverseJoinColumns().next().getSpecifiedName());
- assertEquals("inverseReferenceName", joinTable.inverseJoinColumns().next().getSpecifiedReferencedColumnName());
- }
-
- public void testOneToManyMorphToManyToOneMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.setOrderBy("customOrder");
- oneToManyMapping.setMapKey("mapKey");
- oneToManyMapping.setMappedBy("mappedBy");
- oneToManyMapping.getCascade().setAll(true);
- oneToManyMapping.getCascade().setMerge(true);
- oneToManyMapping.getCascade().setPersist(true);
- oneToManyMapping.getCascade().setRefresh(true);
- oneToManyMapping.getCascade().setRemove(true);
- oneToManyMapping.getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = oneToManyMapping.getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- JoinColumn inverseJoinColumn = oneToManyMapping.getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(oneToManyMapping.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("oneToMany", ormPersistentAttribute.getMapping().getName());
- assertEquals(FetchType.EAGER, ((ManyToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- assertEquals("TargetEntity", ((ManyToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isAll());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
- }
-
- public void testOneToManyMorphToBasicMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.setOrderBy("customOrder");
- oneToManyMapping.setMapKey("mapKey");
- oneToManyMapping.setMappedBy("mappedBy");
- oneToManyMapping.getCascade().setAll(true);
- oneToManyMapping.getCascade().setMerge(true);
- oneToManyMapping.getCascade().setPersist(true);
- oneToManyMapping.getCascade().setRefresh(true);
- oneToManyMapping.getCascade().setRemove(true);
- oneToManyMapping.getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = oneToManyMapping.getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- JoinColumn inverseJoinColumn = oneToManyMapping.getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("oneToMany", ormPersistentAttribute.getMapping().getName());
-//TODO assertEquals(FetchType.EAGER, ((IBasicMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToOneMappingTests.java
deleted file mode 100644
index 19f63d59ac..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToOneMappingTests.java
+++ /dev/null
@@ -1,955 +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.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.BasicMapping;
-import org.eclipse.jpt.core.context.Cascade;
-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.JoinColumn;
-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.OneToOneMapping;
-import org.eclipse.jpt.core.context.TransientMapping;
-import org.eclipse.jpt.core.context.VersionMapping;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-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.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class OrmOneToOneMappingTests extends ContextModelTestCase
-{
- public OrmOneToOneMappingTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- private ICompilationUnit createTestEntityOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.JOIN_COLUMN, JPA.FETCH_TYPE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne(fetch=FetchType.LAZY, optional=false, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH})");
- sb.append(CR);
- sb.append(" @JoinColumn(name=\"MY_COLUMN\", referencedColumnName=\"MY_REFERENCED_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\")");
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertEquals("oneToOneMapping", ormOneToOneMapping.getName());
- assertEquals("oneToOneMapping", oneToOne.getName());
-
- //set name in the resource model, verify context model updated
- oneToOne.setName("newName");
- assertEquals("newName", ormOneToOneMapping.getName());
- assertEquals("newName", oneToOne.getName());
-
- //set name to null in the resource model
- oneToOne.setName(null);
- assertNull(ormOneToOneMapping.getName());
- assertNull(oneToOne.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertEquals("oneToOneMapping", ormOneToOneMapping.getName());
- assertEquals("oneToOneMapping", oneToOne.getName());
-
- //set name in the context model, verify resource model updated
- ormOneToOneMapping.setName("newName");
- assertEquals("newName", ormOneToOneMapping.getName());
- assertEquals("newName", oneToOne.getName());
-
- //set name to null in the context model
- ormOneToOneMapping.setName(null);
- assertNull(ormOneToOneMapping.getName());
- assertNull(oneToOne.getName());
- }
-
- public void testUpdateSpecifiedTargetEntity() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertNull(ormOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOne.getTargetEntity());
-
- //set target entity in the resource model, verify context model updated
- oneToOne.setTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", ormOneToOneMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", oneToOne.getTargetEntity());
-
- //set target entity to null in the resource model
- oneToOne.setTargetEntity(null);
- assertNull(ormOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOne.getTargetEntity());
- }
-
- public void testModifySpecifiedTargetEntity() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertNull(ormOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOne.getTargetEntity());
-
- //set target entity in the context model, verify resource model updated
- ormOneToOneMapping.setSpecifiedTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", ormOneToOneMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", oneToOne.getTargetEntity());
-
- //set target entity to null in the context model
- ormOneToOneMapping.setSpecifiedTargetEntity(null);
- assertNull(ormOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOne.getTargetEntity());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertNull(ormOneToOneMapping.getSpecifiedFetch());
- assertNull(oneToOneResource.getFetch());
-
- //set fetch in the resource model, verify context model updated
- oneToOneResource.setFetch(org.eclipse.jpt.core.resource.orm.FetchType.EAGER);
- assertEquals(FetchType.EAGER, ormOneToOneMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.core.resource.orm.FetchType.EAGER, oneToOneResource.getFetch());
-
- oneToOneResource.setFetch(org.eclipse.jpt.core.resource.orm.FetchType.LAZY);
- assertEquals(FetchType.LAZY, ormOneToOneMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.core.resource.orm.FetchType.LAZY, oneToOneResource.getFetch());
-
- //set fetch to null in the resource model
- oneToOneResource.setFetch(null);
- assertNull(ormOneToOneMapping.getSpecifiedFetch());
- assertNull(oneToOneResource.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertNull(ormOneToOneMapping.getSpecifiedFetch());
- assertNull(oneToOneResource.getFetch());
-
- //set fetch in the context model, verify resource model updated
- ormOneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(org.eclipse.jpt.core.resource.orm.FetchType.EAGER, oneToOneResource.getFetch());
- assertEquals(FetchType.EAGER, ormOneToOneMapping.getSpecifiedFetch());
-
- ormOneToOneMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(org.eclipse.jpt.core.resource.orm.FetchType.LAZY, oneToOneResource.getFetch());
- assertEquals(FetchType.LAZY, ormOneToOneMapping.getSpecifiedFetch());
-
- //set fetch to null in the context model
- ormOneToOneMapping.setSpecifiedFetch(null);
- assertNull(oneToOneResource.getFetch());
- assertNull(ormOneToOneMapping.getSpecifiedFetch());
- }
-
- public void testUpdateMappedBy() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertNull(ormOneToOneMapping.getMappedBy());
- assertNull(oneToOne.getMappedBy());
-
- //set mappedBy in the resource model, verify context model updated
- oneToOne.setMappedBy("newMappedBy");
- assertEquals("newMappedBy", ormOneToOneMapping.getMappedBy());
- assertEquals("newMappedBy", oneToOne.getMappedBy());
-
- //set mappedBy to null in the resource model
- oneToOne.setMappedBy(null);
- assertNull(ormOneToOneMapping.getMappedBy());
- assertNull(oneToOne.getMappedBy());
- }
-
- public void testModifyMappedBy() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertNull(ormOneToOneMapping.getMappedBy());
- assertNull(oneToOne.getMappedBy());
-
- //set mappedBy in the context model, verify resource model updated
- ormOneToOneMapping.setMappedBy("newMappedBy");
- assertEquals("newMappedBy", ormOneToOneMapping.getMappedBy());
- assertEquals("newMappedBy", oneToOne.getMappedBy());
-
- //set mappedBy to null in the context model
- ormOneToOneMapping.setMappedBy(null);
- assertNull(ormOneToOneMapping.getMappedBy());
- assertNull(oneToOne.getMappedBy());
- }
-
-
- public void testUpdateSpecifiedOptional() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertNull(ormOneToOneMapping.getSpecifiedOptional());
- assertNull(oneToOneResource.getOptional());
-
- //set optional in the resource model, verify context model updated
- oneToOneResource.setOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormOneToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.TRUE, oneToOneResource.getOptional());
-
- oneToOneResource.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormOneToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.FALSE, oneToOneResource.getOptional());
-
- //set optional to null in the resource model
- oneToOneResource.setOptional(null);
- assertNull(ormOneToOneMapping.getSpecifiedOptional());
- assertNull(oneToOneResource.getOptional());
- }
-
- public void testModifySpecifiedOptional() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertNull(ormOneToOneMapping.getSpecifiedOptional());
- assertNull(oneToOneResource.getOptional());
-
- //set optional in the context model, verify resource model updated
- ormOneToOneMapping.setSpecifiedOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, oneToOneResource.getOptional());
- assertEquals(Boolean.TRUE, ormOneToOneMapping.getSpecifiedOptional());
-
- ormOneToOneMapping.setSpecifiedOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, oneToOneResource.getOptional());
- assertEquals(Boolean.FALSE, ormOneToOneMapping.getSpecifiedOptional());
-
- //set optional to null in the context model
- ormOneToOneMapping.setSpecifiedOptional(null);
- assertNull(oneToOneResource.getOptional());
- assertNull(ormOneToOneMapping.getSpecifiedOptional());
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- OrmJoinColumn joinColumn = ormOneToOneMapping.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", oneToOneResource.getJoinColumns().get(0).getName());
-
- OrmJoinColumn joinColumn2 = ormOneToOneMapping.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", oneToOneResource.getJoinColumns().get(0).getName());
- assertEquals("FOO", oneToOneResource.getJoinColumns().get(1).getName());
-
- OrmJoinColumn joinColumn3 = ormOneToOneMapping.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", oneToOneResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", oneToOneResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", oneToOneResource.getJoinColumns().get(2).getName());
-
- ListIterator<OrmJoinColumn> joinColumns = ormOneToOneMapping.specifiedJoinColumns();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = ormOneToOneMapping.specifiedJoinColumns();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- ormOneToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- ormOneToOneMapping.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- ormOneToOneMapping.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, oneToOneResource.getJoinColumns().size());
-
- ormOneToOneMapping.removeSpecifiedJoinColumn(0);
- assertEquals(2, oneToOneResource.getJoinColumns().size());
- assertEquals("BAR", oneToOneResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", oneToOneResource.getJoinColumns().get(1).getName());
-
- ormOneToOneMapping.removeSpecifiedJoinColumn(0);
- assertEquals(1, oneToOneResource.getJoinColumns().size());
- assertEquals("BAZ", oneToOneResource.getJoinColumns().get(0).getName());
-
- ormOneToOneMapping.removeSpecifiedJoinColumn(0);
- assertEquals(0, oneToOneResource.getJoinColumns().size());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- ormOneToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- ormOneToOneMapping.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- ormOneToOneMapping.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, oneToOneResource.getJoinColumns().size());
-
-
- ormOneToOneMapping.moveSpecifiedJoinColumn(2, 0);
- ListIterator<OrmJoinColumn> joinColumns = ormOneToOneMapping.specifiedJoinColumns();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", oneToOneResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", oneToOneResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", oneToOneResource.getJoinColumns().get(2).getName());
-
-
- ormOneToOneMapping.moveSpecifiedJoinColumn(0, 1);
- joinColumns = ormOneToOneMapping.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", oneToOneResource.getJoinColumns().get(0).getName());
- assertEquals("BAR", oneToOneResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", oneToOneResource.getJoinColumns().get(2).getName());
- }
-
- public void testOneToOneMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "foo");
- assertEquals(3, ormPersistentType.virtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("foo", ormOneToOneMapping.getName());
-
- assertNull(ormOneToOneMapping.getSpecifiedFetch());
- assertNull(ormOneToOneMapping.getSpecifiedOptional());
- assertNull(ormOneToOneMapping.getSpecifiedTargetEntity());
- assertEquals(FetchType.EAGER, ormOneToOneMapping.getFetch());
- assertEquals(Boolean.TRUE, ormOneToOneMapping.getOptional());
- assertNull(ormOneToOneMapping.getTargetEntity());
-
-
- assertFalse(ormOneToOneMapping.specifiedJoinColumns().hasNext());
- //TODO default joinColumns
- //assertTrue(ormOneToOneMapping.defaultJoinColumns().hasNext());
-
-
- Cascade cascade = ormOneToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- }
-
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormOneToOneMapping.getName());
- assertEquals(FetchType.LAZY, ormOneToOneMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, ormOneToOneMapping.getSpecifiedOptional());
- assertEquals("Address", ormOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(ormOneToOneMapping.getMappedBy());
-
- OrmJoinColumn ormJoinColumn = ormOneToOneMapping.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());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
-
- ormPersistentAttribute.makeSpecified(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute= ormPersistentType.specifiedAttributes().next();
-
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormOneToOneMapping.getName());
- assertEquals(FetchType.EAGER, ormOneToOneMapping.getFetch());
- assertEquals(Boolean.TRUE, ormOneToOneMapping.getOptional());
- assertEquals("test.Address", ormOneToOneMapping.getTargetEntity());
- assertNull(ormOneToOneMapping.getMappedBy());
-
- //TODO default join columns in xml one-to-one
-// XmlJoinColumn ormJoinColumn = ormOneToOneMapping.specifiedJoinColumns().next();
-// //TODO java default columns name in JavaSingleRelationshipMapping.JoinColumnOwner
-// //assertEquals("address", ormJoinColumn.getSpecifiedName());
-// //assertEquals("address", ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUnique());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedNullable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedInsertable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUpdatable());
-// assertNull(ormJoinColumn.getColumnDefinition());
-// assertEquals(TYPE_NAME, ormJoinColumn.getSpecifiedTable());
-
- Cascade cascade = ormOneToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "address");
- assertEquals(2, ormPersistentType.virtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("address", ormOneToOneMapping.getName());
- assertNull(ormOneToOneMapping.getSpecifiedFetch());
- assertNull(ormOneToOneMapping.getSpecifiedOptional());
- assertNull(ormOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(ormOneToOneMapping.getMappedBy());
- assertEquals(FetchType.EAGER, ormOneToOneMapping.getFetch());
- assertEquals(Boolean.TRUE, ormOneToOneMapping.getOptional());
- //TODO default target entity in xml
- //assertEquals("test.Address", ormOneToOneMapping.getDefaultTargetEntity());
-
- assertFalse(ormOneToOneMapping.specifiedJoinColumns().hasNext());
-
- //TODO default join columns for specified xmlOneToOne mapping
-// XmlJoinColumn ormJoinColumn = ormOneToOneMapping.defaultJoinColumns().next();
-// assertNull(ormJoinColumn.getSpecifiedName());
-// assertNull(ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertNull(ormJoinColumn.getSpecifiedUnique());
-// assertNull(ormJoinColumn.getSpecifiedNullable());
-// assertNull(ormJoinColumn.getSpecifiedInsertable());
-// assertNull(ormJoinColumn.getSpecifiedUpdatable());
-// assertNull(ormJoinColumn.getColumnDefinition());
-// assertNull(ormJoinColumn.getSpecifiedTable());
-//
-// assertEquals("address", ormJoinColumn.getDefaultName());
-// assertEquals("address", ormJoinColumn.getDefaultReferencedColumnName());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getDefaultUnique());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getDefaultNullable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getDefaultInsertable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getDefaultUpdatable());
-// assertEquals(null, ormJoinColumn.getColumnDefinition());
-// assertEquals(TYPE_NAME, ormJoinColumn.getDefaultTable());
-
- Cascade cascade = ormOneToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- }
-
-
- public void testOneToOneMorphToIdMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToOneMapping.setMappedBy("mappedBy");
- oneToOneMapping.getCascade().setAll(true);
- oneToOneMapping.getCascade().setMerge(true);
- oneToOneMapping.getCascade().setPersist(true);
- oneToOneMapping.getCascade().setRefresh(true);
- oneToOneMapping.getCascade().setRemove(true);
- JoinColumn joinColumn = oneToOneMapping.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.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 testOneToOneMorphToVersionMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToOneMapping.setMappedBy("mappedBy");
- oneToOneMapping.getCascade().setAll(true);
- oneToOneMapping.getCascade().setMerge(true);
- oneToOneMapping.getCascade().setPersist(true);
- oneToOneMapping.getCascade().setRefresh(true);
- oneToOneMapping.getCascade().setRemove(true);
- JoinColumn joinColumn = oneToOneMapping.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.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 testOneToOneMorphToTransientMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToOneMapping.setMappedBy("mappedBy");
- oneToOneMapping.getCascade().setAll(true);
- oneToOneMapping.getCascade().setMerge(true);
- oneToOneMapping.getCascade().setPersist(true);
- oneToOneMapping.getCascade().setRefresh(true);
- oneToOneMapping.getCascade().setRemove(true);
- JoinColumn joinColumn = oneToOneMapping.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.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 testOneToOneMorphToEmbeddedMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToOneMapping.setMappedBy("mappedBy");
- oneToOneMapping.getCascade().setAll(true);
- oneToOneMapping.getCascade().setMerge(true);
- oneToOneMapping.getCascade().setPersist(true);
- oneToOneMapping.getCascade().setRefresh(true);
- oneToOneMapping.getCascade().setRemove(true);
- JoinColumn joinColumn = oneToOneMapping.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.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 testOneToOneMorphToEmbeddedIdMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToOneMapping.setMappedBy("mappedBy");
- oneToOneMapping.getCascade().setAll(true);
- oneToOneMapping.getCascade().setMerge(true);
- oneToOneMapping.getCascade().setPersist(true);
- oneToOneMapping.getCascade().setRefresh(true);
- oneToOneMapping.getCascade().setRemove(true);
- JoinColumn joinColumn = oneToOneMapping.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.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 testOneToOneMorphToManyToManyMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToOneMapping.setMappedBy("mappedBy");
- oneToOneMapping.getCascade().setAll(true);
- oneToOneMapping.getCascade().setMerge(true);
- oneToOneMapping.getCascade().setPersist(true);
- oneToOneMapping.getCascade().setRefresh(true);
- oneToOneMapping.getCascade().setRemove(true);
- JoinColumn joinColumn = oneToOneMapping.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.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());
- assertEquals("TargetEntity", ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- assertEquals("mappedBy", ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getMappedBy());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isAll());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
- }
-
- public void testOneToOneMorphToOneToManyMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToOneMapping.setMappedBy("mappedBy");
- oneToOneMapping.getCascade().setAll(true);
- oneToOneMapping.getCascade().setMerge(true);
- oneToOneMapping.getCascade().setPersist(true);
- oneToOneMapping.getCascade().setRefresh(true);
- oneToOneMapping.getCascade().setRemove(true);
- JoinColumn joinColumn = oneToOneMapping.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.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());
- assertEquals("TargetEntity", ((OneToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- assertEquals("mappedBy", ((OneToManyMapping) ormPersistentAttribute.getMapping()).getMappedBy());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isAll());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
- }
-
- public void testOneToOneMorphToManyToOneMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToOneMapping.setMappedBy("mappedBy");
- oneToOneMapping.getCascade().setAll(true);
- oneToOneMapping.getCascade().setMerge(true);
- oneToOneMapping.getCascade().setPersist(true);
- oneToOneMapping.getCascade().setRefresh(true);
- oneToOneMapping.getCascade().setRemove(true);
- JoinColumn joinColumn = oneToOneMapping.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.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());
- assertEquals("TargetEntity", ((ManyToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isAll());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
-
- joinColumn = ((ManyToOneMapping) ormPersistentAttribute.getMapping()).specifiedJoinColumns().next();
- assertEquals("name", joinColumn.getName());
- assertEquals("referenceName", joinColumn.getReferencedColumnName());
- }
-
- public void testOneToOneMorphToBasicMapping() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToOneMapping.setMappedBy("mappedBy");
- oneToOneMapping.getCascade().setAll(true);
- oneToOneMapping.getCascade().setMerge(true);
- oneToOneMapping.getCascade().setPersist(true);
- oneToOneMapping.getCascade().setRefresh(true);
- oneToOneMapping.getCascade().setRemove(true);
- JoinColumn joinColumn = oneToOneMapping.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.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 testAddPrimaryKeyJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- OrmPrimaryKeyJoinColumn joinColumn = ormOneToOneMapping.addPrimaryKeyJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", oneToOneResource.getPrimaryKeyJoinColumns().get(0).getName());
-
- OrmPrimaryKeyJoinColumn joinColumn2 = ormOneToOneMapping.addPrimaryKeyJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", oneToOneResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("FOO", oneToOneResource.getPrimaryKeyJoinColumns().get(1).getName());
-
- OrmPrimaryKeyJoinColumn joinColumn3 = ormOneToOneMapping.addPrimaryKeyJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", oneToOneResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", oneToOneResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", oneToOneResource.getPrimaryKeyJoinColumns().get(2).getName());
-
- ListIterator<OrmPrimaryKeyJoinColumn> joinColumns = ormOneToOneMapping.primaryKeyJoinColumns();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = ormOneToOneMapping.primaryKeyJoinColumns();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemovePrimaryKeyJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- ormOneToOneMapping.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- ormOneToOneMapping.addPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- ormOneToOneMapping.addPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, oneToOneResource.getPrimaryKeyJoinColumns().size());
-
- ormOneToOneMapping.removePrimaryKeyJoinColumn(0);
- assertEquals(2, oneToOneResource.getPrimaryKeyJoinColumns().size());
- assertEquals("BAR", oneToOneResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", oneToOneResource.getPrimaryKeyJoinColumns().get(1).getName());
-
- ormOneToOneMapping.removePrimaryKeyJoinColumn(0);
- assertEquals(1, oneToOneResource.getPrimaryKeyJoinColumns().size());
- assertEquals("BAZ", oneToOneResource.getPrimaryKeyJoinColumns().get(0).getName());
-
- ormOneToOneMapping.removePrimaryKeyJoinColumn(0);
- assertEquals(0, oneToOneResource.getPrimaryKeyJoinColumns().size());
- }
-
- public void testMovePrimaryKeyJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- ormOneToOneMapping.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- ormOneToOneMapping.addPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- ormOneToOneMapping.addPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, oneToOneResource.getPrimaryKeyJoinColumns().size());
-
-
- ormOneToOneMapping.movePrimaryKeyJoinColumn(2, 0);
- ListIterator<OrmPrimaryKeyJoinColumn> joinColumns = ormOneToOneMapping.primaryKeyJoinColumns();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", oneToOneResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", oneToOneResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", oneToOneResource.getPrimaryKeyJoinColumns().get(2).getName());
-
-
- ormOneToOneMapping.movePrimaryKeyJoinColumn(0, 1);
- joinColumns = ormOneToOneMapping.primaryKeyJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", oneToOneResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAR", oneToOneResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", oneToOneResource.getPrimaryKeyJoinColumns().get(2).getName());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmPersistentAttributeTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmPersistentAttributeTests.java
deleted file mode 100644
index aaefccf921..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmPersistentAttributeTests.java
+++ /dev/null
@@ -1,251 +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.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.BasicMapping;
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmIdMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmNullAttributeMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmOneToOneMapping;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class OrmPersistentAttributeTests extends ContextModelTestCase
-{
- public OrmPersistentAttributeTests(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);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().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 = entityMappings().addOrmPersistentType(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());
- ListIterator<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 = entityMappings().addOrmPersistentType(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 GenericOrmOneToOneMapping);
-
-
- ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
- ormPersistentAttribute.makeSpecified(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- assertEquals(1, ormPersistentType.virtualAttributesSize());
- assertEquals(2, ormPersistentType.specifiedAttributesSize());
- ListIterator<OrmPersistentAttribute> specifiedAttributes = ormPersistentType.specifiedAttributes();
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- assertTrue(specifiedOrmPersistentAttribute.getMapping() instanceof GenericOrmIdMapping);
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("address", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- }
-
- public void testMakeVirtual() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(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());
-
- ListIterator<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 = entityMappings().addOrmPersistentType(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 = entityMappings().addOrmPersistentType(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.virtualAttributes().next();
- 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 = entityMappings().addOrmPersistentType(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.virtualAttributes().next();
- assertEquals("address", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmPersistentTypeTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmPersistentTypeTests.java
deleted file mode 100644
index 116390af5b..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmPersistentTypeTests.java
+++ /dev/null
@@ -1,510 +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.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.JptCorePlugin;
-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.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.core.resource.orm.XmlBasicImpl;
-import org.eclipse.jpt.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddedIdImpl;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddedImpl;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.orm.XmlId;
-import org.eclipse.jpt.core.resource.orm.XmlIdImpl;
-import org.eclipse.jpt.core.resource.orm.XmlManyToManyImpl;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOneImpl;
-import org.eclipse.jpt.core.resource.orm.XmlOneToManyImpl;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOneImpl;
-import org.eclipse.jpt.core.resource.orm.XmlTransient;
-import org.eclipse.jpt.core.resource.orm.XmlTransientImpl;
-import org.eclipse.jpt.core.resource.orm.XmlVersion;
-import org.eclipse.jpt.core.resource.orm.XmlVersionImpl;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-
-public class OrmPersistentTypeTests extends ContextModelTestCase
-{
- public OrmPersistentTypeTests(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);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
-// public void testUpdateXmlTypeMapping() throws Exception {
-// assertFalse(entityMappings().ormPersistentTypes().hasNext());
-// assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
-// assertTrue(ormResource().getEntityMappings().getEntities().isEmpty());
-// assertTrue(ormResource().getEntityMappings().getEmbeddables().isEmpty());
-//
-// //add embeddable in the resource model, verify context model updated
-// Embeddable embeddable = OrmFactory.eINSTANCE.createEmbeddable();
-// ormResource().getEntityMappings().getEmbeddables().add(embeddable);
-// embeddable.setClassName("model.Foo");
-// assertTrue(entityMappings().ormPersistentTypes().hasNext());
-// assertEquals("model.Foo", entityMappings().ormPersistentTypes().next().getMapping().getClass_());
-// assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
-// assertTrue(ormResource().getEntityMappings().getEntities().isEmpty());
-// assertFalse(ormResource().getEntityMappings().getEmbeddables().isEmpty());
-// assertEquals("model.Foo", ormResource().getEntityMappings().getEmbeddables().get(0).getClassName());
-//
-// //add entity in the resource model, verify context model updated
-// Entity entity = OrmFactory.eINSTANCE.createEntity();
-// ormResource().getEntityMappings().getEntities().add(entity);
-// entity.setClassName("model.Foo2");
-// assertTrue(entityMappings().ormPersistentTypes().hasNext());
-// assertEquals("model.Foo2", entityMappings().ormPersistentTypes().next().getMapping().getClass_());
-// assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
-// assertFalse(ormResource().getEntityMappings().getEntities().isEmpty());
-// assertFalse(ormResource().getEntityMappings().getEmbeddables().isEmpty());
-// assertEquals("model.Foo2", ormResource().getEntityMappings().getEntities().get(0).getClassName());
-//
-// //add mapped-superclass in the resource model, verify context model updated
-// MappedSuperclass mappedSuperclass = OrmFactory.eINSTANCE.createMappedSuperclass();
-// ormResource().getEntityMappings().getMappedSuperclasses().add(mappedSuperclass);
-// mappedSuperclass.setClassName("model.Foo3");
-// assertTrue(entityMappings().ormPersistentTypes().hasNext());
-// assertEquals("model.Foo3", entityMappings().ormPersistentTypes().next().getMapping().getClass_());
-// assertFalse(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
-// assertFalse(ormResource().getEntityMappings().getEntities().isEmpty());
-// assertFalse(ormResource().getEntityMappings().getEmbeddables().isEmpty());
-// assertEquals("model.Foo3", ormResource().getEntityMappings().getMappedSuperclasses().get(0).getClassName());
-// }
-//
-
- public void testMorphXmlTypeMapping() throws Exception {
- assertFalse(entityMappings().ormPersistentTypes().hasNext());
- assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(ormResource().getEntityMappings().getEntities().isEmpty());
- assertTrue(ormResource().getEntityMappings().getEmbeddables().isEmpty());
-
- OrmPersistentType embeddablePersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- OrmPersistentType mappedSuperclassPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo3");
-
- OrmPersistentType ormPersistentType = entityMappings().ormPersistentTypes().next();
- assertEquals(mappedSuperclassPersistentType, ormPersistentType);
- assertEquals(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, ormPersistentType.getMapping().getKey());
-
- ormPersistentType.setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
- assertEquals(0, ormResource().getEntityMappings().getMappedSuperclasses().size());
- assertEquals(1, ormResource().getEntityMappings().getEntities().size());
- assertEquals(2, ormResource().getEntityMappings().getEmbeddables().size());
-
- Iterator<OrmPersistentType> ormPersistentTypes = entityMappings().ormPersistentTypes();
- //the same OrmPersistentTypes should still be in the context model
- assertEquals(ormPersistentTypes.next(), entityPersistentType);
- assertEquals(ormPersistentTypes.next(), embeddablePersistentType);
- assertEquals(ormPersistentTypes.next(), mappedSuperclassPersistentType);
-
- assertEquals("model.Foo", ormResource().getEntityMappings().getEmbeddables().get(0).getClassName());
- assertEquals("model.Foo3", ormResource().getEntityMappings().getEmbeddables().get(1).getClassName());
- }
-
- public void testAddSpecifiedPersistentAttribute() throws Exception {
- OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
-
- entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicAttribute");
-
- XmlEntity entity = ormResource().getEntityMappings().getEntities().get(0);
- XmlBasic basic = entity.getAttributes().getBasics().get(0);
- assertEquals("basicAttribute", basic.getName());
-
- entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedAttribute");
-
- XmlEmbedded embedded = entity.getAttributes().getEmbeddeds().get(0);
- assertEquals("embeddedAttribute", embedded.getName());
-
- entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transientAttribute");
-
- XmlTransient transientResource = entity.getAttributes().getTransients().get(0);
- assertEquals("transientAttribute", transientResource.getName());
-
- entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "versionAttribute");
-
- XmlVersion version = entity.getAttributes().getVersions().get(0);
- assertEquals("versionAttribute", version.getName());
-
- entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idAttribute");
-
- XmlId id = entity.getAttributes().getIds().get(0);
- assertEquals("idAttribute", id.getName());
-
-
- ListIterator<OrmPersistentAttribute> persistentAttributes = entityPersistentType.specifiedAttributes();
- assertEquals("idAttribute", persistentAttributes.next().getName());
- assertEquals("basicAttribute", persistentAttributes.next().getName());
- assertEquals("versionAttribute", persistentAttributes.next().getName());
- assertEquals("embeddedAttribute", persistentAttributes.next().getName());
- assertEquals("transientAttribute", persistentAttributes.next().getName());
- assertFalse(persistentAttributes.hasNext());
- }
-
- public void testRemoveSpecifiedPersistentAttribute() throws Exception {
- OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
-
- entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicAttribute");
- entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedAttribute");
- entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "versionAttribute");
- entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idAttribute");
- entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transientAttribute");
-
- XmlEntity entity = ormResource().getEntityMappings().getEntities().get(0);
- assertEquals("basicAttribute", entity.getAttributes().getBasics().get(0).getName());
- assertEquals("embeddedAttribute", entity.getAttributes().getEmbeddeds().get(0).getName());
- assertEquals("versionAttribute", entity.getAttributes().getVersions().get(0).getName());
- assertEquals("idAttribute", entity.getAttributes().getIds().get(0).getName());
- assertEquals("transientAttribute", entity.getAttributes().getTransients().get(0).getName());
-
- entityPersistentType.removeSpecifiedPersistentAttribute(entityPersistentType.getAttributeNamed("basicAttribute"));
- assertEquals("embeddedAttribute", entity.getAttributes().getEmbeddeds().get(0).getName());
- assertEquals("versionAttribute", entity.getAttributes().getVersions().get(0).getName());
- assertEquals("idAttribute", entity.getAttributes().getIds().get(0).getName());
- assertEquals("transientAttribute", entity.getAttributes().getTransients().get(0).getName());
-
- entityPersistentType.removeSpecifiedPersistentAttribute(entityPersistentType.getAttributeNamed("embeddedAttribute"));
- assertEquals("versionAttribute", entity.getAttributes().getVersions().get(0).getName());
- assertEquals("idAttribute", entity.getAttributes().getIds().get(0).getName());
- assertEquals("transientAttribute", entity.getAttributes().getTransients().get(0).getName());
-
- entityPersistentType.removeSpecifiedPersistentAttribute(entityPersistentType.getAttributeNamed("versionAttribute"));
- assertEquals("idAttribute", entity.getAttributes().getIds().get(0).getName());
- assertEquals("transientAttribute", entity.getAttributes().getTransients().get(0).getName());
-
- entityPersistentType.removeSpecifiedPersistentAttribute(entityPersistentType.getAttributeNamed("idAttribute"));
- assertEquals("transientAttribute", entity.getAttributes().getTransients().get(0).getName());
-
- entityPersistentType.removeSpecifiedPersistentAttribute(entityPersistentType.getAttributeNamed("transientAttribute"));
- assertNull(entity.getAttributes());
- }
-
- public void testRemoveId() throws Exception {
- OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- XmlEntity entity = ormResource().getEntityMappings().getEntities().get(0);
-
- entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idAttribute");
- assertEquals("idAttribute", entity.getAttributes().getIds().get(0).getName());
-
- entityPersistentType.removeSpecifiedPersistentAttribute(entityPersistentType.getAttributeNamed("idAttribute"));
- assertNull(entity.getAttributes());
- }
-
- public void testRemoveBasic() throws Exception {
- OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- XmlEntity entity = ormResource().getEntityMappings().getEntities().get(0);
-
- entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicAttribute");
- assertEquals("basicAttribute", entity.getAttributes().getBasics().get(0).getName());
-
- entityPersistentType.removeSpecifiedPersistentAttribute(entityPersistentType.getAttributeNamed("basicAttribute"));
- assertNull(entity.getAttributes());
- }
-
- public void testRemoveVersion() throws Exception {
- OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- XmlEntity entity = ormResource().getEntityMappings().getEntities().get(0);
-
- entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "versionAttribute");
- assertEquals("versionAttribute", entity.getAttributes().getVersions().get(0).getName());
-
- entityPersistentType.removeSpecifiedPersistentAttribute(entityPersistentType.getAttributeNamed("versionAttribute"));
- assertNull(entity.getAttributes());
- }
-
- public void testRemoveEmbedded() throws Exception {
- OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- XmlEntity entity = ormResource().getEntityMappings().getEntities().get(0);
-
- entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedAttribute");
- assertEquals("embeddedAttribute", entity.getAttributes().getEmbeddeds().get(0).getName());
-
- entityPersistentType.removeSpecifiedPersistentAttribute(entityPersistentType.getAttributeNamed("embeddedAttribute"));
- assertNull(entity.getAttributes());
- }
-
- public void testRemoveTransient() throws Exception {
- OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- XmlEntity entity = ormResource().getEntityMappings().getEntities().get(0);
-
- entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transientAttribute");
- assertEquals("transientAttribute", entity.getAttributes().getTransients().get(0).getName());
-
- entityPersistentType.removeSpecifiedPersistentAttribute(entityPersistentType.getAttributeNamed("transientAttribute"));
- assertNull(entity.getAttributes());
- }
-
- public void testUpdateSpecifiedPersistentAttributes() throws Exception {
- OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- XmlEntity entity = ormResource().getEntityMappings().getEntities().get(0);
-
- entity.setAttributes(OrmFactory.eINSTANCE.createAttributes());
- XmlBasicImpl basic = OrmFactory.eINSTANCE.createXmlBasicImpl();
- entity.getAttributes().getBasics().add(basic);
- basic.setName("basicAttribute");
-
- OrmPersistentAttribute ormPersistentAttribute = entityPersistentType.attributes().next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
-
- XmlEmbeddedImpl embedded = OrmFactory.eINSTANCE.createXmlEmbeddedImpl();
- entity.getAttributes().getEmbeddeds().add(embedded);
- embedded.setName("embeddedAttribute");
-
- ListIterator<OrmPersistentAttribute> attributes = entityPersistentType.attributes();
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
- XmlVersionImpl version = OrmFactory.eINSTANCE.createXmlVersionImpl();
- entity.getAttributes().getVersions().add(version);
- version.setName("versionAttribute");
-
- attributes = entityPersistentType.attributes();
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("versionAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
- XmlIdImpl id = OrmFactory.eINSTANCE.createXmlIdImpl();
- entity.getAttributes().getIds().add(id);
- id.setName("idAttribute");
-
- attributes = entityPersistentType.attributes();
- ormPersistentAttribute = attributes.next();
- assertEquals("idAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("versionAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
- XmlTransientImpl transientResource = OrmFactory.eINSTANCE.createXmlTransientImpl();
- entity.getAttributes().getTransients().add(transientResource);
- transientResource.setName("transientAttribute");
-
- attributes = entityPersistentType.attributes();
- ormPersistentAttribute = attributes.next();
- assertEquals("idAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("versionAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("transientAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
- XmlManyToOneImpl manyToOneResource = OrmFactory.eINSTANCE.createXmlManyToOneImpl();
- entity.getAttributes().getManyToOnes().add(manyToOneResource);
- manyToOneResource.setName("manyToOneAttribute");
-
- attributes = entityPersistentType.attributes();
- ormPersistentAttribute = attributes.next();
- assertEquals("idAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("versionAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToOneAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("transientAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
- XmlManyToManyImpl manyToManyResource = OrmFactory.eINSTANCE.createXmlManyToManyImpl();
- entity.getAttributes().getManyToManys().add(manyToManyResource);
- manyToManyResource.setName("manyToManyAttribute");
-
- attributes = entityPersistentType.attributes();
- ormPersistentAttribute = attributes.next();
- assertEquals("idAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("versionAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToOneAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToManyAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("transientAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
- XmlOneToManyImpl oneToManyResource = OrmFactory.eINSTANCE.createXmlOneToManyImpl();
- entity.getAttributes().getOneToManys().add(oneToManyResource);
- oneToManyResource.setName("oneToManyAttribute");
-
- attributes = entityPersistentType.attributes();
- ormPersistentAttribute = attributes.next();
- assertEquals("idAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("versionAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToOneAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("oneToManyAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToManyAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("transientAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
- XmlOneToOneImpl oneToOneResource = OrmFactory.eINSTANCE.createXmlOneToOneImpl();
- entity.getAttributes().getOneToOnes().add(oneToOneResource);
- oneToOneResource.setName("oneToOneAttribute");
-
- attributes = entityPersistentType.attributes();
- ormPersistentAttribute = attributes.next();
- assertEquals("idAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("versionAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToOneAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("oneToManyAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("oneToOneAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToManyAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("transientAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
-
- XmlEmbeddedIdImpl embeddedIdResource = OrmFactory.eINSTANCE.createXmlEmbeddedIdImpl();
- entity.getAttributes().getEmbeddedIds().add(embeddedIdResource);
- embeddedIdResource.setName("embeddedIdAttribute");
-
- attributes = entityPersistentType.attributes();
- ormPersistentAttribute = attributes.next();
- assertEquals("idAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedIdAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("versionAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToOneAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("oneToManyAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("oneToOneAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToManyAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("transientAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
- entity.getAttributes().getBasics().remove(0);
- entity.getAttributes().getEmbeddeds().remove(0);
- entity.getAttributes().getTransients().remove(0);
- entity.getAttributes().getIds().remove(0);
- entity.getAttributes().getVersions().remove(0);
- entity.getAttributes().getManyToOnes().remove(0);
- entity.getAttributes().getManyToManys().remove(0);
- entity.getAttributes().getOneToManys().remove(0);
- entity.getAttributes().getOneToOnes().remove(0);
- entity.getAttributes().getEmbeddedIds().remove(0);
- assertFalse(entityPersistentType.attributes().hasNext());
- assertNotNull(entity.getAttributes());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmPrimaryKeyJoinColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmPrimaryKeyJoinColumnTests.java
deleted file mode 100644
index 8f0dfae4da..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmPrimaryKeyJoinColumnTests.java
+++ /dev/null
@@ -1,292 +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.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.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class OrmPrimaryKeyJoinColumnTests extends ContextModelTestCase
-{
- public OrmPrimaryKeyJoinColumnTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0);
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlPrimaryKeyJoinColumn primaryKeyJoinColumnResource = entityResource.getPrimaryKeyJoinColumns().get(0);
-
- assertNull(ormPrimaryKeyJoinColumn.getSpecifiedName());
- assertNull(primaryKeyJoinColumnResource.getName());
-
- //set name in the resource model, verify context model updated
- primaryKeyJoinColumnResource.setName("FOO");
- assertEquals("FOO", ormPrimaryKeyJoinColumn.getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumnResource.getName());
-
- //set name to null in the resource model
- primaryKeyJoinColumnResource.setName(null);
- assertNull(ormPrimaryKeyJoinColumn.getSpecifiedName());
- assertNull(primaryKeyJoinColumnResource.getName());
-
- primaryKeyJoinColumnResource.setName("FOO");
- assertEquals("FOO", ormPrimaryKeyJoinColumn.getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumnResource.getName());
-
- entityResource.getPrimaryKeyJoinColumns().remove(0);
- assertFalse(ormEntity.specifiedPrimaryKeyJoinColumns().hasNext());
- assertTrue(entityResource.getPrimaryKeyJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0);
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlPrimaryKeyJoinColumn primaryKeyJoinColumnResource = entityResource.getPrimaryKeyJoinColumns().get(0);
-
- assertNull(ormPrimaryKeyJoinColumn.getSpecifiedName());
- assertNull(primaryKeyJoinColumnResource.getName());
-
- //set name in the context model, verify resource model modified
- ormPrimaryKeyJoinColumn.setSpecifiedName("foo");
- assertEquals("foo", ormPrimaryKeyJoinColumn.getSpecifiedName());
- assertEquals("foo", primaryKeyJoinColumnResource.getName());
-
- //set name to null in the context model
- ormPrimaryKeyJoinColumn.setSpecifiedName(null);
- assertNull(ormPrimaryKeyJoinColumn.getSpecifiedName());
- assertNull(entityResource.getPrimaryKeyJoinColumns().get(0).getName());
- }
-
- public void testUpdateSpecifiedReferencedColumnName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0);
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlPrimaryKeyJoinColumn primaryKeyJoinColumnResource = entityResource.getPrimaryKeyJoinColumns().get(0);
-
- assertNull(ormPrimaryKeyJoinColumn.getSpecifiedReferencedColumnName());
- assertNull(primaryKeyJoinColumnResource.getReferencedColumnName());
-
- //set name in the resource model, verify context model updated
- primaryKeyJoinColumnResource.setReferencedColumnName("FOO");
- assertEquals("FOO", ormPrimaryKeyJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals("FOO", primaryKeyJoinColumnResource.getReferencedColumnName());
-
- //set name to null in the resource model
- primaryKeyJoinColumnResource.setReferencedColumnName(null);
- assertNull(ormPrimaryKeyJoinColumn.getSpecifiedReferencedColumnName());
- assertNull(primaryKeyJoinColumnResource.getReferencedColumnName());
-
- primaryKeyJoinColumnResource.setReferencedColumnName("FOO");
- assertEquals("FOO", ormPrimaryKeyJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals("FOO", primaryKeyJoinColumnResource.getReferencedColumnName());
-
- entityResource.getPrimaryKeyJoinColumns().remove(0);
- assertFalse(ormEntity.specifiedPrimaryKeyJoinColumns().hasNext());
- assertTrue(entityResource.getPrimaryKeyJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedReferencedColumnName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0);
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlPrimaryKeyJoinColumn primaryKeyJoinColumnResource = entityResource.getPrimaryKeyJoinColumns().get(0);
-
- assertNull(ormPrimaryKeyJoinColumn.getSpecifiedReferencedColumnName());
- assertNull(primaryKeyJoinColumnResource.getReferencedColumnName());
-
- //set name in the context model, verify resource model modified
- ormPrimaryKeyJoinColumn.setSpecifiedReferencedColumnName("foo");
- assertEquals("foo", ormPrimaryKeyJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals("foo", primaryKeyJoinColumnResource.getReferencedColumnName());
-
- //set name to null in the context model
- ormPrimaryKeyJoinColumn.setSpecifiedReferencedColumnName(null);
- assertNull(ormPrimaryKeyJoinColumn.getSpecifiedReferencedColumnName());
- assertNull(entityResource.getPrimaryKeyJoinColumns().get(0).getReferencedColumnName());
- }
-
-// public void testUpdateDefaultNameFromJavaTable() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// XmlEntity ormEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-//
-// ormEntity.javaEntity().getTable().setSpecifiedName("Foo");
-// assertEquals("Foo", ormEntity.getTable().getDefaultName());
-//
-// ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-//
-// ormEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-// ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-//
-// ormEntity.setSpecifiedMetadataComplete(null);
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-//
-// ormEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
-// assertEquals("Foo", ormEntity.getTable().getDefaultName());
-//
-// ormEntity.getTable().setSpecifiedName("Bar");
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-// }
-//
-// public void testUpdateDefaultNameNoJava() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlEntity ormEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertEquals("Foo", ormEntity.getTable().getDefaultName());
-// }
-//
-// public void testUpdateDefaultNameFromParent() throws Exception {
-// createTestEntity();
-// createTestSubType();
-//
-// OrmPersistentType parentOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-// XmlEntity parentXmlEntity = (XmlEntity) parentOrmPersistentType.getMapping();
-// XmlEntity childXmlEntity = (XmlEntity) childOrmPersistentType.getMapping();
-//
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals(TYPE_NAME, childXmlEntity.getTable().getDefaultName());
-//
-// parentXmlEntity.getTable().setSpecifiedName("FOO");
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals("FOO", childXmlEntity.getTable().getDefaultName());
-//
-// parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals("AnnotationTestTypeChild", childXmlEntity.getTable().getDefaultName());
-// }
-
-
- public void testUpdateSpecifiedColumnDefinition() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0);
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlPrimaryKeyJoinColumn primaryKeyJoinColumnResource = entityResource.getPrimaryKeyJoinColumns().get(0);
-
- assertNull(ormPrimaryKeyJoinColumn.getColumnDefinition());
- assertNull(primaryKeyJoinColumnResource.getColumnDefinition());
-
- //set name in the resource model, verify context model updated
- primaryKeyJoinColumnResource.setColumnDefinition("FOO");
- assertEquals("FOO", ormPrimaryKeyJoinColumn.getColumnDefinition());
- assertEquals("FOO", primaryKeyJoinColumnResource.getColumnDefinition());
-
- //set name to null in the resource model
- primaryKeyJoinColumnResource.setColumnDefinition(null);
- assertNull(ormPrimaryKeyJoinColumn.getColumnDefinition());
- assertNull(primaryKeyJoinColumnResource.getColumnDefinition());
-
- primaryKeyJoinColumnResource.setColumnDefinition("FOO");
- assertEquals("FOO", ormPrimaryKeyJoinColumn.getColumnDefinition());
- assertEquals("FOO", primaryKeyJoinColumnResource.getColumnDefinition());
-
- entityResource.getPrimaryKeyJoinColumns().remove(0);
- assertFalse(ormEntity.specifiedPrimaryKeyJoinColumns().hasNext());
- assertTrue(entityResource.getPrimaryKeyJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedColumnDefinition() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0);
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlPrimaryKeyJoinColumn primaryKeyJoinColumnResource = entityResource.getPrimaryKeyJoinColumns().get(0);
-
- assertNull(ormPrimaryKeyJoinColumn.getColumnDefinition());
- assertNull(primaryKeyJoinColumnResource.getColumnDefinition());
-
- //set name in the context model, verify resource model modified
- ormPrimaryKeyJoinColumn.setColumnDefinition("foo");
- assertEquals("foo", ormPrimaryKeyJoinColumn.getColumnDefinition());
- assertEquals("foo", primaryKeyJoinColumnResource.getColumnDefinition());
-
- //set name to null in the context model
- ormPrimaryKeyJoinColumn.setColumnDefinition(null);
- assertNull(ormPrimaryKeyJoinColumn.getColumnDefinition());
- assertNull(entityResource.getPrimaryKeyJoinColumns().get(0).getColumnDefinition());
- }
-
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmQueryHintTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmQueryHintTests.java
deleted file mode 100644
index 1323d381d3..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmQueryHintTests.java
+++ /dev/null
@@ -1,122 +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.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.core.JptCorePlugin;
-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.OrmQueryHint;
-import org.eclipse.jpt.core.resource.orm.XmlQueryHint;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-
-public class OrmQueryHintTests extends ContextModelTestCase
-{
- public OrmQueryHintTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmQueryHint ormQueryHint = ormEntity.addNamedQuery(0).addHint(0);
-
- XmlQueryHint queryHintResource = ormResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0).getHints().get(0);
-
- assertNull(ormQueryHint.getName());
- assertNull(queryHintResource.getName());
-
- //set name in the resource model, verify context model updated
- queryHintResource.setName("newName");
- assertEquals("newName", ormQueryHint.getName());
- assertEquals("newName", queryHintResource.getName());
-
- //set name to null in the resource model
- queryHintResource.setName(null);
- assertNull(ormQueryHint.getName());
- assertNull(queryHintResource.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmQueryHint ormQueryHint = ormEntity.addNamedQuery(0).addHint(0);
-
- XmlQueryHint queryHintResource = ormResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0).getHints().get(0);
-
- assertNull(ormQueryHint.getName());
- assertNull(queryHintResource.getName());
-
- //set name in the context model, verify resource model updated
- ormQueryHint.setName("newName");
- assertEquals("newName", ormQueryHint.getName());
- assertEquals("newName", queryHintResource.getName());
-
- //set name to null in the context model
- ormQueryHint.setName(null);
- assertNull(ormQueryHint.getName());
- assertNull(queryHintResource.getName());
- }
-
- public void testUpdateValue() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmQueryHint ormQueryHint = ormEntity.addNamedQuery(0).addHint(0);
-
- XmlQueryHint queryHintResource = ormResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0).getHints().get(0);
-
- assertNull(ormQueryHint.getValue());
- assertNull(queryHintResource.getValue());
-
- //set name in the resource model, verify context model updated
- queryHintResource.setValue("newName");
- assertEquals("newName", ormQueryHint.getValue());
- assertEquals("newName", queryHintResource.getValue());
-
- //set name to null in the resource model
- queryHintResource.setValue(null);
- assertNull(ormQueryHint.getValue());
- assertNull(queryHintResource.getValue());
- }
-
- public void testModifyValue() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmQueryHint ormQueryHint = ormEntity.addNamedQuery(0).addHint(0);
-
- XmlQueryHint queryHintResource = ormResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0).getHints().get(0);
-
- assertNull(ormQueryHint.getValue());
- assertNull(queryHintResource.getValue());
-
- //set name in the context model, verify resource model updated
- ormQueryHint.setValue("newName");
- assertEquals("newName", ormQueryHint.getValue());
- assertEquals("newName", queryHintResource.getValue());
-
- //set name to null in the context model
- ormQueryHint.setValue(null);
- assertNull(ormQueryHint.getValue());
- assertNull(queryHintResource.getValue());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmSecondaryTableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmSecondaryTableTests.java
deleted file mode 100644
index e150408d8a..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmSecondaryTableTests.java
+++ /dev/null
@@ -1,763 +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.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.InheritanceType;
-import org.eclipse.jpt.core.context.SecondaryTable;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaSecondaryTable;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmSecondaryTable;
-import org.eclipse.jpt.core.context.orm.OrmUniqueConstraint;
-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.XmlSecondaryTable;
-import org.eclipse.jpt.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class OrmSecondaryTableTests extends ContextModelTestCase
-{
- public OrmSecondaryTableTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- //set name in the resource model, verify context model updated
- entityResource.getSecondaryTables().add(OrmFactory.eINSTANCE.createXmlSecondaryTableImpl());
- entityResource.getSecondaryTables().get(0).setName("FOO");
- OrmSecondaryTable secondaryTable = ormEntity.specifiedSecondaryTables().next();
- assertEquals("FOO", secondaryTable.getSpecifiedName());
- assertEquals("FOO", entityResource.getSecondaryTables().get(0).getName());
-
- //set name to null in the resource model
- entityResource.getSecondaryTables().get(0).setName(null);
- assertNull(secondaryTable.getSpecifiedName());
- assertNull(entityResource.getSecondaryTables().get(0).getName());
-
- entityResource.getSecondaryTables().remove(0);
- assertFalse(ormEntity.specifiedSecondaryTables().hasNext());
- assertEquals(0, entityResource.getSecondaryTables().size());
- }
-
- public void testModifySpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- //set name in the context model, verify resource model modified
- OrmSecondaryTable secondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- secondaryTable.setSpecifiedName("foo");
-
- assertEquals("foo", secondaryTable.getSpecifiedName());
- assertEquals("foo", entityResource.getSecondaryTables().get(0).getName());
-
- //set name to null in the context model
- secondaryTable.setSpecifiedName(null);
- assertNull(secondaryTable.getSpecifiedName());
- assertNull(entityResource.getSecondaryTables().get(0).getName());
-
- ormEntity.removeSpecifiedSecondaryTable(0);
- assertFalse(ormEntity.specifiedSecondaryTables().hasNext());
- assertEquals(0, entityResource.getSecondaryTables().size());
- }
-
- public void testUpdateDefaultNameFromJavaTable() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- ormEntity.getJavaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("FOO");
-
- OrmSecondaryTable ormSecondaryTable = ormEntity.virtualSecondaryTables().next();
- assertEquals("FOO", ormSecondaryTable.getSpecifiedName());
-
- ormEntity.getJavaEntity().specifiedSecondaryTables().next().setSpecifiedName("BAZ");
- assertEquals("BAZ", ormSecondaryTable.getSpecifiedName());
-
- ormEntity.setSecondaryTablesDefinedInXml(true);
- assertNull(ormEntity.specifiedSecondaryTables().next().getDefaultName());
- assertEquals("BAZ", ormEntity.specifiedSecondaryTables().next().getSpecifiedName());
-
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- //set schema in the resource model, verify context model updated
- entityResource.getSecondaryTables().add(OrmFactory.eINSTANCE.createXmlSecondaryTableImpl());
- entityResource.getSecondaryTables().get(0).setSchema("FOO");
- OrmSecondaryTable secondaryTable = ormEntity.specifiedSecondaryTables().next();
- assertEquals("FOO", secondaryTable.getSpecifiedSchema());
- assertEquals("FOO", entityResource.getSecondaryTables().get(0).getSchema());
-
- //set schema to null in the resource model
- entityResource.getSecondaryTables().get(0).setSchema(null);
- assertNull(secondaryTable.getSpecifiedSchema());
- assertNull(entityResource.getSecondaryTables().get(0).getSchema());
-
- entityResource.getSecondaryTables().remove(0);
- assertFalse(ormEntity.specifiedSecondaryTables().hasNext());
- assertEquals(0, entityResource.getSecondaryTables().size());
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- //set schema in the context model, verify resource model modified
- OrmSecondaryTable secondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- secondaryTable.setSpecifiedSchema("foo");
-
- assertEquals("foo", secondaryTable.getSpecifiedSchema());
- assertEquals("foo", entityResource.getSecondaryTables().get(0).getSchema());
-
- //set schema to null in the context model
- secondaryTable.setSpecifiedSchema(null);
- assertNull(secondaryTable.getSpecifiedSchema());
- assertNull(entityResource.getSecondaryTables().get(0).getSchema());
-
- ormEntity.removeSpecifiedSecondaryTable(0);
- assertFalse(ormEntity.specifiedSecondaryTables().hasNext());
- assertEquals(0, entityResource.getSecondaryTables().size());
- }
-
- public void testUpdateDefaultSchemaFromJavaTable() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-
- SecondaryTable javaSecondaryTable = ormEntity.getJavaEntity().addSpecifiedSecondaryTable(0);
- javaSecondaryTable.setSpecifiedName("FOO");
- javaSecondaryTable.setSpecifiedSchema("BAR");
-
- OrmSecondaryTable ormSecondaryTable = ormEntity.virtualSecondaryTables().next();
- assertEquals("BAR", ormSecondaryTable.getSpecifiedSchema());
-
- javaSecondaryTable.setSpecifiedSchema("BAZ");
- assertEquals("BAZ", ormSecondaryTable.getSpecifiedSchema());
-
-
- ormEntity.setSecondaryTablesDefinedInXml(true);
- assertNull(ormEntity.specifiedSecondaryTables().next().getDefaultSchema());
- assertEquals("BAZ", ormEntity.specifiedSecondaryTables().next().getSpecifiedSchema());
- }
-
- public void testUpdateDefaultSchemaFromParent() throws Exception {
- createTestEntity();
- createTestSubType();
-
- OrmPersistentType parentOrmPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmEntity parentOrmEntity = (OrmEntity) parentOrmPersistentType.getMapping();
- OrmEntity childOrmEntity = (OrmEntity) childOrmPersistentType.getMapping();
-
- assertNull(parentOrmEntity.getTable().getDefaultSchema());
- assertNull(childOrmEntity.getTable().getDefaultSchema());
-
- parentOrmEntity.getTable().setSpecifiedSchema("FOO");
- assertNull(parentOrmEntity.getTable().getDefaultSchema());
- assertEquals("FOO", childOrmEntity.getTable().getDefaultSchema());
-
- parentOrmEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertNull(parentOrmEntity.getTable().getDefaultSchema());
- assertNull(childOrmEntity.getTable().getDefaultSchema());
- }
-
- public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- ormSecondaryTable.setSpecifiedName("FOO");
- assertNull(ormSecondaryTable.getDefaultSchema());
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO");
- assertEquals("FOO", ormSecondaryTable.getDefaultSchema());
-
- entityMappings().setSpecifiedSchema("BAR");
- assertEquals("BAR", ormSecondaryTable.getDefaultSchema());
-
- SecondaryTable javaSecondaryTable = ormEntity.getJavaEntity().addSpecifiedSecondaryTable(0);
- javaSecondaryTable.setSpecifiedName("FOO");
- javaSecondaryTable.setSpecifiedSchema("JAVA_SCHEMA");
- assertEquals("BAR", ormSecondaryTable.getDefaultSchema()); //schema is not defaulted from underlying java
-
- entityMappings().setSpecifiedSchema(null);
- assertEquals("FOO", ormSecondaryTable.getDefaultSchema());
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema(null);
- assertNull(ormSecondaryTable.getDefaultSchema());
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- //set catalog in the resource model, verify context model updated
- entityResource.getSecondaryTables().add(OrmFactory.eINSTANCE.createXmlSecondaryTableImpl());
- entityResource.getSecondaryTables().get(0).setCatalog("FOO");
- OrmSecondaryTable secondaryTable = ormEntity.specifiedSecondaryTables().next();
- assertEquals("FOO", secondaryTable.getSpecifiedCatalog());
- assertEquals("FOO", entityResource.getSecondaryTables().get(0).getCatalog());
-
- //set catalog to null in the resource model
- entityResource.getSecondaryTables().get(0).setCatalog(null);
- assertNull(secondaryTable.getSpecifiedCatalog());
- assertNull(entityResource.getSecondaryTables().get(0).getCatalog());
-
- entityResource.getSecondaryTables().remove(0);
- assertFalse(ormEntity.specifiedSecondaryTables().hasNext());
- assertEquals(0, entityResource.getSecondaryTables().size());
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-
- //set catalog in the context model, verify resource model modified
- OrmSecondaryTable secondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- secondaryTable.setSpecifiedCatalog("foo");
-
- assertEquals("foo", secondaryTable.getSpecifiedCatalog());
- assertEquals("foo", entityResource.getSecondaryTables().get(0).getCatalog());
-
- //set catalog to null in the context model
- secondaryTable.setSpecifiedCatalog(null);
- assertNull(secondaryTable.getSpecifiedCatalog());
- assertNull(entityResource.getSecondaryTables().get(0).getCatalog());
-
- ormEntity.removeSpecifiedSecondaryTable(0);
- assertFalse(ormEntity.specifiedSecondaryTables().hasNext());
- assertEquals(0, entityResource.getSecondaryTables().size());
- }
-
- public void testUpdateDefaultCatalogFromJavaTable() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-
- SecondaryTable javaSecondaryTable = ormEntity.getJavaEntity().addSpecifiedSecondaryTable(0);
- javaSecondaryTable.setSpecifiedName("FOO");
- javaSecondaryTable.setSpecifiedCatalog("BAR");
-
- OrmSecondaryTable ormSecondaryTable = ormEntity.virtualSecondaryTables().next();
- assertEquals("BAR", ormSecondaryTable.getSpecifiedCatalog());
-
- javaSecondaryTable.setSpecifiedCatalog("BAZ");
- assertEquals("BAZ", ormSecondaryTable.getSpecifiedCatalog());
-
- ormEntity.setSecondaryTablesDefinedInXml(true);
- assertNull(ormEntity.specifiedSecondaryTables().next().getDefaultCatalog());
- assertEquals("BAZ", ormEntity.specifiedSecondaryTables().next().getSpecifiedCatalog());
- }
-
- public void testUpdateDefaultCatalogFromPersistenceUnitDefaults() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- ormSecondaryTable.setSpecifiedName("FOO");
- assertNull(ormSecondaryTable.getDefaultCatalog());
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("FOO");
- assertEquals("FOO", ormSecondaryTable.getDefaultCatalog());
-
- entityMappings().setSpecifiedCatalog("BAR");
- assertEquals("BAR", ormSecondaryTable.getDefaultCatalog());
-
- SecondaryTable javaSecondaryTable = ormEntity.getJavaEntity().addSpecifiedSecondaryTable(0);
- javaSecondaryTable.setSpecifiedName("FOO");
- javaSecondaryTable.setSpecifiedCatalog("JAVA_CATALOG");
- assertEquals("BAR", ormSecondaryTable.getDefaultCatalog()); //schema is not defaulted from underlying java
-
- entityMappings().setSpecifiedCatalog(null);
- assertEquals("FOO", ormSecondaryTable.getDefaultCatalog());
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog(null);
- assertNull(ormSecondaryTable.getDefaultCatalog());
- }
-
- public void testAddSpecifiedPrimaryKeyJoinColumn() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- OrmPrimaryKeyJoinColumn primaryKeyJoinColumn = ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(0);
- primaryKeyJoinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", secondaryTableResource.getPrimaryKeyJoinColumns().get(0).getName());
-
- OrmPrimaryKeyJoinColumn primaryKeyJoinColumn2 = ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(0);
- primaryKeyJoinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", secondaryTableResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("FOO", secondaryTableResource.getPrimaryKeyJoinColumns().get(1).getName());
-
- OrmPrimaryKeyJoinColumn primaryKeyJoinColumn3 = ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(1);
- primaryKeyJoinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", secondaryTableResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", secondaryTableResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", secondaryTableResource.getPrimaryKeyJoinColumns().get(2).getName());
-
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns = ormSecondaryTable.specifiedPrimaryKeyJoinColumns();
- assertEquals(primaryKeyJoinColumn2, primaryKeyJoinColumns.next());
- assertEquals(primaryKeyJoinColumn3, primaryKeyJoinColumns.next());
- assertEquals(primaryKeyJoinColumn, primaryKeyJoinColumns.next());
-
- primaryKeyJoinColumns = ormSecondaryTable.specifiedPrimaryKeyJoinColumns();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, secondaryTableResource.getPrimaryKeyJoinColumns().size());
-
- ormSecondaryTable.removeSpecifiedPrimaryKeyJoinColumn(0);
- assertEquals(2, secondaryTableResource.getPrimaryKeyJoinColumns().size());
- assertEquals("BAR", secondaryTableResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", secondaryTableResource.getPrimaryKeyJoinColumns().get(1).getName());
-
- ormSecondaryTable.removeSpecifiedPrimaryKeyJoinColumn(0);
- assertEquals(1, secondaryTableResource.getPrimaryKeyJoinColumns().size());
- assertEquals("BAZ", secondaryTableResource.getPrimaryKeyJoinColumns().get(0).getName());
-
- ormSecondaryTable.removeSpecifiedPrimaryKeyJoinColumn(0);
- assertEquals(0, secondaryTableResource.getPrimaryKeyJoinColumns().size());
- }
-
- public void testMoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, secondaryTableResource.getPrimaryKeyJoinColumns().size());
-
-
- ormSecondaryTable.moveSpecifiedPrimaryKeyJoinColumn(2, 0);
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns = ormSecondaryTable.specifiedPrimaryKeyJoinColumns();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
-
- assertEquals("BAR", secondaryTableResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", secondaryTableResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", secondaryTableResource.getPrimaryKeyJoinColumns().get(2).getName());
-
-
- ormSecondaryTable.moveSpecifiedPrimaryKeyJoinColumn(0, 1);
- primaryKeyJoinColumns = ormSecondaryTable.specifiedPrimaryKeyJoinColumns();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
-
- assertEquals("BAZ", secondaryTableResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAR", secondaryTableResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", secondaryTableResource.getPrimaryKeyJoinColumns().get(2).getName());
- }
-
- public void testUpdatePrimaryKeyJoinColumns() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- secondaryTableResource.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumnImpl());
- secondaryTableResource.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumnImpl());
- secondaryTableResource.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumnImpl());
-
- secondaryTableResource.getPrimaryKeyJoinColumns().get(0).setName("FOO");
- secondaryTableResource.getPrimaryKeyJoinColumns().get(1).setName("BAR");
- secondaryTableResource.getPrimaryKeyJoinColumns().get(2).setName("BAZ");
-
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns = ormSecondaryTable.specifiedPrimaryKeyJoinColumns();
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- secondaryTableResource.getPrimaryKeyJoinColumns().move(2, 0);
- primaryKeyJoinColumns = ormSecondaryTable.specifiedPrimaryKeyJoinColumns();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- secondaryTableResource.getPrimaryKeyJoinColumns().move(0, 1);
- primaryKeyJoinColumns = ormSecondaryTable.specifiedPrimaryKeyJoinColumns();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- secondaryTableResource.getPrimaryKeyJoinColumns().remove(1);
- primaryKeyJoinColumns = ormSecondaryTable.specifiedPrimaryKeyJoinColumns();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- secondaryTableResource.getPrimaryKeyJoinColumns().remove(1);
- primaryKeyJoinColumns = ormSecondaryTable.specifiedPrimaryKeyJoinColumns();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- secondaryTableResource.getPrimaryKeyJoinColumns().remove(0);
- assertFalse(ormSecondaryTable.specifiedPrimaryKeyJoinColumns().hasNext());
- }
-
-
- public void testUniqueConstraints() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormSecondaryTable.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- secondaryTableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- secondaryTableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- uniqueConstraints = ormSecondaryTable.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 persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- assertEquals(0, ormSecondaryTable.uniqueConstraintsSize());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- secondaryTableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- secondaryTableResource.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- assertEquals(2, ormSecondaryTable.uniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "BAR");
- ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = secondaryTableResource.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormSecondaryTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = secondaryTableResource.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormSecondaryTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormSecondaryTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, secondaryTableResource.getUniqueConstraints().size());
-
- ormSecondaryTable.removeUniqueConstraint(1);
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = secondaryTableResource.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- Iterator<OrmUniqueConstraint> uniqueConstraints = ormSecondaryTable.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- ormSecondaryTable.removeUniqueConstraint(1);
- uniqueConstraintResources = secondaryTableResource.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- uniqueConstraints = ormSecondaryTable.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- ormSecondaryTable.removeUniqueConstraint(0);
- uniqueConstraintResources = secondaryTableResource.getUniqueConstraints().listIterator();
- assertFalse(uniqueConstraintResources.hasNext());
- uniqueConstraints = ormSecondaryTable.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormSecondaryTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormSecondaryTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, secondaryTableResource.getUniqueConstraints().size());
-
-
- ormSecondaryTable.moveUniqueConstraint(2, 0);
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormSecondaryTable.uniqueConstraints();
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = secondaryTableResource.getUniqueConstraints().listIterator();
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
-
-
- ormSecondaryTable.moveUniqueConstraint(0, 1);
- uniqueConstraints = ormSecondaryTable.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
-
- uniqueConstraintResources = secondaryTableResource.getUniqueConstraints().listIterator();
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- secondaryTableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "FOO");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- secondaryTableResource.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAR");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- secondaryTableResource.getUniqueConstraints().add(2, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAZ");
-
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormSecondaryTable.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableResource.getUniqueConstraints().move(2, 0);
- uniqueConstraints = ormSecondaryTable.uniqueConstraints();
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableResource.getUniqueConstraints().move(0, 1);
- uniqueConstraints = ormSecondaryTable.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableResource.getUniqueConstraints().remove(1);
- uniqueConstraints = ormSecondaryTable.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableResource.getUniqueConstraints().remove(1);
- uniqueConstraints = ormSecondaryTable.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableResource.getUniqueConstraints().remove(0);
- uniqueConstraints = ormSecondaryTable.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
- }
-
-
- public void testUniqueConstraintsFromJava() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- JavaEntity javaEntity = (JavaEntity) ormPersistentType.getJavaPersistentType().getMapping();
- JavaSecondaryTable javaSecondaryTable = javaEntity.addSpecifiedSecondaryTable(0);
- javaSecondaryTable.setSpecifiedName("SECONDARY");
-
- OrmSecondaryTable ormSecondaryTable = ormEntity.secondaryTables().next();
- assertTrue(ormSecondaryTable.isVirtual());
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormSecondaryTable.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
-
-
- javaSecondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- javaSecondaryTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- javaSecondaryTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- uniqueConstraints = ormSecondaryTable.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());
-
- ormEntity.setSecondaryTablesDefinedInXml(true);
- OrmSecondaryTable ormSecondaryTable2 = ormEntity.secondaryTables().next();
- ormSecondaryTable2.setSpecifiedName("SECONDARY");
-
- assertEquals("SECONDARY", ormSecondaryTable.getSpecifiedName());
- assertFalse(ormSecondaryTable2.isVirtual());
- assertEquals(0, ormSecondaryTable2.uniqueConstraintsSize());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmSequenceGeneratorTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmSequenceGeneratorTests.java
deleted file mode 100644
index 5d54536317..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmSequenceGeneratorTests.java
+++ /dev/null
@@ -1,211 +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.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.context.SequenceGenerator;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class OrmSequenceGeneratorTests extends ContextModelTestCase
-{
- public OrmSequenceGeneratorTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- SequenceGenerator sequenceGenerator = entityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = ormResource().getEntityMappings().getSequenceGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- sequenceGeneratorResource.setName("FOO");
- assertEquals("FOO", sequenceGenerator.getName());
- assertEquals("FOO", sequenceGeneratorResource.getName());
-
- //set name to null in the resource model
- sequenceGeneratorResource.setName(null);
- assertNull(sequenceGenerator.getName());
- assertNull(sequenceGeneratorResource.getName());
- }
-
- public void testModifySpecifiedName() throws Exception {
- SequenceGenerator sequenceGenerator = entityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = ormResource().getEntityMappings().getSequenceGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- sequenceGenerator.setName("FOO");
- assertEquals("FOO", sequenceGeneratorResource.getName());
- assertEquals("FOO", sequenceGenerator.getName());
-
- //set name to null in the context model
- sequenceGenerator.setName(null);
- assertNull(sequenceGeneratorResource.getName());
- assertNull(sequenceGenerator.getName());
- }
-
- public void testUpdateSpecifiedSequenceName() throws Exception {
- SequenceGenerator sequenceGenerator = entityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = ormResource().getEntityMappings().getSequenceGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- sequenceGeneratorResource.setSequenceName("FOO");
- assertEquals("FOO", sequenceGenerator.getSpecifiedSequenceName());
- assertEquals("FOO", sequenceGeneratorResource.getSequenceName());
-
- //set name to null in the resource model
- sequenceGeneratorResource.setSequenceName(null);
- assertNull(sequenceGenerator.getSpecifiedSequenceName());
- assertNull(sequenceGeneratorResource.getSequenceName());
- }
-
- public void testModifySpecifiedSequenceName() throws Exception {
- SequenceGenerator sequenceGenerator = entityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = ormResource().getEntityMappings().getSequenceGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- sequenceGenerator.setSpecifiedSequenceName("FOO");
- assertEquals("FOO", sequenceGeneratorResource.getSequenceName());
- assertEquals("FOO", sequenceGenerator.getSpecifiedSequenceName());
-
- //set name to null in the context model
- sequenceGenerator.setSpecifiedSequenceName(null);
- assertNull(sequenceGeneratorResource.getSequenceName());
- assertNull(sequenceGenerator.getSpecifiedSequenceName());
- }
-
- public void testUpdateSpecifiedInitialValue() throws Exception {
- SequenceGenerator sequenceGenerator = entityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = ormResource().getEntityMappings().getSequenceGenerators().get(0);
-
- //set initial value in the resource model, verify context model updated
- sequenceGeneratorResource.setInitialValue(Integer.valueOf(10));
- assertEquals(Integer.valueOf(10), sequenceGenerator.getSpecifiedInitialValue());
- assertEquals(Integer.valueOf(10), sequenceGeneratorResource.getInitialValue());
-
- //set initial value to 1, which happens to be the default, in the resource model
- sequenceGeneratorResource.setInitialValue(Integer.valueOf(1));
- assertEquals(Integer.valueOf(1), sequenceGenerator.getSpecifiedInitialValue());
- assertEquals(Integer.valueOf(1), sequenceGeneratorResource.getInitialValue());
-
- //set initial value to null in the resource model
- sequenceGeneratorResource.setInitialValue(null);
- assertNull(sequenceGenerator.getSpecifiedInitialValue());
- assertNull(sequenceGeneratorResource.getInitialValue());
- }
-
- public void testModifySpecifiedInitialValue() throws Exception {
- SequenceGenerator sequenceGenerator = entityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = ormResource().getEntityMappings().getSequenceGenerators().get(0);
-
- //set initial value in the context model, verify resource model modified
- sequenceGenerator.setSpecifiedInitialValue(Integer.valueOf(10));
- assertEquals(Integer.valueOf(10), sequenceGeneratorResource.getInitialValue());
- assertEquals(Integer.valueOf(10), sequenceGenerator.getSpecifiedInitialValue());
-
- sequenceGenerator.setSpecifiedInitialValue(Integer.valueOf(1));
- assertEquals(Integer.valueOf(1), sequenceGeneratorResource.getInitialValue());
- assertEquals(Integer.valueOf(1), sequenceGenerator.getSpecifiedInitialValue());
-
- //set initial value to null in the context model
- sequenceGenerator.setSpecifiedInitialValue(null);
- assertNull(sequenceGeneratorResource.getInitialValue());
- assertNull(sequenceGenerator.getSpecifiedInitialValue());
- }
-
- public void testUpdateSpecifiedAllocationSize() throws Exception {
- SequenceGenerator sequenceGenerator = entityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = ormResource().getEntityMappings().getSequenceGenerators().get(0);
-
- //set allocation size in the resource model, verify context model updated
- sequenceGeneratorResource.setAllocationSize(Integer.valueOf(10));
- assertEquals(Integer.valueOf(10), sequenceGenerator.getSpecifiedAllocationSize());
- assertEquals(Integer.valueOf(10), sequenceGeneratorResource.getAllocationSize());
-
- //set allocation size to 50, which happens to be the default, in the resource model
- sequenceGeneratorResource.setAllocationSize(Integer.valueOf(1));
- assertEquals(Integer.valueOf(1), sequenceGenerator.getSpecifiedAllocationSize());
- assertEquals(Integer.valueOf(1), sequenceGeneratorResource.getAllocationSize());
-
- //set allocation size to null in the resource model
- sequenceGeneratorResource.setAllocationSize(null);
- assertNull(sequenceGenerator.getSpecifiedAllocationSize());
- assertNull(sequenceGeneratorResource.getAllocationSize());
- }
-
- public void testModifySpecifiedAllocationSize() throws Exception {
- SequenceGenerator sequenceGenerator = entityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = ormResource().getEntityMappings().getSequenceGenerators().get(0);
-
- //set allocation size in the context model, verify resource model modified
- sequenceGenerator.setSpecifiedAllocationSize(Integer.valueOf(10));
- assertEquals(Integer.valueOf(10), sequenceGeneratorResource.getAllocationSize());
- assertEquals(Integer.valueOf(10), sequenceGenerator.getSpecifiedAllocationSize());
-
- sequenceGenerator.setSpecifiedAllocationSize(Integer.valueOf(50));
- assertEquals(Integer.valueOf(50), sequenceGeneratorResource.getAllocationSize());
- assertEquals(Integer.valueOf(50), sequenceGenerator.getSpecifiedAllocationSize());
-
- //set allocation size to null in the context model
- sequenceGenerator.setSpecifiedAllocationSize(null);
- assertNull(sequenceGeneratorResource.getAllocationSize());
- assertNull(sequenceGenerator.getSpecifiedAllocationSize());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTableGeneratorTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTableGeneratorTests.java
deleted file mode 100644
index ac4af0ec38..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTableGeneratorTests.java
+++ /dev/null
@@ -1,622 +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.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.TableGenerator;
-import org.eclipse.jpt.core.context.UniqueConstraint;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.java.JavaTableGenerator;
-import org.eclipse.jpt.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmTableGenerator;
-import org.eclipse.jpt.core.context.orm.OrmUniqueConstraint;
-import org.eclipse.jpt.core.resource.java.JPA;
-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.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class OrmTableGeneratorTests extends ContextModelTestCase
-{
- public OrmTableGeneratorTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- tableGeneratorResource.setName("FOO");
- assertEquals("FOO", tableGenerator.getName());
- assertEquals("FOO", tableGeneratorResource.getName());
-
- //set name to null in the resource model
- tableGeneratorResource.setName(null);
- assertNull(tableGenerator.getName());
- assertNull(tableGeneratorResource.getName());
- }
-
- public void testModifySpecifiedName() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- tableGenerator.setName("FOO");
- assertEquals("FOO", tableGeneratorResource.getName());
- assertEquals("FOO", tableGenerator.getName());
-
- //set name to null in the context model
- tableGenerator.setName(null);
- assertNull(tableGeneratorResource.getName());
- assertNull(tableGenerator.getName());
- }
-
- public void testUpdateSpecifiedInitialValue() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- //set initial value in the resource model, verify context model updated
- tableGeneratorResource.setInitialValue(Integer.valueOf(10));
- assertEquals(Integer.valueOf(10), tableGenerator.getSpecifiedInitialValue());
- assertEquals(Integer.valueOf(10), tableGeneratorResource.getInitialValue());
-
- //set initial value to 1, which happens to be the default, in the resource model
- tableGeneratorResource.setInitialValue(Integer.valueOf(1));
- assertEquals(Integer.valueOf(1), tableGenerator.getSpecifiedInitialValue());
- assertEquals(Integer.valueOf(1), tableGeneratorResource.getInitialValue());
-
- //set initial value to null in the resource model
- tableGeneratorResource.setInitialValue(null);
- assertNull(tableGenerator.getSpecifiedInitialValue());
- assertNull(tableGeneratorResource.getInitialValue());
- }
-
- public void testModifySpecifiedInitialValue() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- //set initial value in the context model, verify resource model modified
- tableGenerator.setSpecifiedInitialValue(Integer.valueOf(10));
- assertEquals(Integer.valueOf(10), tableGeneratorResource.getInitialValue());
- assertEquals(Integer.valueOf(10), tableGenerator.getSpecifiedInitialValue());
-
- tableGenerator.setSpecifiedInitialValue(Integer.valueOf(1));
- assertEquals(Integer.valueOf(1), tableGeneratorResource.getInitialValue());
- assertEquals(Integer.valueOf(1), tableGenerator.getSpecifiedInitialValue());
-
- //set initial value to null in the context model
- tableGenerator.setSpecifiedInitialValue(null);
- assertNull(tableGeneratorResource.getInitialValue());
- assertNull(tableGenerator.getSpecifiedInitialValue());
- }
-
- public void testUpdateSpecifiedAllocationSize() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- //set allocation size in the resource model, verify context model updated
- tableGeneratorResource.setAllocationSize(Integer.valueOf(10));
- assertEquals(Integer.valueOf(10), tableGenerator.getSpecifiedAllocationSize());
- assertEquals(Integer.valueOf(10), tableGeneratorResource.getAllocationSize());
-
- //set allocation size to 50, which happens to be the default, in the resource model
- tableGeneratorResource.setAllocationSize(Integer.valueOf(1));
- assertEquals(Integer.valueOf(1), tableGenerator.getSpecifiedAllocationSize());
- assertEquals(Integer.valueOf(1), tableGeneratorResource.getAllocationSize());
-
- //set allocation size to null in the resource model
- tableGeneratorResource.setAllocationSize(null);
- assertNull(tableGenerator.getSpecifiedAllocationSize());
- assertNull(tableGeneratorResource.getAllocationSize());
- }
-
- public void testModifySpecifiedAllocationSize() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- //set allocation size in the context model, verify resource model modified
- tableGenerator.setSpecifiedAllocationSize(Integer.valueOf(10));
- assertEquals(Integer.valueOf(10), tableGeneratorResource.getAllocationSize());
- assertEquals(Integer.valueOf(10), tableGenerator.getSpecifiedAllocationSize());
-
- tableGenerator.setSpecifiedAllocationSize(Integer.valueOf(50));
- assertEquals(Integer.valueOf(50), tableGeneratorResource.getAllocationSize());
- assertEquals(Integer.valueOf(50), tableGenerator.getSpecifiedAllocationSize());
-
- //set allocation size to null in the context model
- tableGenerator.setSpecifiedAllocationSize(null);
- assertNull(tableGeneratorResource.getAllocationSize());
- assertNull(tableGenerator.getSpecifiedAllocationSize());
- }
-
- public void testUpdateSpecifiedTable() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- tableGeneratorResource.setTable("FOO");
- assertEquals("FOO", tableGenerator.getSpecifiedTable());
- assertEquals("FOO", tableGeneratorResource.getTable());
-
- //set name to null in the resource model
- tableGeneratorResource.setTable(null);
- assertNull(tableGenerator.getSpecifiedTable());
- assertNull(tableGeneratorResource.getTable());
- }
-
- public void testModifySpecifiedTable() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- tableGenerator.setSpecifiedTable("FOO");
- assertEquals("FOO", tableGeneratorResource.getTable());
- assertEquals("FOO", tableGenerator.getSpecifiedTable());
-
- //set name to null in the context model
- tableGenerator.setSpecifiedTable(null);
- assertNull(tableGeneratorResource.getTable());
- assertNull(tableGenerator.getSpecifiedTable());
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- tableGeneratorResource.setSchema("FOO");
- assertEquals("FOO", tableGenerator.getSpecifiedSchema());
- assertEquals("FOO", tableGeneratorResource.getSchema());
-
- //set name to null in the resource model
- tableGeneratorResource.setSchema(null);
- assertNull(tableGenerator.getSpecifiedSchema());
- assertNull(tableGeneratorResource.getSchema());
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- tableGenerator.setSpecifiedSchema("FOO");
- assertEquals("FOO", tableGeneratorResource.getSchema());
- assertEquals("FOO", tableGenerator.getSpecifiedSchema());
-
- //set name to null in the context model
- tableGenerator.setSpecifiedSchema(null);
- assertNull(tableGeneratorResource.getSchema());
- assertNull(tableGenerator.getSpecifiedSchema());
- }
-
- public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
-
- assertNull(tableGenerator.getDefaultSchema());
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO");
- assertEquals("FOO", tableGenerator.getDefaultSchema());
-
- entityMappings().setSpecifiedSchema("BAR");
- assertEquals("BAR", tableGenerator.getDefaultSchema());
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- tableGeneratorResource.setCatalog("FOO");
- assertEquals("FOO", tableGenerator.getSpecifiedCatalog());
- assertEquals("FOO", tableGeneratorResource.getCatalog());
-
- //set name to null in the resource model
- tableGeneratorResource.setCatalog(null);
- assertNull(tableGenerator.getSpecifiedCatalog());
- assertNull(tableGeneratorResource.getCatalog());
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- tableGenerator.setSpecifiedCatalog("FOO");
- assertEquals("FOO", tableGeneratorResource.getCatalog());
- assertEquals("FOO", tableGenerator.getSpecifiedCatalog());
-
- //set name to null in the context model
- tableGenerator.setSpecifiedCatalog(null);
- assertNull(tableGeneratorResource.getCatalog());
- assertNull(tableGenerator.getSpecifiedCatalog());
- }
-
- public void testUpdateSpecifiedPkColumnName() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- tableGeneratorResource.setPkColumnName("FOO");
- assertEquals("FOO", tableGenerator.getSpecifiedPkColumnName());
- assertEquals("FOO", tableGeneratorResource.getPkColumnName());
-
- //set name to null in the resource model
- tableGeneratorResource.setPkColumnName(null);
- assertNull(tableGenerator.getSpecifiedPkColumnName());
- assertNull(tableGeneratorResource.getPkColumnName());
- }
-
- public void testModifySpecifiedPkColumnName() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- tableGenerator.setSpecifiedPkColumnName("FOO");
- assertEquals("FOO", tableGeneratorResource.getPkColumnName());
- assertEquals("FOO", tableGenerator.getSpecifiedPkColumnName());
-
- //set name to null in the context model
- tableGenerator.setSpecifiedPkColumnName(null);
- assertNull(tableGeneratorResource.getPkColumnName());
- assertNull(tableGenerator.getSpecifiedPkColumnName());
- }
-
- public void testUpdateSpecifiedValueColumnName() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- tableGeneratorResource.setValueColumnName("FOO");
- assertEquals("FOO", tableGenerator.getSpecifiedValueColumnName());
- assertEquals("FOO", tableGeneratorResource.getValueColumnName());
-
- //set name to null in the resource model
- tableGeneratorResource.setValueColumnName(null);
- assertNull(tableGenerator.getSpecifiedValueColumnName());
- assertNull(tableGeneratorResource.getValueColumnName());
- }
-
- public void testModifySpecifiedValueColumnName() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- tableGenerator.setSpecifiedValueColumnName("FOO");
- assertEquals("FOO", tableGeneratorResource.getValueColumnName());
- assertEquals("FOO", tableGenerator.getSpecifiedValueColumnName());
-
- //set name to null in the context model
- tableGenerator.setSpecifiedValueColumnName(null);
- assertNull(tableGeneratorResource.getValueColumnName());
- assertNull(tableGenerator.getSpecifiedValueColumnName());
- }
-
- public void testUpdateSpecifiedPkColumnValue() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- tableGeneratorResource.setPkColumnValue("FOO");
- assertEquals("FOO", tableGenerator.getSpecifiedPkColumnValue());
- assertEquals("FOO", tableGeneratorResource.getPkColumnValue());
-
- //set name to null in the resource model
- tableGeneratorResource.setPkColumnValue(null);
- assertNull(tableGenerator.getSpecifiedPkColumnValue());
- assertNull(tableGeneratorResource.getPkColumnValue());
- }
-
- public void testModifySpecifiedPkColumnValue() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- tableGenerator.setSpecifiedPkColumnValue("FOO");
- assertEquals("FOO", tableGeneratorResource.getPkColumnValue());
- assertEquals("FOO", tableGenerator.getSpecifiedPkColumnValue());
-
- //set name to null in the context model
- tableGenerator.setSpecifiedPkColumnValue(null);
- assertNull(tableGeneratorResource.getPkColumnValue());
- assertNull(tableGenerator.getSpecifiedPkColumnValue());
- }
-
-
- public void testUniqueConstraints() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = tableGenerator.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- tableGeneratorResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- tableGeneratorResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- uniqueConstraints = tableGenerator.uniqueConstraints();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().columnNames().next());
- assertEquals("foo", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- assertEquals(0, tableGenerator.uniqueConstraintsSize());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- tableGeneratorResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- tableGeneratorResource.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- assertEquals(2, tableGenerator.uniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "BAR");
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = tableGeneratorResource.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- tableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR");
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = tableGeneratorResource.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- tableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR");
- tableGenerator.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, tableGeneratorResource.getUniqueConstraints().size());
-
- tableGenerator.removeUniqueConstraint(1);
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = tableGeneratorResource.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- Iterator<UniqueConstraint> uniqueConstraints = tableGenerator.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- tableGenerator.removeUniqueConstraint(1);
- uniqueConstraintResources = tableGeneratorResource.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- uniqueConstraints = tableGenerator.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- tableGenerator.removeUniqueConstraint(0);
- uniqueConstraintResources = tableGeneratorResource.getUniqueConstraints().listIterator();
- assertFalse(uniqueConstraintResources.hasNext());
- uniqueConstraints = tableGenerator.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- tableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR");
- tableGenerator.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, tableGeneratorResource.getUniqueConstraints().size());
-
-
- tableGenerator.moveUniqueConstraint(2, 0);
- ListIterator<UniqueConstraint> uniqueConstraints = tableGenerator.uniqueConstraints();
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = tableGeneratorResource.getUniqueConstraints().listIterator();
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
-
-
- tableGenerator.moveUniqueConstraint(0, 1);
- uniqueConstraints = tableGenerator.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
-
- uniqueConstraintResources = tableGeneratorResource.getUniqueConstraints().listIterator();
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- TableGenerator tableGenerator = entityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0);
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- tableGeneratorResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "FOO");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- tableGeneratorResource.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAR");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- tableGeneratorResource.getUniqueConstraints().add(2, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAZ");
-
-
- ListIterator<UniqueConstraint> uniqueConstraints = tableGenerator.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorResource.getUniqueConstraints().move(2, 0);
- uniqueConstraints = tableGenerator.uniqueConstraints();
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorResource.getUniqueConstraints().move(0, 1);
- uniqueConstraints = tableGenerator.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorResource.getUniqueConstraints().remove(1);
- uniqueConstraints = tableGenerator.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorResource.getUniqueConstraints().remove(1);
- uniqueConstraints = tableGenerator.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorResource.getUniqueConstraints().remove(0);
- uniqueConstraints = tableGenerator.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsFromJava() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentType.attributes().next().getMapping();
-
- JavaIdMapping javaIdMapping = (JavaIdMapping) ormPersistentType.getJavaPersistentType().attributes().next().getMapping();
- JavaTableGenerator javaTableGenerator = javaIdMapping.addTableGenerator();
- javaTableGenerator.setName("TABLE_GENERATOR");
-
- OrmTableGenerator ormTableGenerator = ormIdMapping.getTableGenerator();
- assertTrue(ormTableGenerator.isVirtual());
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormTableGenerator.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
-
-
- javaTableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- javaTableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR");
- javaTableGenerator.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- uniqueConstraints = ormTableGenerator.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());
-
- ormIdMapping.getPersistentAttribute().makeSpecified();
- ormIdMapping = (OrmIdMapping) ormPersistentType.attributes().next().getMapping();
-
- OrmTableGenerator ormTableGenerator2 = ormIdMapping.addTableGenerator();
- ormTableGenerator2.setName("TABLE_GENERATOR");
-
- assertFalse(ormTableGenerator2.isVirtual());
- assertEquals(0, ormTableGenerator2.uniqueConstraintsSize());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTableTests.java
deleted file mode 100644
index 5fba977c37..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTableTests.java
+++ /dev/null
@@ -1,767 +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.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.InheritanceType;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmTable;
-import org.eclipse.jpt.core.context.orm.OrmUniqueConstraint;
-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.XmlTable;
-import org.eclipse.jpt.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class OrmTableTests extends ContextModelTestCase
-{
- public OrmTableTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmTable ormTable = ormEntity.getTable();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertNull(ormTable.getSpecifiedName());
- assertNull(entityResource.getTable());
-
- //set name in the resource model, verify context model updated
- entityResource.setTable(OrmFactory.eINSTANCE.createXmlTable());
- entityResource.getTable().setName("FOO");
- assertEquals("FOO", ormTable.getSpecifiedName());
- assertEquals("FOO", entityResource.getTable().getName());
-
- //set name to null in the resource model
- entityResource.getTable().setName(null);
- assertNull(ormTable.getSpecifiedName());
- assertNull(entityResource.getTable().getName());
-
- entityResource.getTable().setName("FOO");
- assertEquals("FOO", ormTable.getSpecifiedName());
- assertEquals("FOO", entityResource.getTable().getName());
-
- entityResource.setTable(null);
- assertNull(ormTable.getSpecifiedName());
- assertNull(entityResource.getTable());
- }
-
- public void testModifySpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmTable ormTable = ((OrmEntity) ormPersistentType.getMapping()).getTable();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertNull(ormTable.getSpecifiedName());
- assertNull(entityResource.getTable());
-
- //set name in the context model, verify resource model modified
- ormTable.setSpecifiedName("foo");
- assertEquals("foo", ormTable.getSpecifiedName());
- assertEquals("foo", entityResource.getTable().getName());
-
- //set name to null in the context model
- ormTable.setSpecifiedName(null);
- assertNull(ormTable.getSpecifiedName());
- assertNull(entityResource.getTable());
- }
-
- public void testUpdateDefaultNameFromJavaTable() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-
- ormEntity.getJavaEntity().getTable().setSpecifiedName("Foo");
- assertEquals("Foo", ormEntity.getTable().getDefaultName());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-
- entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-
- ormEntity.setSpecifiedMetadataComplete(null);
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-
- entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertEquals("Foo", ormEntity.getTable().getDefaultName());
-
- ormEntity.getTable().setSpecifiedName("Bar");
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
- }
-
- public void testUpdateDefaultNameNoJava() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertEquals("Foo", ormEntity.getTable().getDefaultName());
- }
-
- public void testUpdateDefaultNameFromEntityName() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
- ormEntity.setSpecifiedName("foo");
-
- assertEquals("foo", ormEntity.getTable().getDefaultName());
-
- ormEntity.setSpecifiedName(null);
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-
- ormEntity.getJavaEntity().setSpecifiedName("foo");
- assertEquals("foo", ormEntity.getTable().getDefaultName());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
- }
-
- public void testUpdateDefaultNameFromParent() throws Exception {
- createTestEntity();
- createTestSubType();
-
- OrmPersistentType parentOrmPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmEntity parentXmlEntity = (OrmEntity) parentOrmPersistentType.getMapping();
- OrmEntity childXmlEntity = (OrmEntity) childOrmPersistentType.getMapping();
-
- assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
- assertEquals(TYPE_NAME, childXmlEntity.getTable().getDefaultName());
-
- parentXmlEntity.getTable().setSpecifiedName("FOO");
- assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
- assertEquals("FOO", childXmlEntity.getTable().getDefaultName());
-
- parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
- assertEquals("AnnotationTestTypeChild", childXmlEntity.getTable().getDefaultName());
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmTable ormTable = ormEntity.getTable();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertNull(ormTable.getSpecifiedSchema());
- assertNull(entityResource.getTable());
-
- //set schema in the resource model, verify context model updated
- entityResource.setTable(OrmFactory.eINSTANCE.createXmlTable());
- entityResource.getTable().setSchema("FOO");
- assertEquals("FOO", ormTable.getSpecifiedSchema());
- assertEquals("FOO", entityResource.getTable().getSchema());
-
- //set Schema to null in the resource model
- entityResource.getTable().setSchema(null);
- assertNull(ormTable.getSpecifiedSchema());
- assertNull(entityResource.getTable().getSchema());
-
- entityResource.getTable().setSchema("FOO");
- assertEquals("FOO", ormTable.getSpecifiedSchema());
- assertEquals("FOO", entityResource.getTable().getSchema());
-
- entityResource.setTable(null);
- assertNull(ormTable.getSpecifiedSchema());
- assertNull(entityResource.getTable());
- }
-
- public void testUpdateDefaultSchemaFromJavaTable() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertNull(ormEntity.getTable().getDefaultSchema());
-
- ormEntity.getJavaEntity().getTable().setSpecifiedSchema("Foo");
- assertEquals("Foo", ormEntity.getTable().getDefaultSchema());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertNull(ormEntity.getTable().getDefaultSchema());
-
- entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertNull(ormEntity.getTable().getDefaultSchema());
-
- ormEntity.setSpecifiedMetadataComplete(null);
- assertNull(ormEntity.getTable().getDefaultSchema());
-
- entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertEquals("Foo", ormEntity.getTable().getDefaultSchema());
-
- ormEntity.getTable().setSpecifiedName("Bar");
- assertNull(ormEntity.getTable().getDefaultSchema());
- }
-
- public void testUpdateDefaultSchemaNoJava() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertNull(ormEntity.getTable().getDefaultSchema());
- }
-
- public void testUpdateDefaultSchemaFromParent() throws Exception {
- createTestEntity();
- createTestSubType();
-
- OrmPersistentType parentOrmPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmEntity parentXmlEntity = (OrmEntity) parentOrmPersistentType.getMapping();
- OrmEntity childXmlEntity = (OrmEntity) childOrmPersistentType.getMapping();
-
- assertNull(parentXmlEntity.getTable().getDefaultSchema());
- assertNull(childXmlEntity.getTable().getDefaultSchema());
-
- parentXmlEntity.getTable().setSpecifiedSchema("FOO");
- assertNull(parentXmlEntity.getTable().getDefaultSchema());
- assertEquals("FOO", childXmlEntity.getTable().getDefaultSchema());
-
- parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertNull(parentXmlEntity.getTable().getDefaultSchema());
- assertNull(childXmlEntity.getTable().getDefaultSchema());
- }
-
- public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertNull(ormEntity.getTable().getDefaultSchema());
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO");
- assertEquals("FOO", ormEntity.getTable().getDefaultSchema());
-
- entityMappings().setSpecifiedSchema("BAR");
- assertEquals("BAR", ormEntity.getTable().getDefaultSchema());
-
- ormEntity.getJavaEntity().getTable().setSpecifiedSchema("JAVA_SCHEMA");
- assertEquals("JAVA_SCHEMA", ormEntity.getTable().getDefaultSchema());
-
- ormEntity.getTable().setSpecifiedName("BLAH");
- //xml entity now has a table element so default schema is not taken from java
- assertEquals("BAR", ormEntity.getTable().getDefaultSchema());
-
-
- entityMappings().setSpecifiedSchema(null);
- assertEquals("FOO", ormEntity.getTable().getDefaultSchema());
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema(null);
- assertNull(ormEntity.getTable().getDefaultSchema());
-
- ormEntity.getTable().setSpecifiedName(null);
- assertEquals("JAVA_SCHEMA", ormEntity.getTable().getDefaultSchema());
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmTable ormTable = ormEntity.getTable();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertNull(ormTable.getSpecifiedSchema());
- assertNull(entityResource.getTable());
-
- //set Schema in the context model, verify resource model modified
- ormTable.setSpecifiedSchema("foo");
- assertEquals("foo", ormTable.getSpecifiedSchema());
- assertEquals("foo", entityResource.getTable().getSchema());
-
- //set Schema to null in the context model
- ormTable.setSpecifiedSchema(null);
- assertNull(ormTable.getSpecifiedSchema());
- assertNull(entityResource.getTable());
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmTable ormTable = ormEntity.getTable();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertNull(ormTable.getSpecifiedCatalog());
- assertNull(entityResource.getTable());
-
- //set Catalog in the resource model, verify context model updated
- entityResource.setTable(OrmFactory.eINSTANCE.createXmlTable());
- entityResource.getTable().setCatalog("FOO");
- assertEquals("FOO", ormTable.getSpecifiedCatalog());
- assertEquals("FOO", entityResource.getTable().getCatalog());
-
- //set Catalog to null in the resource model
- entityResource.getTable().setCatalog(null);
- assertNull(ormTable.getSpecifiedCatalog());
- assertNull(entityResource.getTable().getCatalog());
-
- entityResource.getTable().setCatalog("FOO");
- assertEquals("FOO", ormTable.getSpecifiedCatalog());
- assertEquals("FOO", entityResource.getTable().getCatalog());
-
- entityResource.setTable(null);
- assertNull(ormTable.getSpecifiedCatalog());
- assertNull(entityResource.getTable());
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmTable ormTable = ormEntity.getTable();
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- assertNull(ormTable.getSpecifiedCatalog());
- assertNull(entityResource.getTable());
-
- //set Catalog in the context model, verify resource model modified
- ormTable.setSpecifiedCatalog("foo");
- assertEquals("foo", ormTable.getSpecifiedCatalog());
- assertEquals("foo", entityResource.getTable().getCatalog());
-
- //set Catalog to null in the context model
- ormTable.setSpecifiedCatalog(null);
- assertNull(ormTable.getSpecifiedCatalog());
- assertNull(entityResource.getTable());
- }
-
- public void testUpdateDefaultCatalogFromJavaTable() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertNull(ormEntity.getTable().getDefaultCatalog());
-
- ormEntity.getJavaEntity().getTable().setSpecifiedCatalog("Foo");
- assertEquals("Foo", ormEntity.getTable().getDefaultCatalog());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertNull(ormEntity.getTable().getDefaultCatalog());
-
- entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertNull(ormEntity.getTable().getDefaultCatalog());
-
- ormEntity.setSpecifiedMetadataComplete(null);
- assertNull(ormEntity.getTable().getDefaultCatalog());
-
- entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertEquals("Foo", ormEntity.getTable().getDefaultCatalog());
-
- ormEntity.getTable().setSpecifiedName("Bar");
- assertNull(ormEntity.getTable().getDefaultCatalog());
- }
-
- public void testUpdateDefaultCatalogNoJava() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertNull(ormEntity.getTable().getDefaultCatalog());
- }
-
- public void testUpdateDefaultCatalogFromParent() throws Exception {
- createTestEntity();
- createTestSubType();
-
- OrmPersistentType parentOrmPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmEntity parentXmlEntity = (OrmEntity) parentOrmPersistentType.getMapping();
- OrmEntity childXmlEntity = (OrmEntity) childOrmPersistentType.getMapping();
-
- assertNull(parentXmlEntity.getTable().getDefaultCatalog());
- assertNull(childXmlEntity.getTable().getDefaultCatalog());
-
- parentXmlEntity.getTable().setSpecifiedCatalog("FOO");
- assertNull(parentXmlEntity.getTable().getDefaultCatalog());
- assertEquals("FOO", childXmlEntity.getTable().getDefaultCatalog());
-
- parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertNull(parentXmlEntity.getTable().getDefaultCatalog());
- assertNull(childXmlEntity.getTable().getDefaultCatalog());
- }
-
- public void testUpdateDefaultCatalogFromPersistenceUnitDefaults() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertNull(ormEntity.getTable().getDefaultCatalog());
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("FOO");
- assertEquals("FOO", ormEntity.getTable().getDefaultCatalog());
-
- entityMappings().setSpecifiedCatalog("BAR");
- assertEquals("BAR", ormEntity.getTable().getDefaultCatalog());
-
- ormEntity.getJavaEntity().getTable().setSpecifiedCatalog("JAVA_CATALOG");
- assertEquals("JAVA_CATALOG", ormEntity.getTable().getDefaultCatalog());
-
- ormEntity.getTable().setSpecifiedName("BLAH");
- //xml entity now has a table element so default schema is not taken from java
- assertEquals("BAR", ormEntity.getTable().getDefaultCatalog());
-
-
- entityMappings().setSpecifiedCatalog(null);
- assertEquals("FOO", ormEntity.getTable().getDefaultCatalog());
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog(null);
- assertNull(ormEntity.getTable().getDefaultCatalog());
-
- ormEntity.getTable().setSpecifiedName(null);
- assertEquals("JAVA_CATALOG", ormEntity.getTable().getDefaultCatalog());
-}
-
-//
-// public void testUpdateName() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlEntity ormEntity = (XmlEntity) ormPersistentType.getMapping();
-// Entity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-// assertEquals("Foo", ormEntity.getName());
-//
-// //set class in the resource model, verify context model updated
-// entityResource.setClassName("com.Bar");
-// assertEquals("Bar", ormEntity.getName());
-//
-// entityResource.setName("Baz");
-// assertEquals("Baz", ormEntity.getName());
-//
-// //set class to null in the resource model
-// entityResource.setClassName(null);
-// assertEquals("Baz", ormEntity.getName());
-//
-// entityResource.setName(null);
-// assertNull(ormEntity.getName());
-// }
-
- public void testUniqueConstraints() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormEntity.getTable().uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlTable tableResource = OrmFactory.eINSTANCE.createXmlTable();
- entityResource.setTable(tableResource);
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- tableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- tableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- uniqueConstraints = ormEntity.getTable().uniqueConstraints();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().columnNames().next());
- assertEquals("foo", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- assertEquals(0, ormEntity.getTable().uniqueConstraintsSize());
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlTable tableResource = OrmFactory.eINSTANCE.createXmlTable();
- entityResource.setTable(tableResource);
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- tableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- tableResource.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- assertEquals(2, ormEntity.getTable().uniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- OrmTable table = ormEntity.getTable();
- table.addUniqueConstraint(0).addColumnName(0, "FOO");
- table.addUniqueConstraint(0).addColumnName(0, "BAR");
- table.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlTable tableResource = entityResource.getTable();
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = tableResource.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- OrmTable table = ormEntity.getTable();
- table.addUniqueConstraint(0).addColumnName(0, "FOO");
- table.addUniqueConstraint(1).addColumnName(0, "BAR");
- table.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlTable tableResource = entityResource.getTable();
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = tableResource.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- OrmTable table = ormEntity.getTable();
- table.addUniqueConstraint(0).addColumnName(0, "FOO");
- table.addUniqueConstraint(1).addColumnName(0, "BAR");
- table.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlTable tableResource = entityResource.getTable();
-
- assertEquals(3, tableResource.getUniqueConstraints().size());
-
- table.removeUniqueConstraint(1);
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = tableResource.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- Iterator<OrmUniqueConstraint> uniqueConstraints = table.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- table.removeUniqueConstraint(1);
- uniqueConstraintResources = tableResource.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- uniqueConstraints = table.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- table.removeUniqueConstraint(0);
- uniqueConstraintResources = tableResource.getUniqueConstraints().listIterator();
- assertFalse(uniqueConstraintResources.hasNext());
- uniqueConstraints = table.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- OrmTable table = ormEntity.getTable();
- table.addUniqueConstraint(0).addColumnName(0, "FOO");
- table.addUniqueConstraint(1).addColumnName(0, "BAR");
- table.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlTable tableResource = entityResource.getTable();
-
- assertEquals(3, tableResource.getUniqueConstraints().size());
-
-
- table.moveUniqueConstraint(2, 0);
- ListIterator<OrmUniqueConstraint> uniqueConstraints = table.uniqueConstraints();
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = tableResource.getUniqueConstraints().listIterator();
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
-
-
- table.moveUniqueConstraint(0, 1);
- uniqueConstraints = table.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
-
- uniqueConstraintResources = tableResource.getUniqueConstraints().listIterator();
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- OrmTable table = ormEntity.getTable();
-
- XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
- XmlTable tableResource = OrmFactory.eINSTANCE.createXmlTable();
- entityResource.setTable(tableResource);
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- tableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "FOO");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- tableResource.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAR");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl();
- tableResource.getUniqueConstraints().add(2, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAZ");
-
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = table.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableResource.getUniqueConstraints().move(2, 0);
- uniqueConstraints = table.uniqueConstraints();
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableResource.getUniqueConstraints().move(0, 1);
- uniqueConstraints = table.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableResource.getUniqueConstraints().remove(1);
- uniqueConstraints = table.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableResource.getUniqueConstraints().remove(1);
- uniqueConstraints = table.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableResource.getUniqueConstraints().remove(0);
- uniqueConstraints = table.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
- }
-
-//TODO not yet supporting unique constriants from java
-// public void testUniqueConstraintsFromJava() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-//
-// ListIterator<OrmUniqueConstraint> uniqueConstraints = ormEntity.getTable().uniqueConstraints();
-// assertFalse(uniqueConstraints.hasNext());
-//
-// JavaEntity javaEntity = (JavaEntity) ormPersistentType.getJavaPersistentType().getMapping();
-// javaEntity.getTable().addUniqueConstraint(0).addColumnName(0, "FOO");
-// javaEntity.getTable().addUniqueConstraint(1).addColumnName(0, "BAR");
-// javaEntity.getTable().addUniqueConstraint(2).addColumnName(0, "BAZ");
-//
-//
-// XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-// assertNull(entityResource.getTable());
-//
-// uniqueConstraints = ormEntity.getTable().uniqueConstraints();
-// assertTrue(uniqueConstraints.hasNext());
-// assertEquals("FOO", uniqueConstraints.next().columnNames().next());
-// assertEquals("BAR", uniqueConstraints.next().columnNames().next());
-// assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
-// assertFalse(uniqueConstraints.hasNext());
-//
-// entityResource.setTable(OrmFactory.eINSTANCE.createXmlTableImpl());
-// assertEquals(0, ormEntity.getTable().uniqueConstraintsSize());
-// }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTransientMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTransientMappingTests.java
deleted file mode 100644
index 369fc2ad05..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTransientMappingTests.java
+++ /dev/null
@@ -1,301 +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.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.EmbeddedIdMapping;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-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.OneToOneMapping;
-import org.eclipse.jpt.core.context.TransientMapping;
-import org.eclipse.jpt.core.context.VersionMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmTransientMapping;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.orm.XmlTransient;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class OrmTransientMappingTests extends ContextModelTestCase
-{
- public OrmTransientMappingTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- private ICompilationUnit createTestEntityTransientMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TRANSIENT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Transient");
- }
- });
- }
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transientMapping");
- OrmTransientMapping xmlTransientnMapping = (OrmTransientMapping) ormPersistentAttribute.getMapping();
- XmlTransient transientResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getTransients().get(0);
-
- assertEquals("transientMapping", xmlTransientnMapping.getName());
- assertEquals("transientMapping", transientResource.getName());
-
- //set name in the resource model, verify context model updated
- transientResource.setName("newName");
- assertEquals("newName", xmlTransientnMapping.getName());
- assertEquals("newName", transientResource.getName());
-
- //set name to null in the resource model
- transientResource.setName(null);
- assertNull(xmlTransientnMapping.getName());
- assertNull(transientResource.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transientMapping");
- OrmTransientMapping xmlTransientnMapping = (OrmTransientMapping) ormPersistentAttribute.getMapping();
- XmlTransient transientResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getTransients().get(0);
-
- assertEquals("transientMapping", xmlTransientnMapping.getName());
- assertEquals("transientMapping", transientResource.getName());
-
- //set name in the context model, verify resource model updated
- xmlTransientnMapping.setName("newName");
- assertEquals("newName", xmlTransientnMapping.getName());
- assertEquals("newName", transientResource.getName());
-
- //set name to null in the context model
- xmlTransientnMapping.setName(null);
- assertNull(xmlTransientnMapping.getName());
- assertNull(transientResource.getName());
- }
-
-
- public void testTransientMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityTransientMapping();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "foo");
- assertEquals(2, ormPersistentType.virtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- OrmTransientMapping ormTransientMapping = (OrmTransientMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("foo", ormTransientMapping.getName());
- }
-
- //@Basic(fetch=FetchType.LAZY, optional=false)
- //@Column(name="MY_COLUMN", unique=true, nullable=false, insertable=false, updatable=false,
- // columnDefinition="COLUMN_DEFINITION", table="MY_TABLE", length=5, precision=6, scale=7)");
- //@Column(
- //@Lob
- //@Temporal(TemporalType.TIMESTAMP)
- //@Enumerated(EnumType.STRING)
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(2, ormPersistentType.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- OrmTransientMapping ormTransientMapping = (OrmTransientMapping) ormPersistentAttribute.getMapping();
- assertEquals("id", ormTransientMapping.getName());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(2, ormPersistentType.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
-
- ormPersistentAttribute.makeSpecified(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute= ormPersistentType.specifiedAttributes().next();
-
- OrmTransientMapping ormTransientMapping = (OrmTransientMapping) ormPersistentAttribute.getMapping();
- assertEquals("id", ormTransientMapping.getName());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityTransientMapping();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "id");
- assertEquals(1, ormPersistentType.virtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- OrmTransientMapping ormTransientMapping = (OrmTransientMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("id", ormTransientMapping.getName());
- }
-
- public void testTransientMorphToIdMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient");
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("transient", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testTransientMorphToVersionMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient");
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("transient", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testTransientMorphToTransientMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient");
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("transient", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testTransientMorphToEmbeddedMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient");
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("transient", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testTransientMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient");
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals("transient", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testTransientMorphToOneToOneMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient");
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("transient", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testTransientMorphToOneToManyMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient");
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.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("transient", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testTransientMorphToManyToOneMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient");
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.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("transient", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testTransientMorphToManyToManyMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient");
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.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("transient", ormPersistentAttribute.getMapping().getName());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmVersionMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmVersionMappingTests.java
deleted file mode 100644
index 7ff26c1a79..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmVersionMappingTests.java
+++ /dev/null
@@ -1,485 +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.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.BasicMapping;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-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.OneToOneMapping;
-import org.eclipse.jpt.core.context.TemporalConverter;
-import org.eclipse.jpt.core.context.TemporalType;
-import org.eclipse.jpt.core.context.TransientMapping;
-import org.eclipse.jpt.core.context.VersionMapping;
-import org.eclipse.jpt.core.context.orm.OrmColumn;
-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.core.resource.orm.XmlVersion;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class OrmVersionMappingTests extends ContextModelTestCase
-{
- public OrmVersionMappingTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- private ICompilationUnit createTestEntityVersionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.VERSION, JPA.COLUMN, JPA.TEMPORAL, JPA.TEMPORAL_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version");
- sb.append(CR);
- sb.append(" @Column(name=\"MY_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\", length=5, precision=6, scale=7)");
- sb.append(CR);
- sb.append(" @Temporal(TemporalType.TIMESTAMP)");
- }
- });
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "versionMapping");
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
- XmlVersion versionResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getVersions().get(0);
-
- assertEquals("versionMapping", ormVersionMapping.getName());
- assertEquals("versionMapping", versionResource.getName());
-
- //set name in the resource model, verify context model updated
- versionResource.setName("newName");
- assertEquals("newName", ormVersionMapping.getName());
- assertEquals("newName", versionResource.getName());
-
- //set name to null in the resource model
- versionResource.setName(null);
- assertNull(ormVersionMapping.getName());
- assertNull(versionResource.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "versionMapping");
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
- XmlVersion versionResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getVersions().get(0);
-
- assertEquals("versionMapping", ormVersionMapping.getName());
- assertEquals("versionMapping", versionResource.getName());
-
- //set name in the context model, verify resource model updated
- ormVersionMapping.setName("newName");
- assertEquals("newName", ormVersionMapping.getName());
- assertEquals("newName", versionResource.getName());
-
- //set name to null in the context model
- ormVersionMapping.setName(null);
- assertNull(ormVersionMapping.getName());
- assertNull(versionResource.getName());
- }
-
- public void testUpdateTemporal() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "versionMapping");
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
- XmlVersion versionResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getVersions().get(0);
-
- assertNull(ormVersionMapping.getSpecifiedConverter());
- assertNull(versionResource.getTemporal());
-
- //set temporal in the resource model, verify context model updated
- versionResource.setTemporal(org.eclipse.jpt.core.resource.orm.TemporalType.DATE);
- assertEquals(TemporalType.DATE, ((TemporalConverter) ormVersionMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.core.resource.orm.TemporalType.DATE, versionResource.getTemporal());
-
- versionResource.setTemporal(org.eclipse.jpt.core.resource.orm.TemporalType.TIME);
- assertEquals(TemporalType.TIME, ((TemporalConverter) ormVersionMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.core.resource.orm.TemporalType.TIME, versionResource.getTemporal());
-
- versionResource.setTemporal(org.eclipse.jpt.core.resource.orm.TemporalType.TIMESTAMP);
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) ormVersionMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.core.resource.orm.TemporalType.TIMESTAMP, versionResource.getTemporal());
-
- //set temporal to null in the resource model
- versionResource.setTemporal(null);
- assertNull(ormVersionMapping.getSpecifiedConverter());
- assertNull(versionResource.getTemporal());
- }
-
- public void testModifyTemporal() throws Exception {
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "versionMapping");
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
- XmlVersion versionResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getVersions().get(0);
-
- assertNull(ormVersionMapping.getSpecifiedConverter());
- assertNull(versionResource.getTemporal());
-
- //set temporal in the context model, verify resource model updated
- ormVersionMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) ormVersionMapping.getSpecifiedConverter()).setTemporalType(TemporalType.DATE);
- assertEquals(org.eclipse.jpt.core.resource.orm.TemporalType.DATE, versionResource.getTemporal());
- assertEquals(TemporalType.DATE, ((TemporalConverter) ormVersionMapping.getSpecifiedConverter()).getTemporalType());
-
- ((TemporalConverter) ormVersionMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.core.resource.orm.TemporalType.TIME, versionResource.getTemporal());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ormVersionMapping.getSpecifiedConverter()).getTemporalType());
-
- ((TemporalConverter) ormVersionMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIMESTAMP);
- assertEquals(org.eclipse.jpt.core.resource.orm.TemporalType.TIMESTAMP, versionResource.getTemporal());
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) ormVersionMapping.getSpecifiedConverter()).getTemporalType());
-
- //set temporal to null in the context model
- ormVersionMapping.setSpecifiedConverter(null);
- assertNull(versionResource.getTemporal());
- assertNull(ormVersionMapping.getSpecifiedConverter());
- }
-
- //TODO test defaults
- //TODO test overriding java mapping with a different mapping type in xml
-
- public void testVersionMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityVersionMapping();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "foo");
- assertEquals(2, ormPersistentType.virtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("foo", ormVersionMapping.getName());
- assertNull(ormVersionMapping.getSpecifiedConverter());
-
-
- OrmColumn ormColumn = ormVersionMapping.getColumn();
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
-
- assertEquals("foo", ormColumn.getDefaultName());
- assertEquals(Boolean.FALSE, ormColumn.getDefaultUnique());
- assertEquals(Boolean.TRUE, ormColumn.getDefaultNullable());
- assertEquals(Boolean.TRUE, ormColumn.getDefaultInsertable());
- assertEquals(Boolean.TRUE, ormColumn.getDefaultUpdatable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getDefaultTable());
- assertEquals(Integer.valueOf(255), ormColumn.getDefaultLength());
- assertEquals(Integer.valueOf(0), ormColumn.getDefaultPrecision());
- assertEquals(Integer.valueOf(0), ormColumn.getDefaultScale());
- }
-
- //@Basic(fetch=FetchType.LAZY, optional=false)
- //@Column(name="MY_COLUMN", unique=true, nullable=false, insertable=false, updatable=false,
- // columnDefinition="COLUMN_DEFINITION", table="MY_TABLE", length=5, precision=6, scale=7)");
- //@Column(
- //@Lob
- //@Temporal(TemporalType.TIMESTAMP)
- //@Enumerated(EnumType.STRING)
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(2, ormPersistentType.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
- assertEquals("id", ormVersionMapping.getName());
- assertEquals(Converter.TEMPORAL_CONVERTER, ormVersionMapping.getConverter().getType());
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) ormVersionMapping.getConverter()).getTemporalType());
-
- OrmColumn ormColumn = ormVersionMapping.getColumn();
- assertEquals("MY_COLUMN", ormColumn.getSpecifiedName());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", ormColumn.getColumnDefinition());
- assertEquals("MY_TABLE", ormColumn.getSpecifiedTable());
- assertEquals(Integer.valueOf(5), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(6), ormColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(7), ormColumn.getSpecifiedScale());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(2, ormPersistentType.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
-
- ormPersistentAttribute.makeSpecified(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute= ormPersistentType.specifiedAttributes().next();
-
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
- assertEquals("id", ormVersionMapping.getName());
- assertNull(ormVersionMapping.getSpecifiedConverter());
-
- OrmColumn ormColumn = ormVersionMapping.getColumn();
- assertEquals("id", ormColumn.getName());
- assertEquals(Boolean.FALSE, ormColumn.getUnique());
- assertEquals(Boolean.TRUE, ormColumn.getNullable());
- assertEquals(Boolean.TRUE, ormColumn.getInsertable());
- assertEquals(Boolean.TRUE, ormColumn.getUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getTable());
- assertEquals(Integer.valueOf(255), ormColumn.getLength());
- assertEquals(Integer.valueOf(0), ormColumn.getPrecision());
- assertEquals(Integer.valueOf(0), ormColumn.getScale());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityVersionMapping();
-
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "id");
- assertEquals(1, ormPersistentType.virtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("id", ormVersionMapping.getName());
- assertNull(ormVersionMapping.getSpecifiedConverter());
-
- OrmColumn ormColumn = ormVersionMapping.getColumn();
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
-
- assertEquals("id", ormColumn.getDefaultName());
- assertEquals(Boolean.FALSE, ormColumn.getDefaultUnique());
- assertEquals(Boolean.TRUE, ormColumn.getDefaultNullable());
- assertEquals(Boolean.TRUE, ormColumn.getDefaultInsertable());
- assertEquals(Boolean.TRUE, ormColumn.getDefaultUpdatable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getDefaultTable());
- assertEquals(Integer.valueOf(255), ormColumn.getDefaultLength());
- assertEquals(Integer.valueOf(0), ormColumn.getDefaultPrecision());
- assertEquals(Integer.valueOf(0), ormColumn.getDefaultScale());
- }
-
- public void testVersionMorphToIdMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version");
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) versionMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("version", ormPersistentAttribute.getMapping().getName());
- assertEquals("FOO", ((IdMapping) ormPersistentAttribute.getMapping()).getColumn().getSpecifiedName());
- }
-
- public void testVersionMorphToBasicMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version");
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) versionMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("version", ormPersistentAttribute.getMapping().getName());
- assertEquals("FOO", ((BasicMapping) ormPersistentAttribute.getMapping()).getColumn().getSpecifiedName());
- }
-
- public void testVersionMorphToTransientMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version");
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) versionMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("version", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testVersionMorphToEmbeddedMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version");
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) versionMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("version", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testVersionMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version");
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) versionMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals("version", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testVersionMorphToOneToOneMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version");
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) versionMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- ormPersistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("version", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testVersionMorphToOneToManyMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version");
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) versionMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.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("version", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testVersionMorphToManyToOneMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version");
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) versionMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.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("version", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testVersionMorphToManyToManyMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version");
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) versionMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.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("version", ormPersistentAttribute.getMapping().getName());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmXmlTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmXmlTests.java
deleted file mode 100644
index 2cc31866cf..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmXmlTests.java
+++ /dev/null
@@ -1,112 +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.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.orm.OrmXml;
-import org.eclipse.jpt.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.OrmResource;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-
-public class OrmXmlTests extends ContextModelTestCase
-{
- public OrmXmlTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- xmlPersistenceUnit().setName("foo");
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- protected PersistenceXml persistenceXml() {
- return getRootContextNode().getPersistenceXml();
- }
-
- protected OrmXml ormXml() {
- return (OrmXml) persistenceUnit().mappingFileRefs().next().getMappingFile();
- }
-
- public void testUpdateAddEntityMappings() throws Exception {
- OrmResource ormResource = ormResource();
- ormResource.getContents().clear();
- ormResource.save(null);
-
- // removing root node now results in reducing content type to simple xml
- assertNull(ormXml());
-
- ormResource.getContents().add(OrmFactory.eINSTANCE.createXmlEntityMappings());
- ormResource.save(null);
-
- assertNotNull(ormXml().getRoot());
- }
-
- public void testModifyAddEntityMappings() {
- OrmResource ormResource = ormResource();
- ormResource.getContents().remove(ormResource.getEntityMappings());
- assertNull(ormResource.getEntityMappings());
-
- OrmXml ormXml = ormXml();
- assertNull(ormXml.getRoot());
-
- ormXml.addEntityMappings();
-
- assertNotNull(ormXml.getRoot());
-
- boolean exceptionThrown = false;
- try {
- ormXml.addEntityMappings();
- }
- catch (IllegalStateException ise) {
- exceptionThrown = true;
- }
-
- assertTrue("IllegalStateException was not thrown", exceptionThrown);
- }
-
- public void testUpdateRemoveEntityMappings() throws Exception {
- OrmResource ormResource = ormResource();
-
- assertNotNull(ormXml().getRoot());
-
- ormResource.getContents().clear();
-
- assertNull(ormXml().getRoot());
- }
-
- public void testModifyRemoveEntityMappings() {
- OrmXml ormXml = ormXml();
-
- assertNotNull(ormXml.getRoot());
-
- ormXml.removeEntityMappings();
-
- assertNull(ormXml.getRoot());
-
- boolean exceptionThrown = false;
- try {
- ormXml.removeEntityMappings();
- }
- catch (IllegalStateException ise) {
- exceptionThrown = true;
- }
-
- assertTrue("IllegalStateException was not thrown", exceptionThrown);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/PersistenceUnitDefaultsTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/PersistenceUnitDefaultsTests.java
deleted file mode 100644
index 4e74faad75..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/PersistenceUnitDefaultsTests.java
+++ /dev/null
@@ -1,369 +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.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.core.JptCorePlugin;
-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.core.tests.internal.context.ContextModelTestCase;
-
-public class PersistenceUnitDefaultsTests extends ContextModelTestCase
-{
- public PersistenceUnitDefaultsTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- protected OrmPersistenceUnitDefaults persistenceUnitDefaults() {
- return entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults();
- }
-
- public void testIsAllFeaturesUnset() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata());
-
- XmlPersistenceUnitMetadata persistenceUnitMetadata = OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata();
- ormResource().getEntityMappings().setPersistenceUnitMetadata(persistenceUnitMetadata);
- assertTrue(persistenceUnitMetadata.isAllFeaturesUnset());
-
- org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults persistenceUnitDefaultsResource = OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults();
- persistenceUnitMetadata.setPersistenceUnitDefaults(persistenceUnitDefaultsResource);
- assertTrue(persistenceUnitDefaultsResource.isAllFeaturesUnset());
-
- persistenceUnitDefaultsResource.setCascadePersist(true);
- assertFalse(persistenceUnitDefaultsResource.isAllFeaturesUnset());
-
- persistenceUnitDefaultsResource.setCascadePersist(false);
- assertTrue(persistenceUnitDefaultsResource.isAllFeaturesUnset());
-
- persistenceUnitDefaultsResource.setSchema("asdf");
- assertFalse(persistenceUnitDefaultsResource.isAllFeaturesUnset());
-
- persistenceUnitDefaultsResource.setSchema(null);
- assertTrue(persistenceUnitDefaultsResource.isAllFeaturesUnset());
-
- persistenceUnitDefaultsResource.setCatalog("asdf");
- assertFalse(persistenceUnitDefaultsResource.isAllFeaturesUnset());
-
- persistenceUnitDefaultsResource.setCatalog(null);
- assertTrue(persistenceUnitDefaultsResource.isAllFeaturesUnset());
-
-
- persistenceUnitDefaultsResource.setAccess(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY);
- assertFalse(persistenceUnitDefaultsResource.isAllFeaturesUnset());
-
- persistenceUnitDefaultsResource.setAccess(org.eclipse.jpt.core.resource.orm.AccessType.FIELD);
- assertFalse(persistenceUnitDefaultsResource.isAllFeaturesUnset());
-
- persistenceUnitDefaultsResource.setAccess(null);
- assertTrue(persistenceUnitDefaultsResource.isAllFeaturesUnset());
- }
-
- public void testUpdateSchema() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata());
-
- //set schema in the resource model, verify context model updated
- ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", persistenceUnitDefaults.getSchema());
- assertEquals("MY_SCHEMA", ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
-
- //set schema to null in the resource model
- ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema(null);
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
- }
-
- public void testModifySchema() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata());
-
- //set schema in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", persistenceUnitDefaults.getSchema());
- assertEquals("MY_SCHEMA", ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
-
- //set schema to null in the context model
- persistenceUnitDefaults.setSpecifiedSchema(null);
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifySchema2() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata());
-
- //set schema in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", persistenceUnitDefaults.getSchema());
- assertEquals("MY_SCHEMA", ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
-
- //set another element on the persistence-unit-defaults element so it doesn't get removed
- ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog("MY_CATALOG");
- //set schema to null in the context model
- persistenceUnitDefaults.setSpecifiedSchema(null);
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
- }
-
- public void testModifySchema3() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata());
- //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed
- ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- ormResource().getEntityMappings().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", ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
-
- //set schema to null in the context model
- persistenceUnitDefaults.setSpecifiedSchema(null);
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults());
- }
-
- public void testUpdateCatalog() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata());
-
- //set catalog in the resource model, verify context model updated
- ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", persistenceUnitDefaults.getCatalog());
- assertEquals("MY_CATALOG", ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
-
- //set catalog to null in the resource model
- ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog(null);
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
- }
-
- public void testModifyCatalog() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata());
-
- //set catalog in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", persistenceUnitDefaults.getCatalog());
- assertEquals("MY_CATALOG", ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
-
- //set catalog to null in the context model
- persistenceUnitDefaults.setSpecifiedCatalog(null);
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifyCatalog2() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata());
-
- //set catalog in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", persistenceUnitDefaults.getCatalog());
- assertEquals("MY_CATALOG", ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
-
- //set another element on the persistence-unit-defaults element so it doesn't get removed
- ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema("MY_SCHEMA");
- //set catalog to null in the context model
- persistenceUnitDefaults.setSpecifiedCatalog(null);
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
- }
-
- public void testModifyCatalog3() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata());
- //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed
- ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- ormResource().getEntityMappings().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", ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
-
- //set catalog to null in the context model
- persistenceUnitDefaults.setSpecifiedCatalog(null);
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults());
- }
-
- public void testUpdateCascadePersist() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata());
-
- //set cascadePersist in the resource model, verify context model updated
- ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCascadePersist(true);
- assertTrue(persistenceUnitDefaults.isCascadePersist());
- assertTrue(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
-
- //set cascadePersist to null in the resource model, persistence-unit-defaults tag not removed
- ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCascadePersist(false);
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertFalse(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
- }
-
- public void testModifyCascadePersist() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata());
-
- //set cascadePersist in the context model, verify resource model modified
- persistenceUnitDefaults.setCascadePersist(true);
- assertTrue(persistenceUnitDefaults.isCascadePersist());
- assertTrue(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
-
- //set cascadePersist to null in the context model
- persistenceUnitDefaults.setCascadePersist(false);
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifyCascadePersist2() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata());
-
- //set cascadePersist in the context model, verify resource model modified
- persistenceUnitDefaults.setCascadePersist(true);
- assertTrue(persistenceUnitDefaults.isCascadePersist());
- assertTrue(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
-
- //set another element on the persistence-unit-defaults element so it doesn't get removed
- ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog("MY_CATALOG");
- //set cascadePersist to null in the context model
- persistenceUnitDefaults.setCascadePersist(false);
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertFalse(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
- }
-
- public void testModifyCascadePersist3() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata());
- //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed
- ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-
- //set cascadePersist in the context model, verify resource model modified
- persistenceUnitDefaults.setCascadePersist(true);
- assertTrue(persistenceUnitDefaults.isCascadePersist());
- assertTrue(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
-
- //set cascadePersist to null in the context model
- persistenceUnitDefaults.setCascadePersist(false);
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults());
- }
-
-
- public void testUpdateAccess() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata());
-
- //set access in the resource model, verify context model updated
- ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- ormResource().getEntityMappings().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, ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set access to null in the resource model
- ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(null);
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
- }
-
- public void testModifyAccess() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(ormResource().getEntityMappings().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, ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set access to null in the context model
- persistenceUnitDefaults.setAccess(null);
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifyAccess2() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(ormResource().getEntityMappings().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, ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set another element on the persistence-unit-defaults element so it doesn't get removed
- ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCascadePersist(true);
- //set access to null in the context model
- persistenceUnitDefaults.setAccess(null);
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
- }
-
- public void testModifyAccess3() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata());
- //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed
- ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- ormResource().getEntityMappings().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, ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set access to null in the context model
- persistenceUnitDefaults.setAccess(null);
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/PersistenceUnitMetadataTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/PersistenceUnitMetadataTests.java
deleted file mode 100644
index feada5432d..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/PersistenceUnitMetadataTests.java
+++ /dev/null
@@ -1,105 +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.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.core.JptCorePlugin;
-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.core.tests.internal.context.ContextModelTestCase;
-
-public class PersistenceUnitMetadataTests extends ContextModelTestCase
-{
- public PersistenceUnitMetadataTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- protected PersistenceUnitMetadata persistenceUnitMetadata() {
- return entityMappings().getPersistenceUnitMetadata();
- }
-
- public void testIsAllFeaturesUnset() throws Exception {
- org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata persistenceUnitMetadata = OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata();
- ormResource().getEntityMappings().setPersistenceUnitMetadata(persistenceUnitMetadata);
- assertTrue(persistenceUnitMetadata.isAllFeaturesUnset());
-
- persistenceUnitMetadata.setXmlMappingMetadataComplete(true);
- assertFalse(persistenceUnitMetadata.isAllFeaturesUnset());
-
- persistenceUnitMetadata.setXmlMappingMetadataComplete(false);
- assertTrue(persistenceUnitMetadata.isAllFeaturesUnset());
-
- persistenceUnitMetadata.setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- assertFalse(persistenceUnitMetadata.isAllFeaturesUnset());
- }
-
- public void testUpdateXmlMappingMetadataComplete() throws Exception {
- PersistenceUnitMetadata persistenceUnitMetadata = entityMappings().getPersistenceUnitMetadata();
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata());
-
- //set xmlMappingMetadataComplete in the resource model, verify context model updated
- ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertTrue(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertTrue(ormResource().getEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete());
-
- //set xmlMappingMetadataComplete to null in the resource model
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertFalse(ormResource().getEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete());
- }
-
- public void testModifyXmlMappingMetadataComplete() throws Exception {
- PersistenceUnitMetadata persistenceUnitMetadata = entityMappings().getPersistenceUnitMetadata();
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata());
-
- //set xmlMappingMetadataComplete in the context model, verify resource model modified
- persistenceUnitMetadata.setXmlMappingMetadataComplete(true);
- assertTrue(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertTrue(ormResource().getEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete());
-
- //set xmlMappingMetadataComplete to null in the context model
- persistenceUnitMetadata.setXmlMappingMetadataComplete(false);
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifyXmlMappingMetadataComplete2() throws Exception {
- PersistenceUnitMetadata persistenceUnitMetadata = entityMappings().getPersistenceUnitMetadata();
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata());
-
- //set xmlMappingMetadataComplete in the context model, verify resource model modified
- persistenceUnitMetadata.setXmlMappingMetadataComplete(true);
- assertTrue(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertTrue(ormResource().getEntityMappings().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
- ormResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- persistenceUnitMetadata.setXmlMappingMetadataComplete(false);
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertFalse(ormResource().getEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/ClassRefTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/ClassRefTests.java
deleted file mode 100644
index 3e44c6de2b..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/ClassRefTests.java
+++ /dev/null
@@ -1,112 +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.tests.internal.context.persistence;
-
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-
-public class ClassRefTests extends ContextModelTestCase
-{
- public ClassRefTests(String name) {
- super(name);
- }
-
- public void testUpdateClassName() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // add class ref
- XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass("com.foo.Bar");
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
- ClassRef classRef = persistenceUnit.specifiedClassRefs().next();
-
- // test that class names are initially equal
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
-
- // set xml class name to different name, test equality
- xmlClassRef.setJavaClass("com.bar.Foo");
-
- classRef = persistenceUnit.specifiedClassRefs().next();
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
-
- // set class name to empty string, test equality
- xmlClassRef.setJavaClass("");
-
- classRef = persistenceUnit.specifiedClassRefs().next();
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
-
- // set name back to non empty string, test equality
- xmlClassRef.setJavaClass("com.foo.Bar");
-
- classRef = persistenceUnit.specifiedClassRefs().next();
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
- }
-
- public void testModifyClassName() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // add class ref
- XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass("com.foo.Bar");
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
- ClassRef classRef = persistenceUnit.specifiedClassRefs().next();
-
- // test that class names are initially equal
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
-
- // set context class name to different name, test equality
- classRef.setClassName("com.bar.Foo");
-
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
-
- // set class name to empty string, test equality
- classRef.setClassName("");
-
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
-
- // set class name to null, test equality
- classRef.setClassName(null);
-
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
-
- // set name back to non-null, test equality
- classRef.setClassName("com.foo.Bar");
-
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
- }
-
-
- public void testGetPersistentType() throws Exception {
- createTestType();
-
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
-
- XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass(FULLY_QUALIFIED_TYPE_NAME);
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
-
- ClassRef classRef = classRef();
-
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, classRef.getJavaPersistentType().getName());
-
- //test setting to a class that does not exist in the project
- xmlClassRef.setJavaClass("com.foo.Bar");
-
- classRef = classRef();
- assertNull(classRef.getJavaPersistentType());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/JptCorePersistenceContextModelTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/JptCorePersistenceContextModelTests.java
deleted file mode 100644
index 71707d99c2..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/JptCorePersistenceContextModelTests.java
+++ /dev/null
@@ -1,37 +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.core.tests.internal.context.persistence;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JptCorePersistenceContextModelTests extends TestCase
-{
- public static Test suite() {
- return suite(true);
- }
-
- public static Test suite(boolean all) {
- TestSuite suite = new TestSuite(JptCorePersistenceContextModelTests.class.getName());
- suite.addTestSuite(RootContextNodeTests.class);
- suite.addTestSuite(PersistenceXmlTests.class);
- suite.addTestSuite(PersistenceTests.class);
- suite.addTestSuite(PersistenceUnitTests.class);
- suite.addTestSuite(MappingFileRefTests.class);
- suite.addTestSuite(ClassRefTests.class);
- return suite;
- }
-
- private JptCorePersistenceContextModelTests() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/MappingFileRefTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/MappingFileRefTests.java
deleted file mode 100644
index 1854a15312..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/MappingFileRefTests.java
+++ /dev/null
@@ -1,97 +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.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-
-public class MappingFileRefTests extends ContextModelTestCase
-{
- public MappingFileRefTests(String name) {
- super(name);
- }
-
- protected MappingFileRef mappingFileRef() {
- return persistenceUnit().mappingFileRefs().next();
- }
-
- public void testUpdateFileName() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // add mapping file ref
- XmlMappingFileRef xmlFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlFileRef.setFileName("foo.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlFileRef);
- MappingFileRef fileRef = persistenceUnit.specifiedMappingFileRefs().next();
-
- // test that file names are initially equal
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
-
- // set xml to different file name, test equality
- xmlFileRef.setFileName("bar.xml");
-
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
-
- // set file name to empty string, test equality
- xmlFileRef.setFileName("");
-
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
-
- // set file name to null, test equality
- xmlFileRef.setFileName(null);
-
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
-
- // set file name back to non-null, test equality
- xmlFileRef.setFileName("baz.xml");
-
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
- }
-
- public void testModifyFileName() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // add mapping file ref
- XmlMappingFileRef xmlFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlFileRef.setFileName("foo.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlFileRef);
- MappingFileRef fileRef = persistenceUnit.specifiedMappingFileRefs().next();
-
- // test that file names are initially equal
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
-
- // set context to different file name, test equality
- fileRef.setFileName("bar.xml");
-
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
-
- // set file name to empty string, test equality
- fileRef.setFileName("");
-
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
-
- // set file name to null, test equality
- fileRef.setFileName(null);
-
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
-
- // set file name back to non-null, test equality
- fileRef.setFileName("baz.xml");
-
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceTests.java
deleted file mode 100644
index 9c76269325..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceTests.java
+++ /dev/null
@@ -1,137 +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.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.PersistenceResource;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistence;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-
-public class PersistenceTests extends ContextModelTestCase
-{
- public PersistenceTests(String name) {
- super(name);
- }
-
- protected Persistence persistence() {
- return getRootContextNode().getPersistenceXml().getPersistence();
- }
-
- public void testUpdateAddPersistenceUnit() throws Exception {
- PersistenceResource prm = persistenceResource();
- XmlPersistence xmlPersistence = prm.getPersistence();
- Persistence persistence = getRootContextNode().getPersistenceXml().getPersistence();
-
- // clear xml persistence units, test that it's clear in context
- xmlPersistence.getPersistenceUnits().clear();
-
- assertEquals(0, persistence.persistenceUnitsSize());
-
- // add xml persistence unit, test that it's added to context
- XmlPersistenceUnit xmlPersistenceUnit = PersistenceFactory.eINSTANCE.createXmlPersistenceUnit();
- xmlPersistenceUnit.setName("test");
- xmlPersistence.getPersistenceUnits().add(xmlPersistenceUnit);
-
- assertEquals(1, persistence.persistenceUnitsSize());
-
- // add another, test that it *isn't* add to context
- xmlPersistenceUnit = PersistenceFactory.eINSTANCE.createXmlPersistenceUnit();
- xmlPersistenceUnit.setName("test2");
- xmlPersistence.getPersistenceUnits().add(xmlPersistenceUnit);
-
- assertEquals(1, persistence.persistenceUnitsSize());
- }
-
- public void testModifyAddPersistencUnit() {
- XmlPersistence xmlPersistence = xmlPersistence();
- Persistence persistence = persistence();
-
- // clear xml persistence units, test that it's clear in context
- xmlPersistence.getPersistenceUnits().clear();
- assertEquals(0, persistence.persistenceUnitsSize());
-
- // add persistence unit, test that it's added to resource
- persistence.addPersistenceUnit();
-
- assertEquals(1, persistence.persistenceUnitsSize());
-
- // add another, test that we get an exception
- boolean exception = false;
- try {
- persistence.addPersistenceUnit();
- }
- catch (IllegalStateException e) {
- exception = true;
- }
-
- assertTrue(exception);
- }
-
- public void testUpdateRemovePersistenceUnit() throws Exception {
- PersistenceResource prm = persistenceResource();
- XmlPersistence xmlPersistence = prm.getPersistence();
- Persistence persistence = getRootContextNode().getPersistenceXml().getPersistence();
-
- // add a persistence unit and test that there are two existing xml and
- // one context persistence unit
- XmlPersistenceUnit xmlPersistenceUnit = PersistenceFactory.eINSTANCE.createXmlPersistenceUnit();
- xmlPersistenceUnit.setName("test");
- xmlPersistence.getPersistenceUnits().add(xmlPersistenceUnit);
-
- assertEquals(2, xmlPersistence.getPersistenceUnits().size());
- assertEquals(1, persistence.persistenceUnitsSize());
-
- // remove persistence unit from xml, test that context remains unchanged
- xmlPersistenceUnit = xmlPersistence.getPersistenceUnits().get(0);
- xmlPersistence.getPersistenceUnits().remove(xmlPersistenceUnit);
-
- assertEquals(1, xmlPersistence.getPersistenceUnits().size());
- assertEquals(1, persistence.persistenceUnitsSize());
-
- // remove another one from xml, text that it's now removed from context
- xmlPersistenceUnit = xmlPersistence.getPersistenceUnits().get(0);
- xmlPersistence.getPersistenceUnits().remove(xmlPersistenceUnit);
-
- assertEquals(0, xmlPersistence.getPersistenceUnits().size());
- assertEquals(0, persistence.persistenceUnitsSize());
- }
-
- public void testModifyRemovePersistenceUnit() {
- XmlPersistence xmlPersistence = xmlPersistence();
- Persistence persistence = persistence();
-
- // add a persistence unit and test that there are two existing xml and
- // one context persistence unit
- XmlPersistenceUnit xmlPersistenceUnit = PersistenceFactory.eINSTANCE.createXmlPersistenceUnit();
- xmlPersistenceUnit.setName("test");
- xmlPersistence.getPersistenceUnits().add(xmlPersistenceUnit);
-
- assertEquals(2, xmlPersistence.getPersistenceUnits().size());
- assertEquals(1, persistence.persistenceUnitsSize());
-
- // remove persistence unit, test that it's removed from resource and that
- // a *new* persistence unit representing the previously unrepresented one
- // is present
- persistence.removePersistenceUnit(0);
-
- assertEquals(1, xmlPersistence.getPersistenceUnits().size());
- assertEquals(1, persistence.persistenceUnitsSize());
-
- // remove new persistence unit, test that it's removed from resource and
- // context
- persistence.removePersistenceUnit(0);
-
- assertEquals(0, xmlPersistence.getPersistenceUnits().size());
- assertEquals(0, persistence.persistenceUnitsSize());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceUnitTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceUnitTests.java
deleted file mode 100644
index 4ab50d113a..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceUnitTests.java
+++ /dev/null
@@ -1,1162 +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.tests.internal.context.persistence;
-
-import java.io.IOException;
-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.AccessType;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitTransactionType;
-import org.eclipse.jpt.core.context.persistence.Property;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.orm.OrmResource;
-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.persistence.XmlPersistenceUnitTransactionType;
-import org.eclipse.jpt.core.resource.persistence.XmlProperties;
-import org.eclipse.jpt.core.resource.persistence.XmlProperty;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class PersistenceUnitTests extends ContextModelTestCase
-{
-
- protected static final String INNER_CLASS_NAME = "InnerAnnotationTestType";
- protected static final String FULLY_QUALIFIED_INNER_CLASS_NAME = PACKAGE_NAME + "." + TYPE_NAME + "." + INNER_CLASS_NAME;
-
- public static final String OTHER_TYPE_NAME = "OtherTestType";
- public static final String FULLY_QUALIFIED_OTHER_TYPE_NAME = PACKAGE_NAME + "." + OTHER_TYPE_NAME;
-
-
- public PersistenceUnitTests(String name) {
- super(name);
- }
-
- public void testUpdateName() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // test that names are initially equal
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
-
- // set name to different name, test equality
- xmlPersistenceUnit.setName("newName");
-
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
-
- // set name to empty string, test equality
- xmlPersistenceUnit.setName("");
-
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
-
- // set name to null, test equality
- xmlPersistenceUnit.setName(null);
-
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
-
- // set name back to non-null, test equality
- xmlPersistenceUnit.setName("newName");
-
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
- }
-
- public void testModifyName() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // test that names are initially equal
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
-
- // set name to different name, test equality
- persistenceUnit.setName("newName");
-
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
-
- // set name to empty string, test equality
- persistenceUnit.setName("");
-
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
-
- // set name to null, test equality
- persistenceUnit.setName(null);
-
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
-
- // set name back to non-null, test equality
- persistenceUnit.setName("newName");
-
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
- }
-
- public void testUpdateTransactionType() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // 1 - initial value is default
- assertNull(xmlPersistenceUnit.getTransactionType());
- assertNull(persistenceUnit.getSpecifiedTransactionType());
-
- // 2 - set value, context changed
- xmlPersistenceUnit.setTransactionType(XmlPersistenceUnitTransactionType.JTA);
-
- assertEquals(PersistenceUnitTransactionType.JTA, persistenceUnit.getSpecifiedTransactionType());
-
- xmlPersistenceUnit.setTransactionType(XmlPersistenceUnitTransactionType.RESOURCE_LOCAL);
-
- assertEquals(PersistenceUnitTransactionType.RESOURCE_LOCAL, persistenceUnit.getSpecifiedTransactionType());
-
- // 3 - unset value, context changed
- xmlPersistenceUnit.setTransactionType(null);
-
- assertNull(persistenceUnit.getSpecifiedTransactionType());
- }
-
- public void testModifyTransactionType() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // 1 - initial value is default
- assertNull(xmlPersistenceUnit.getTransactionType());
- assertNull(persistenceUnit.getSpecifiedTransactionType());
-
- // 2 - set context value, resource changed
- persistenceUnit.setSpecifiedTransactionType(PersistenceUnitTransactionType.JTA);
-
- assertEquals(XmlPersistenceUnitTransactionType.JTA, xmlPersistenceUnit.getTransactionType());
-
- persistenceUnit.setSpecifiedTransactionType(PersistenceUnitTransactionType.RESOURCE_LOCAL);
-
- assertEquals(XmlPersistenceUnitTransactionType.RESOURCE_LOCAL, xmlPersistenceUnit.getTransactionType());
-
- // 3 - set context value to default, resource unset
- persistenceUnit.setSpecifiedTransactionType(null);
-
- assertNull(persistenceUnit.getSpecifiedTransactionType());
- assertNull(xmlPersistenceUnit.getTransactionType());
- }
-
- public void testUpdateDescription() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // test that descriptions are initially equal
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
-
- // set description to different description, test equality
- xmlPersistenceUnit.setDescription("newDescription");
-
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
-
- // set description to empty string, test equality
- xmlPersistenceUnit.setDescription("");
-
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
-
- // set description to null, test equality
- xmlPersistenceUnit.setDescription(null);
-
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
-
- // set description back to non-null, test equality
- xmlPersistenceUnit.setDescription("newDescription");
-
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
- }
-
- public void testModifyDescription() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // test that descriptions are initially equal
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
-
- // set description to different description, test equality
- persistenceUnit.setDescription("newDescription");
-
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
-
- // set description to empty string, test equality
- persistenceUnit.setDescription("");
-
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
-
- // set description to null, test equality
- persistenceUnit.setDescription(null);
-
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
-
- // set description back to non-null, test equality
- persistenceUnit.setDescription("newDescription");
-
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
- }
-
- public void testUpdateProvider() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // test that providers are initially equal
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
-
- // set provider to different provider, test equality
- xmlPersistenceUnit.setProvider("newProvider");
-
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
-
- // set provider to empty string, test equality
- xmlPersistenceUnit.setProvider("");
-
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
-
- // set provider to null, test equality
- xmlPersistenceUnit.setProvider(null);
-
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
-
- // set provider back to non-null, test equality
- xmlPersistenceUnit.setProvider("newProvider");
-
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
- }
-
- public void testModifyProvider() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // test that providers are initially equal
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
-
- // set provider to different provider, test equality
- persistenceUnit.setProvider("newProvider");
-
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
-
- // set provider to empty string, test equality
- persistenceUnit.setProvider("");
-
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
-
- // set provider to null, test equality
- persistenceUnit.setProvider(null);
-
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
-
- // set provider back to non-null, test equality
- persistenceUnit.setProvider("newProvider");
-
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
- }
-
- public void testUpdateJtaDataSource() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // test that jtaDataSources are initially equal
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
-
- // set jtaDataSource to different jtaDataSource, test equality
- xmlPersistenceUnit.setJtaDataSource("newJtaDataSource");
-
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
-
- // set jtaDataSource to empty string, test equality
- xmlPersistenceUnit.setJtaDataSource("");
-
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
-
- // set jtaDataSource to null, test equality
- xmlPersistenceUnit.setJtaDataSource(null);
-
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
-
- // set jtaDataSource back to non-null, test equality
- xmlPersistenceUnit.setJtaDataSource("newJtaDataSource");
-
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
- }
-
- public void testModifyJtaDataSource() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // test that jtaDataSources are initially equal
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
-
- // set jtaDataSource to different jtaDataSource, test equality
- persistenceUnit.setJtaDataSource("newJtaDataSource");
-
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
-
- // set jtaDataSource to empty string, test equality
- persistenceUnit.setJtaDataSource("");
-
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
-
- // set jtaDataSource to null, test equality
- persistenceUnit.setJtaDataSource(null);
-
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
-
- // set jtaDataSource back to non-null, test equality
- persistenceUnit.setJtaDataSource("newJtaDataSource");
-
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
- }
-
- public void testUpdateNonJtaDataSource() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // test that nonJtaDataSources are initially equal
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
-
- // set nonJtaDataSource to different nonJtaDataSource, test equality
- xmlPersistenceUnit.setNonJtaDataSource("newNonJtaDataSource");
-
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
-
- // set nonJtaDataSource to empty string, test equality
- xmlPersistenceUnit.setNonJtaDataSource("");
-
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
-
- // set nonJtaDataSource to null, test equality
- xmlPersistenceUnit.setNonJtaDataSource(null);
-
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
-
- // set nonJtaDataSource back to non-null, test equality
- xmlPersistenceUnit.setNonJtaDataSource("newNonJtaDataSource");
-
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
- }
-
- public void testModifyNonJtaDataSource() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // test that nonJtaDataSources are initially equal
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
-
- // set nonJtaDataSource to different nonJtaDataSource, test equality
- persistenceUnit.setNonJtaDataSource("newNonJtaDataSource");
-
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
-
- // set nonJtaDataSource to empty string, test equality
- persistenceUnit.setNonJtaDataSource("");
-
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
-
- // set nonJtaDataSource to null, test equality
- persistenceUnit.setNonJtaDataSource(null);
-
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
-
- // set nonJtaDataSource back to non-null, test equality
- persistenceUnit.setNonJtaDataSource("newNonJtaDataSource");
-
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
- }
-
- public void testUpdateJarFileRefs1() {
- // TODO
- }
-
- public void testUpdateJarFileRefs2() {
- // TODO
- }
-
- public void testUpdateImpliedMappingFileRef1() throws Exception {
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // test that there is one initially
- OrmResource ormResource = ormResource();
- assertTrue(ormResource.exists());
- assertNotNull(persistenceUnit.getImpliedMappingFileRef());
-
- // remove orm.xml
- deleteResource(ormResource);
-
- assertFalse(ormResource.exists());
- assertNull(persistenceUnit.getImpliedMappingFileRef());
- }
-
- public void testUpdateImpliedMappingFileRef2() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // test that there is one initially
- OrmResource ormResource = ormResource();
- assertTrue(ormResource.exists());
- assertNotNull(persistenceUnit.getImpliedMappingFileRef());
-
- // add specified orm.xml
- XmlMappingFileRef xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName("META-INF/orm.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
-
- assertEquals(1, CollectionTools.size(persistenceUnit.specifiedMappingFileRefs()));
-
- assertTrue(ormResource.exists());
- assertNull(persistenceUnit.getImpliedMappingFileRef());
- }
-
- public void testUpdateSpecifiedMappingFileRefs1() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // test there are none initially
- assertEquals(0, xmlPersistenceUnit.getMappingFiles().size());
- assertEquals(0, persistenceUnit.specifiedMappingFileRefsSize());
-
- // add mapping file ref, test that it's added to context
- XmlMappingFileRef xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName("orm.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
-
- assertEquals(1, CollectionTools.size(persistenceUnit.specifiedMappingFileRefs()));
-
- // add another ...
- xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName("orm2.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
-
- assertEquals(2, CollectionTools.size(persistenceUnit.specifiedMappingFileRefs()));
- }
-
- public void testUpdateSpecifiedMappingFileRefs2() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // add two mapping file refs and test that there are two existing in xml and context
- XmlMappingFileRef xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName("orm.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
- xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName("orm2.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
-
- assertEquals(xmlPersistenceUnit.getMappingFiles().size(), 2);
- assertEquals(2, CollectionTools.size(persistenceUnit.specifiedMappingFileRefs()));
-
- // remove mapping file ref from xml, test that it's removed from context
- xmlMappingFileRef = xmlPersistenceUnit.getMappingFiles().get(0);
- xmlPersistenceUnit.getMappingFiles().remove(xmlMappingFileRef);
-
- assertEquals(1, CollectionTools.size(persistenceUnit.specifiedMappingFileRefs()));
-
- // remove another one ...
- xmlMappingFileRef = xmlPersistenceUnit.getMappingFiles().get(0);
- xmlPersistenceUnit.getMappingFiles().remove(xmlMappingFileRef);
-
- assertEquals(0, CollectionTools.size(persistenceUnit.specifiedMappingFileRefs()));
- }
-
- public void testModifySpecifiedMappingFileRefs1() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // test there are none initially
- assertEquals(0, xmlPersistenceUnit.getMappingFiles().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.specifiedMappingFileRefs()));
-
- // add mapping file ref, test that it's added to resource
- persistenceUnit.addSpecifiedMappingFileRef().setFileName("foo");
-
- assertEquals(1, xmlPersistenceUnit.getMappingFiles().size());
- assertEquals("foo", xmlPersistenceUnit.getMappingFiles().get(0).getFileName());
-
- // add another ...
- persistenceUnit.addSpecifiedMappingFileRef().setFileName("bar");
- assertEquals("foo", xmlPersistenceUnit.getMappingFiles().get(0).getFileName());
- assertEquals("bar", xmlPersistenceUnit.getMappingFiles().get(1).getFileName());
-
- assertEquals(2, xmlPersistenceUnit.getMappingFiles().size());
-
- // add another, testing order
- persistenceUnit.addSpecifiedMappingFileRef(0).setFileName("baz");
- assertEquals(3, xmlPersistenceUnit.getMappingFiles().size());
- assertEquals("baz", xmlPersistenceUnit.getMappingFiles().get(0).getFileName());
- assertEquals("foo", xmlPersistenceUnit.getMappingFiles().get(1).getFileName());
- assertEquals("bar", xmlPersistenceUnit.getMappingFiles().get(2).getFileName());
- }
-
- public void testModifySpecifiedMappingFileRefs2() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // add two mapping file refs and test that there are two existing in xml and context
- XmlMappingFileRef xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName("orm.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
- xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName("orm2.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
-
- assertEquals(2, xmlPersistenceUnit.getMappingFiles().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.specifiedMappingFileRefs()));
-
- // remove mapping file ref from context, test that it's removed from xml
- persistenceUnit.removeSpecifiedMappingFileRef(0);
-
- assertEquals(1, xmlPersistenceUnit.getMappingFiles().size());
-
- // remove another one ...
- persistenceUnit.removeSpecifiedMappingFileRef(0);
-
- assertEquals(0, xmlPersistenceUnit.getMappingFiles().size());
- }
-
- public void testUpdateClassRefs1() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // test there are none initially
- assertEquals(0, xmlPersistenceUnit.getClasses().size());
- assertEquals(0, persistenceUnit.specifiedClassRefsSize());
-
- // add mapping file ref, test that it's added to context
- XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass("com.foo.Bar");
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
-
- assertEquals(1, persistenceUnit.specifiedClassRefsSize());
-
- // add another ...
- xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass("com.foo.Baz");
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
-
- assertEquals(2, persistenceUnit.specifiedClassRefsSize());
- }
-
- public void testUpdateClassRefs2() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // add two class refs and test that there are two existing in xml and context
- XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass("com.foo.Bar");
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
- xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass("com.foo.Baz");
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
-
- assertEquals(2, xmlPersistenceUnit.getClasses().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.specifiedClassRefs()));
-
- // remove class ref from xml, test that it's removed from context
- xmlClassRef = xmlPersistenceUnit.getClasses().get(0);
- xmlPersistenceUnit.getClasses().remove(xmlClassRef);
-
- assertEquals(1, CollectionTools.size(persistenceUnit.specifiedClassRefs()));
-
- // remove another one ...
- xmlClassRef = xmlPersistenceUnit.getClasses().get(0);
- xmlPersistenceUnit.getClasses().remove(xmlClassRef);
-
- assertEquals(0, CollectionTools.size(persistenceUnit.specifiedClassRefs()));
- }
-
- public void testModifyClassRefs1() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // test there are none initially
- assertEquals(0, xmlPersistenceUnit.getClasses().size());
- assertEquals(0, persistenceUnit.specifiedClassRefsSize());
-
- // add class ref, test that it's added to context
- persistenceUnit.addSpecifiedClassRef().setClassName("Foo");
-
- try {
- persistenceResource().save(null);
- }
- catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- assertEquals(1, xmlPersistenceUnit.getClasses().size());
- assertEquals("Foo", xmlPersistenceUnit.getClasses().get(0).getJavaClass());
-
- // add another ...
- persistenceUnit.addSpecifiedClassRef().setClassName("Bar");
-
- assertEquals(2, xmlPersistenceUnit.getClasses().size());
- assertEquals("Foo", xmlPersistenceUnit.getClasses().get(0).getJavaClass());
- assertEquals("Bar", xmlPersistenceUnit.getClasses().get(1).getJavaClass());
-
-
- persistenceUnit.addSpecifiedClassRef(0).setClassName("Baz");
-
- assertEquals(3, xmlPersistenceUnit.getClasses().size());
- assertEquals("Baz", xmlPersistenceUnit.getClasses().get(0).getJavaClass());
- assertEquals("Foo", xmlPersistenceUnit.getClasses().get(1).getJavaClass());
- assertEquals("Bar", xmlPersistenceUnit.getClasses().get(2).getJavaClass());
- }
-
- public void testModifyClassRefs2() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // add two class refs and test that there are two existing in xml and context
- XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass("com.foo.Bar");
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
- xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass("com.foo.Baz");
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
-
- assertEquals(2, xmlPersistenceUnit.getClasses().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.specifiedClassRefs()));
-
- // remove class ref from context, test that it's removed from xml
- persistenceUnit.removeSpecifiedClassRef(0);
-
- assertEquals(1, xmlPersistenceUnit.getClasses().size());
-
- // remove another one ...
- persistenceUnit.removeSpecifiedClassRef(0);
-
- assertEquals(0, xmlPersistenceUnit.getClasses().size());
- }
-
- public void testImpliedClassRefs() throws Exception {
- createTestEntityWithPersistentInnerClass();
- ListIterator<ClassRef> classRefs = persistenceUnit().impliedClassRefs();
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, classRefs.next().getClassName());
- assertEquals(FULLY_QUALIFIED_INNER_CLASS_NAME, classRefs.next().getClassName());
-
- jpaProject().setDiscoversAnnotatedClasses(true);
- classRefs = persistenceUnit().impliedClassRefs();
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, classRefs.next().getClassName());
- assertEquals(FULLY_QUALIFIED_INNER_CLASS_NAME, classRefs.next().getClassName());
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- classRefs = persistenceUnit().impliedClassRefs();
- assertEquals(FULLY_QUALIFIED_INNER_CLASS_NAME, classRefs.next().getClassName());
- assertFalse(classRefs.hasNext());
-
-
- removeXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- classRefs = persistenceUnit().impliedClassRefs();
- assertEquals(FULLY_QUALIFIED_INNER_CLASS_NAME, classRefs.next().getClassName());
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, classRefs.next().getClassName());
-
- entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- classRefs = persistenceUnit().impliedClassRefs();
- assertEquals(FULLY_QUALIFIED_INNER_CLASS_NAME, classRefs.next().getClassName());
- assertFalse(classRefs.hasNext());
-
- addXmlClassRef(FULLY_QUALIFIED_INNER_CLASS_NAME);
- classRefs = persistenceUnit().impliedClassRefs();
- assertFalse(classRefs.hasNext());
-
- removeXmlClassRef(FULLY_QUALIFIED_INNER_CLASS_NAME);
- classRefs = persistenceUnit().impliedClassRefs();
- assertEquals(FULLY_QUALIFIED_INNER_CLASS_NAME, classRefs.next().getClassName());
- assertFalse(classRefs.hasNext());
-
- entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_INNER_CLASS_NAME);
- classRefs = persistenceUnit().impliedClassRefs();
- assertFalse(classRefs.hasNext());
- }
-
- public void testRenamePersistentTypeImpliedClassRefs() throws Exception {
- getJavaProject().getJpaProject().setDiscoversAnnotatedClasses(true);
- ICompilationUnit testType = createTestEntity();
- @SuppressWarnings("unused")
- ICompilationUnit otherTestType = this.createTestOtherTypeEntity();
-
- ListIterator<ClassRef> classRefs = persistenceUnit().impliedClassRefs();
- ClassRef testTypeClassRef = classRefs.next();
- ClassRef otherTestTypeClassRef = classRefs.next();
-
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, testTypeClassRef.getClassName());
- assertEquals(FULLY_QUALIFIED_OTHER_TYPE_NAME, otherTestTypeClassRef.getClassName());
-
- JavaPersistentType testJavaPersistentType = testTypeClassRef.getJavaPersistentType();
- JavaPersistentType otherTestJavaPersistentType = otherTestTypeClassRef.getJavaPersistentType();
-
- testType.findPrimaryType().rename("TestType2", false, null);
-
- classRefs = persistenceUnit().impliedClassRefs();
- otherTestTypeClassRef = classRefs.next();
- testTypeClassRef = classRefs.next();
-
- assertEquals(FULLY_QUALIFIED_OTHER_TYPE_NAME, otherTestTypeClassRef.getClassName());
- assertEquals("test.TestType2", testTypeClassRef.getClassName());
-
- assertEquals(otherTestJavaPersistentType, otherTestTypeClassRef.getJavaPersistentType());
- assertNotSame(testJavaPersistentType, testTypeClassRef.getJavaPersistentType());
- }
-
- public void testUpdateExcludeUnlistedClasses() throws Exception {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // 1 - initial value is default
- assertNull(persistenceUnit.getSpecifiedExcludeUnlistedClasses());
- assertFalse(persistenceUnit.isExcludeUnlistedClasses());
- assertNull(xmlPersistenceUnit.getExcludeUnlistedClasses());
-
- // 2 - set value, context changed
- xmlPersistenceUnit.setExcludeUnlistedClasses(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, persistenceUnit.getSpecifiedExcludeUnlistedClasses());
- assertTrue(persistenceUnit.isExcludeUnlistedClasses());
- assertEquals(Boolean.TRUE, xmlPersistenceUnit.getExcludeUnlistedClasses());
-
- xmlPersistenceUnit.setExcludeUnlistedClasses(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, persistenceUnit.getSpecifiedExcludeUnlistedClasses());
- assertFalse(persistenceUnit.isExcludeUnlistedClasses());
- assertEquals(Boolean.FALSE, xmlPersistenceUnit.getExcludeUnlistedClasses());
-
- // 3 - unset value, context changed
- xmlPersistenceUnit.setExcludeUnlistedClasses(null);
-
- assertNull(persistenceUnit.getSpecifiedExcludeUnlistedClasses());
- assertFalse(persistenceUnit.isExcludeUnlistedClasses());
- assertNull(xmlPersistenceUnit.getExcludeUnlistedClasses());
- }
-
- public void testModifyExcludeUnlistedClasses() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // 1 - initial value is default
- assertNull(persistenceUnit.getSpecifiedExcludeUnlistedClasses());
- assertFalse(persistenceUnit.isExcludeUnlistedClasses());
- assertNull(xmlPersistenceUnit.getExcludeUnlistedClasses());
-
- // 2 - set value, resource changed
- persistenceUnit.setSpecifiedExcludeUnlistedClasses(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, persistenceUnit.getSpecifiedExcludeUnlistedClasses());
- assertTrue(persistenceUnit.isExcludeUnlistedClasses());
- assertEquals(Boolean.TRUE, xmlPersistenceUnit.getExcludeUnlistedClasses());
-
- persistenceUnit.setSpecifiedExcludeUnlistedClasses(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, persistenceUnit.getSpecifiedExcludeUnlistedClasses());
- assertFalse(persistenceUnit.isExcludeUnlistedClasses());
- assertEquals(Boolean.FALSE, xmlPersistenceUnit.getExcludeUnlistedClasses());
-
- // 3 - set context to default, resource unset
- persistenceUnit.setSpecifiedExcludeUnlistedClasses(null);
-
- assertNull(persistenceUnit.getSpecifiedExcludeUnlistedClasses());
- assertFalse(persistenceUnit.isExcludeUnlistedClasses());
- assertNull(xmlPersistenceUnit.getExcludeUnlistedClasses());
- }
-
- public void testUpdateProperties1() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // test there are none initially
- assertNull(xmlPersistenceUnit.getProperties());
- assertEquals(0, CollectionTools.size(persistenceUnit.properties()));
-
- // add "properties", test that there's no real change to context
- XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties();
- xmlPersistenceUnit.setProperties(xmlProperties);
- assertEquals(0, CollectionTools.size(persistenceUnit.properties()));
-
- // add property, test that it's added to context
- XmlProperty xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperty.setName("foo");
- xmlProperty.setValue("bar");
- xmlProperties.getProperties().add(xmlProperty);
-
- assertEquals(1, CollectionTools.size(persistenceUnit.properties()));
-
- // add another ...
- xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperty.setName("FOO");
- xmlProperty.setValue("BAR");
- xmlProperties.getProperties().add(xmlProperty);
-
- assertEquals(2, CollectionTools.size(persistenceUnit.properties()));
- }
-
- public void testUpdateProperties2() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // add two properties and test that there are two existing in xml and context
- XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties();
- xmlPersistenceUnit.setProperties(xmlProperties);
- XmlProperty xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperty.setName("foo");
- xmlProperty.setValue("bar");
- xmlProperties.getProperties().add(xmlProperty);
- xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperty.setName("FOO");
- xmlProperty.setValue("BAR");
- xmlProperties.getProperties().add(xmlProperty);
-
- assertEquals(2, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.properties()));
-
- // remove property from xml, test that it's removed from context
- xmlProperty = xmlProperties.getProperties().get(0);
- xmlProperties.getProperties().remove(xmlProperty);
-
- assertEquals(1, CollectionTools.size(persistenceUnit.properties()));
-
- // remove another one ...
- xmlProperty = xmlProperties.getProperties().get(0);
- xmlProperties.getProperties().remove(xmlProperty);
-
- assertEquals(0, CollectionTools.size(persistenceUnit.properties()));
- }
-
- public void testModifyProperties1() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // test there are none initially
- assertNull(xmlPersistenceUnit.getProperties());
- assertEquals(0, persistenceUnit.propertiesSize());
-
- // add property, test that it's added to resource
- persistenceUnit.addProperty().setName("foo");
-
- assertNotNull(xmlPersistenceUnit.getProperties());
- assertEquals(1, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals("foo", xmlPersistenceUnit.getProperties().getProperties().get(0).getName());
-
- // add another ...
- persistenceUnit.addProperty().setName("bar");
-
- assertEquals(2, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals("foo", xmlPersistenceUnit.getProperties().getProperties().get(0).getName());
- assertEquals("bar", xmlPersistenceUnit.getProperties().getProperties().get(1).getName());
-
- // add another testing order
- persistenceUnit.addProperty(0).setName("baz");
-
- assertEquals(3, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals("baz", xmlPersistenceUnit.getProperties().getProperties().get(0).getName());
- assertEquals("foo", xmlPersistenceUnit.getProperties().getProperties().get(1).getName());
- assertEquals("bar", xmlPersistenceUnit.getProperties().getProperties().get(2).getName());
- }
-
- public void testModifyProperties2() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // add two properties and test that there are two existing in xml and context
- XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties();
- xmlPersistenceUnit.setProperties(xmlProperties);
- XmlProperty xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperty.setName("foo");
- xmlProperty.setValue("bar");
- xmlProperties.getProperties().add(xmlProperty);
- xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperty.setName("FOO");
- xmlProperty.setValue("BAR");
- xmlProperties.getProperties().add(xmlProperty);
-
- assertEquals(2, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.properties()));
-
- // remove property from context, test that it's removed from resource
- persistenceUnit.removeProperty("foo");
-
- assertEquals(1, xmlPersistenceUnit.getProperties().getProperties().size());
-
- // remove another one. test that properties object is nulled
- persistenceUnit.removeProperty("FOO", "BAR");
-
- assertNull(xmlPersistenceUnit.getProperties());
- }
-
- public void testModifyProperties3() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // add two properties and test that there are two existing in xml and context
- persistenceUnit.putProperty("foo", "bar", false);
- persistenceUnit.putProperty("FOO", "BAR", false);
-
- assertEquals(2, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.properties()));
-
- // remove property from context, test that it's removed from resource
- persistenceUnit.removeProperty("foo", "bar");
-
- assertEquals(1, xmlPersistenceUnit.getProperties().getProperties().size());
-
- // remove another one, test that properties object is nulled
- persistenceUnit.removeProperty("FOO");
-
- assertNull(xmlPersistenceUnit.getProperties());
- }
-
- public void testModifyProperties4() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // add two properties and test that there are two existing in xml and context
- persistenceUnit.putProperty("foo", "bar", false);
- persistenceUnit.putProperty("FOO", "BAR", false);
-
- assertEquals(2, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals(2, persistenceUnit.propertiesSize());
-
- // modify a property, test its value
- persistenceUnit.putProperty("foo", "", false);
- assertEquals("", persistenceUnit.getProperty("foo").getValue());
-
- persistenceUnit.putProperty("foo", "BAR", false);
- assertEquals("BAR", persistenceUnit.getProperty("foo").getValue());
-
- // remove property that doesn't from context, test that the resource is unchanged
- persistenceUnit.removeProperty("notExist");
- assertEquals(2, xmlPersistenceUnit.getProperties().getProperties().size());
-
- // remove property from context, test that it's removed from resource
- persistenceUnit.removeProperty("FOO");
- assertNull(persistenceUnit.getProperty("FOO"));
- assertEquals(1, xmlPersistenceUnit.getProperties().getProperties().size());
-
- // remove by setting value to null, test that properties object is nulled
- persistenceUnit.putProperty("notExist", null, false);
- assertNull(persistenceUnit.getProperty("notExist"));
-
- persistenceUnit.putProperty("foo", null, false);
- assertNull(persistenceUnit.getProperty("foo"));
- assertNull(xmlPersistenceUnit.getProperties());
- }
-
- public void testModifyProperties5() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // testing duplicate keys, add four properties and test that there are four existing in xml and context
- persistenceUnit.putProperty("FOO", "BAR", false);
- persistenceUnit.putProperty("foo", "bar 3", true);
- persistenceUnit.putProperty("foo", "bar 2", true);
- persistenceUnit.putProperty("foo", "bar 1", true);
-
- assertEquals(4, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals(4, CollectionTools.size(persistenceUnit.properties()));
-
- // modify a property, test its value
- persistenceUnit.replacePropertyValue("foo", "bar 2", "bar two");
-
- Property property = persistenceUnit.getProperty("foo", "bar two");
- assertEquals("bar two", property.getValue());
-
- // remove a property, test that there are four existing in xml and context
- persistenceUnit.removeProperty("foo", "bar 1");
- assertEquals(3, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals(3, CollectionTools.size(persistenceUnit.properties()));
- }
-
- public void testAccessProperty() {
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- // add two properties and try to access it.
- persistenceUnit.putProperty("foo", "bar", false);
- persistenceUnit.putProperty("FOO", "BAR", false);
-
- Property property = persistenceUnit.getProperty("foo");
- assertNotNull(property);
- assertEquals("bar", property.getValue());
- assertTrue(persistenceUnit.containsProperty("FOO"));
- assertEquals("BAR", persistenceUnit.getProperty("FOO").getValue());
- assertNull(persistenceUnit.getProperty("notExist"));
- }
-
- private Property persistenceUnitFirstProperty() {
- return persistenceUnit().properties().next();
- }
-
- public void testUpdatePropertyName() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
-
- // add property for testing
- XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties();
- xmlPersistenceUnit.setProperties(xmlProperties);
- XmlProperty xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperties.getProperties().add(xmlProperty);
-
- // test that names are initially equal
- assertEquals(xmlProperty.getName(), persistenceUnitFirstProperty().getName());
-
- // set name to different name, test equality
- xmlProperty.setName("newName");
-
- assertEquals(xmlProperty.getName(), persistenceUnitFirstProperty().getName());
-
- // set name to empty string, test equality
- xmlProperty.setName("");
-
- assertEquals(xmlProperty.getName(), persistenceUnitFirstProperty().getName());
-
- // set name back to non-null, test equality
- xmlProperty.setName("newName");
-
- assertEquals(xmlProperty.getName(), persistenceUnitFirstProperty().getName());
- }
-
- public void testUpdatePropertyValue() {
- XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit();
-
- // add property for testing
- XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties();
- xmlPersistenceUnit.setProperties(xmlProperties);
- XmlProperty xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperties.getProperties().add(xmlProperty);
-
- // test that values are initially equal
- assertEquals(xmlProperty.getValue(), persistenceUnitFirstProperty().getValue());
-
- // set value to different value, test equality
- xmlProperty.setValue("newValue");
-
- assertEquals(xmlProperty.getValue(), persistenceUnitFirstProperty().getValue());
-
- // set value to empty string, test equality
- xmlProperty.setValue("");
-
- assertEquals(xmlProperty.getValue(), persistenceUnitFirstProperty().getValue());
-
- // set value to null, test equality
- xmlProperty.setValue(null);
-
- assertEquals(xmlProperty.getValue(), persistenceUnitFirstProperty().getValue());
-
- // set value back to non-null, test equality
- xmlProperty.setValue("newValue");
-
- assertEquals(xmlProperty.getValue(), persistenceUnitFirstProperty().getValue());
- }
-
-
- public void testGetDefaultAccess() throws Exception {
- createOrmXmlFile();
- PersistenceUnit persistenceUnit = persistenceUnit();
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, persistenceUnit.getDefaultAccess());
-
- entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, persistenceUnit.getDefaultAccess());
- }
-
- protected void createOrmXmlFile() throws Exception {
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- xmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- persistenceResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestOtherTypeEntity() throws Exception {
- return this.createTestType(PACKAGE_NAME, OTHER_TYPE_NAME + ".java", OTHER_TYPE_NAME, new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- });
- }
-
- private ICompilationUnit createTestEntityWithPersistentInnerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendMemberTypeTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append(" public static class " + INNER_CLASS_NAME + " {}").append(CR);
- }
- });
- }
-
- public void testPersistentType() throws Exception {
- PersistenceUnit persistenceUnit = persistenceUnit();
- createTestEntity();
-
- //persistentType not listed in persistence.xml and discoverAnnotatedClasses is false
- //still find the persistentType because of changes for bug 190317
- assertFalse(jpaProject().discoversAnnotatedClasses());
- assertNotNull(persistenceUnit.getPersistentType(FULLY_QUALIFIED_TYPE_NAME));
-
- //test persistentType not listed in persistence.xml, discover annotated classes set to true
- jpaProject().setDiscoversAnnotatedClasses(true);
- assertNotNull(persistenceUnit.getPersistentType(FULLY_QUALIFIED_TYPE_NAME));
-
- //test persistentType list as class in persistence.xml
- jpaProject().setDiscoversAnnotatedClasses(false);
- XmlJavaClassRef classRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- classRef.setJavaClass(FULLY_QUALIFIED_TYPE_NAME);
- xmlPersistenceUnit().getClasses().add(classRef);
- assertNotNull(persistenceUnit.getPersistentType(FULLY_QUALIFIED_TYPE_NAME));
-
-
- //test persistentType from orm.xml file that is specified in the persistence.xml
- createOrmXmlFile();
- OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- assertNotNull(persistenceUnit.getPersistentType("model.Foo"));
- assertEquals(ormPersistentType, persistenceUnit.getPersistentType("model.Foo"));
-
- //test persistentType from orm.xml file that is implied(not specified) in the persistence.xml
- xmlPersistenceUnit().getMappingFiles().remove(0);
- assertNotNull(persistenceUnit.getPersistentType("model.Foo"));
- }
-
-//TODO
-// String getDefaultSchema();
-// String getDefaultCatalog();
-// AccessType getDefaultAccess();
-// boolean getDefaultCascadePersist();
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceXmlTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceXmlTests.java
deleted file mode 100644
index 5e7c816754..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceXmlTests.java
+++ /dev/null
@@ -1,92 +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.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.PersistenceResource;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-
-public class PersistenceXmlTests extends ContextModelTestCase
-{
- public PersistenceXmlTests(String name) {
- super(name);
- }
-
- protected PersistenceXml persistenceXml() {
- return getRootContextNode().getPersistenceXml();
- }
-
- public void testUpdateAddPersistence() throws Exception {
- PersistenceResource prm = persistenceResource();
- prm.getContents().clear();
- prm.save(null);
-
- assertNull(persistenceXml().getPersistence());
-
- prm.getContents().add(PersistenceFactory.eINSTANCE.createXmlPersistence());
-
- assertNotNull(persistenceXml().getPersistence());
-
- }
-
- public void testModifyAddPersistence() {
- PersistenceResource prm = persistenceResource();
- prm.getContents().remove(prm.getPersistence());
- assertNull(prm.getPersistence());
-
- PersistenceXml persistenceXml = persistenceXml();
-
- persistenceXml.addPersistence();
-
- assertNotNull(persistenceXml.getPersistence());
-
- boolean exceptionThrown = false;
- try {
- persistenceXml.addPersistence();
- }
- catch (IllegalStateException ise) {
- exceptionThrown = true;
- }
-
- assertTrue(exceptionThrown);
- }
-
- public void testUpdateRemovePersistence() throws Exception {
- PersistenceResource prm = persistenceResource();
-
- assertNotNull(persistenceXml().getPersistence());
-
- prm.getContents().clear();
-
- assertNull(persistenceXml().getPersistence());
- }
-
- public void testModifyRemovePersistence() {
- PersistenceXml persistenceXml = persistenceXml();
-
- assertNotNull(persistenceXml.getPersistence());
-
- persistenceXml.removePersistence();
-
- assertNull(persistenceXml.getPersistence());
-
- boolean exceptionThrown = false;
- try {
- persistenceXml.removePersistence();
- }
- catch (IllegalStateException ise) {
- exceptionThrown = true;
- }
-
- assertTrue(exceptionThrown);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/RootContextNodeTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/RootContextNodeTests.java
deleted file mode 100644
index 6cf8b7ecd2..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/RootContextNodeTests.java
+++ /dev/null
@@ -1,93 +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.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.core.context.JpaRootContextNode;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.PersistenceResource;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-
-public class RootContextNodeTests extends ContextModelTestCase
-{
- public RootContextNodeTests(String name) {
- super(name);
- }
-
- public void testModifyAddPersistenceXml() throws Exception {
- PersistenceResource pr = persistenceResource();
- deleteResource(pr);
-
- assertFalse(pr.exists());
-
- JpaRootContextNode baseJpaContent = getJavaProject().getJpaProject().getRootContextNode();
- assertNull(baseJpaContent.getPersistenceXml());
-
- baseJpaContent.addPersistenceXml();
-
- assertNotNull(baseJpaContent.getPersistenceXml());
-
- boolean exceptionThrown = false;
- try {
- baseJpaContent.addPersistenceXml();
- }
- catch (IllegalStateException ise) {
- exceptionThrown = true;
- }
-
- assertTrue(exceptionThrown);
- }
-
- public void testModifyRemovePersistenceXml() throws Exception {
- JpaRootContextNode baseJpaContent = getJavaProject().getJpaProject().getRootContextNode();
-
- assertNotNull(baseJpaContent.getPersistenceXml());
-
- baseJpaContent.removePersistenceXml();
- waitForWorkspaceJobs();
-
- assertNull(baseJpaContent.getPersistenceXml());
-
- boolean exceptionThrown = false;
- try {
- baseJpaContent.removePersistenceXml();
- }
- catch (IllegalStateException ise) {
- exceptionThrown = true;
- }
-
- assertTrue(exceptionThrown);
- }
-
- public void testUpdateAddPersistenceXml() throws Exception {
- PersistenceResource pr = persistenceResource();
- deleteResource(pr);
-
- assertFalse(pr.exists());
-
- JpaRootContextNode baseJpaContent = getJavaProject().getJpaProject().getRootContextNode();
- assertNull(baseJpaContent.getPersistenceXml());
-
- pr.getContents().add(PersistenceFactory.eINSTANCE.createXmlPersistence());
- pr.save(null);
- assertNotNull(baseJpaContent.getPersistenceXml());
- }
-
- public void testUpdateRemovePersistenceXml() throws Exception {
- PersistenceResource pr = persistenceResource();
- JpaRootContextNode baseJpaContent = getJavaProject().getJpaProject().getRootContextNode();
-
- assertNotNull(baseJpaContent.getPersistenceXml());
-
- deleteResource(pr);
-
- assertNull(baseJpaContent.getPersistenceXml());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/JpaModelTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/JpaModelTests.java
deleted file mode 100644
index d634056999..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/JpaModelTests.java
+++ /dev/null
@@ -1,227 +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.tests.internal.model;
-
-import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import junit.framework.TestCase;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.GenericJpaModel;
-import org.eclipse.jpt.core.internal.JpaModelManager;
-import org.eclipse.jpt.core.tests.internal.projects.TestFacetedProject;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject;
-import org.eclipse.jpt.core.tests.internal.projects.TestPlatformProject;
-import org.eclipse.jpt.utility.internal.ClassTools;
-
-@SuppressWarnings("nls")
-public class JpaModelTests extends TestCase {
-
- /** carriage return */
- public static final String CR = System.getProperty("line.separator");
-
- protected TestFacetedProject testProject;
- public JpaModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- if (this.debug()) {
- this.printName();
- }
- this.testProject = this.buildTestProject();
- }
-
- private boolean debug() {
- Boolean debug = (Boolean) ClassTools.staticFieldValue(JpaModelManager.class, "DEBUG");
- return debug.booleanValue();
- }
-
- private void printName() {
- String name = this.getName();
- System.out.println();
- System.out.println();
- this.printNameBorder(name);
- System.out.println(name);
- this.printNameBorder(name);
- }
-
- private void printNameBorder(String name) {
- for (int i = name.length(); i-- > 0; ) {
- System.out.print('=');
- }
- System.out.println();
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.testProject.getProject().delete(true, true, null);
- this.testProject = null;
- super.tearDown();
- }
-
- /**
- * Builds a project with the java and utility facets installed, and with
- * pre-existing entities added.
- */
- private TestFacetedProject buildTestProject() throws Exception {
- TestJavaProject testProject = TestJavaProject.buildJavaProject(ClassTools.shortClassNameForObject(this), true);
- testProject.installFacet("jst.utility", "1.0");
- testProject.createCompilationUnit("test.pkg", "TestEntity.java", "@Entity public class TestEntity {}");
- testProject.createCompilationUnit("test.pkg", "TestEntity2.java", "@Entity public class TestEntity2 {}");
- return testProject;
- }
-
- private IFile getFile(TestPlatformProject p, String path) {
- return p.getProject().getFile(new Path(path));
- }
-
- public void testJpaModel() {
- assertNotNull(JptCorePlugin.getJpaModel());
- }
-
- public void testProjectCloseReopen() throws Exception {
- this.testProject.installFacet("jpt.jpa", "1.0");
-
- this.testProject.getProject().close(null);
- assertFalse(this.testProject.getProject().isOpen());
- JpaProject jpaProject = JptCorePlugin.getJpaProject(this.testProject.getProject());
- assertNull(jpaProject);
-
- this.testProject.getProject().open(null);
- assertTrue(this.testProject.getProject().isOpen());
- jpaProject = JptCorePlugin.getJpaProject(this.testProject.getProject());
- assertNotNull(jpaProject);
- assertEquals(4, jpaProject.jpaFilesSize());
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/test/pkg/TestEntity.java")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/test/pkg/TestEntity2.java")));
-
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/META-INF/persistence.xml")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/META-INF/orm.xml")));
- }
-
- public void testProjectDeleteReimport() throws Exception {
- this.testProject.installFacet("jpt.jpa", "1.0");
- JpaProject jpaProject = JptCorePlugin.getJpaProject(this.testProject.getProject());
- assertNotNull(jpaProject);
- assertEquals(1, JptCorePlugin.getJpaModel().jpaProjectsSize());
-
- this.testProject.getProject().delete(false, true, null);
- jpaProject = JptCorePlugin.getJpaProject(this.testProject.getProject());
- assertNull(jpaProject);
- assertEquals(0, JptCorePlugin.getJpaModel().jpaProjectsSize());
- assertEquals(0, ResourcesPlugin.getWorkspace().getRoot().getProjects().length);
-
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(this.testProject.getProject().getName());
- project.create(null);
- assertEquals(1, ResourcesPlugin.getWorkspace().getRoot().getProjects().length);
- project.open(null);
-
- assertTrue(project.isOpen());
- assertTrue(JptCorePlugin.projectHasJpaFacet(project));
- jpaProject = JptCorePlugin.getJpaProject(project);
- assertNotNull(jpaProject);
- assertEquals(4, jpaProject.jpaFilesSize());
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/test/pkg/TestEntity.java")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/test/pkg/TestEntity2.java")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/META-INF/persistence.xml")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/META-INF/orm.xml")));
- }
-
- public void testFacetInstallUninstall() throws Exception {
- assertNull(JptCorePlugin.getJpaProject(this.testProject.getProject()));
-
- this.testProject.installFacet("jpt.jpa", "1.0");
- assertEquals(1, JptCorePlugin.getJpaModel().jpaProjectsSize());
- JpaProject jpaProject = JptCorePlugin.getJpaProject(this.testProject.getProject());
- assertNotNull(jpaProject);
- assertEquals(4, jpaProject.jpaFilesSize());
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/test/pkg/TestEntity.java")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/test/pkg/TestEntity2.java")));
-
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/META-INF/persistence.xml")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/META-INF/orm.xml")));
-
- this.testProject.uninstallFacet("jpt.jpa", "1.0");
- assertEquals(0, JptCorePlugin.getJpaModel().jpaProjectsSize());
- jpaProject = JptCorePlugin.getJpaProject(this.testProject.getProject());
- assertNull(jpaProject);
- }
-
- //TODO - Commented out this test, since it was failing in the I-Build and we're not sure why.
- //See bug 221757
- public void testEditFacetSettingsFile() throws Exception {
- assertNull(JptCorePlugin.getJpaProject(this.testProject.getProject()));
-
- // add the JPA facet by modifying the facet settings file directly
- IFile facetSettingsFile = this.getFile(this.testProject, ".settings/org.eclipse.wst.common.project.facet.core.xml");
- InputStream inStream = new BufferedInputStream(facetSettingsFile.getContents());
- int fileSize = inStream.available();
- byte[] buf = new byte[fileSize];
- inStream.read(buf);
- inStream.close();
-
- String oldDocument = new String(buf);
- String oldString = "<installed facet=\"jst.utility\" version=\"1.0\"/>";
- String newString = oldString + CR + " " + "<installed facet=\"jpt.jpa\" version=\"1.0\"/>";
- String newDocument = oldDocument.replaceAll(oldString, newString);
-
- facetSettingsFile.setContents(new ByteArrayInputStream(newDocument.getBytes()), false, false, null);
-
- // TODO moved more stuff to the error console until we can figure out why it fails intermittently ~kfb
-// assertEquals(1, JptCorePlugin.getJpaModel().jpaProjectsSize());
-// JpaProject jpaProject = JptCorePlugin.getJpaProject(this.testProject.getProject());
-// assertNotNull(jpaProject);
-// // persistence.xml and orm.xml do not get created in this situation (?)
-// assertEquals(2, jpaProject.jpaFilesSize());
-// assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/test/pkg/TestEntity.java")));
-// assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/test/pkg/TestEntity2.java")));
-//// assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/META-INF/persistence.xml")));
-//// assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/META-INF/orm.xml")));
- int size = JptCorePlugin.getJpaModel().jpaProjectsSize();
- if (size != 1) {
- System.err.println("bogus size: " + size);
- System.err.println("bogus project: " + JptCorePlugin.getJpaProject(this.testProject.getProject()));
- }
-
- // now remove the JPA facet
- facetSettingsFile.setContents(new ByteArrayInputStream(oldDocument.getBytes()), false, false, null);
-// TODO moved this stuff to the error console until we can figure out why it fails intermittently ~bjv
-// assertEquals(0, JptCorePlugin.jpaModel().jpaProjectsSize());
-// jpaProject = JptCorePlugin.jpaProject(testProject.getProject());
-// assertNull(jpaProject);
- int newSize = JptCorePlugin.getJpaModel().jpaProjectsSize();
- if (newSize != 0) {
- System.err.println("bogus size: " + newSize);
- System.err.println("bogus project: " + JptCorePlugin.getJpaProject(this.testProject.getProject()));
- }
- }
-
- /**
- * make sure the DEBUG constants are 'false' before checking in the code
- */
- public void testDEBUG() {
- this.verifyDEBUG(JpaModelManager.class);
- this.verifyDEBUG(GenericJpaModel.class);
- }
-
- private void verifyDEBUG(Class<?> clazz) {
- assertFalse("Recompile with \"DEBUG = false\": " + clazz.getName(),
- ((Boolean) ClassTools.staticFieldValue(clazz, "DEBUG")).booleanValue());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/JptCoreModelTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/JptCoreModelTests.java
deleted file mode 100644
index 59be1a1135..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/JptCoreModelTests.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.core.tests.internal.model;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptCoreModelTests {
-
- public static Test suite() {
- return suite(true);
- }
-
- public static Test suite(boolean all) {
- TestSuite suite = new TestSuite(JptCoreModelTests.class.getPackage().getName());
- suite.addTestSuite(JpaModelTests.class);
- return suite;
- }
-
- private JptCoreModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/BaseJpaPlatformTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/BaseJpaPlatformTests.java
deleted file mode 100644
index b27caa31ae..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/BaseJpaPlatformTests.java
+++ /dev/null
@@ -1,76 +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.tests.internal.platform;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJpaProject;
-
-public class BaseJpaPlatformTests extends TestCase
-{
- protected TestJpaProject jpaProject;
-
- protected static final String PROJECT_NAME = "PlatformTestProject";
- protected static final String PACKAGE_NAME = "platform.test";
- protected static final String PERSISTENCE_XML_LOCATION = "src/META-INF/persistence.xml";
- protected static final String ORM_XML_LOCATION = "src/META-INF/orm.xml";
-
-
- public BaseJpaPlatformTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.jpaProject = this.buildJpaProject(PROJECT_NAME, false); // false = no auto-build
- }
-
- protected TestJpaProject buildJpaProject(String projectName, boolean autoBuild) throws Exception {
- return new TestJpaProject(projectName, autoBuild); // false = no auto-build
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.jpaProject.getProject().delete(true, true, null);
- this.jpaProject = null;
- super.tearDown();
- }
-
-// public void testPersistentTypes() throws CoreException, IOException {
-// IFile persistenceXmlIFile = jpaProject.getProject().getFile(PERSISTENCE_XML_LOCATION);
-// IJpaFile persistenceXmlJpaFile = jpaProject.getJpaProject().getJpaFile(persistenceXmlIFile);
-// PersistenceXmlRootContentNode persistenceRoot = (PersistenceXmlRootContentNode) persistenceXmlJpaFile.getContent();
-// XmlPersistence persistence = persistenceRoot.getPersistence();
-//
-// IFile ormXmlIFile = jpaProject.getProject().getFile(ORM_XML_LOCATION);
-// IJpaFile ormXmlJpaFile = jpaProject.getJpaProject().getJpaFile(ormXmlIFile);
-// XmlRootContentNode ormRoot = (XmlRootContentNode) ormXmlJpaFile.getContent();
-// EntityMappingsInternal entityMappings = ormRoot.getEntityMappings();
-//
-// // add xml persistent type
-// XmlEntityInternal xmlEntity = OrmFactory.eINSTANCE.createXmlEntityInternal();
-// xmlEntity.setSpecifiedName("XmlEntity");
-// entityMappings.getTypeMappings().add(xmlEntity);
-// entityMappings.eResource().save(null);
-// assertEquals(1, CollectionTools.size(jpaProject.getJpaProject().getPlatform().persistentTypes(PROJECT_NAME)));
-//
-// // add java persistent type
-// jpaProject.createType(PACKAGE_NAME, "JavaEntity.java",
-// "@Entity public class JavaEntity {}"
-// );
-// XmlJavaClassRef javaClassRef = PersistenceFactory.eINSTANCE.createJavaClassRef();
-// javaClassRef.setJavaClass(PACKAGE_NAME + ".JavaEntity");
-// persistence.getPersistenceUnits().get(0).getClasses().add(javaClassRef);
-// persistence.eResource().save(null);
-//
-// assertEquals(2, CollectionTools.size(jpaProject.getJpaProject().getPlatform().persistentTypes(PROJECT_NAME)));
-// }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/JpaPlatformExtensionTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/JpaPlatformExtensionTests.java
deleted file mode 100644
index 6e6ea5cc26..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/JpaPlatformExtensionTests.java
+++ /dev/null
@@ -1,71 +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.tests.internal.platform;
-
-import junit.framework.TestCase;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.platform.JpaPlatformRegistry;
-import org.eclipse.jpt.core.tests.extension.resource.ExtensionTestPlugin;
-import org.eclipse.jpt.core.tests.extension.resource.TestJpaPlatform;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-public class JpaPlatformExtensionTests extends TestCase
-{
- public static final String TEST_PLATFORM_ID = TestJpaPlatform.ID;
- public static final String TEST_PLATFORM_LABEL = "Test Jpa Platform";
-
- public JpaPlatformExtensionTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- verifyExtensionTestProjectExists();
- }
-
- public static void verifyExtensionTestProjectExists() {
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint extensionPoint =
- registry.getExtensionPoint(JptCorePlugin.PLUGIN_ID, "jpaPlatform");
- IExtension[] extensions = extensionPoint.getExtensions();
- boolean extensionFound = false;
- for (IExtension extension : extensions) {
- if (extension.getContributor().getName().equals(ExtensionTestPlugin.PLUGIN_ID)) {
- extensionFound = true;
- }
- }
- if (!extensionFound) {
- throw new RuntimeException("Missing Extension " + TEST_PLATFORM_ID + ". The ExtensionTestProject plugin must be in your testing workspace.");
- }
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testAllJpaPlatformIds() {
- assertTrue(CollectionTools.size(JpaPlatformRegistry.instance().jpaPlatformIds()) >= 2);
- }
-
- public void testJpaPlatformLabel() {
- assertEquals(TEST_PLATFORM_LABEL, JpaPlatformRegistry.instance().getJpaPlatformLabel(TEST_PLATFORM_ID));
- }
-
- public void testJpaPlatform() {
- assertNotNull(JpaPlatformRegistry.instance().getJpaPlatform(TEST_PLATFORM_ID));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/JpaPlatformTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/JpaPlatformTests.java
deleted file mode 100644
index 81e2e71019..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/JpaPlatformTests.java
+++ /dev/null
@@ -1,120 +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.tests.internal.platform;
-
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.core.internal.facet.JpaFacetDataModelProvider;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.tests.extension.resource.ExtensionTestPlugin;
-import org.eclipse.jpt.core.tests.extension.resource.JavaTestAttributeMapping;
-import org.eclipse.jpt.core.tests.extension.resource.JavaTestAttributeMappingProvider;
-import org.eclipse.jpt.core.tests.extension.resource.JavaTestTypeMapping;
-import org.eclipse.jpt.core.tests.extension.resource.JavaTestTypeMappingProvider;
-import org.eclipse.jpt.core.tests.extension.resource.TestJavaBasicMapping;
-import org.eclipse.jpt.core.tests.extension.resource.TestJavaEntity;
-import org.eclipse.jpt.core.tests.extension.resource.TestJpaFactory;
-import org.eclipse.jpt.core.tests.extension.resource.TestJpaPlatform;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject;
-import org.eclipse.jpt.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IActionConfigFactory;
-
-public class JpaPlatformTests extends ContextModelTestCase
-{
- 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 = "org.eclipse.jpt.core.tests.extension.resource";
-
- public static final String TEST_PLATFORM_CLASS_NAME = TestJpaPlatform.class.getName();
- public static final String TEST_PLATFORM_LABEL = "Test Jpa Platform";
- public static final String TEST_JPA_FACTORY = TestJpaFactory.class.getName();
- public static final String TEST_TYPE_MAPPING_PROVIDER_CLASS = JavaTestTypeMappingProvider.class.getName();
- public static final String TEST_ATTRIBUTE_MAPPING_PROVIDER_CLASS = JavaTestAttributeMappingProvider.class.getName();
-
- public JpaPlatformTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- JpaPlatformExtensionTests.verifyExtensionTestProjectExists();
- }
-
- @Override
- protected TestJavaProject buildJavaProject(boolean autoBuild) throws Exception {
- return super.buildJpaProject(PROJECT_NAME, autoBuild, this.buildConfig());
- }
-
- protected IDataModel buildConfig() throws Exception {
- IActionConfigFactory configFactory = new JpaFacetDataModelProvider();
- IDataModel config = (IDataModel) configFactory.create();
- config.setProperty(JpaFacetDataModelProperties.PLATFORM_ID, TestJpaPlatform.ID);
- return config;
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
-
- protected JpaPlatform jpaPlatform() {
- return this.jpaProject().getJpaPlatform();
- }
-
- public void testJpaFactory() {
- assertTrue(jpaPlatform().getJpaFactory().getClass().getName().equals(TEST_JPA_FACTORY));
- }
-
- public void testBuildJavaTypeMappingFromMappingKey() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaTypeMapping javaTypeMapping = jpaProject().getJpaPlatform().buildJavaTypeMappingFromMappingKey(JavaTestTypeMapping.TEST_TYPE_MAPPING_KEY, javaPersistentType());
- assertTrue(javaTypeMapping instanceof JavaTestTypeMapping);
-
- javaTypeMapping = jpaPlatform().buildJavaTypeMappingFromMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY, javaPersistentType());
- assertTrue(javaTypeMapping instanceof TestJavaEntity);
- }
-
- public void testBuildJavaAttributeMappingFromMappingKey() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAttributeMapping javaAttributeMapping = jpaProject().getJpaPlatform().buildJavaAttributeMappingFromMappingKey(JavaTestAttributeMapping.TEST_ATTRIBUTE_MAPPING_KEY, javaPersistentType().getAttributeNamed("name"));
- assertTrue(javaAttributeMapping instanceof JavaTestAttributeMapping);
-
- javaAttributeMapping = jpaPlatform().buildJavaAttributeMappingFromMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, javaPersistentType().getAttributeNamed("name"));
- assertTrue(javaAttributeMapping instanceof TestJavaBasicMapping);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestFacetedProject.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestFacetedProject.java
deleted file mode 100644
index 22f66e3171..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestFacetedProject.java
+++ /dev/null
@@ -1,80 +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.core.tests.internal.projects;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-/**
- * This builds and holds a "faceted" project.
- * Support for installing facets.
- */
-public class TestFacetedProject extends TestPlatformProject {
- private final IFacetedProject facetedProject;
-
-
- // ********** builders *****************************
-
- public static TestFacetedProject buildFacetedProject(String baseProjectName, boolean autoBuild)
- throws CoreException {
- return new TestFacetedProject(baseProjectName, autoBuild);
- }
-
-
- // ********** constructors/initialization **********
-
- public TestFacetedProject(String projectName) throws CoreException {
- this(projectName, true);
- }
-
- public TestFacetedProject(String projectName, boolean autoBuild) throws CoreException {
- super(projectName, autoBuild);
- this.facetedProject = this.createFacetedProject();
- }
-
- private IFacetedProject createFacetedProject() throws CoreException {
- return ProjectFacetsManager.create(this.getProject(), true, null); // true = "convert if necessary"
- }
-
-
- // ********** public methods **********
-
- public IFacetedProject getFacetedProject() {
- return this.facetedProject;
- }
-
- public void installFacet(String facetName, String versionName) throws CoreException {
- this.installFacet(facetName, versionName, null);
- }
-
- public void uninstallFacet(String facetName, String versionName) throws CoreException {
- this.uninstallFacet(facetName, versionName, null);
- }
-
- /**
- * if 'config' is null, the JPA project will be built with the defaults
- * defined in JpaFacetDataModelProvider#getDefaultProperty(String)
- */
- public void installFacet(String facetName, String versionName, IDataModel config) throws CoreException {
- this.facetedProject.installProjectFacet(this.facetVersion(facetName, versionName), config, null);
- }
-
- public void uninstallFacet(String facetName, String versionName, IDataModel config) throws CoreException {
- this.facetedProject.uninstallProjectFacet(this.facetVersion(facetName, versionName), config, null);
- }
-
- private IProjectFacetVersion facetVersion(String facetName, String versionName) {
- return ProjectFacetsManager.getProjectFacet(facetName).getVersion(versionName);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJavaProject.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJavaProject.java
deleted file mode 100644
index 3679873d93..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJavaProject.java
+++ /dev/null
@@ -1,118 +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.tests.internal.projects;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-/**
- * This builds and holds a "Java" project.
- * Support for adding packages and types.
- *
- * "Java" projects aren't required to be "faceted" projects, but for JPA
- * testing they are.
- */
-public class TestJavaProject extends TestFacetedProject {
- private final IJavaProject javaProject;
- private final IPackageFragmentRoot sourceFolder;
-
-
- // ********** builders *****************************
-
- public static TestJavaProject buildJavaProject(String baseProjectName, boolean autoBuild)
- throws CoreException {
- return new TestJavaProject(baseProjectName, autoBuild);
- }
-
-
- // ********** constructors/initialization **********
-
- public TestJavaProject(String projectName) throws CoreException {
- this(projectName, false);
- }
-
- public TestJavaProject(String projectName, boolean autoBuild) throws CoreException {
- super(projectName, autoBuild);
- this.installFacet("jst.java", "5.0");
- this.javaProject = JavaCore.create(this.getProject());
- this.sourceFolder = this.javaProject.getPackageFragmentRoot(this.getProject().getFolder("src"));
- }
-
- protected void addJar(String jarPath) throws JavaModelException {
- this.addClasspathEntry(JavaCore.newLibraryEntry(new Path(jarPath), null, null));
- }
-
- private void addClasspathEntry(IClasspathEntry entry) throws JavaModelException {
- this.javaProject.setRawClasspath(CollectionTools.add(this.javaProject.getRawClasspath(), entry), null);
- }
-
-
- // ********** public methods **********
-
- public IPackageFragment createPackage(String packageName) throws CoreException {
- return this.sourceFolder.createPackageFragment(packageName, false, null); // false = "no force"
- }
-
- /**
- * The source should NOT contain a package declaration;
- * it will be added here.
- */
- public ICompilationUnit createCompilationUnit(String packageName, String compilationUnitName, String source) throws CoreException {
- return this.createCompilationUnit(this.createPackage(packageName), compilationUnitName, new SimpleSourceWriter(source));
- }
-
- /**
- * The source should NOT contain a package declaration;
- * it will be added here.
- */
- public ICompilationUnit createCompilationUnit(String packageName, String compilationUnitName, SourceWriter sourceWriter) throws CoreException {
- return this.createCompilationUnit(this.createPackage(packageName), compilationUnitName, sourceWriter);
- }
-
- /**
- * The source should NOT contain a package declaration;
- * it will be added here.
- */
- public ICompilationUnit createCompilationUnit(IPackageFragment packageFragment, String compilationUnitName, SourceWriter sourceWriter) throws CoreException {
- StringBuilder sb = new StringBuilder(2000);
- sb.append("package ").append(packageFragment.getElementName()).append(";").append(CR);
- sb.append(CR);
- sourceWriter.appendSourceTo(sb);
- String source = sb.toString();
- return packageFragment.createCompilationUnit(compilationUnitName, source, false, null); // false = "no force"
- }
-
-
- // ********** member classes **********
-
- public interface SourceWriter {
- void appendSourceTo(StringBuilder sb);
- }
-
- public class SimpleSourceWriter implements SourceWriter {
- private final String source;
- public SimpleSourceWriter(String source) {
- super();
- this.source = source;
- }
- public void appendSourceTo(StringBuilder sb) {
- sb.append(source);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJpaProject.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJpaProject.java
deleted file mode 100644
index 539421cf53..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJpaProject.java
+++ /dev/null
@@ -1,77 +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.tests.internal.projects;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.SynchronousJpaProjectUpdater;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-/**
- * This builds and holds a "JPA" project.
- * Support for adding packages and types.
- *
- * The JPA project's settings (platform, database connection, etc.) can be
- * controlled by building a data model and passing it into the constructor.
- */
-public class TestJpaProject extends TestJavaProject {
- private final JpaProject jpaProject;
-
- public static final String JPA_JAR_NAME_SYSTEM_PROPERTY = "org.eclipse.jpt.jpa.jar";
-
-
- // ********** builders **********
-
- public static TestJpaProject buildJpaProject(String baseProjectName, boolean autoBuild, IDataModel jpaConfig)
- throws CoreException {
- return new TestJpaProject(baseProjectName, autoBuild, jpaConfig);
- }
-
- public static TestJpaProject buildJpaProject(String baseProjectName, boolean autoBuild)
- throws CoreException {
- return buildJpaProject(baseProjectName, autoBuild, null);
- }
-
- // ********** constructors/initialization **********
-
- public TestJpaProject(String projectName) throws CoreException {
- this(projectName, false);
- }
-
- public TestJpaProject(String projectName, boolean autoBuild) throws CoreException {
- this(projectName, autoBuild, null);
- }
-
- public TestJpaProject(String projectName, boolean autoBuild, IDataModel jpaConfig) throws CoreException {
- super(projectName, autoBuild);
- this.installFacet("jst.utility", "1.0");
- this.installFacet("jpt.jpa", "1.0", jpaConfig);
- this.addJar(jpaJarName());
- this.jpaProject = JptCorePlugin.getJpaProject(this.getProject());
- this.jpaProject.setUpdater(new SynchronousJpaProjectUpdater(this.jpaProject));
- }
-
- public static String jpaJarName() {
- String jarName = System.getProperty(JPA_JAR_NAME_SYSTEM_PROPERTY);
- if (jarName == null) {
- throw new RuntimeException("missing Java system property: \"" + JPA_JAR_NAME_SYSTEM_PROPERTY + "\"");
- }
- return jarName;
- }
-
-
- // ********** public methods **********
-
- public JpaProject getJpaProject() {
- return this.jpaProject;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestPlatformProject.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestPlatformProject.java
deleted file mode 100644
index 20e9b0b8cc..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestPlatformProject.java
+++ /dev/null
@@ -1,78 +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.tests.internal.projects;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IWorkspaceDescription;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-/**
- * This builds and holds a "general" Eclipse project.
- * Support for adding natures, folders, and files.
- */
-public class TestPlatformProject {
- private final IProject project;
-
- /** carriage return */
- public static final String CR = System.getProperty("line.separator");
-
-
- // ********** builders **********
-
- public static TestPlatformProject buildPlatformProject(String baseProjectName, boolean autoBuild)
- throws CoreException {
- return new TestPlatformProject(baseProjectName, autoBuild);
- }
-
-
- // ********** constructors/initialization **********
-
- public TestPlatformProject(String projectName, boolean autoBuild) throws CoreException {
- super();
- this.setAutoBuild(autoBuild); // workspace-wide setting
- this.project = this.buildPlatformProject(projectName);
- }
-
- private void setAutoBuild(boolean autoBuild) throws CoreException {
- IWorkspaceDescription description = ResourcesPlugin.getWorkspace().getDescription();
- description.setAutoBuilding(autoBuild);
- ResourcesPlugin.getWorkspace().setDescription(description);
- }
-
- private IProject buildPlatformProject(String projectName) throws CoreException {
- IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- p.create(null);
- p.open(null);
- return p;
- }
-
-
- // ********** public methods **********
-
- public IProject getProject() {
- return this.project;
- }
-
- public void addProjectNature(String natureID) throws CoreException {
- IProjectDescription description = this.project.getDescription();
- description.setNatureIds(CollectionTools.add(description.getNatureIds(), natureID));
- this.project.setDescription(description, null);
- }
-
- public void removeProjectNature(String natureID) throws CoreException {
- IProjectDescription description = this.project.getDescription();
- description.setNatureIds(CollectionTools.removeAllOccurrences(description.getNatureIds(), natureID));
- this.project.setDescription(description, null);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/JptCoreResourceModelTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/JptCoreResourceModelTests.java
deleted file mode 100644
index e77d42f62c..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/JptCoreResourceModelTests.java
+++ /dev/null
@@ -1,36 +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.tests.internal.resource;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.core.tests.internal.resource.java.JptJavaResourceTests;
-
-public class JptCoreResourceModelTests extends TestCase
-{
- public static Test suite() {
- return suite(true);
- }
-
- public static Test suite(boolean all) {
- TestSuite suite = new TestSuite(JptCoreResourceModelTests.class.getName());
- suite.addTest(JptJavaResourceTests.suite(all));
- suite.addTestSuite(OrmModelTests.class);
- suite.addTestSuite(PersistenceModelTests.class);
- return suite;
- }
-
- private JptCoreResourceModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/OrmModelTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/OrmModelTests.java
deleted file mode 100644
index 77749ed809..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/OrmModelTests.java
+++ /dev/null
@@ -1,82 +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.tests.internal.resource;
-
-import junit.framework.TestCase;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jpt.core.internal.resource.orm.OrmResourceModelProvider;
-import org.eclipse.jpt.core.resource.orm.OrmResource;
-import org.eclipse.jpt.core.tests.internal.projects.TestJpaProject;
-
-public class OrmModelTests extends TestCase
-{
- static final String BASE_PROJECT_NAME = OrmModelTests.class.getSimpleName();
-
- TestJpaProject jpaProject;
-
-
- public OrmModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- jpaProject = TestJpaProject.buildJpaProject(BASE_PROJECT_NAME, false); // false = no auto-build
- }
-
- protected void createFile() throws CoreException {
- OrmResourceModelProvider modelProvider =
- OrmResourceModelProvider.getDefaultModelProvider(jpaProject.getProject());
- modelProvider.createResource();
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.jpaProject.getProject().delete(true, true, null);
- jpaProject = null;
- super.tearDown();
- }
-
- public void testModelLoad() {
- OrmResourceModelProvider modelProvider =
- OrmResourceModelProvider.getDefaultModelProvider(jpaProject.getProject());
- assertNotNull(modelProvider);
- OrmResource resource = modelProvider.getResource();
- assertNotNull(resource);
- }
-
- public void testModelLoad2() {
- OrmResourceModelProvider modelProvider =
- OrmResourceModelProvider.getDefaultModelProvider(jpaProject.getProject());
- assertNotNull(modelProvider);
- OrmResource resource = modelProvider.getResource();
- assertNotNull(resource);
- }
-
- public void testModelLoadForDifferentlyNamedOrmXml() {
- OrmResourceModelProvider modelProvider =
- OrmResourceModelProvider.getModelProvider(jpaProject.getProject(), "META-INF/orm2.xml");
- assertNotNull(modelProvider);
- OrmResource resource = modelProvider.getResource();
- assertNotNull(resource);
- }
-
- public void testCreateFile() throws CoreException {
- createFile();
- OrmResourceModelProvider modelProvider =
- OrmResourceModelProvider.getDefaultModelProvider(jpaProject.getProject());
- assertNotNull(modelProvider);
- OrmResource resource = modelProvider.getResource();
- assertNotNull(resource);
- assertTrue(resource.exists());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/PersistenceModelTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/PersistenceModelTests.java
deleted file mode 100644
index 66048a683b..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/PersistenceModelTests.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.core.tests.internal.resource;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.core.internal.resource.persistence.PersistenceResourceModelProvider;
-import org.eclipse.jpt.core.resource.persistence.PersistenceResource;
-import org.eclipse.jpt.core.tests.internal.projects.TestJpaProject;
-
-public class PersistenceModelTests extends TestCase
-{
- static final String BASE_PROJECT_NAME = PersistenceModelTests.class.getSimpleName();
-
- TestJpaProject jpaProject;
-
-
- public PersistenceModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.jpaProject = TestJpaProject.buildJpaProject(BASE_PROJECT_NAME, false); // false = no auto-build
- }
-
- protected void createFile() {
- PersistenceResourceModelProvider modelProvider =
- PersistenceResourceModelProvider.getDefaultModelProvider(jpaProject.getProject());
- modelProvider.modify(new Runnable() {
- public void run() {
-
- }
- });
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.jpaProject.getProject().delete(true, true, null);
- this.jpaProject = null;
- super.tearDown();
- }
-
- public void testModelLoad() {
- PersistenceResourceModelProvider modelProvider =
- PersistenceResourceModelProvider.getDefaultModelProvider(jpaProject.getProject());
- assertNotNull(modelProvider);
- PersistenceResource resource = modelProvider.getResource();
- assertNotNull(resource);
- }
-
- public void testModelLoad2() {
- PersistenceResourceModelProvider modelProvider =
- PersistenceResourceModelProvider.getDefaultModelProvider(jpaProject.getProject());
- assertNotNull(modelProvider);
- PersistenceResource resource = modelProvider.getResource();
- assertNotNull(resource);
- }
-
- public void testCreateFile() {
- createFile();
- PersistenceResourceModelProvider modelProvider =
- PersistenceResourceModelProvider.getDefaultModelProvider(jpaProject.getProject());
- assertNotNull(modelProvider);
- PersistenceResource resource = modelProvider.getResource();
- assertNotNull(resource);
- assertTrue(resource.exists());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AssociationOverrideTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AssociationOverrideTests.java
deleted file mode 100644
index b64f907cc6..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AssociationOverrideTests.java
+++ /dev/null
@@ -1,252 +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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-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.JoinColumnAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class AssociationOverrideTests extends JavaResourceModelTestCase {
-
- private static final String ASSOCIATION_OVERRIDE_NAME = "MY_ASSOCIATION_OVERRIDE";
-
- public AssociationOverrideTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestAssociationOverrideOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideWithJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns={@JoinColumn(name=\"BAR\"), @JoinColumn})");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) attributeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE);
-
- assertNotNull(associationOverride);
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) attributeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE);
-
- assertNotNull(associationOverride);
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
-
- associationOverride.setName("Foo");
- assertEquals("Foo", associationOverride.getName());
- assertSourceContains("@AssociationOverride(name=\"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) attributeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE);
-
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
-
- associationOverride.setName(null);
- assertNull(associationOverride.getName());
-
- assertSourceDoesNotContain("@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\")", cu);
- assertSourceContains("@AssociationOverride", cu);
- }
-
-
- public void testJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) attributeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE);
-
- assertEquals(0, associationOverride.joinColumnsSize());
- }
-
- public void testJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) attributeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE);
-
-
- associationOverride.addJoinColumn(0);
- associationOverride.addJoinColumn(1);
-
- assertEquals(2, associationOverride.joinColumnsSize());
- }
-
- public void testJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) attributeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE);
-
- assertEquals(2, associationOverride.joinColumnsSize());
- }
-
- public void testAddJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) attributeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE);
-
- associationOverride.addJoinColumn(0).setName("FOO");
- associationOverride.addJoinColumn(1);
- associationOverride.addJoinColumn(0).setName("BAR");
-
- assertEquals("BAR", associationOverride.joinColumnAt(0).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(1).getName());
- assertNull(associationOverride.joinColumnAt(2).getName());
-
- assertSourceContains("@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name=\"BAR\"),@JoinColumn(name=\"FOO\"), @JoinColumn})", cu);
- }
-
- public void testRemoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) attributeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE);
- associationOverride.addJoinColumn(0).setName("FOO");
-
- Iterator<JoinColumnAnnotation> joinColumns = associationOverride.joinColumns();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns={@JoinColumn(name=\"FOO\"), @JoinColumn(name=\"BAR\"), @JoinColumn})", cu);
-
- associationOverride.removeJoinColumn(1);
- joinColumns = associationOverride.joinColumns();
- assertEquals("FOO", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns={@JoinColumn(name=\"FOO\"), @JoinColumn})", cu);
-
- associationOverride.removeJoinColumn(0);
- joinColumns = associationOverride.joinColumns();
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns=@JoinColumn)", cu);
-
-
- associationOverride.setName(null);
- associationOverride.removeJoinColumn(0);
- assertSourceDoesNotContain("@AssociationOverride", cu);
- }
-
- public void testMoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) attributeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE);
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- associationOverride.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns={@JoinColumn(name=\"FOO\"), @JoinColumn(name=\"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn})", cu);
-
- associationOverride.moveJoinColumn(2, 0);
- assertEquals("BAR", associationOverride.joinColumnAt(0).getName());
- assertNull(associationOverride.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(2).getName());
- assertEquals(3, associationOverride.joinColumnsSize());
- assertSourceContains("@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns={@JoinColumn(name=\"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn, @JoinColumn(name=\"FOO\")})", cu);
- }
-
- public void testMoveJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) attributeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE);
-
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- associationOverride.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns={@JoinColumn(name=\"FOO\"), @JoinColumn(name=\"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn})", cu);
-
- associationOverride.moveJoinColumn(0, 2);
- assertNull(associationOverride.joinColumnAt(0).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(1).getName());
- assertEquals("BAR", associationOverride.joinColumnAt(2).getName());
- assertEquals(3, associationOverride.joinColumnsSize());
- assertSourceContains("@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns={@JoinColumn, @JoinColumn(name=\"FOO\"), @JoinColumn(name=\"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")})", cu);
- }
-
- public void testSetJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) attributeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE);
-
- assertEquals(2, associationOverride.joinColumnsSize());
-
- JoinColumnAnnotation joinColumn = associationOverride.joinColumns().next();
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns={@JoinColumn(name=\"foo\"), @JoinColumn})", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AssociationOverridesTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AssociationOverridesTests.java
deleted file mode 100644
index 4e44ff3d8f..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AssociationOverridesTests.java
+++ /dev/null
@@ -1,320 +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.tests.internal.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-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.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class AssociationOverridesTests extends JavaResourceModelTestCase {
-
- private static final String ASSOCIATION_OVERRIDE_NAME = "MY_ASSOCIATION_OVERRIDE";
-
- public AssociationOverridesTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestAssociationOverrideOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverrides(@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideWithJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverrides(@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns={@JoinColumn(name=\"BAR\"), @JoinColumn}))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverride() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@AssociationOverride(name=\"FOO\", joinColumns=@JoinColumn(name=\"FOO\", columnDefinition=\"BAR\", referencedColumnName=\"BAZ\"))");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) attributeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDES);
- AssociationOverrideAnnotation associationOverride = associationOverrides.nestedAnnotations().next();
-
- assertNotNull(associationOverride);
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) attributeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDES);
- AssociationOverrideAnnotation associationOverride = associationOverrides.nestedAnnotations().next();
-
- assertNotNull(associationOverride);
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
-
- associationOverride.setName("Foo");
- assertEquals("Foo", associationOverride.getName());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name=\"Foo\"))", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) attributeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDES);
- AssociationOverrideAnnotation associationOverride = associationOverrides.nestedAnnotations().next();
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
-
- associationOverride.setName(null);
- assertNull(associationOverride.getName());
-
- assertSourceDoesNotContain("@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\")", cu);
- assertSourceContains("@AssociationOverride", cu);
- assertSourceContains("@AssociationOverrides", cu);
- }
-
- public void testAddAssociationOverrideCopyExisting() throws Exception {
- ICompilationUnit cu = createTestAssociationOverride();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) typeResource.addSupportingAnnotation(1, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- associationOverride.setName("BAR");
- assertSourceContains("@AssociationOverrides({@AssociationOverride(name=\"FOO\", joinColumns = @JoinColumn(name=\"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\")),@AssociationOverride(name=\"BAR\")})", cu);
-
- assertNull(typeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE));
- assertNotNull(typeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDES));
- assertEquals(2, CollectionTools.size(typeResource.supportingAnnotations(JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES)));
- }
-
- public void testAddAssociationOverrideToBeginningOfList() throws Exception {
- ICompilationUnit cu = createTestAssociationOverride();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) typeResource.addSupportingAnnotation(1, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- associationOverride.setName("BAR");
- assertSourceContains("@AssociationOverrides({@AssociationOverride(name=\"FOO\", joinColumns = @JoinColumn(name=\"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\")),@AssociationOverride(name=\"BAR\")})", cu);
-
- associationOverride = (AssociationOverrideAnnotation) typeResource.addSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- associationOverride.setName("BAZ");
- assertSourceContains("@AssociationOverrides({@AssociationOverride(name=\"BAZ\"),@AssociationOverride(name=\"FOO\", joinColumns = @JoinColumn(name=\"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\")), @AssociationOverride(name=\"BAR\")})", cu);
-
- Iterator<NestableAnnotation> associationOverrides = typeResource.supportingAnnotations(JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- assertEquals("BAZ", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("FOO", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("BAR", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
-
- assertNull(typeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE));
- assertNotNull(typeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDES));
- assertEquals(3, CollectionTools.size(typeResource.supportingAnnotations(JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES)));
- }
-
- public void testRemoveAssociationOverrideCopyExisting() throws Exception {
- ICompilationUnit cu = createTestAssociationOverride();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) typeResource.addSupportingAnnotation(1, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- associationOverride.setName("BAR");
- assertSourceContains("@AssociationOverrides({@AssociationOverride(name=\"FOO\", joinColumns = @JoinColumn(name=\"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\")),@AssociationOverride(name=\"BAR\")})", cu);
-
- typeResource.removeSupportingAnnotation(1, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- assertSourceContains("@AssociationOverride(name=\"FOO\", joinColumns = @JoinColumn(name=\"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\"))", cu);
- }
-
- public void testJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) attributeResource.supportingAnnotations(JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES).next();
-
- assertEquals(0, associationOverride.joinColumnsSize());
- }
-
- public void testJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) attributeResource.supportingAnnotations(JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES).next();
-
- associationOverride.addJoinColumn(0);
- associationOverride.addJoinColumn(1);
-
- assertEquals(2, associationOverride.joinColumnsSize());
- }
-
- public void testJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) attributeResource.supportingAnnotations(JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES).next();
-
- assertEquals(2, associationOverride.joinColumnsSize());
- }
-
- public void testAddJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) attributeResource.supportingAnnotations(JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES).next();
-
- associationOverride.addJoinColumn(0).setName("FOO");
- associationOverride.addJoinColumn(1);
- associationOverride.addJoinColumn(0).setName("BAR");
-
-
- Iterator<JoinColumnAnnotation> joinColumns = associationOverride.joinColumns();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
-
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name=\"BAR\"),@JoinColumn(name=\"FOO\"), @JoinColumn}))", cu);
- }
-
- public void testRemoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) attributeResource.supportingAnnotations(JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES).next();
- associationOverride.addJoinColumn(0).setName("FOO");
-
- Iterator<JoinColumnAnnotation> joinColumns = associationOverride.joinColumns();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns={@JoinColumn(name=\"FOO\"), @JoinColumn(name=\"BAR\"), @JoinColumn}))", cu);
-
- associationOverride.removeJoinColumn(1);
- joinColumns = associationOverride.joinColumns();
- assertEquals("FOO", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns={@JoinColumn(name=\"FOO\"), @JoinColumn}))", cu);
-
- associationOverride.removeJoinColumn(0);
- joinColumns = associationOverride.joinColumns();
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns=@JoinColumn))", cu);
-
-
- associationOverride.setName(null);
- associationOverride.removeJoinColumn(0);
- assertSourceDoesNotContain("@AssociationOverride", cu);
- }
-
- public void testMoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) attributeResource.supportingAnnotations(JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES).next();
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- associationOverride.addJoinColumn(0).setName("FOO");
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns={@JoinColumn(name=\"FOO\"), @JoinColumn(name=\"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn}))", cu);
-
- associationOverride.moveJoinColumn(2, 0);
- assertEquals("BAR", associationOverride.joinColumnAt(0).getName());
- assertNull(associationOverride.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(2).getName());
- assertEquals(3, associationOverride.joinColumnsSize());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns={@JoinColumn(name=\"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn, @JoinColumn(name=\"FOO\")}))", cu);
- }
-
- public void testMoveJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) attributeResource.supportingAnnotations(JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES).next();
-
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- associationOverride.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns={@JoinColumn(name=\"FOO\"), @JoinColumn(name=\"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn}))", cu);
- associationOverride.moveJoinColumn(0, 2);
- assertNull(associationOverride.joinColumnAt(0).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(1).getName());
- assertEquals("BAR", associationOverride.joinColumnAt(2).getName());
- assertEquals(3, associationOverride.joinColumnsSize());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns={@JoinColumn, @JoinColumn(name=\"FOO\"), @JoinColumn(name=\"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")}))", cu);
- }
-
- public void testSetJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) attributeResource.supportingAnnotations(JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES).next();
-
- assertEquals(2, associationOverride.joinColumnsSize());
-
- JoinColumnAnnotation joinColumn = associationOverride.joinColumns().next();
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns={@JoinColumn(name=\"foo\"), @JoinColumn}))", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AttributeOverrideTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AttributeOverrideTests.java
deleted file mode 100644
index 67246b4ad3..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AttributeOverrideTests.java
+++ /dev/null
@@ -1,149 +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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-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.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class AttributeOverrideTests extends JavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String ATTRIBUTE_OVERRIDE_NAME = "MY_ATTRIBUTE_OVERRIDE";
-
- public AttributeOverrideTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestAttributeOverrideOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ATTRIBUTE_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestAttributeOverrideWithColumnOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ATTRIBUTE_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\", column = @Column(name=\"" + COLUMN_NAME + "\"))");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE);
-
- assertNotNull(attributeOverride);
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, attributeOverride.getName());
- }
-
- public void testGetNullColumn() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE);
- ColumnAnnotation column = attributeOverride.getColumn();
- assertNotNull(attributeOverride);
- assertNull(column);
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE);
-
- assertNotNull(attributeOverride);
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, attributeOverride.getName());
-
- attributeOverride.setName("Foo");
- assertEquals("Foo", attributeOverride.getName());
- assertSourceContains("@AttributeOverride(name=\"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE);
-
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, attributeOverride.getName());
-
- attributeOverride.setName(null);
- assertNull(attributeOverride.getName());
-
- assertSourceDoesNotContain("@AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\")", cu);
- assertSourceContains("@AttributeOverride", cu);
- }
-
- public void testColumnGetName() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideWithColumnOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE);
- ColumnAnnotation column = attributeOverride.getColumn();
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testColumnSetName() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideWithColumnOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE);
- ColumnAnnotation column = attributeOverride.getColumn();
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName("Foo");
-
- assertSourceContains("@AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\", column = @Column(name=\"Foo\"))", cu);
-
- column.setName(null);
- assertNull(attributeOverride.getColumn());
- assertSourceContains("@AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\")", cu);
- }
-
- public void testAddColumn() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE);
- ColumnAnnotation column = attributeOverride.getColumn();
- assertNull(column);
- }
-
- public void testRemoveColumn() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE);
- ColumnAnnotation column = attributeOverride.getColumn();
- assertNull(column);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AttributeOverridesTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AttributeOverridesTests.java
deleted file mode 100644
index 1cd63a6107..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AttributeOverridesTests.java
+++ /dev/null
@@ -1,272 +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.tests.internal.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.AttributeOverridesAnnotation;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-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.NestableAnnotation;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class AttributeOverridesTests extends JavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String ATTRIBUTE_OVERRIDE_NAME = "MY_ATTRIBUTE_OVERRIDE";
-
- public AttributeOverridesTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestAttributeOverrideOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES, JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AttributeOverrides(@AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestAttributeOverrideWithColumnOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES, JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AttributeOverrides(@AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\", column = @Column(name=\"" + COLUMN_NAME + "\")))");
- }
- });
- }
-
- private ICompilationUnit createTestAttributeOverride() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ATTRIBUTE_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@AttributeOverride(name=\"FOO\", column=@Column(name=\"FOO\", columnDefinition=\"BAR\", table=\"BAZ\", unique=false, nullable=false, insertable=false, updatable=false, length=1, precision=1, scale=1))");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- AttributeOverridesAnnotation attributeOverrides = (AttributeOverridesAnnotation) attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDES);
- AttributeOverrideAnnotation attributeOverride = attributeOverrides.nestedAnnotations().next();
-
- assertNotNull(attributeOverride);
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, attributeOverride.getName());
- }
-
- public void testGetNullColumn() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- AttributeOverridesAnnotation attributeOverrides = (AttributeOverridesAnnotation) attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDES);
- AttributeOverrideAnnotation attributeOverride = attributeOverrides.nestedAnnotations().next();
- ColumnAnnotation column = attributeOverride.getColumn();
- assertNotNull(attributeOverride);
- assertNull(column);
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- AttributeOverridesAnnotation attributeOverrides = (AttributeOverridesAnnotation) attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDES);
- AttributeOverrideAnnotation attributeOverride = attributeOverrides.nestedAnnotations().next();
-
- assertNotNull(attributeOverride);
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, attributeOverride.getName());
-
- attributeOverride.setName("Foo");
- assertEquals("Foo", attributeOverride.getName());
- assertSourceContains("@AttributeOverrides(@AttributeOverride(name=\"Foo\"))", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- AttributeOverridesAnnotation attributeOverrides = (AttributeOverridesAnnotation) attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDES);
- AttributeOverrideAnnotation attributeOverride = attributeOverrides.nestedAnnotations().next();
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, attributeOverride.getName());
-
- attributeOverride.setName(null);
- assertNull(attributeOverride.getName());
-
- assertSourceDoesNotContain("@AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\")", cu);
- assertSourceContains("@AttributeOverride", cu);
- assertSourceContains("@AttributeOverrides", cu);
- }
-
- public void testColumnGetName() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideWithColumnOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- AttributeOverridesAnnotation attributeOverrides = (AttributeOverridesAnnotation) attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDES);
- AttributeOverrideAnnotation attributeOverride = attributeOverrides.nestedAnnotations().next();
-
- ColumnAnnotation column = attributeOverride.getColumn();
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testColumnSetName() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideWithColumnOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.supportingAnnotations(JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES).next();
-
- ColumnAnnotation column = attributeOverride.getColumn();
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName("Foo");
-
- assertSourceContains("@AttributeOverrides(@AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\", column = @Column(name=\"Foo\")))", cu);
-
- column.setName(null);
- assertNull(attributeOverride.getColumn());
- assertSourceContains("@AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\")", cu);
- }
-
- public void testAddAttributeOverrideCopyExisting() throws Exception {
- ICompilationUnit cu = createTestAttributeOverride();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) typeResource.addSupportingAnnotation(1, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAR");
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"FOO\", column = @Column(name=\"FOO\", columnDefinition = \"BAR\", table = \"BAZ\", unique = false, nullable = false, insertable = false, updatable = false, length = 1, precision = 1, scale = 1)),@AttributeOverride(name=\"BAR\")})", cu);
-
- assertNull(typeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE));
- assertNotNull(typeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDES));
- assertEquals(2, CollectionTools.size(typeResource.supportingAnnotations(JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES)));
- }
-
- public void testAddAttributeOverrideToBeginningOfList() throws Exception {
- ICompilationUnit cu = createTestAttributeOverride();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) typeResource.addSupportingAnnotation(1, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAR");
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"FOO\", column = @Column(name=\"FOO\", columnDefinition = \"BAR\", table = \"BAZ\", unique = false, nullable = false, insertable = false, updatable = false, length = 1, precision = 1, scale = 1)),@AttributeOverride(name=\"BAR\")})", cu);
-
- attributeOverride = (AttributeOverrideAnnotation) typeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAZ");
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"BAZ\"),@AttributeOverride(name=\"FOO\", column = @Column(name=\"FOO\", columnDefinition = \"BAR\", table = \"BAZ\", unique = false, nullable = false, insertable = false, updatable = false, length = 1, precision = 1, scale = 1)), @AttributeOverride(name=\"BAR\")})", cu);
-
- Iterator<NestableAnnotation> attributeOverrides = typeResource.supportingAnnotations(JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- assertEquals("BAZ", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("FOO", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("BAR", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
-
- assertNull(typeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE));
- assertNotNull(typeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDES));
- assertEquals(3, CollectionTools.size(typeResource.supportingAnnotations(JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES)));
- }
-
- public void testRemoveAttributeOverrideCopyExisting() throws Exception {
- ICompilationUnit cu = createTestAttributeOverride();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) typeResource.addSupportingAnnotation(1, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAR");
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"FOO\", column = @Column(name=\"FOO\", columnDefinition = \"BAR\", table = \"BAZ\", unique = false, nullable = false, insertable = false, updatable = false, length = 1, precision = 1, scale = 1)),@AttributeOverride(name=\"BAR\")})", cu);
-
- typeResource.removeSupportingAnnotation(1, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- assertSourceContains("@AttributeOverride(name=\"FOO\", column = @Column(name=\"FOO\", columnDefinition = \"BAR\", table = \"BAZ\", unique = false, nullable = false, insertable = false, updatable = false, length = 1, precision = 1, scale = 1))", cu);
- }
- //not sure i want to test this api, how can we keep ContainerAnnotation.add, move, remove from being public?
- //users should go throught AbstractJavapersistenceResource. this gets confusing because you would handle it differently
- //for non top-level annotations
-// public void testAdd() throws Exception {
-// ICompilationUnit cu = this.createTestType();
-// JavaPersistentTypeResource typeResource = buildJavaTypeResource(cu);
-// JavaPersistentAttributeResource attributeResource = typeResource.fields().next();
-// AttributeOverrides attributeOverrides = (AttributeOverrides) attributeResource.annotation(JPA.ATTRIBUTE_OVERRIDES);
-// assertNull(attributeOverrides);
-//
-// attributeResource.addAnnotation(JPA.ATTRIBUTE_OVERRIDES);
-// attributeOverrides = (AttributeOverrides) attributeResource.annotation(JPA.ATTRIBUTE_OVERRIDES);
-// assertNotNull(attributeOverrides);
-//
-// assertSourceContains("@AttributeOverrides");
-//
-// AttributeOverride fooAttributeOverride = attributeOverrides.add(0);
-// fooAttributeOverride.setName("Foo");
-//
-// assertSourceContains("@AttributeOverrides(@AttributeOverride(name=\"Foo\"))");
-//
-// AttributeOverride barAttributeOverride = attributeOverrides.add(0);
-// barAttributeOverride.setName("Bar");
-//
-// assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"Bar\"), @AttributeOverride(name=\"Foo\")})");
-//
-// }
-//
-// public void testMove() throws Exception {
-// ICompilationUnit cu = this.createTestAttributeOverrideWithColumnOnField();
-// JavaPersistentTypeResource typeResource = buildJavaTypeResource(cu);
-// JavaPersistentAttributeResource attributeResource = typeResource.fields().next();
-// AttributeOverrides attributeOverrides = (AttributeOverrides) attributeResource.annotation(JPA.ATTRIBUTE_OVERRIDES);
-//
-// AttributeOverride fooAttributeOverride = attributeOverrides.add(1);
-// fooAttributeOverride.setName("Foo");
-//
-// assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\"), @AttributeOverride(name=\"Foo\")})");
-//
-// attributeOverrides.move(0, 1);
-//
-// assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"Foo\"), @AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\")})");
-// }
-//
-// public void testRemove() throws Exception {
-// ICompilationUnit cu = this.createTestAttributeOverrideWithColumnOnField();
-// JavaPersistentTypeResource typeResource = buildJavaTypeResource(cu);
-// JavaPersistentAttributeResource attributeResource = typeResource.fields().next();
-// AttributeOverrides attributeOverrides = (AttributeOverrides) attributeResource.annotation(JPA.ATTRIBUTE_OVERRIDES);
-//
-// AttributeOverride fooAttributeOverride = attributeOverrides.add(1);
-// fooAttributeOverride.setName("Foo");
-//
-// assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\"), @AttributeOverride(name=\"Foo\")})");
-//
-// attributeOverrides.remove(0);
-//
-// assertSourceContains("@AttributeOverrides(@AttributeOverride(name=\"Foo\"))");
-//
-// attributeOverrides.remove(0);
-//
-// assertSourceContains("@AttributeOverrides()");
-//
-// }
-
-
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/BasicTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/BasicTests.java
deleted file mode 100644
index 7466cedd90..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/BasicTests.java
+++ /dev/null
@@ -1,150 +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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-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.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class BasicTests extends JavaResourceModelTestCase {
-
- public BasicTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestBasic() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.BASIC);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic");
- }
- });
- }
-
- private ICompilationUnit createTestBasicWithOptional() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.BASIC);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic(optional=true)");
- }
- });
- }
-
- private ICompilationUnit createTestBasicWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.BASIC, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic(fetch=FetchType.EAGER)");
- }
- });
- }
-
- public void testBasic() throws Exception {
- ICompilationUnit cu = this.createTestBasic();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- BasicAnnotation basic = (BasicAnnotation) attributeResource.getMappingAnnotation(JPA.BASIC);
- assertNotNull(basic);
- }
-
- public void testGetOptional() throws Exception {
- ICompilationUnit cu = this.createTestBasicWithOptional();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- BasicAnnotation basic = (BasicAnnotation) attributeResource.getMappingAnnotation(JPA.BASIC);
- assertTrue(basic.getOptional());
- }
-
- public void testSetOptional() throws Exception {
- ICompilationUnit cu = this.createTestBasicWithOptional();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- BasicAnnotation basic = (BasicAnnotation) attributeResource.getMappingAnnotation(JPA.BASIC);
- assertTrue(basic.getOptional());
-
- basic.setOptional(false);
- assertFalse(basic.getOptional());
-
- assertSourceContains("@Basic(optional=false)", cu);
- }
-
- public void testSetOptionalNull() throws Exception {
- ICompilationUnit cu = this.createTestBasicWithOptional();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- BasicAnnotation basic = (BasicAnnotation) attributeResource.getMappingAnnotation(JPA.BASIC);
- assertTrue(basic.getOptional());
-
- basic.setOptional(null);
- assertNull(basic.getOptional());
-
- assertSourceContains("@Basic", cu);
- assertSourceDoesNotContain("optional", cu);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestBasicWithFetch();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- BasicAnnotation basic = (BasicAnnotation) attributeResource.getMappingAnnotation(JPA.BASIC);
- assertEquals(FetchType.EAGER, basic.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestBasicWithFetch();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- BasicAnnotation basic = (BasicAnnotation) attributeResource.getMappingAnnotation(JPA.BASIC);
- assertEquals(FetchType.EAGER, basic.getFetch());
-
- basic.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, basic.getFetch());
-
- assertSourceContains("@Basic(fetch=LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestBasicWithFetch();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- BasicAnnotation basic = (BasicAnnotation) attributeResource.getMappingAnnotation(JPA.BASIC);
- assertEquals(FetchType.EAGER, basic.getFetch());
-
- basic.setFetch(null);
- assertNull(basic.getFetch());
-
- assertSourceContains("@Basic", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ColumnTests.java
deleted file mode 100644
index ebb20fb54d..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ColumnTests.java
+++ /dev/null
@@ -1,403 +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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-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.utility.internal.iterators.ArrayIterator;
-
-public class ColumnTests extends JavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_TABLE = "MY_TABLE";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
-
- public ColumnTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column(name=\"" + COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column(table=\"" + COLUMN_TABLE + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column(columnDefinition=\"" + COLUMN_COLUMN_DEFINITION + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column(" + booleanElement + "=true)");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithIntElement(final String intElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column(" + intElement + "=5)");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getNullable());
- assertNull(column.getInsertable());
- assertNull(column.getUnique());
- assertNull(column.getUpdatable());
- assertNull(column.getTable());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@Column(name=\"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("@Column", cu);
- }
-
- public void testGetTable() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
- assertEquals(COLUMN_TABLE, column.getTable());
- }
-
- public void testSetTable() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getTable());
-
- column.setTable("Foo");
- assertEquals("Foo", column.getTable());
-
- assertSourceContains("@Column(table=\"Foo\")", cu);
-
-
- column.setTable(null);
- assertSourceDoesNotContain("@Column", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithColumnDefinition();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@Column(columnDefinition=\"Foo\")", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("@Column", cu);
- }
-
- public void testGetUnique() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithBooleanElement("unique");
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertEquals(Boolean.TRUE, column.getUnique());
- }
-
- public void testSetUnique() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getUnique());
-
- column.setUnique(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getUnique());
-
- assertSourceContains("@Column(unique=false)", cu);
-
- column.setUnique(null);
- assertSourceDoesNotContain("@Column", cu);
- }
-
- public void testGetNullable() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithBooleanElement("nullable");
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertEquals(Boolean.TRUE, column.getNullable());
- }
-
- public void testSetNullable() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getNullable());
-
- column.setNullable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getNullable());
-
- assertSourceContains("@Column(nullable=false)", cu);
-
- column.setNullable(null);
- assertSourceDoesNotContain("@Column", cu);
- }
-
- public void testGetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithBooleanElement("insertable");
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertEquals(Boolean.TRUE, column.getInsertable());
- }
-
- public void testSetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getInsertable());
-
- column.setInsertable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getInsertable());
-
- assertSourceContains("@Column(insertable=false)", cu);
-
- column.setInsertable(null);
- assertSourceDoesNotContain("@Column", cu);
- }
-
- public void testGetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithBooleanElement("updatable");
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertEquals(Boolean.TRUE, column.getUpdatable());
- }
-
- public void testSetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getUpdatable());
-
- column.setUpdatable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getUpdatable());
-
- assertSourceContains("@Column(updatable=false)", cu);
-
- column.setUpdatable(null);
- assertSourceDoesNotContain("@Column", cu);
- }
-
- public void testGetLength() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithIntElement("length");
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertEquals(Integer.valueOf(5), column.getLength());
- }
-
- public void testSetLength() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getLength());
-
- column.setLength(Integer.valueOf(5));
- assertEquals(Integer.valueOf(5), column.getLength());
-
- assertSourceContains("@Column(length=5)", cu);
-
- column.setLength(null);
- assertSourceDoesNotContain("@Column", cu);
- }
-
- public void testGetPrecision() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithIntElement("precision");
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertEquals(Integer.valueOf(5), column.getPrecision());
- }
-
- public void testSetPrecision() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertEquals(null, column.getPrecision());
-
- column.setPrecision(Integer.valueOf(5));
- assertEquals(Integer.valueOf(5), column.getPrecision());
-
- assertSourceContains("@Column(precision=5)", cu);
-
- column.setPrecision(null);
- assertSourceDoesNotContain("@Column", cu);
- }
-
- public void testGetScale() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithIntElement("scale");
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertEquals(Integer.valueOf(5), column.getScale());
- }
-
- public void testSetScale() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getScale());
-
- column.setScale(Integer.valueOf(5));
- assertEquals(Integer.valueOf(5), column.getScale());
-
- assertSourceContains("@Column(scale=5)", cu);
-
- column.setScale(null);
- assertSourceDoesNotContain("@Column", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/DiscriminatorColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/DiscriminatorColumnTests.java
deleted file mode 100644
index ed0f56f01f..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/DiscriminatorColumnTests.java
+++ /dev/null
@@ -1,211 +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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-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.utility.internal.iterators.ArrayIterator;
-
-public class DiscriminatorColumnTests extends JavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
-
- public DiscriminatorColumnTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestDiscriminatorColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@DiscriminatorColumn");
- }
- });
- }
-
- private ICompilationUnit createTestDiscriminatorColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@DiscriminatorColumn(name=\"" + COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestDiscriminatorColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@DiscriminatorColumn(columnDefinition=\"" + COLUMN_COLUMN_DEFINITION + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestDiscriminatorColumnWithDiscriminatorType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.DISCRIMINATOR_COLUMN, JPA.DISCRIMINATOR_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@DiscriminatorColumn(discriminatorType=DiscriminatorType.CHAR)");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithIntElement(final String intElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@DiscriminatorColumn(" + intElement + "=5)");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumnWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN);
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getDiscriminatorType());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@DiscriminatorColumn(name=\"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumnWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("@DiscriminatorColumn", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumnWithColumnDefinition();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@DiscriminatorColumn(columnDefinition=\"Foo\")", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("@DiscriminatorColumn", cu);
- }
-
- public void testGetLength() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithIntElement("length");
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertEquals(Integer.valueOf(5), column.getLength());
- }
-
- public void testSetLength() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getLength());
-
- column.setLength(Integer.valueOf(5));
- assertEquals(Integer.valueOf(5), column.getLength());
-
- assertSourceContains("@DiscriminatorColumn(length=5)", cu);
-
- column.setLength(null);
- assertSourceDoesNotContain("@DiscriminatorColumn", cu);
- }
-
- public void testGetDiscriminatorType() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumnWithDiscriminatorType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN);
- assertEquals(DiscriminatorType.CHAR, column.getDiscriminatorType());
- }
-
- public void testSetDiscriminatorType() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertNull(column.getDiscriminatorType());
-
- column.setDiscriminatorType(DiscriminatorType.INTEGER);
- assertEquals(DiscriminatorType.INTEGER, column.getDiscriminatorType());
-
- assertSourceContains("@DiscriminatorColumn(discriminatorType=INTEGER)", cu);
-
- column.setDiscriminatorType(null);
- assertSourceDoesNotContain("@DiscriminatorColumn", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/DiscriminatorValueTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/DiscriminatorValueTests.java
deleted file mode 100644
index 007fb692dc..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/DiscriminatorValueTests.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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-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.utility.internal.iterators.ArrayIterator;
-
-public class DiscriminatorValueTests extends JavaResourceModelTestCase {
-
- public DiscriminatorValueTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestDiscriminatorValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.DISCRIMINATOR_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@DiscriminatorValue");
- }
- });
- }
-
- private ICompilationUnit createTestDiscriminatorValueWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.DISCRIMINATOR_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@DiscriminatorValue(value=\"discriminator\")");
- }
- });
- }
-
- public void testDiscriminatorValue() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- DiscriminatorValueAnnotation discriminatorValue = (DiscriminatorValueAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_VALUE);
- assertNotNull(discriminatorValue);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorValueWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- DiscriminatorValueAnnotation discriminatorValue = (DiscriminatorValueAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_VALUE);
- assertEquals("discriminator", discriminatorValue.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- DiscriminatorValueAnnotation discriminatorValue = (DiscriminatorValueAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_VALUE);
-
- discriminatorValue.setValue("foo");
-
- assertSourceContains("@DiscriminatorValue(\"foo\")", cu);
-
- discriminatorValue.setValue(null);
-
- assertSourceDoesNotContain("@DiscriminatorValue", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddableTests.java
deleted file mode 100644
index c3b08cf132..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddableTests.java
+++ /dev/null
@@ -1,73 +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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class EmbeddableTests extends JavaResourceModelTestCase {
-
- public EmbeddableTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEmbeddable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Embeddable");
- }
- });
- }
-
- private ICompilationUnit createTestEmbeddableAndEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE, JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append("@Embeddable");
- }
- });
- }
-
- public void testEmbeddable() throws Exception {
- ICompilationUnit cu = this.createTestEmbeddable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- JavaResourceNode mappingAnnotation = typeResource.getMappingAnnotation();
- assertTrue(mappingAnnotation instanceof EmbeddableAnnotation);
- }
-
- public void testEmbeddableAndEntity() throws Exception {
- ICompilationUnit cu = this.createTestEmbeddableAndEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- JavaResourceNode mappingAnnotation = typeResource.getMappingAnnotation();
- assertTrue(mappingAnnotation instanceof EmbeddableAnnotation);
-
- EntityAnnotation entity = (EntityAnnotation) typeResource.getMappingAnnotation(JPA.ENTITY);
- assertNotNull(entity);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddedIdTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddedIdTests.java
deleted file mode 100644
index 82dfa43ab2..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddedIdTests.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.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.EmbeddedIdAnnotation;
-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.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class EmbeddedIdTests extends JavaResourceModelTestCase {
-
- public EmbeddedIdTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEmbeddedId() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDED_ID);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@EmbeddedId");
- }
- });
- }
-
- public void testEmbeddedId() throws Exception {
- ICompilationUnit cu = this.createTestEmbeddedId();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JavaResourceNode mappingAnnotation = attributeResource.getMappingAnnotation();
- assertTrue(mappingAnnotation instanceof EmbeddedIdAnnotation);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddedTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddedTests.java
deleted file mode 100644
index b85694061f..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddedTests.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.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.EmbeddedAnnotation;
-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.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class EmbeddedTests extends JavaResourceModelTestCase {
-
- public EmbeddedTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEmbedded() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDED);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Embedded");
- }
- });
- }
-
- public void testEmbedded() throws Exception {
- ICompilationUnit cu = this.createTestEmbedded();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JavaResourceNode mappingAnnotation = attributeResource.getMappingAnnotation();
- assertTrue(mappingAnnotation instanceof EmbeddedAnnotation);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EntityTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EntityTests.java
deleted file mode 100644
index e66d4e0799..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EntityTests.java
+++ /dev/null
@@ -1,124 +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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.MappedSuperclassAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class EntityTests extends JavaResourceModelTestCase {
-
- private static final String ENTITY_NAME = "Foo";
-
- public EntityTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity(name=\"" + ENTITY_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassAndEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- sb.append("@Entity");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EntityAnnotation entity = (EntityAnnotation) typeResource.getMappingAnnotation(JPA.ENTITY);
- assertTrue(entity != null);
- assertEquals(ENTITY_NAME, entity.getName());
- }
-
- public void testGetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EntityAnnotation entity = (EntityAnnotation) typeResource.getMappingAnnotation(JPA.ENTITY);
- assertTrue(entity != null);
- assertNull(entity.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EntityAnnotation entity = (EntityAnnotation) typeResource.getMappingAnnotation(JPA.ENTITY);
- assertNull(entity.getName());
- entity.setName("Foo");
- assertEquals("Foo", entity.getName());
-
- assertSourceContains("@Entity(name=\"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EntityAnnotation entity = (EntityAnnotation) typeResource.getMappingAnnotation(JPA.ENTITY);
- assertEquals(ENTITY_NAME, entity.getName());
-
- entity.setName(null);
- assertNull(entity.getName());
-
- assertSourceContains("@Entity", cu);
- assertSourceDoesNotContain("@Entity(name=\"Foo\")", cu);
- }
-
- public void testMappedSuperclassAndEntity() throws Exception {
- ICompilationUnit cu = this.createTestMappedSuperclassAndEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- JavaResourceNode mappingAnnotation = typeResource.getMappingAnnotation();
- assertTrue(mappingAnnotation instanceof EntityAnnotation);
-
- MappedSuperclassAnnotation mappedSuperclass = (MappedSuperclassAnnotation) typeResource.getMappingAnnotation(JPA.MAPPED_SUPERCLASS);
- assertNotNull(mappedSuperclass);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EnumeratedTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EnumeratedTests.java
deleted file mode 100644
index 64ba2af0a9..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EnumeratedTests.java
+++ /dev/null
@@ -1,88 +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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.EnumType;
-import org.eclipse.jpt.core.resource.java.EnumeratedAnnotation;
-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.utility.internal.iterators.ArrayIterator;
-
-public class EnumeratedTests extends JavaResourceModelTestCase {
-
- public EnumeratedTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEnumerated() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENUMERATED);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Enumerated");
- }
- });
- }
-
- private ICompilationUnit createTestEnumeratedWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENUMERATED, JPA.ENUM_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Enumerated(EnumType.ORDINAL)");
- }
- });
- }
-
- public void testEnumerated() throws Exception {
- ICompilationUnit cu = this.createTestEnumerated();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EnumeratedAnnotation enumerated = (EnumeratedAnnotation) attributeResource.getSupportingAnnotation(JPA.ENUMERATED);
- assertNotNull(enumerated);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestEnumeratedWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EnumeratedAnnotation enumerated = (EnumeratedAnnotation) attributeResource.getSupportingAnnotation(JPA.ENUMERATED);
- assertEquals(EnumType.ORDINAL, enumerated.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestEnumerated();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EnumeratedAnnotation enumerated = (EnumeratedAnnotation) attributeResource.getSupportingAnnotation(JPA.ENUMERATED);
-
- enumerated.setValue(EnumType.STRING);
-
- assertSourceContains("@Enumerated(STRING)", cu);
-
- enumerated.setValue(null);
-
- assertSourceDoesNotContain("@Enumerated(", cu);
- assertSourceContains("@Enumerated", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/GeneratedValueTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/GeneratedValueTests.java
deleted file mode 100644
index bf5cbc1b96..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/GeneratedValueTests.java
+++ /dev/null
@@ -1,132 +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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-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.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class GeneratedValueTests extends JavaResourceModelTestCase {
-
- private static final String GENERATOR = "MY_GENERATOR";
- public GeneratedValueTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestGeneratedValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.GENERATED_VALUE, JPA.GENERATION_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@GeneratedValue");
- }
- });
- }
-
- private ICompilationUnit createTestGeneratedValueWithGenerator() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.GENERATED_VALUE, JPA.GENERATION_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@GeneratedValue(generator=\"" + GENERATOR + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestGeneratedValueWithStrategy() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.GENERATED_VALUE, JPA.GENERATION_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@GeneratedValue(strategy=GenerationType.SEQUENCE)");
- }
- });
- }
-
- public void testGeneratedValue() throws Exception {
- ICompilationUnit cu = this.createTestGeneratedValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) attributeResource.getSupportingAnnotation(JPA.GENERATED_VALUE);
- assertNotNull(generatedValue);
- }
-
- public void testGetGenerator() throws Exception {
- ICompilationUnit cu = this.createTestGeneratedValueWithGenerator();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) attributeResource.getSupportingAnnotation(JPA.GENERATED_VALUE);
- assertEquals(GENERATOR, generatedValue.getGenerator());
- }
-
- public void testSetGenerator() throws Exception {
- ICompilationUnit cu = this.createTestGeneratedValueWithGenerator();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) attributeResource.getSupportingAnnotation(JPA.GENERATED_VALUE);
- assertEquals(GENERATOR, generatedValue.getGenerator());
-
- generatedValue.setGenerator("foo");
- assertEquals("foo", generatedValue.getGenerator());
-
- assertSourceContains("@GeneratedValue(generator=\"foo\")", cu);
-
- generatedValue.setGenerator(null);
- assertNull(generatedValue.getGenerator());
-
- assertSourceDoesNotContain("generator", cu);
- assertSourceContains("@GeneratedValue", cu);
- }
-
- public void testGetStrategy() throws Exception {
- ICompilationUnit cu = this.createTestGeneratedValueWithStrategy();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) attributeResource.getSupportingAnnotation(JPA.GENERATED_VALUE);
- assertEquals(GenerationType.SEQUENCE, generatedValue.getStrategy());
- }
-
- public void testSetStrategy() throws Exception {
- ICompilationUnit cu = this.createTestGeneratedValueWithStrategy();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) attributeResource.getSupportingAnnotation(JPA.GENERATED_VALUE);
- assertEquals(GenerationType.SEQUENCE, generatedValue.getStrategy());
-
- generatedValue.setStrategy(GenerationType.TABLE);
- assertEquals(GenerationType.TABLE, generatedValue.getStrategy());
-
- assertSourceContains("@GeneratedValue(strategy=TABLE)", cu);
-
- generatedValue.setStrategy(null);
- assertNull(generatedValue.getStrategy());
- assertSourceDoesNotContain("strategy", cu);
- assertSourceContains("@GeneratedValue", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/IdClassTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/IdClassTests.java
deleted file mode 100644
index b9389bba52..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/IdClassTests.java
+++ /dev/null
@@ -1,105 +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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-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.utility.internal.iterators.ArrayIterator;
-
-public class IdClassTests extends JavaResourceModelTestCase {
-
- private static final String ID_CLASS_VALUE = "MyClass";
-
- public IdClassTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestIdClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ID_CLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@IdClass");
- }
- });
- }
-
- private ICompilationUnit createTestIdClassWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ID_CLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@IdClass(" + ID_CLASS_VALUE + ".class)");
- }
- });
- }
-
- public void testIdClass() throws Exception {
- ICompilationUnit cu = this.createTestIdClass();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- IdClassAnnotation idClass = (IdClassAnnotation) typeResource.getSupportingAnnotation(JPA.ID_CLASS);
- assertNotNull(idClass);
- assertNull(idClass.getValue());
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestIdClassWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- IdClassAnnotation idClass = (IdClassAnnotation) typeResource.getSupportingAnnotation(JPA.ID_CLASS);
- assertEquals(ID_CLASS_VALUE, idClass.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestIdClassWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- IdClassAnnotation idClass = (IdClassAnnotation) typeResource.getSupportingAnnotation(JPA.ID_CLASS);
- assertEquals(ID_CLASS_VALUE, idClass.getValue());
-
- idClass.setValue("foo");
- assertEquals("foo", idClass.getValue());
-
- assertSourceContains("@IdClass(foo.class)", cu);
-
- idClass.setValue(null);
-
- assertSourceDoesNotContain("@IdClass", cu);
-
- idClass = (IdClassAnnotation) typeResource.getSupportingAnnotation(JPA.ID_CLASS);
- assertNull(idClass);
- }
-
- public void testGetFullyQualifiedClass() throws Exception {
- ICompilationUnit cu = this.createTestIdClassWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- IdClassAnnotation idClass = (IdClassAnnotation) typeResource.getSupportingAnnotation(JPA.ID_CLASS);
- assertNotNull(idClass.getValue());
- assertEquals("MyClass", idClass.getFullyQualifiedClass()); //bug 196200 changed this
-
-
- idClass.setValue(TYPE_NAME);
-
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, idClass.getFullyQualifiedClass());
- assertSourceContains("@IdClass(" + TYPE_NAME + ".class)", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/IdTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/IdTests.java
deleted file mode 100644
index 6f72af1f62..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/IdTests.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.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.IdAnnotation;
-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.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class IdTests extends JavaResourceModelTestCase {
-
- public IdTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestId() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ID);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- public void testId() throws Exception {
- ICompilationUnit cu = this.createTestId();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JavaResourceNode mappingAnnotation = attributeResource.getMappingAnnotation();
- assertTrue(mappingAnnotation instanceof IdAnnotation);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/InheritanceTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/InheritanceTests.java
deleted file mode 100644
index 21c3acafe8..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/InheritanceTests.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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-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.utility.internal.iterators.ArrayIterator;
-
-public class InheritanceTests extends JavaResourceModelTestCase {
-
- public InheritanceTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestInheritance() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.INHERITANCE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Inheritance");
- }
- });
- }
-
- private ICompilationUnit createTestInheritanceWithStrategy() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.INHERITANCE, JPA.INHERITANCE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Inheritance(strategy=InheritanceType.JOINED)");
- }
- });
- }
-
- public void testInheritance() throws Exception {
- ICompilationUnit cu = this.createTestInheritance();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- InheritanceAnnotation inheritance = (InheritanceAnnotation) typeResource.getSupportingAnnotation(JPA.INHERITANCE);
- assertNotNull(inheritance);
- }
-
- public void testGetStrategy() throws Exception {
- ICompilationUnit cu = this.createTestInheritanceWithStrategy();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- InheritanceAnnotation inheritance = (InheritanceAnnotation) typeResource.getSupportingAnnotation(JPA.INHERITANCE);
- assertEquals(InheritanceType.JOINED, inheritance.getStrategy());
- }
-
- public void testSetStrategy() throws Exception {
- ICompilationUnit cu = this.createTestInheritance();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- InheritanceAnnotation inheritance = (InheritanceAnnotation) typeResource.getSupportingAnnotation(JPA.INHERITANCE);
- inheritance.setStrategy(InheritanceType.TABLE_PER_CLASS);
-
- assertSourceContains("@Inheritance(strategy=TABLE_PER_CLASS)", cu);
-
- inheritance.setStrategy(null);
-
- assertSourceDoesNotContain("@Inheritance", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JPTToolsTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JPTToolsTests.java
deleted file mode 100644
index 4df0a87c68..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JPTToolsTests.java
+++ /dev/null
@@ -1,517 +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.tests.internal.resource.java;
-
-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.IVariableBinding;
-import org.eclipse.jpt.core.internal.utility.jdt.JDTTools;
-import org.eclipse.jpt.core.internal.utility.jdt.JPTTools;
-import org.eclipse.jpt.core.utility.jdt.FieldAttribute;
-import org.eclipse.jpt.core.utility.jdt.MethodAttribute;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-public class JPTToolsTests extends JavaResourceModelTestCase {
-
- public JPTToolsTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTypeFieldWithModifier(final String modifier) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" " + modifier + " String foo;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- protected FieldAttribute fooField(ICompilationUnit cu) {
- return this.buildField("foo", cu);
- }
-
-
- private ICompilationUnit createTestTypeGetMethodWithModifier(final String modifier) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" " + modifier + " int getFoo() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" public void setFoo(int id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeInvalidMethodName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public int foo() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" public void setFoo(int id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeConstructor() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public " + TYPE_NAME + "() {").append(CR);
- sb.append(" super();").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeVoidMethodReturnType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public void getFoo() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" public void setFoo(int id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
-// private ICompilationUnit createTestTypeInvalidMethodReturnType() throws Exception {
-// return this.createTestType(new DefaultAnnotationWriter() {
-//
-// @Override
-// public Iterator<String> imports() {
-// return new ArrayIterator<String>("com.foo.Foo");
-// }
-// @Override
-// public void appendGetIdMethodAnnotationTo(StringBuffer sb) {
-// sb.append(CR);
-// sb.append(" public Foo getFoo() {").append(CR);
-// sb.append(" return null;").append(CR);
-// sb.append(" }").append(CR);
-// sb.append(CR);
-// sb.append(" public void setFoo(Foo id) {").append(CR);
-// sb.append(" this.id = id;").append(CR);
-// sb.append(" }").append(CR);
-// sb.append(CR);
-// }
-// });
-// }
-
- private ICompilationUnit createTestTypeIsMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public boolean isFoo() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" public void setFoo(boolean id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeIsMethodReturnInt() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public int isFoo() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" public void setFoo(int id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeIsAndGetMethodWithModifier(final String modifier) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" " + modifier + " boolean isFoo() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" " + modifier + " boolean getFoo() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" public void setFoo(boolean id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeSetMethodWithModifier(final String modifier) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public int getFoo() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" " + modifier + " void setFoo(int id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeWithMemberTypes() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public void appendMemberTypeTo(StringBuilder sb) {
- sb.append(" public static class FooStatic {}").append(CR);
- sb.append(CR);
- sb.append(" public class FooNotStatic {}").append(CR);
- sb.append(CR);
- sb.append(" public @interface MyAnnotation {}").append(CR);
- sb.append(CR);
- sb.append(" public enum MyEnum {}").append(CR);
- }
- });
- }
-
- protected MethodAttribute fooMethod(ICompilationUnit cu) {
- return this.buildMethod("getFoo", cu);
- }
-
- //private String foo; - persistable
- public void testFieldIsPersistable1() throws Exception {
- ICompilationUnit cu = createTestTypeFieldWithModifier("private");
- FieldAttribute fieldAttribute = fooField(cu);
- IVariableBinding variableBinding = fieldAttribute.getBinding(JDTTools.buildASTRoot(cu));
- assertTrue(JPTTools.fieldIsPersistable(variableBinding));
- }
-
- //private static String foo; - not persistable
- public void testFieldIsPersistable2() throws Exception {
- ICompilationUnit cu = createTestTypeFieldWithModifier("private static");
- FieldAttribute fieldAttribute = fooField(cu);
- IVariableBinding variableBinding = fieldAttribute.getBinding(JDTTools.buildASTRoot(cu));
- assertFalse(JPTTools.fieldIsPersistable(variableBinding));
- }
-
- //private transient String foo; - not persistable
- public void testFieldIsPersistable3() throws Exception {
- ICompilationUnit cu = createTestTypeFieldWithModifier("private transient");
- FieldAttribute fieldAttribute = fooField(cu);
- IVariableBinding variableBinding = fieldAttribute.getBinding(JDTTools.buildASTRoot(cu));
- assertFalse(JPTTools.fieldIsPersistable(variableBinding));
- }
-
- //private final String foo; - persistable
- public void testFieldIsPersistable4() throws Exception {
- ICompilationUnit cu = createTestTypeFieldWithModifier("private final");
- FieldAttribute fieldAttribute = fooField(cu);
- IVariableBinding variableBinding = fieldAttribute.getBinding(JDTTools.buildASTRoot(cu));
- assertTrue(JPTTools.fieldIsPersistable(variableBinding));
- }
-
- //public String foo; - persistable
- public void testFieldIsPersistable5() throws Exception {
- ICompilationUnit cu = createTestTypeFieldWithModifier("public");
- FieldAttribute fieldAttribute = fooField(cu);
- IVariableBinding variableBinding = fieldAttribute.getBinding(JDTTools.buildASTRoot(cu));
- assertTrue(JPTTools.fieldIsPersistable(variableBinding));
- }
-
-
- //public int getFoo() {} - persistable
- public void testMethodIsPersistablePropertyGetter1() throws Exception {
- ICompilationUnit cu = createTestTypeGetMethodWithModifier("public");
- MethodAttribute methodAttribute = fooMethod(cu);
- IMethodBinding methodBinding = methodAttribute.getBinding(JDTTools.buildASTRoot(cu));
- assertTrue(JPTTools.methodIsPersistablePropertyGetter(methodBinding));
-
- }
-
- //protected int getFoo() {} - persistable
- public void testMethodIsPersistablePropertyGetter2() throws Exception {
- ICompilationUnit cu = createTestTypeGetMethodWithModifier("protected");
- MethodAttribute methodAttribute = fooMethod(cu);
- IMethodBinding methodBinding = methodAttribute.getBinding(JDTTools.buildASTRoot(cu));
- assertTrue(JPTTools.methodIsPersistablePropertyGetter(methodBinding));
- }
-
- //int getFoo() {} - not persistable
- public void testMethodIsPersistablePropertyGetter3() throws Exception {
- ICompilationUnit cu = createTestTypeGetMethodWithModifier("");
- MethodAttribute methodAttribute = fooMethod(cu);
- IMethodBinding methodBinding = methodAttribute.getBinding(JDTTools.buildASTRoot(cu));
- assertFalse(JPTTools.methodIsPersistablePropertyGetter(methodBinding));
- }
-
- //private int getFoo() {} - not persistable
- public void testMethodIsPersistablePropertyGetter4() throws Exception {
- ICompilationUnit cu = createTestTypeGetMethodWithModifier("private");
- MethodAttribute methodAttribute = fooMethod(cu);
- IMethodBinding methodBinding = methodAttribute.getBinding(JDTTools.buildASTRoot(cu));
- assertFalse(JPTTools.methodIsPersistablePropertyGetter(methodBinding));
- }
-
- //public static int getFoo() {} - not persistable
- public void testMethodIsPersistablePropertyGetter5() throws Exception {
- ICompilationUnit cu = createTestTypeGetMethodWithModifier("public static");
- MethodAttribute methodAttribute = fooMethod(cu);
- IMethodBinding methodBinding = methodAttribute.getBinding(JDTTools.buildASTRoot(cu));
- assertFalse(JPTTools.methodIsPersistablePropertyGetter(methodBinding));
- }
-
- //public final int getFoo() {} - not persistable
- public void testMethodIsPersistablePropertyGetter6() throws Exception {
- ICompilationUnit cu = createTestTypeGetMethodWithModifier("public final");
- MethodAttribute methodAttribute = fooMethod(cu);
- IMethodBinding methodBinding = methodAttribute.getBinding(JDTTools.buildASTRoot(cu));
- assertFalse(JPTTools.methodIsPersistablePropertyGetter(methodBinding));
- }
-
- //public void setFoo(int foo) {} - persistable
- public void testMethodIsPersistablePropertyGetter7() throws Exception {
- ICompilationUnit cu = createTestTypeSetMethodWithModifier("public");
- MethodAttribute methodAttribute = fooMethod(cu);
- IMethodBinding methodBinding = methodAttribute.getBinding(JDTTools.buildASTRoot(cu));
- assertTrue(JPTTools.methodIsPersistablePropertyGetter(methodBinding));
-
- }
-
- //protected void setFoo(int foo) {} - persistable
- public void testMethodIsPersistablePropertyGetter8() throws Exception {
- ICompilationUnit cu = createTestTypeSetMethodWithModifier("protected");
- MethodAttribute methodAttribute = fooMethod(cu);
- IMethodBinding methodBinding = methodAttribute.getBinding(JDTTools.buildASTRoot(cu));
- assertTrue(JPTTools.methodIsPersistablePropertyGetter(methodBinding));
- }
-
- //void setFoo(int foo) {} - not persistable
- public void testMethodIsPersistablePropertyGetter9() throws Exception {
- ICompilationUnit cu = createTestTypeSetMethodWithModifier("");
- MethodAttribute methodAttribute = fooMethod(cu);
- IMethodBinding methodBinding = methodAttribute.getBinding(JDTTools.buildASTRoot(cu));
- assertFalse(JPTTools.methodIsPersistablePropertyGetter(methodBinding));
- }
-
- //private void setFoo(int foo) {} - not persistable
- public void testMethodIsPersistablePropertyGetter10() throws Exception {
- ICompilationUnit cu = createTestTypeSetMethodWithModifier("private");
- MethodAttribute methodAttribute = fooMethod(cu);
- IMethodBinding methodBinding = methodAttribute.getBinding(JDTTools.buildASTRoot(cu));
- assertFalse(JPTTools.methodIsPersistablePropertyGetter(methodBinding));
- }
-
- //public static void setFoo(int foo) {} - not persistable
- public void testMethodIsPersistablePropertyGetter11() throws Exception {
- ICompilationUnit cu = createTestTypeSetMethodWithModifier("public static");
- MethodAttribute methodAttribute = fooMethod(cu);
- IMethodBinding methodBinding = methodAttribute.getBinding(JDTTools.buildASTRoot(cu));
- assertFalse(JPTTools.methodIsPersistablePropertyGetter(methodBinding));
- }
-
- //public final void setFoo(int foo) {} - not persistable
- public void testMethodIsPersistablePropertyGetter12() throws Exception {
- ICompilationUnit cu = createTestTypeSetMethodWithModifier("public final");
- MethodAttribute methodAttribute = fooMethod(cu);
- IMethodBinding methodBinding = methodAttribute.getBinding(JDTTools.buildASTRoot(cu));
- assertFalse(JPTTools.methodIsPersistablePropertyGetter(methodBinding));
- }
-
- //public boolean isFoo() {} - persistable
- public void testMethodIsPersistablePropertyGetter13() throws Exception {
- ICompilationUnit cu = createTestTypeIsMethod();
- MethodAttribute methodAttribute = this.buildMethod("isFoo", cu);
- IMethodBinding methodBinding = methodAttribute.getBinding(JDTTools.buildASTRoot(cu));
- assertTrue(JPTTools.methodIsPersistablePropertyGetter(methodBinding));
-
- }
-
- //public int isFoo() {} - not persistable
- public void testMethodIsPersistablePropertyGetter14() throws Exception {
- ICompilationUnit cu = createTestTypeIsMethodReturnInt();
- MethodAttribute methodAttribute = this.buildMethod("isFoo", cu);
- IMethodBinding methodBinding = methodAttribute.getBinding(JDTTools.buildASTRoot(cu));
- assertFalse(JPTTools.methodIsPersistablePropertyGetter(methodBinding));
-
- }
-
- //public int isFoo() {} - persistable
- //public int getFoo() {} - not persistable
- public void testMethodIsPersistablePropertyGetter15() throws Exception {
- ICompilationUnit cu = createTestTypeIsAndGetMethodWithModifier("public");
- MethodAttribute isFooMethod = this.buildMethod("isFoo", cu);
- MethodAttribute getFooMethod = this.buildMethod("getFoo", cu);
-
- CompilationUnit astRoot = JDTTools.buildASTRoot(cu);
- assertTrue(JPTTools.methodIsPersistablePropertyGetter(isFooMethod.getBinding(astRoot)));
- assertFalse(JPTTools.methodIsPersistablePropertyGetter(getFooMethod.getBinding(astRoot)));
- }
-
- //public int foo() {} - not persistable
- public void testMethodIsPersistablePropertyGetter16() throws Exception {
- ICompilationUnit cu = createTestTypeInvalidMethodName();
- MethodAttribute fooMethod = this.buildMethod("foo", cu);
-
- CompilationUnit astRoot = JDTTools.buildASTRoot(cu);
- assertFalse(JPTTools.methodIsPersistablePropertyGetter(fooMethod.getBinding(astRoot)));
- }
-
- //public void getFoo() {} - not persistable - void return type
- public void testMethodIsPersistablePropertyGetter17() throws Exception {
- ICompilationUnit cu = createTestTypeVoidMethodReturnType();
- MethodAttribute fooMethod = this.buildMethod("getFoo", cu);
-
- CompilationUnit astRoot = JDTTools.buildASTRoot(cu);
- assertFalse(JPTTools.methodIsPersistablePropertyGetter(fooMethod.getBinding(astRoot)));
- }
-
- //TODO
- //**getFooMethod.binding(CompliationUnit) is returning null, not sure why and don't know how to test
- //**this if it is returning null there instead of returning null for IMethodBinding.getReturnType()
-// //public Foo getFoo() {} - not persistable - Foo does not resolve
-// public void testMethodIsPersistablePropertyGetter18() throws Exception {
-// ICompilationUnit cu = createTestTypeInvalidMethodReturnType();
-// MethodAttribute getFooMethod = this.buildMethod("getFoo");
-//
-// CompilationUnit astRoot = JDTTools.buildASTRoot(cu);
-// assertFalse(JPTTools.methodIsPersistablePropertyGetter(fooMethod.binding(astRoot)));
-// }
-
- //method with parameters - not persistable
- public void testMethodIsPersistablePropertyGetter19() throws Exception {
- ICompilationUnit cu = createTestType();
- MethodAttribute setIdMethod = idSetMethod(cu);
-
- CompilationUnit astRoot = JDTTools.buildASTRoot(cu);
- assertFalse(JPTTools.methodIsPersistablePropertyGetter(setIdMethod.getBinding(astRoot)));
- }
-
- //constructor - not persistable
- public void testMethodIsPersistablePropertyGetter20() throws Exception {
- ICompilationUnit cu = createTestTypeConstructor();
- MethodAttribute constructor = buildMethod(TYPE_NAME, cu);
-
- CompilationUnit astRoot = JDTTools.buildASTRoot(cu);
- assertFalse(JPTTools.methodIsPersistablePropertyGetter(constructor.getBinding(astRoot)));
- }
-
- //no corresponding set method - not persistable
- public void testMethodIsPersistablePropertyGetter21() throws Exception {
- ICompilationUnit cu = createTestType();
- MethodAttribute getNameMethod = nameGetMethod(cu);
-
- CompilationUnit astRoot = JDTTools.buildASTRoot(cu);
- assertFalse(JPTTools.methodIsPersistablePropertyGetter(getNameMethod.getBinding(astRoot)));
- }
-
- //public class AnnotationTestType
- public void cuIsPersistable() throws Exception {
- ICompilationUnit cu = createTestType();
- Type type = testType(cu);
- CompilationUnit astRoot = JDTTools.buildASTRoot(cu);
- assertTrue(JPTTools.typeIsPersistable(type.getBinding(astRoot)));
- }
-
- //public final class MyFinal
- public void cuIsPersistable2() throws Exception {
- ICompilationUnit cu = this.javaProject.createCompilationUnit("finals", "MyFinal.java", "public final class MyFinal { }");
- Type type = buildType("MyFinal", cu);
- CompilationUnit astRoot = JDTTools.buildASTRoot(cu);
- assertFalse(JPTTools.typeIsPersistable(type.getBinding(astRoot)));
- }
-
- //public interface MyInterface
- public void cuIsPersistable3() throws Exception {
- ICompilationUnit cu = this.javaProject.createCompilationUnit("interfaces", "MyInterface.java", "public interface MyInterface { }");
- Type type = buildType("MyInterface", cu);
- CompilationUnit astRoot = JDTTools.buildASTRoot(cu);
- assertFalse(JPTTools.typeIsPersistable(type.getBinding(astRoot)));
- }
-
- //enum not persistable
- public void cuIsPersistable4() throws Exception {
- ICompilationUnit cu = this.createEnumAndMembers("TestEnum", "FOO, BAR, BAZ");
- Type type = buildType("TestEnum", cu);
- CompilationUnit astRoot = JDTTools.buildASTRoot(cu);
- assertFalse(JPTTools.typeIsPersistable(type.getBinding(astRoot)));
- }
-
- //annotation not persistable
- public void cuIsPersistable5() throws Exception {
- ICompilationUnit cu = this.createAnnotationAndMembers("TestAnnotation", "TestEnum foo();");
- Type type = buildType("TestAnnotation", cu);
- CompilationUnit astRoot = JDTTools.buildASTRoot(cu);
- assertFalse(JPTTools.typeIsPersistable(type.getBinding(astRoot)));
- }
-
- //public static member type is persistable
- public void cuIsPersistable6() throws Exception {
- ICompilationUnit cu = this.createTestTypeWithMemberTypes();
- Type testType = this.testType(cu);
- Type memberType = this.buildType(testType, "FooStatic", 1, cu);
- CompilationUnit astRoot = JDTTools.buildASTRoot(cu);
- assertTrue(JPTTools.typeIsPersistable(memberType.getBinding(astRoot)));
- }
-
- //non-static member type is not persistable
- public void cuIsPersistable7() throws Exception {
- ICompilationUnit cu = this.createTestTypeWithMemberTypes();
- Type testType = this.testType(cu);
- Type memberType = this.buildType(testType, "FooNotStatic", 1, cu);
- CompilationUnit astRoot = JDTTools.buildASTRoot(cu);
- assertFalse(JPTTools.typeIsPersistable(memberType.getBinding(astRoot)));
- }
- //TODO still need to test typeIsPersistable() returns false for local and anonymous classes
-
-
-}
-
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourceModelTestCase.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourceModelTestCase.java
deleted file mode 100644
index 4daf73bc3e..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourceModelTestCase.java
+++ /dev/null
@@ -1,177 +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.tests.internal.resource.java;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.resources.IResourceProxyVisitor;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IElementChangedListener;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.ResourceModelListener;
-import org.eclipse.jpt.core.context.JpaRootContextNode;
-import org.eclipse.jpt.core.internal.GenericJpaProject;
-import org.eclipse.jpt.core.internal.SimpleJpaProjectConfig;
-import org.eclipse.jpt.core.internal.resource.java.JpaCompilationUnitImpl;
-import org.eclipse.jpt.core.internal.utility.jdt.NullAnnotationEditFormatter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.JpaCompilationUnit;
-import org.eclipse.jpt.core.tests.internal.utility.jdt.AnnotationTestCase;
-import org.eclipse.jpt.utility.CommandExecutorProvider;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-@SuppressWarnings("nls")
-public class JavaResourceModelTestCase extends AnnotationTestCase
-{
- private JavaElementChangeListener javaElementChangeListener;
- protected JpaCompilationUnit jpaCompilationUnit;
-
-
- public JavaResourceModelTestCase(String name) {
- super(name);
- }
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.javaElementChangeListener = new JavaElementChangeListener();
- JavaCore.addElementChangedListener(this.javaElementChangeListener);
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- JavaCore.removeElementChangedListener(this.javaElementChangeListener);
- this.javaElementChangeListener = null;
- }
-
- /**
- * Forward the Java element change event back to the JPA model manager.
- */
- private class JavaElementChangeListener implements IElementChangedListener {
- JavaElementChangeListener() {
- super();
- }
- public void elementChanged(ElementChangedEvent event) {
- JavaResourceModelTestCase.this.javaElementChanged(event);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
- void javaElementChanged(ElementChangedEvent event) {
- if (this.jpaCompilationUnit != null) {
- this.jpaCompilationUnit.javaElementChanged(event);
- }
- }
-
- protected ICompilationUnit createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception {
- return createAnnotationAndMembers("javax.persistence", annotationName, annotationBody);
- }
-
- protected ICompilationUnit createAnnotationAndMembers(String packageName, String annotationName, String annotationBody) throws Exception {
- return this.javaProject.createCompilationUnit(packageName, annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }");
- }
-
- protected ICompilationUnit createEnumAndMembers(String enumName, String enumBody) throws Exception {
- return createEnumAndMembers("javax.persistence", enumName, enumBody);
- }
-
- protected ICompilationUnit createEnumAndMembers(String packageName, String enumName, String enumBody) throws Exception {
- return this.javaProject.createCompilationUnit(packageName, enumName + ".java", "public enum " + enumName + " { " + enumBody + " }");
- }
-
- //build up a dummy JpaProject that does not have JpaFiles in it and does not update from java changes
- protected JpaProject buildJpaProject() throws CoreException {
- return new TestJpaProject(this.buildJpaProjectConfig(this.javaProject.getProject()));
- }
-
- protected class TestJpaProject extends GenericJpaProject {
- protected TestJpaProject(JpaProject.Config config) throws CoreException {
- super(config);
- this.setUpdater(Updater.Null.instance());// ignore all updates, since there is no context model
- this.addJar(org.eclipse.jpt.core.tests.internal.projects.TestJpaProject.jpaJarName());
- }
-
- protected void addJar(String jarPath) throws JavaModelException {
- this.addClasspathEntry(JavaCore.newLibraryEntry(new Path(jarPath), null, null));
- }
-
- private void addClasspathEntry(IClasspathEntry entry) throws JavaModelException {
- getJavaProject().setRawClasspath(CollectionTools.add(getJavaProject().getRawClasspath(), entry), null);
- }
-
- @Override
- protected IResourceProxyVisitor buildInitialResourceProxyVisitor() {
- return new IResourceProxyVisitor() {
- public boolean visit(IResourceProxy proxy) throws CoreException {
- return false; // ignore all the files in the Eclipse project
- }
- };
- }
-
- @Override
- protected JpaRootContextNode buildRootContextNode() {
- return null; // no root context
- }
- }
-
- protected JpaProject.Config buildJpaProjectConfig(IProject project) {
- SimpleJpaProjectConfig config = new SimpleJpaProjectConfig();
- config.setProject(project);
- config.setJpaPlatform(JptCorePlugin.getJpaPlatform(project));
- config.setConnectionProfileName(JptCorePlugin.getConnectionProfileName(project));
- config.setDiscoverAnnotatedClasses(JptCorePlugin.discoverAnnotatedClasses(project));
- return config;
- }
-
- protected JavaResourcePersistentType buildJavaTypeResource(ICompilationUnit cu) throws CoreException {
- this.jpaCompilationUnit = this.buildJpaCompilationUnit(cu);
- this.jpaCompilationUnit.resolveTypes();
- return this.hackJavaResourcePersistentType();
- }
-
- protected JavaResourcePersistentType hackJavaResourcePersistentType() {
- return (JavaResourcePersistentType) ClassTools.fieldValue(this.jpaCompilationUnit, "persistentType");
- }
-
- protected JpaCompilationUnit buildJpaCompilationUnit(ICompilationUnit cu) throws CoreException {
- if (this.jpaCompilationUnit != null) {
- throw new IllegalStateException();
- }
- JpaProject jpaProject = buildJpaProject();
- return new JpaCompilationUnitImpl(
- cu,
- jpaProject.getJpaPlatform().getAnnotationProvider(),
- CommandExecutorProvider.Default.instance(),
- NullAnnotationEditFormatter.instance(),
- this.buildResourceModelListener()
- );
- }
-
- ResourceModelListener buildResourceModelListener() {
- return new ResourceModelListener() {
- public void resourceModelChanged() {
- // ignore
- }
- };
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourcePersistentAttributeTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourcePersistentAttributeTests.java
deleted file mode 100644
index cd399c8a2f..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourcePersistentAttributeTests.java
+++ /dev/null
@@ -1,859 +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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.IdImpl;
-import org.eclipse.jpt.core.internal.resource.java.OneToOneImpl;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.IdAnnotation;
-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.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.core.utility.jdt.Member.Editor;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class JavaResourcePersistentAttributeTests extends JavaResourceModelTestCase {
-
- public JavaResourcePersistentAttributeTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithNonResolvingField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("private Foo foo;").append(CR);
- sb.append(CR);
- }
- });
- }
- private ICompilationUnit createTestEntityWithNonResolvingMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("private Foo foo;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- sb.append(CR);
- sb.append(" public Foo getFoo() {").append(CR);
- sb.append(" return this.foo;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" ");
- sb.append(CR);
- sb.append(" public void setFoo(Foo foo) {").append(CR);
- sb.append(" this.foo = foo;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- private ICompilationUnit createTestEntityMultipleVariableDeclarationsPerLine() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" ");
- sb.append("@Id");
- sb.append(CR);
- sb.append(" ");
- sb.append("@Column(name=\"baz\")");
- sb.append(" private String foo, bar;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithIdAndBasic() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.BASIC);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append(CR);
- sb.append("@Basic");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append(CR);
- sb.append(" ");
- sb.append("@Column");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column(name=\"FOO\", table=\"MY_TABLE\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithIdColumnGeneratedValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.COLUMN, JPA.ID, JPA.GENERATED_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append(CR);
- sb.append("@Column");
- sb.append(CR);
- sb.append("@GeneratedValue");
- }
- });
- }
-
-
- private ICompilationUnit createTestEntityMultipleColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column(name=\"FOO\")");
- sb.append(CR);
- sb.append("@Column(name=\"BAR\")");
- }
- });
- }
-
- private ICompilationUnit createTestEmbeddedWithAttributeOverride() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDED, JPA.ATTRIBUTE_OVERRIDE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Embedded");
- sb.append(CR);
- sb.append("@AttributeOverride(name=\"FOO\")");
- }
- });
- }
- private ICompilationUnit createTestEmbeddedWithAttributeOverrides() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDED, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Embedded");
- sb.append(CR);
- sb.append("@AttributeOverrides(@AttributeOverride(name=\"FOO\"))");
- }
- });
- }
- private ICompilationUnit createTestEmbeddedWithAttributeOverridesEmpty() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDED, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Embedded");
- sb.append(CR);
- sb.append("@AttributeOverrides()");
- }
- });
- }
-
- private ICompilationUnit createTestEmbeddedWith2AttributeOverrides() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDED, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Embedded");
- sb.append(CR);
- sb.append("@AttributeOverrides({@AttributeOverride(name=\"FOO\"), @AttributeOverride(name=\"BAR\")})");
- }
- });
- }
-
- private ICompilationUnit createTestEmbeddedWithAttributeOverrideAndAttributeOverrides() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDED, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Embedded");
- sb.append(CR);
- sb.append("@AttributeOverride(name=\"FOO\")");
- sb.append(CR);
- sb.append("@AttributeOverrides({@AttributeOverride(name=\"BAR\"), @AttributeOverride(name=\"BAZ\")})");
- }
- });
- }
-
- private ICompilationUnit createTestTypePublicAttribute() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public String foo;");
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypePackageAttribute() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" String foo;");
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeFinalAttribute() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public final String foo;");
- sb.append(CR);
- }
- });
- }
-
- public void testJavaAttributeAnnotations() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- assertEquals(1, attributeResource.supportingAnnotationsSize());
- }
-
- public void testJavaAttributeAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- assertNotNull(attributeResource.getSupportingAnnotation(JPA.COLUMN));
- }
-
- public void testJavaAttributeAnnotationNull() throws Exception {
- ICompilationUnit cu = this.createTestEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- assertNull(attributeResource.getSupportingAnnotation(JPA.TABLE));
- }
-
- //This will result in a compilation error, but we assume the first column found
- public void testDuplicateAnnotations() throws Exception {
- ICompilationUnit cu = this.createTestEntityMultipleColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- ColumnAnnotation columnResource = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
- assertEquals("FOO", columnResource.getName());
- }
-
- public void testRemoveColumn() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- attributeResource.removeSupportingAnnotation(JPA.COLUMN);
-
- assertSourceDoesNotContain("@Column", cu);
- }
-
- public void testRemoveColumnName() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ColumnAnnotation columnResource = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
- columnResource.setTable(null);
- assertSourceContains("@Column(name=\"FOO\")", cu);
-
- columnResource.setName(null);
- assertSourceDoesNotContain("@Column", cu);
-
- assertNull(typeResource.getSupportingAnnotation(JPA.TABLE));
- }
-
- public void testMultipleAttributeMappings() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithIdAndBasic();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- assertEquals(2, attributeResource.mappingAnnotationsSize());
- assertEquals(0, attributeResource.supportingAnnotationsSize());
- assertNotNull(attributeResource.getMappingAnnotation(JPA.BASIC));
- assertNotNull(attributeResource.getMappingAnnotation(JPA.ID));
-
- JavaResourceNode javaAttributeMappingAnnotation = attributeResource.getMappingAnnotation();
- assertTrue(javaAttributeMappingAnnotation instanceof BasicAnnotation);
- assertSourceContains("@Basic", cu);
- assertSourceContains("@Id", cu);
-
- attributeResource.setMappingAnnotation(JPA.ONE_TO_MANY);
- assertEquals(1, attributeResource.mappingAnnotationsSize());
- javaAttributeMappingAnnotation = attributeResource.getMappingAnnotation();
- assertTrue(javaAttributeMappingAnnotation instanceof OneToManyAnnotation);
- assertSourceDoesNotContain("@Id", cu);
- assertSourceContains("@OneToMany", cu);
- assertSourceDoesNotContain("@Basic", cu);
- }
-
- public void testSetJavaAttributeMappingAnnotation() throws Exception {
- ICompilationUnit cu = createTestType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- assertEquals(0, attributeResource.mappingAnnotationsSize());
-
- attributeResource.setMappingAnnotation(JPA.ID);
- assertTrue(attributeResource.getMappingAnnotation() instanceof IdAnnotation);
- assertSourceContains("@Id", cu);
- }
-
- public void testSetJavaAttributeMappingAnnotation2() throws Exception {
- ICompilationUnit cu = createTestEntityWithColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- assertNull(attributeResource.getMappingAnnotation());
-
- attributeResource.setMappingAnnotation(JPA.ID);
- assertTrue(attributeResource.getMappingAnnotation() instanceof IdAnnotation);
-
- assertSourceContains("@Id", cu);
- assertSourceContains("@Column", cu);
- }
-
- public void testSetJavaAttributeMappingAnnotation3() throws Exception {
- ICompilationUnit cu = createTestEntityWithIdColumnGeneratedValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- assertTrue(attributeResource.getMappingAnnotation() instanceof IdAnnotation);
-
- attributeResource.setMappingAnnotation(JPA.BASIC);
- assertTrue(attributeResource.getMappingAnnotation() instanceof BasicAnnotation);
-
- assertSourceDoesNotContain("@Id", cu);
- assertSourceContains("@GeneratedValue", cu); //not supported by Basic
- assertSourceContains("@Column", cu); //common between Id and Basic
- }
-
- public void testSetJavaAttributeMappingAnnotationNull() throws Exception {
- ICompilationUnit cu = createTestEntityWithIdColumnGeneratedValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- assertTrue(attributeResource.getMappingAnnotation() instanceof IdAnnotation);
-
- attributeResource.setMappingAnnotation(null);
- assertNull(attributeResource.getMappingAnnotation());
-
- assertSourceDoesNotContain("@Id", cu);
- assertSourceContains("@GeneratedValue", cu); //not supported by Basic
- assertSourceContains("@Column", cu); //common between Id and Basic
- }
-
- public void testAddJavaAttributeAnnotation() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- assertSourceDoesNotContain("@Column", cu);
- attributeResource.addSupportingAnnotation(JPA.COLUMN);
- assertSourceContains("@Column", cu);
- }
-
- public void testRemoveJavaAttributeAnnotation() throws Exception {
- ICompilationUnit cu = createTestEntityAnnotatedField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- assertSourceContains("@Column", cu);
- attributeResource.removeSupportingAnnotation(JPA.COLUMN);
- assertSourceDoesNotContain("@Column", cu);
- }
-
- //update source code to change from @Id to @OneToOne and make sure @Column is not removed
- public void testChangeAttributeMappingInSource() throws Exception {
- ICompilationUnit cu = createTestEntityAnnotatedField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- final JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- idField(cu).edit(new Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ((IdImpl) attributeResource.getMappingAnnotation()).getDeclarationAnnotationAdapter().removeAnnotation(declaration);
- }
- });
-
- cu.createImport("javax.persistence.OneToOne", null, new NullProgressMonitor());
-
- idField(cu).edit(new Editor() {
- public void edit(ModifiedDeclaration declaration) {
- OneToOneImpl.DECLARATION_ANNOTATION_ADAPTER.newMarkerAnnotation(declaration);
- }
- });
-
- assertNotNull(attributeResource.getSupportingAnnotation(JPA.COLUMN));
- assertNull(attributeResource.getMappingAnnotation(JPA.ID));
- assertNotNull(attributeResource.getMappingAnnotation(JPA.ONE_TO_ONE));
- assertSourceContains("@Column", cu);
- }
-
- public void testJavaAttributeAnnotationsNestable() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWithAttributeOverride();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- assertEquals(1, CollectionTools.size(attributeResource.supportingAnnotations(JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES)));
-
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.supportingAnnotations(JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES).next();
-
- assertEquals("FOO", attributeOverride.getName());
- }
-
- public void testJavaAttributeAnnotationsNoNestable() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- assertEquals(0, CollectionTools.size(attributeResource.supportingAnnotations(JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES)));
- }
-
- public void testJavaAttributeAnnotationsContainerNoNestable() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWithAttributeOverridesEmpty();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- assertEquals(0, CollectionTools.size(attributeResource.supportingAnnotations(JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES)));
- }
-
- public void testJavaAttributeAnnotationsNestableAndContainer() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWithAttributeOverrideAndAttributeOverrides();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- assertNotNull(attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE));
- assertNotNull(attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDES));
- assertEquals(2, CollectionTools.size(attributeResource.supportingAnnotations(JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES)));
-
- AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) attributeResource.supportingAnnotations(JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES).next();
- assertEquals("BAR", attributeOverrideResource.getName());
- }
-
- // -->> @AttributeOverride(name="FOO")
- public void testAddJavaAttributeAnnotationNestableContainer() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- assertSourceContains("@AttributeOverride(name=\"FOO\")", cu);
- }
-
- // @Embedded -->> @Embedded
- // @AttributeOverride(name="FOO") @AttributeOverrides({@AttributeOverride(name="FOO"), @AttributeOverride(name="BAR")})
- public void testAddJavaAttributeAnnotationNestableContainer2() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWithAttributeOverride();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.addSupportingAnnotation(1, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAR");
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"FOO\"),@AttributeOverride(name=\"BAR\")})", cu);
-
- assertNull(attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE));
- assertNotNull(attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDES));
- assertEquals(2, CollectionTools.size(attributeResource.supportingAnnotations(JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES)));
- }
-
- // @Embedded
- // @AttributeOverrides(@AttributeOverride(name="FOO"))
- // ||
- // \/
- // @Embedded
- // @AttributeOverrides({@AttributeOverride(name="FOO"), @AttributeOverride(name="BAR")})
- public void testAddJavaAttributeAnnotationNestableContainer3() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWithAttributeOverrides();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.addSupportingAnnotation(1, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAR");
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"FOO\"),@AttributeOverride(name=\"BAR\")})", cu);
-
- assertNull(attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE));
- assertNotNull(attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDES));
- assertEquals(2, CollectionTools.size(attributeResource.supportingAnnotations(JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES)));
- }
-
- public void testAddJavaAttributeAnnotationNestableContainer5() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWithAttributeOverrides();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAR");
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"BAR\"),@AttributeOverride(name=\"FOO\")})", cu);
-
- assertNull(attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE));
- assertNotNull(attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDES));
- assertEquals(2, CollectionTools.size(attributeResource.supportingAnnotations(JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES)));
- }
-
- // @Embedded
- // @SecondaryTable(name=\"FOO\")
- // @AttributeOverrides({@AttributeOverride(name=\"BAR\"), @AttributeOverride(name=\"BAZ\")})
- // ||
- // \/
- // @Embedded
- // @AttributeOverride(name=\"FOO\")
- // @AttributeOverrides({@AttributeOverride(name=\"BAR\"), @AttributeOverride(name=\"BAZ\"), @AttributeOverride(name=\"BOO\")})
- public void testAddJavaAttributeAnnotationNestableContainer4() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWithAttributeOverrideAndAttributeOverrides();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- assertNotNull(attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE));
- assertNotNull(attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDES));
- assertEquals(2, CollectionTools.size(attributeResource.supportingAnnotations(JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES)));
-
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.addSupportingAnnotation(2, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"BAR\"), @AttributeOverride(name=\"BAZ\"),", cu);
- assertSourceContains("@AttributeOverride})", cu);
- attributeOverride.setName("BOO");
-
- assertNotNull(attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE));
- assertNotNull(attributeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDES));
- assertEquals(3, CollectionTools.size(attributeResource.supportingAnnotations(JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES)));
-
- Iterator<NestableAnnotation> attributeOverrideAnnotations = attributeResource.supportingAnnotations(JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride = (AttributeOverrideAnnotation) attributeOverrideAnnotations.next();
- assertEquals("BAR", attributeOverride.getName());
- attributeOverride = (AttributeOverrideAnnotation) attributeOverrideAnnotations.next();
- assertEquals("BAZ", attributeOverride.getName());
- attributeOverride = (AttributeOverrideAnnotation) attributeOverrideAnnotations.next();
- assertEquals("BOO", attributeOverride.getName());
-
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"BAR\"), @AttributeOverride(name=\"BAZ\"),", cu);
- assertSourceContains("@AttributeOverride(name=\"BOO\")})", cu);
- }
-
- //@Entity
- //@AttributeOverride(name="FOO")
- public void testRemoveJavaAttributeAnnotationNestableContainer() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWithAttributeOverride();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- attributeResource.removeSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
-
- assertSourceDoesNotContain("@AttributeOverride", cu);
- }
-
-
- //@Entity
- //@SecondaryTables(@SecondaryTable(name="FOO"))
- public void testRemoveJavaAttributeAnnotationNestableContainer2() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWithAttributeOverrides();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- attributeResource.removeSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
-
- assertSourceDoesNotContain("@AttributeOverride", cu);
- assertSourceDoesNotContain("@AttributeOverrides", cu);
- }
-
- public void testRemoveJavaAttributeAnnotationIndex() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWith2AttributeOverrides();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- attributeResource.removeSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE , JPA.ATTRIBUTE_OVERRIDES);
-
- assertSourceDoesNotContain("@AttributeOverride(name=\"FOO\"", cu);
- assertSourceContains("@AttributeOverride(name=\"BAR\"", cu);
- assertSourceDoesNotContain("@AttributeOverrides", cu);
- }
-
- public void testRemoveJavaAttributeAnnotationIndex2() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWith2AttributeOverrides();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- AttributeOverrideAnnotation newAnnotation = (AttributeOverrideAnnotation)attributeResource.addSupportingAnnotation(2, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- newAnnotation.setName("BAZ");
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"FOO\"), @AttributeOverride(name=\"BAR\"),", cu);
- assertSourceContains("@AttributeOverride(name=\"BAZ\")})", cu);
-
- attributeResource.removeSupportingAnnotation(1, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"FOO\"), @AttributeOverride(name=\"BAZ\")})", cu);
- }
-
- public void testMoveJavaTypeAnnotation() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWith2AttributeOverrides();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- AttributeOverrideAnnotation newAnnotation = (AttributeOverrideAnnotation)attributeResource.addSupportingAnnotation(2, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- newAnnotation.setName("BAZ");
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"FOO\"), @AttributeOverride(name=\"BAR\"),", cu);
- assertSourceContains("@AttributeOverride(name=\"BAZ\")})", cu);
-
-
- attributeResource.moveSupportingAnnotation(0, 2, JPA.ATTRIBUTE_OVERRIDES);
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"BAZ\"), @AttributeOverride(name=\"FOO\"),", cu);
- assertSourceContains("@AttributeOverride(name=\"BAR\")})", cu);
- }
-
- public void testMoveJavaTypeAnnotation2() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWith2AttributeOverrides();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- AttributeOverrideAnnotation newAnnotation = (AttributeOverrideAnnotation) attributeResource.addSupportingAnnotation(2, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- newAnnotation.setName("BAZ");
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"FOO\"), @AttributeOverride(name=\"BAR\"),", cu);
- assertSourceContains("@AttributeOverride(name=\"BAZ\")})", cu);
-
- attributeResource.moveSupportingAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDES);
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"BAR\"), @AttributeOverride(name=\"FOO\"),", cu);
- assertSourceContains("@AttributeOverride(name=\"BAZ\")})", cu);
- }
-
- //more detailed tests in JPTToolsTests
- public void testIsPersistableField() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- assertTrue(attributeResource.isPersistable());
- }
-
- public void testIsPersistableField2() throws Exception {
- ICompilationUnit cu = createTestEntityWithNonResolvingField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- @SuppressWarnings("unchecked")
- List<JavaResourcePersistentAttribute> attributes = (List<JavaResourcePersistentAttribute>) ClassTools.fieldValue(typeResource, "fields");
- JavaResourcePersistentAttribute attributeResource = attributes.get(0);
-
- assertEquals("foo", attributeResource.getName());
- assertTrue(attributeResource.isForField());
- assertTrue(attributeResource.isPersistable()); //bug 196200 changed this
-
- this.javaProject.createCompilationUnit("test", "Foo.java", "public class Foo {}");
-
- assertTrue(attributeResource.isPersistable());
- }
-
- public void testGetQualifiedTypeName() throws Exception {
- ICompilationUnit cu = createTestEntityWithNonResolvingField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- @SuppressWarnings("unchecked")
- List<JavaResourcePersistentAttribute> attributes = (List<JavaResourcePersistentAttribute>) ClassTools.fieldValue(typeResource, "fields");
- JavaResourcePersistentAttribute attributeResource = attributes.get(0);
-
- assertEquals("foo", attributeResource.getName());
- assertEquals("test.Foo", attributeResource.getQualifiedTypeName()); //bug 196200 changed this
-
- this.javaProject.createCompilationUnit("test", "Foo.java", "public class Foo {}");
-
- assertEquals("test.Foo", attributeResource.getQualifiedTypeName());
- }
-
-
- //more detailed tests in JPTToolsTests
- public void testIsPersistableMethod() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableProperties().next();
-
- assertTrue(attributeResource.isPersistable());
- }
-
- public void testIsPersistableMethod2() throws Exception {
- ICompilationUnit cu = createTestEntityWithNonResolvingMethod();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- @SuppressWarnings("unchecked")
- List<JavaResourcePersistentAttribute> attributes = (List<JavaResourcePersistentAttribute>) ClassTools.fieldValue(typeResource, "methods");
- JavaResourcePersistentAttribute attributeResource = attributes.get(0);
-
- assertEquals("foo", attributeResource.getName());
- assertTrue(attributeResource.isForProperty());
- assertTrue(attributeResource.isPersistable());//bug 196200 changed this
-
- this.javaProject.createCompilationUnit("test", "Foo.java", "public class Foo {}");
-
- assertTrue(attributeResource.isPersistable());
- }
-
- //this tests that we handle mutliple variable declarations in one line.
- //The annotations should apply to all fields defined. This is not really a useful
- //thing to do with JPA beyond the most basic things that use default column names
- public void testMultipleVariableDeclarationsPerLine() throws Exception {
- ICompilationUnit cu = createTestEntityMultipleVariableDeclarationsPerLine();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- assertEquals(4, CollectionTools.size(typeResource.fields()));
- Iterator<JavaResourcePersistentAttribute> fields = typeResource.fields();
- JavaResourcePersistentAttribute attributeResource = fields.next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
- assertEquals("baz", column.getName());
-
- attributeResource = fields.next();
- column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN);
- assertEquals("baz", column.getName());
- }
-
- public void testIsPublic() throws Exception {
- ICompilationUnit cu = createTestTypePublicAttribute();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attribute = typeResource.persistableAttributes().next();
-
- assertTrue(attribute.isPublic());
- }
-
- public void testIsPublicFalse() throws Exception {
- ICompilationUnit cu = createTestTypePackageAttribute();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attribute = typeResource.persistableAttributes().next();
-
- assertFalse(attribute.isPublic());
- }
-
- public void testIsFinal() throws Exception {
- ICompilationUnit cu = createTestTypeFinalAttribute();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attribute = typeResource.persistableAttributes().next();
-
- assertTrue(attribute.isFinal());
- }
-
- public void testIsFinalFalse() throws Exception {
- ICompilationUnit cu = createTestTypePackageAttribute();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attribute = typeResource.persistableAttributes().next();
-
- assertFalse(attribute.isFinal());
- }
-
- //TODO add tests for JPTTools static methods
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourcePersistentTypeTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourcePersistentTypeTests.java
deleted file mode 100644
index 19234bb53b..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourcePersistentTypeTests.java
+++ /dev/null
@@ -1,921 +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.tests.internal.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.EmbeddableImpl;
-import org.eclipse.jpt.core.internal.resource.java.EntityImpl;
-import org.eclipse.jpt.core.resource.java.AccessType;
-import org.eclipse.jpt.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.core.resource.java.EntityAnnotation;
-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.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.MappedSuperclassAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.SecondaryTableAnnotation;
-import org.eclipse.jpt.core.resource.java.TableAnnotation;
-import org.eclipse.jpt.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.core.utility.jdt.Member.Editor;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
-
- public JavaResourcePersistentTypeTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestInvalidAnnotations() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>("javax.persistence.Foo");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Foo");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Foo");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMemberEmbeddable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendMemberTypeTo(StringBuilder sb) {
- sb.append(" @Embeddable");
- sb.append(CR);
- sb.append(" public static class Foo { }").append(CR);
-
- }
- });
- }
-
- private ICompilationUnit createTestEntityDuplicates() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity(name=\"FirstEntity\")").append(CR);
- sb.append("@Entity(name=\"SecondEntity\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithEmbeddable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@Embeddable");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedFieldAndMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedNonPersistableMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendGetNameMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedPersistableMethodNonPersistableField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column");
- sb.append(" private transient int notPersistable;").append(CR);
- sb.append(CR);
-
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Column");
- }
- });
- }
- private ICompilationUnit createTestEntityNoPersistableFields() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendMemberTypeTo(StringBuilder sb) {
- sb.delete(sb.indexOf("private int id;"), sb.indexOf("private int id;") + "private int id;".length());
- sb.delete(sb.indexOf("private String name;"), sb.indexOf("private String name;") + "private String name;".length());
- }
- });
- }
-
-// private ICompilationUnit createTestEntityLarge(final int i) throws Exception {
-// return this.createTestType(new DefaultAnnotationWriter() {
-// @Override
-// public Iterator<String> imports() {
-// return new ArrayIterator<String>(JPA.ENTITY + i);
-// }
-// @Override
-// public void appendTypeAnnotationTo(StringBuilder sb) {
-// sb.append("@Entity" + i);
-// sb.append(CR);
-// }
-// @Override
-// public String typeName() {
-// return TYPE_NAME + i;
-// }
-// });
-// }
-//
-// public void testLarge() throws Exception {
-// for (int i = START; i <= END; i++) {
-// this.createAnnotationAndMembers("Entity" +i, "String name();");
-// }
-//
-// List<ICompilationUnit> cus = new ArrayList<ICompilationUnit>();
-// for (int i = START; i <= END; i++) {
-// cus.add(createTestEntityLarge(i));
-// }
-// long start = System.currentTimeMillis();
-// List<JavaPersistentTypeResource> typeResources = new ArrayList<JavaPersistentTypeResource>();
-// for (int i = 0; i < END; i++) {
-// typeResources.add(buildJavaTypeResource(cus.get(i)));
-// }
-// long end = System.currentTimeMillis();
-//
-// System.out.println(end-start + "ms");
-// for (int i = 0; i < END; i++) {
-// assertEquals(1, CollectionTools.size(typeResources.get(i).javaTypeMappingAnnotations()));
-// assertNotNull(typeResources.get(i).javaTypeMappingAnnotation(JPA.ENTITY + (i+1)));
-// }
-//
-//
-//// assertEquals(0, CollectionTools.size(typeResource.javaTypeAnnotations()));
-// }
-
-
-
- private ICompilationUnit createTestEntityWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@Table(name=\"FOO\", schema=\"BAR\")");
- }
- });
- }
-
-// private ICompilationUnit createTestEntityWithTableAndIdClass() throws Exception {
-// createEntityAnnotation();
-// this.createAnnotationAndMembers("Table", "String name(); String schema();");
-// this.createAnnotationAndMembers("IdClass", "Class value();");
-// return this.createTestType(new DefaultAnnotationWriter() {
-// @Override
-// public Iterator<String> imports() {
-// return new ArrayIterator<String>(JPA.ENTITY, JPA.TABLE, JPA.ID_CLASS);
-// }
-// @Override
-// public void appendTypeAnnotationTo(StringBuilder sb) {
-// sb.append("@Entity");
-// sb.append(CR);
-// sb.append("@Table");
-// sb.append(CR);
-// sb.append("@IdClass");
-// }
-// });
-// }
-//
-
- private ICompilationUnit createTestEntityMultipleTables() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@Table(name=\"FOO\")");
- sb.append(CR);
- sb.append("@Table(name=\"BAR\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithSecondaryTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@SecondaryTable(name=\"FOO\")");
- }
- });
- }
- private ICompilationUnit createTestEntityWithEmptySecondaryTables() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@SecondaryTables()");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithSecondaryTables() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@SecondaryTables(@SecondaryTable(name=\"FOO\"))");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWith2SecondaryTables() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@SecondaryTables({@SecondaryTable(name=\"FOO\"), @SecondaryTable(name=\"BAR\")})");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithSecondaryTableAndSecondaryTables() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@SecondaryTable(name=\"FOO\")");
- sb.append(CR);
- sb.append("@SecondaryTables({@SecondaryTable(name=\"BAR\"), @SecondaryTable(name=\"BAZ\")})");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMemberTypes() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendMemberTypeTo(StringBuilder sb) {
- sb.append(" static class FooStatic {}").append(CR);
- sb.append(CR);
- sb.append(" class FooNotStatic {}").append(CR);
- sb.append(CR);
- sb.append(" @interface MyAnnotation {}").append(CR);
- sb.append(CR);
- sb.append(" enum MyEnum {}").append(CR);
- }
- });
- }
-
- public void testJavaTypeAnnotations() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- assertEquals(1, typeResource.supportingAnnotationsSize());
- }
-
- public void testJavaTypeAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- assertNotNull(typeResource.getSupportingAnnotation(JPA.TABLE));
- }
-
- public void testJavaTypeAnnotationNull() throws Exception {
- ICompilationUnit cu = this.createTestEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- assertNull(typeResource.getSupportingAnnotation(JPA.TABLE));
- }
-
- //This will result in a compilation error, but we assume the first table found
- public void testDuplicateAnnotations() throws Exception {
- ICompilationUnit cu = this.createTestEntityMultipleTables();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- TableAnnotation tableResource = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
- assertEquals("FOO", tableResource.getName());
- }
-
- public void testRemoveTable() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- typeResource.removeSupportingAnnotation(JPA.TABLE);
-
- assertSourceDoesNotContain("@Table", cu);
- }
-
- public void testRemoveTableName() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithTable();
- JavaResourcePersistentType jrpt = buildJavaTypeResource(cu);
-
- TableAnnotation tableAnnotation = (TableAnnotation) jrpt.getSupportingAnnotation(JPA.TABLE);
- tableAnnotation.setSchema(null);
- assertSourceContains("@Table(name=\"FOO\")", cu);
-
- tableAnnotation.setName(null);
- assertSourceDoesNotContain("@Table", cu);
-
- assertNull(jrpt.getSupportingAnnotation(JPA.TABLE));
- }
-
- public void testMultipleTypeMappings() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithEmbeddable();
-
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- assertEquals(2, typeResource.mappingAnnotationsSize());
- assertEquals(0, typeResource.supportingAnnotationsSize());
- assertNotNull(typeResource.getMappingAnnotation(JPA.EMBEDDABLE));
- assertNotNull(typeResource.getMappingAnnotation(JPA.ENTITY));
-
- JavaResourceNode javaTypeMappingAnnotation = typeResource.getMappingAnnotation();
- assertTrue(javaTypeMappingAnnotation instanceof EmbeddableAnnotation);
- assertSourceContains("@Entity", cu);
- assertSourceContains("@Embeddable", cu);
-
- typeResource.setMappingAnnotation(JPA.MAPPED_SUPERCLASS);
- assertEquals(1, typeResource.mappingAnnotationsSize());
- javaTypeMappingAnnotation = typeResource.getMappingAnnotation();
- assertTrue(javaTypeMappingAnnotation instanceof MappedSuperclassAnnotation);
- assertSourceDoesNotContain("@Entity", cu);
- assertSourceContains("@MappedSuperclass", cu);
- assertSourceDoesNotContain("@Embeddable", cu);
- }
-
- public void testSetJavaTypeMappingAnnotation() throws Exception {
- ICompilationUnit cu = createTestType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- assertEquals(0, typeResource.mappingAnnotationsSize());
-
- typeResource.setMappingAnnotation(JPA.ENTITY);
- assertTrue(typeResource.getMappingAnnotation() instanceof EntityAnnotation);
- assertSourceContains("@Entity", cu);
- }
-
- public void testSetJavaTypeMappingAnnotation2() throws Exception {
- ICompilationUnit cu = createTestEntityWithTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- assertTrue(typeResource.getMappingAnnotation() instanceof EntityAnnotation);
-
- typeResource.setMappingAnnotation(JPA.EMBEDDABLE);
- assertTrue(typeResource.getMappingAnnotation() instanceof EmbeddableAnnotation);
-
- assertSourceDoesNotContain("@Entity", cu);
- assertSourceContains("@Table", cu);
- }
-
- public void testAddJavaTypeAnnotation() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- assertSourceDoesNotContain("@Table", cu);
- typeResource.addSupportingAnnotation(JPA.TABLE);
-
- assertSourceContains("@Table", cu);
- }
-
- public void testRemoveJavaTypeAnnotation() throws Exception {
- ICompilationUnit cu = createTestEntityWithTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- assertSourceContains("@Table", cu);
- typeResource.removeSupportingAnnotation(JPA.TABLE);
- assertSourceDoesNotContain("@Table", cu);
- }
-
- //update source code to change from @Entity to @Embeddable and make sure @Table is not removed
- public void testChangeTypeMappingInSource() throws Exception {
- ICompilationUnit cu = createTestEntityWithTable();
- final JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- testType(cu).edit(new Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ((EntityImpl) typeResource.getMappingAnnotation()).getDeclarationAnnotationAdapter().removeAnnotation(declaration);
- }
- });
-
- cu.createImport("javax.persistence.Embeddable", null, new NullProgressMonitor());
-
- this.testType(cu).edit(new Editor() {
- public void edit(ModifiedDeclaration declaration) {
- EmbeddableImpl.DECLARATION_ANNOTATION_ADAPTER.newMarkerAnnotation(declaration);
- }
- });
-
- assertNotNull(typeResource.getSupportingAnnotation(JPA.TABLE));
- assertNull(typeResource.getMappingAnnotation(JPA.ENTITY));
- assertNotNull(typeResource.getMappingAnnotation(JPA.EMBEDDABLE));
- assertSourceContains("@Table", cu);
- }
-
- public void testJavaTypeAnnotationsNestable() throws Exception {
- ICompilationUnit cu = createTestEntityWithSecondaryTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- assertEquals(1, CollectionTools.size(typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES)));
-
- SecondaryTableAnnotation secondaryTableResource = (SecondaryTableAnnotation) typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES).next();
-
- assertEquals("FOO", secondaryTableResource.getName());
- }
-
- public void testJavaTypeAnnotationsNoNestable() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- assertEquals(0, CollectionTools.size(typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES)));
- }
-
- public void testJavaTypeAnnotationsContainerNoNestable() throws Exception {
- ICompilationUnit cu = createTestEntityWithEmptySecondaryTables();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- assertEquals(0, CollectionTools.size(typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES)));
- }
-
- public void testJavaTypeAnnotationsNestableAndContainer() throws Exception {
- ICompilationUnit cu = createTestEntityWithSecondaryTableAndSecondaryTables();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- assertNotNull(typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE));
- assertNotNull(typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES));
- assertEquals(2, CollectionTools.size(typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES)));
-
- SecondaryTableAnnotation secondaryTableResource = (SecondaryTableAnnotation) typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES).next();
- assertEquals("BAR", secondaryTableResource.getName());
- }
-
- // @Entity -->> @Entity
- // @SecondaryTable(name="FOO")
- public void testAddJavaTypeAnnotationNestableContainer() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTableAnnotation secondaryTableResource = (SecondaryTableAnnotation) typeResource.addSupportingAnnotation(0, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- secondaryTableResource.setName("FOO");
- assertSourceContains("@SecondaryTable(name=\"FOO\")", cu);
- }
-
- // @Entity -->> @Entity
- // @SecondaryTable(name="FOO") @SecondaryTables({@SecondaryTable(name="FOO"), @SecondaryTable(name="BAR")})
- public void testAddJavaTypeAnnotationNestableContainer2() throws Exception {
- ICompilationUnit cu = createTestEntityWithSecondaryTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTableAnnotation secondaryTableResource = (SecondaryTableAnnotation) typeResource.addSupportingAnnotation(1, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- secondaryTableResource.setName("BAR");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name=\"FOO\"),@SecondaryTable(name=\"BAR\")})", cu);
-
- assertNull(typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE));
- assertNotNull(typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES));
- assertEquals(2, CollectionTools.size(typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES)));
- }
-
- // @Entity
- // @SecondaryTables(@SecondaryTable(name="FOO"))
- // ||
- // \/
- // @Entity
- // @SecondaryTables({@SecondaryTable(name="FOO"), @SecondaryTable(name="BAR")})
- public void testAddJavaTypeAnnotationNestableContainer3() throws Exception {
- ICompilationUnit cu = createTestEntityWithSecondaryTables();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTableAnnotation secondaryTableResource = (SecondaryTableAnnotation) typeResource.addSupportingAnnotation(1, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- secondaryTableResource.setName("BAR");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name=\"FOO\"),@SecondaryTable(name=\"BAR\")})", cu);
-
- assertNull(typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE));
- assertNotNull(typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES));
- assertEquals(2, CollectionTools.size(typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES)));
- }
-
- public void testAddJavaTypeAnnotationNestableContainer5() throws Exception {
- ICompilationUnit cu = createTestEntityWithSecondaryTables();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTableAnnotation secondaryTableResource = (SecondaryTableAnnotation) typeResource.addSupportingAnnotation(0, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- secondaryTableResource.setName("BAR");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name=\"BAR\"),@SecondaryTable(name=\"FOO\")})", cu);
-
- assertNull(typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE));
- assertNotNull(typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES));
- assertEquals(2, CollectionTools.size(typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES)));
- }
-
- public void testAddJavaTypeAnnotationNestableContainer6() throws Exception {
- ICompilationUnit cu = createTestEntityWithSecondaryTables();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTableAnnotation secondaryTableResource = (SecondaryTableAnnotation) typeResource.addSupportingAnnotation(0, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- secondaryTableResource.setName("BAR");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name=\"BAR\"),@SecondaryTable(name=\"FOO\")})", cu);
-
- assertNull(typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE));
- assertNotNull(typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES));
- assertEquals(2, CollectionTools.size(typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES)));
-
- secondaryTableResource = (SecondaryTableAnnotation) typeResource.addSupportingAnnotation(0, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- secondaryTableResource.setName("BAZ");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name=\"BAZ\"),@SecondaryTable(name=\"BAR\"), @SecondaryTable(name=\"FOO\")})", cu);
-
- assertEquals(3, CollectionTools.size(typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES)));
- }
-
- // @Entity
- // @SecondaryTable(name=\"FOO\")
- // @SecondaryTables({@SecondaryTable(name=\"BAR\"), @SecondaryTable(name=\"BAZ\")})
- // ||
- // \/
- // @Entity
- // @SecondaryTable(name=\"FOO\")
- // @SecondaryTables({@SecondaryTable(name=\"BAR\"), @SecondaryTable(name=\"BAZ\"), @SecondaryTable(name=\"BOO\")})
- public void testAddJavaTypeAnnotationNestableContainer4() throws Exception {
- ICompilationUnit cu = createTestEntityWithSecondaryTableAndSecondaryTables();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- assertNotNull(typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE));
- assertNotNull(typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES));
- assertEquals(2, CollectionTools.size(typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES)));
-
- SecondaryTableAnnotation secondaryTableResource = (SecondaryTableAnnotation) typeResource.addSupportingAnnotation(2, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- assertSourceContains("@SecondaryTables({@SecondaryTable(name=\"BAR\"), @SecondaryTable(name=\"BAZ\"), @SecondaryTable})", cu);
- secondaryTableResource.setName("BOO");
-
- assertNotNull(typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE));
- assertNotNull(typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES));
- assertEquals(3, CollectionTools.size(typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES)));
-
- Iterator<NestableAnnotation> secondaryTableAnnotations = typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- secondaryTableResource = (SecondaryTableAnnotation) secondaryTableAnnotations.next();
- assertEquals("BAR", secondaryTableResource.getName());
- secondaryTableResource = (SecondaryTableAnnotation) secondaryTableAnnotations.next();
- assertEquals("BAZ", secondaryTableResource.getName());
- secondaryTableResource = (SecondaryTableAnnotation) secondaryTableAnnotations.next();
- assertEquals("BOO", secondaryTableResource.getName());
-
- assertSourceContains("@SecondaryTables({@SecondaryTable(name=\"BAR\"), @SecondaryTable(name=\"BAZ\"), @SecondaryTable(name=\"BOO\")})", cu);
- }
-
- //@Entity
- //@SecondaryTable(name="FOO")
- public void testRemoveJavaTypeAnnotationNestableContainer() throws Exception {
- ICompilationUnit cu = createTestEntityWithSecondaryTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- typeResource.removeSupportingAnnotation(0, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
-
- assertSourceDoesNotContain("@SecondaryTable", cu);
- }
-
-
- //@Entity
- //@SecondaryTables(@SecondaryTable(name="FOO"))
- public void testRemoveJavaTypeAnnotationNestableContainer2() throws Exception {
- ICompilationUnit cu = createTestEntityWithSecondaryTables();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- typeResource.removeSupportingAnnotation(0, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
-
- assertSourceDoesNotContain("@SecondaryTable", cu);
- assertSourceDoesNotContain("@SecondaryTables", cu);
- }
-
- public void testRemoveJavaTypeAnnotationIndex() throws Exception {
- ICompilationUnit cu = createTestEntityWith2SecondaryTables();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- typeResource.removeSupportingAnnotation(0, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
-
- assertSourceDoesNotContain("@SecondaryTable(name=\"FOO\"", cu);
- assertSourceContains("@SecondaryTable(name=\"BAR\"", cu);
- assertSourceDoesNotContain("@SecondaryTables", cu);
- }
-
- public void testRemoveJavaTypeAnnotationIndex2() throws Exception {
- ICompilationUnit cu = createTestEntityWith2SecondaryTables();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTableAnnotation newAnnotation = (SecondaryTableAnnotation)typeResource.addSupportingAnnotation(2, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- newAnnotation.setName("BAZ");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name=\"FOO\"), @SecondaryTable(name=\"BAR\"), @SecondaryTable(name=\"BAZ", cu);
-
- typeResource.removeSupportingAnnotation(1, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- assertSourceContains("@SecondaryTables({@SecondaryTable(name=\"FOO\"), @SecondaryTable(name=\"BAZ\")})", cu);
- }
-
- public void testMoveJavaTypeAnnotation() throws Exception {
- ICompilationUnit cu = createTestEntityWith2SecondaryTables();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTableAnnotation newAnnotation = (SecondaryTableAnnotation)typeResource.addSupportingAnnotation(2, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- newAnnotation.setName("BAZ");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name=\"FOO\"), @SecondaryTable(name=\"BAR\"), @SecondaryTable(name=\"BAZ\")})", cu);
-
- typeResource.moveSupportingAnnotation(0, 2, JPA.SECONDARY_TABLES);
- assertSourceContains("@SecondaryTables({@SecondaryTable(name=\"BAZ\"), @SecondaryTable(name=\"FOO\"), @SecondaryTable(name=\"BAR\")})", cu);
- }
-
- public void testMoveJavaTypeAnnotation2() throws Exception {
- ICompilationUnit cu = createTestEntityWith2SecondaryTables();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTableAnnotation newAnnotation = (SecondaryTableAnnotation)typeResource.addSupportingAnnotation(2, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- newAnnotation.setName("BAZ");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name=\"FOO\"), @SecondaryTable(name=\"BAR\"), @SecondaryTable(name=\"BAZ\")})", cu);
-
- typeResource.moveSupportingAnnotation(2, 0, JPA.SECONDARY_TABLES);
- assertSourceContains("@SecondaryTables({@SecondaryTable(name=\"BAR\"), @SecondaryTable(name=\"BAZ\"), @SecondaryTable(name=\"FOO\")})", cu);
- }
-
- public void testNestedTypes() throws Exception {
- ICompilationUnit cu = createTestEntityWithMemberTypes();
- JavaResourcePersistentType persistentType = buildJavaTypeResource(cu);
-
- assertEquals("only persistable types should be returned by #persistableTypes()", 1, CollectionTools.size(persistentType.persistableTypes()));
- assertEquals("enums and interfaces should be ignored", 2, CollectionTools.size(persistentType.types()));
- }
-
- public void testDuplicateEntityAnnotations() throws Exception {
- ICompilationUnit cu = createTestEntityDuplicates();
- JavaResourcePersistentType persistentType = buildJavaTypeResource(cu);
-
- EntityAnnotation javaTypeMappingAnnotation = (EntityAnnotation) persistentType.getMappingAnnotation(JPA.ENTITY);
- assertEquals("FirstEntity", javaTypeMappingAnnotation.getName());
-
- assertEquals(1, persistentType.mappingAnnotationsSize());
-
- javaTypeMappingAnnotation = (EntityAnnotation) persistentType.getMappingAnnotation();
- assertEquals("FirstEntity", javaTypeMappingAnnotation.getName());
-
- }
-
-
- public void testAttributes() throws Exception {
- // TODO
- }
-
- public void testFields() throws Exception {
- // TODO
- }
-
- public void testProperties() throws Exception {
- // TODO
- }
-
- public void testGetAccessNoAttributesAnnotated() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourcePersistentType persistentType = buildJavaTypeResource(cu);
-
- assertNull(persistentType.getAccess());
- }
-
- public void testGetAccessFieldsAnnotated() throws Exception {
- ICompilationUnit cu = createTestEntityAnnotatedField();
- JavaResourcePersistentType persistentType = buildJavaTypeResource(cu);
-
- assertEquals(AccessType.FIELD, persistentType.getAccess());
- }
-
- public void testGetAccessMethodsAnnotated() throws Exception {
- ICompilationUnit cu = createTestEntityAnnotatedMethod();
- JavaResourcePersistentType persistentType = buildJavaTypeResource(cu);
-
- assertEquals(AccessType.PROPERTY, persistentType.getAccess());
- }
-
- public void testGetAccessFieldsAndMethodsAnnotated() throws Exception {
- ICompilationUnit cu = createTestEntityAnnotatedFieldAndMethod();
- JavaResourcePersistentType persistentType = buildJavaTypeResource(cu);
-
- assertEquals(AccessType.FIELD, persistentType.getAccess());
- }
-
- public void testGetAccessNonPersistableMethodAnnotated() throws Exception {
- ICompilationUnit cu = createTestEntityAnnotatedNonPersistableMethod();
- JavaResourcePersistentType persistentType = buildJavaTypeResource(cu);
-
- assertNull(persistentType.getAccess());
- }
-
- public void testGetAccessPersistableMethodAndNonPersistableFieldAnnotated() throws Exception {
- ICompilationUnit cu = createTestEntityAnnotatedPersistableMethodNonPersistableField();
- JavaResourcePersistentType persistentType = buildJavaTypeResource(cu);
-
- assertEquals(AccessType.PROPERTY, persistentType.getAccess());
- }
-
- public void testGetAccessNoPersistableFieldsAnnotated() throws Exception {
- ICompilationUnit cu = createTestEntityNoPersistableFields();
- JavaResourcePersistentType persistentType = buildJavaTypeResource(cu);
-
- assertEquals(AccessType.PROPERTY, persistentType.getAccess());
- }
-
- //TODO more tests here with superclasses other than Object.
- //1. Test where the superclass does not resolve
- //2. Test a superclass that does resolve
- //3. What about a superclass that is a class file in a jar??
- //4.
- public void testGetSuperclassQualifiedName() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourcePersistentType persistentType = buildJavaTypeResource(cu);
-
- assertEquals("java.lang.Object", persistentType.getSuperClassQualifiedName());
-
- }
-
- //more detailed tests in JPTToolsTests
- public void testIsPersistable() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourcePersistentType persistentType = buildJavaTypeResource(cu);
-
- assertTrue(persistentType.isPersistable());
- }
-
- public void testAnnotatedMemberType() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithMemberEmbeddable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- assertNotNull(typeResource.getMappingAnnotation(JPA.ENTITY));
- assertNull(typeResource.getMappingAnnotation(JPA.EMBEDDABLE));
-
- JavaResourcePersistentType nestedType = typeResource.persistableTypes().next();
- assertNull(nestedType.getMappingAnnotation(JPA.ENTITY));
- assertNotNull(nestedType.getMappingAnnotation(JPA.EMBEDDABLE));
- }
-
- public void testInvalidAnnotations() throws Exception {
- ICompilationUnit cu = this.createTestInvalidAnnotations();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- assertEquals(0, typeResource.mappingAnnotationsSize());
- assertEquals(0, typeResource.supportingAnnotationsSize());
-
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- assertEquals(0, attributeResource.mappingAnnotationsSize());
- assertEquals(0, attributeResource.supportingAnnotationsSize());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinColumnTests.java
deleted file mode 100644
index 266cf5ce7b..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinColumnTests.java
+++ /dev/null
@@ -1,351 +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.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.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JoinColumnTests extends JavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_TABLE = "MY_TABLE";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
- private static final String COLUMN_REFERENCED_COLUMN_NAME = "MY_REF_COLUMN_NAME";
-
- public JoinColumnTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestJoinColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumn");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumn(name=\"" + COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumn(table=\"" + COLUMN_TABLE + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithReferencedColumnName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumn(referencedColumnName=\"" + COLUMN_REFERENCED_COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumn(columnDefinition=\"" + COLUMN_COLUMN_DEFINITION + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumn(" + booleanElement + "=true)");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_COLUMN);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_COLUMN);
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getNullable());
- assertNull(column.getInsertable());
- assertNull(column.getUnique());
- assertNull(column.getUpdatable());
- assertNull(column.getTable());
- assertNull(column.getReferencedColumnName());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@JoinColumn(name=\"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_COLUMN);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("@JoinColumn", cu);
- }
-
- public void testGetTable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_COLUMN);
- assertEquals(COLUMN_TABLE, column.getTable());
- }
-
- public void testSetTable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getTable());
-
- column.setTable("Foo");
- assertEquals("Foo", column.getTable());
-
- assertSourceContains("@JoinColumn(table=\"Foo\")", cu);
-
-
- column.setTable(null);
- assertSourceDoesNotContain("@JoinColumn", cu);
- }
-
- public void testGetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithReferencedColumnName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_COLUMN);
- assertEquals(COLUMN_REFERENCED_COLUMN_NAME, column.getReferencedColumnName());
- }
-
- public void testSetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getReferencedColumnName());
-
- column.setReferencedColumnName("Foo");
- assertEquals("Foo", column.getReferencedColumnName());
-
- assertSourceContains("@JoinColumn(referencedColumnName=\"Foo\")", cu);
-
-
- column.setReferencedColumnName(null);
- assertSourceDoesNotContain("@JoinColumn", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithColumnDefinition();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_COLUMN);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@JoinColumn(columnDefinition=\"Foo\")", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("@JoinColumn", cu);
- }
-
- public void testGetUnique() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("unique");
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_COLUMN);
-
- assertTrue(column.getUnique());
- }
-
- public void testSetUnique() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getUnique());
-
- column.setUnique(false);
- assertFalse(column.getUnique());
-
- assertSourceContains("@JoinColumn(unique=false)", cu);
-
- column.setUnique(null);
- assertSourceDoesNotContain("@JoinColumn", cu);
- }
-
- public void testGetNullable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("nullable");
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_COLUMN);
-
- assertTrue(column.getNullable());
- }
-
- public void testSetNullable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getNullable());
-
- column.setNullable(false);
- assertFalse(column.getNullable());
-
- assertSourceContains("@JoinColumn(nullable=false)", cu);
-
- column.setNullable(null);
- assertSourceDoesNotContain("@JoinColumn", cu);
- }
-
- public void testGetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("insertable");
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_COLUMN);
-
- assertTrue(column.getInsertable());
- }
-
- public void testSetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getInsertable());
-
- column.setInsertable(false);
- assertFalse(column.getInsertable());
-
- assertSourceContains("@JoinColumn(insertable=false)", cu);
-
- column.setInsertable(null);
- assertSourceDoesNotContain("@JoinColumn", cu);
- }
-
- public void testGetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("updatable");
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_COLUMN);
-
- assertTrue(column.getUpdatable());
- }
-
- public void testSetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getUpdatable());
-
- column.setUpdatable(false);
- assertFalse(column.getUpdatable());
-
- assertSourceContains("@JoinColumn(updatable=false)", cu);
-
- column.setUpdatable(null);
- assertSourceDoesNotContain("@JoinColumn", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinColumnsTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinColumnsTests.java
deleted file mode 100644
index ba06fbcef3..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinColumnsTests.java
+++ /dev/null
@@ -1,421 +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.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.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class JoinColumnsTests extends JavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_TABLE = "MY_TABLE";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
- private static final String COLUMN_REFERENCED_COLUMN_NAME = "MY_REF_COLUMN_NAME";
-
- public JoinColumnsTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumns(@JoinColumn)");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumns(@JoinColumn(name=\"" + COLUMN_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumns(@JoinColumn(table=\"" + COLUMN_TABLE + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithReferencedColumnName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumns(@JoinColumn(referencedColumnName=\"" + COLUMN_REFERENCED_COLUMN_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumns(@JoinColumn(columnDefinition=\"" + COLUMN_COLUMN_DEFINITION + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumns(@JoinColumn(" + booleanElement + "=true))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumn(name=\"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS).next();
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS).next();
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getNullable());
- assertNull(column.getInsertable());
- assertNull(column.getUnique());
- assertNull(column.getUpdatable());
- assertNull(column.getTable());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS).next();
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@JoinColumns(@JoinColumn(name=\"Foo\"))", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS).next();
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("@JoinColumn", cu);
- }
-
- public void testGetTable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS).next();
- assertEquals(COLUMN_TABLE, column.getTable());
- }
-
- public void testSetTable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS).next();
-
- assertNotNull(column);
- assertNull(column.getTable());
-
- column.setTable("Foo");
- assertEquals("Foo", column.getTable());
-
- assertSourceContains("@JoinColumns(@JoinColumn(table=\"Foo\"))", cu);
-
-
- column.setTable(null);
- assertSourceDoesNotContain("@JoinColumn", cu);
- }
-
- public void testGetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithReferencedColumnName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS).next();
- assertEquals(COLUMN_REFERENCED_COLUMN_NAME, column.getReferencedColumnName());
- }
-
- public void testSetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS).next();
-
- assertNotNull(column);
- assertNull(column.getReferencedColumnName());
-
- column.setReferencedColumnName("Foo");
- assertEquals("Foo", column.getReferencedColumnName());
-
- assertSourceContains("@JoinColumns(@JoinColumn(referencedColumnName=\"Foo\"))", cu);
-
-
- column.setReferencedColumnName(null);
- assertSourceDoesNotContain("@JoinColumn", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithColumnDefinition();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS).next();
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS).next();
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@JoinColumns(@JoinColumn(columnDefinition=\"Foo\"))", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("@JoinColumn", cu);
- }
-
- public void testGetUnique() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("unique");
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS).next();
-
- assertTrue(column.getUnique().booleanValue());
- }
-
- public void testSetUnique() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS).next();
-
- assertNotNull(column);
- assertNull(column.getUnique());
-
- column.setUnique(Boolean.FALSE);
- assertFalse(column.getUnique().booleanValue());
-
- assertSourceContains("@JoinColumns(@JoinColumn(unique=false))", cu);
-
- column.setUnique(null);
- assertSourceDoesNotContain("@JoinColumn", cu);
- }
-
- public void testGetNullable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("nullable");
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS).next();
-
- assertTrue(column.getNullable().booleanValue());
- }
-
- public void testSetNullable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS).next();
-
- assertNotNull(column);
- assertNull(column.getNullable());
-
- column.setNullable(Boolean.FALSE);
- assertFalse(column.getNullable().booleanValue());
-
- assertSourceContains("@JoinColumns(@JoinColumn(nullable=false))", cu);
-
- column.setNullable(null);
- assertSourceDoesNotContain("@JoinColumn", cu);
- }
-
- public void testGetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("insertable");
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS).next();
-
- assertTrue(column.getInsertable().booleanValue());
- }
-
- public void testSetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS).next();
-
- assertNotNull(column);
- assertNull(column.getInsertable());
-
- column.setInsertable(Boolean.FALSE);
- assertFalse(column.getInsertable().booleanValue());
-
- assertSourceContains("@JoinColumns(@JoinColumn(insertable=false))", cu);
-
- column.setInsertable(null);
- assertSourceDoesNotContain("@JoinColumn", cu);
- }
-
- public void testGetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("updatable");
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS).next();
-
- assertTrue(column.getUpdatable().booleanValue());
- }
-
- public void testSetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- JoinColumnAnnotation column = (JoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS).next();
-
- assertNotNull(column);
- assertNull(column.getUpdatable());
-
- column.setUpdatable(Boolean.FALSE);
- assertFalse(column.getUpdatable().booleanValue());
-
- assertSourceContains("@JoinColumns(@JoinColumn(updatable=false))", cu);
-
- column.setUpdatable(null);
- assertSourceDoesNotContain("@JoinColumn", cu);
- assertSourceDoesNotContain("@JoinColumns", cu);
- }
-
-
- public void testAddJoinColumnCopyExisting() throws Exception {
- ICompilationUnit cu = createTestJoinColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinColumnAnnotation joinColumn = (JoinColumnAnnotation) attributeResource.addSupportingAnnotation(1, JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- joinColumn.setName("FOO");
- assertSourceContains("@JoinColumns({@JoinColumn(name=\"BAR\", columnDefinition = \"COLUMN_DEF\", table = \"TABLE\", unique = false, nullable = false, insertable = false, updatable = false, referencedColumnName = \"REF_NAME\"),@JoinColumn(name=\"FOO\")})", cu);
-
- assertNull(attributeResource.getSupportingAnnotation(JPA.JOIN_COLUMN));
- assertNotNull(attributeResource.getSupportingAnnotation(JPA.JOIN_COLUMNS));
- assertEquals(2, CollectionTools.size(attributeResource.supportingAnnotations(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS)));
- }
-
- public void testAddJoinColumnToBeginningOfList() throws Exception {
- ICompilationUnit cu = createTestJoinColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinColumnAnnotation joinColumn = (JoinColumnAnnotation) attributeResource.addSupportingAnnotation(1, JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- joinColumn.setName("FOO");
- assertSourceContains("@JoinColumns({@JoinColumn(name=\"BAR\", columnDefinition = \"COLUMN_DEF\", table = \"TABLE\", unique = false, nullable = false, insertable = false, updatable = false, referencedColumnName = \"REF_NAME\"),@JoinColumn(name=\"FOO\")})", cu);
-
- joinColumn = (JoinColumnAnnotation) attributeResource.addSupportingAnnotation(0, JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- joinColumn.setName("BAZ");
- assertSourceContains("@JoinColumns({@JoinColumn(name=\"BAZ\"),@JoinColumn(name=\"BAR\", columnDefinition = \"COLUMN_DEF\", table = \"TABLE\", unique = false, nullable = false, insertable = false, updatable = false, referencedColumnName = \"REF_NAME\"), @JoinColumn(name=\"FOO\")})", cu);
-
- Iterator<NestableAnnotation> joinColumns = attributeResource.supportingAnnotations(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- assertEquals("BAZ", ((JoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("BAR", ((JoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumns.next()).getName());
-
- assertNull(attributeResource.getSupportingAnnotation(JPA.JOIN_COLUMN));
- assertNotNull(attributeResource.getSupportingAnnotation(JPA.JOIN_COLUMNS));
- assertEquals(3, CollectionTools.size(attributeResource.supportingAnnotations(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS)));
- }
-
-
- public void testRemoveJoinColumnCopyExisting() throws Exception {
- ICompilationUnit cu = createTestJoinColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinColumnAnnotation joinColumn = (JoinColumnAnnotation) attributeResource.addSupportingAnnotation(1, JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- joinColumn.setName("FOO");
- assertSourceContains("@JoinColumns({@JoinColumn(name=\"BAR\", columnDefinition = \"COLUMN_DEF\", table = \"TABLE\", unique = false, nullable = false, insertable = false, updatable = false, referencedColumnName = \"REF_NAME\"),@JoinColumn(name=\"FOO\")})", cu);
-
- attributeResource.removeSupportingAnnotation(1, JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- assertSourceContains("@JoinColumn(name=\"BAR\", columnDefinition = \"COLUMN_DEF\", table = \"TABLE\", unique = false, nullable = false, insertable = false, updatable = false, referencedColumnName = \"REF_NAME\")", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinTableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinTableTests.java
deleted file mode 100644
index ba3b324010..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinTableTests.java
+++ /dev/null
@@ -1,655 +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.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.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JoinTableTests extends JavaResourceModelTestCase {
-
- private static final String TABLE_NAME = "MY_TABLE";
- private static final String SCHEMA_NAME = "MY_SCHEMA";
- private static final String CATALOG_NAME = "MY_CATALOG";
-
- public JoinTableTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestJoinTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_TABLE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinTable");
- }
- });
- }
-
- private ICompilationUnit createTestJoinTableWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_TABLE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinTable(name=\"" + TABLE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinTableWithSchema() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_TABLE);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinTable(schema=\"" + SCHEMA_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinTableWithCatalog() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_TABLE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinTable(catalog=\"" + CATALOG_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinTableWithUniqueConstraints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_TABLE, JPA.UNIQUE_CONSTRAINT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinTable(uniqueConstraints={@UniqueConstraint(columnNames={\"BAR\"}), @UniqueConstraint(columnNames={\"FOO\"}), @UniqueConstraint(columnNames={\"BAZ\"})})");
- }
- });
- }
-
- private ICompilationUnit createTestJoinTableWithJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_TABLE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinTable(joinColumns={@JoinColumn(name=\"BAR\"), @JoinColumn})");
- }
- });
- }
-
- private ICompilationUnit createTestJoinTableWithInverseJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_TABLE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinTable(inverseJoinColumns={@JoinColumn(name=\"BAR\"), @JoinColumn})");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
- assertNotNull(table);
- assertEquals(TABLE_NAME, table.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
- assertNotNull(table);
- assertNull(table.getName());
- assertNull(table.getCatalog());
- assertNull(table.getSchema());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
- assertNotNull(table);
- assertNull(table.getName());
-
- table.setName("Foo");
- assertEquals("Foo", table.getName());
-
- assertSourceContains("@JoinTable(name=\"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
- assertEquals(TABLE_NAME, table.getName());
-
- table.setName(null);
- assertNull(table.getName());
-
- assertSourceDoesNotContain("@JoinTable", cu);
- }
-
- public void testGetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithCatalog();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
- assertNotNull(table);
- assertEquals(CATALOG_NAME, table.getCatalog());
- }
-
- public void testSetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
- assertNotNull(table);
- assertNull(table.getCatalog());
-
- table.setCatalog("Foo");
- assertEquals("Foo", table.getCatalog());
-
- assertSourceContains("@JoinTable(catalog=\"Foo\")", cu);
- }
-
- public void testSetCatalogNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithCatalog();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
- assertEquals(CATALOG_NAME, table.getCatalog());
-
- table.setCatalog(null);
- assertNull(table.getCatalog());
-
- assertSourceDoesNotContain("@JoinTable", cu);
- }
-
- public void testGetSchema() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithSchema();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
- assertNotNull(table);
- assertEquals(SCHEMA_NAME, table.getSchema());
- }
-
- public void testSetSchema() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
- assertNotNull(table);
- assertNull(table.getSchema());
-
- table.setSchema("Foo");
- assertEquals("Foo", table.getSchema());
-
- assertSourceContains("@JoinTable(schema=\"Foo\")", cu);
- }
-
- public void testSetSchemaNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithSchema();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
- assertEquals(SCHEMA_NAME, table.getSchema());
-
- table.setSchema(null);
- assertNull(table.getSchema());
-
- assertSourceDoesNotContain("@JoinTable", cu);
- }
-
- public void testUniqueConstraints() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
-
- assertEquals(0, table.uniqueConstraintsSize());
- }
-
- public void testUniqueConstraints2() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
-
-
- table.addUniqueConstraint(0);
- table.addUniqueConstraint(1);
-
- assertEquals(2, table.uniqueConstraintsSize());
- }
-
- public void testUniqueConstraints3() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithUniqueConstraints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
-
- assertEquals(3, table.uniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
-
- table.addUniqueConstraint(0).addColumnName("FOO");
- table.addUniqueConstraint(1);
- table.addUniqueConstraint(0).addColumnName("BAR");
-
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNames().next());
- assertEquals("FOO", table.uniqueConstraintAt(1).columnNames().next());
- assertEquals(0, table.uniqueConstraintAt(2).columnNamesSize());
-
- assertSourceContains("@JoinTable(uniqueConstraints={@UniqueConstraint(columnNames=\"BAR\"),@UniqueConstraint(columnNames=\"FOO\"), @UniqueConstraint})", cu);
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithUniqueConstraints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNames().next());
- assertEquals("FOO", table.uniqueConstraintAt(1).columnNames().next());
- assertEquals("BAZ", table.uniqueConstraintAt(2).columnNames().next());
- assertEquals(3, table.uniqueConstraintsSize());
-
- table.removeUniqueConstraint(1);
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNames().next());
- assertEquals("BAZ", table.uniqueConstraintAt(1).columnNames().next());
- assertEquals(2, table.uniqueConstraintsSize());
- assertSourceContains("@JoinTable(uniqueConstraints={@UniqueConstraint(columnNames={\"BAR\"}), @UniqueConstraint(columnNames={\"BAZ\"})})", cu);
-
- table.removeUniqueConstraint(0);
- assertEquals("BAZ", table.uniqueConstraintAt(0).columnNames().next());
- assertEquals(1, table.uniqueConstraintsSize());
- assertSourceContains("@JoinTable(uniqueConstraints=@UniqueConstraint(columnNames={\"BAZ\"}))", cu);
-
- table.removeUniqueConstraint(0);
- assertEquals(0, table.uniqueConstraintsSize());
- assertSourceDoesNotContain("@JoinTable", cu);
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithUniqueConstraints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
- assertSourceContains("@JoinTable(uniqueConstraints={@UniqueConstraint(columnNames={\"BAR\"}), @UniqueConstraint(columnNames={\"FOO\"}), @UniqueConstraint(columnNames={\"BAZ\"})})", cu);
-
- table.moveUniqueConstraint(2, 0);
- assertSourceContains("@JoinTable(uniqueConstraints={@UniqueConstraint(columnNames={\"FOO\"}), @UniqueConstraint(columnNames={\"BAZ\"}), @UniqueConstraint(columnNames={\"BAR\"})})", cu);
- }
-
- public void testMoveUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithUniqueConstraints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
- assertSourceContains("@JoinTable(uniqueConstraints={@UniqueConstraint(columnNames={\"BAR\"}), @UniqueConstraint(columnNames={\"FOO\"}), @UniqueConstraint(columnNames={\"BAZ\"})})", cu);
-
- table.moveUniqueConstraint(0, 2);
- assertSourceContains("@JoinTable(uniqueConstraints={@UniqueConstraint(columnNames={\"BAZ\"}), @UniqueConstraint(columnNames={\"BAR\"}), @UniqueConstraint(columnNames={\"FOO\"})})", cu);
- }
-
- public void testJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
-
- assertEquals(0, table.joinColumnsSize());
- }
-
- public void testJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
-
-
- table.addJoinColumn(0);
- table.addJoinColumn(1);
-
- assertEquals(2, table.joinColumnsSize());
- }
-
- public void testJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
-
- assertEquals(2, table.joinColumnsSize());
- }
-
- public void testAddJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
-
- table.addJoinColumn(0).setName("FOO");
- table.addJoinColumn(1);
- table.addJoinColumn(0).setName("BAR");
-
- assertEquals("BAR", table.joinColumnAt(0).getName());
- assertEquals("FOO", table.joinColumnAt(1).getName());
- assertNull(table.joinColumnAt(2).getName());
- assertSourceContains("@JoinTable(joinColumns={@JoinColumn(name=\"BAR\"),@JoinColumn(name=\"FOO\"), @JoinColumn})", cu);
- }
-
- public void testRemoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
- table.addJoinColumn(0).setName("FOO");
-
- assertEquals("FOO", table.joinColumnAt(0).getName());
- assertEquals("BAR", table.joinColumnAt(1).getName());
- assertNull(table.joinColumnAt(2).getName());
- assertEquals(3, table.joinColumnsSize());
-
- table.removeJoinColumn(1);
- assertEquals("FOO", table.joinColumnAt(0).getName());
- assertNull(table.joinColumnAt(1).getName());
- assertEquals(2, table.joinColumnsSize());
- assertSourceContains("@JoinTable(joinColumns={@JoinColumn(name=\"FOO\"), @JoinColumn})", cu);
-
- table.removeJoinColumn(0);
- assertNull(table.joinColumnAt(0).getName());
- assertEquals(1, table.joinColumnsSize());
- assertSourceContains("@JoinTable(joinColumns=@JoinColumn)", cu);
-
-
- table.removeJoinColumn(0);
- assertEquals(0, table.joinColumnsSize());
- assertSourceDoesNotContain("@JoinTable", cu);
- }
-
- public void testMoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- table.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@JoinTable(joinColumns={@JoinColumn(name=\"FOO\"), @JoinColumn(name=\"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn})", cu);
-
- table.moveJoinColumn(2, 0);
- assertEquals("BAR", table.joinColumnAt(0).getName());
- assertNull(table.joinColumnAt(1).getName());
- assertEquals("FOO", table.joinColumnAt(2).getName());
- assertEquals(3, table.joinColumnsSize());
- assertSourceContains("@JoinTable(joinColumns={@JoinColumn(name=\"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn, @JoinColumn(name=\"FOO\")})", cu);
- }
-
- public void testMoveJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
-
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
-
- table.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@JoinTable(joinColumns={@JoinColumn(name=\"FOO\"), @JoinColumn(name=\"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn})", cu);
-
-
- table.moveJoinColumn(0, 2);
- assertNull(table.joinColumnAt(0).getName());
- assertEquals("FOO", table.joinColumnAt(1).getName());
- assertEquals("BAR", table.joinColumnAt(2).getName());
- assertEquals(3, table.joinColumnsSize());
- assertSourceContains("@JoinTable(joinColumns={@JoinColumn, @JoinColumn(name=\"FOO\"), @JoinColumn(name=\"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")})", cu);
- }
-
- public void testSetJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
-
- assertEquals(2, table.joinColumnsSize());
-
- JoinColumnAnnotation joinColumn = table.joinColumns().next();
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@JoinTable(joinColumns={@JoinColumn(name=\"foo\"), @JoinColumn})", cu);
- }
-
- public void testInverseJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
-
- assertEquals(0, table.inverseJoinColumnsSize());
- }
-
- public void testInverseJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
-
-
- table.addInverseJoinColumn(0);
- table.addInverseJoinColumn(1);
-
- assertEquals(2, table.inverseJoinColumnsSize());
- }
-
- public void testInverseJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithInverseJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
-
- assertEquals(2, table.inverseJoinColumnsSize());
- }
-
- public void testAddInverseJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
-
- table.addInverseJoinColumn(0).setName("FOO");
- table.addInverseJoinColumn(1);
- table.addInverseJoinColumn(0).setName("BAR");
-
- assertEquals("BAR", table.inverseJoinColumnAt(0).getName());
- assertEquals("FOO", table.inverseJoinColumnAt(1).getName());
- assertNull(table.inverseJoinColumnAt(2).getName());
- assertSourceContains("@JoinTable(inverseJoinColumns={@JoinColumn(name=\"BAR\"),@JoinColumn(name=\"FOO\"), @JoinColumn})", cu);
- }
-
- public void testRemoveInverseJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithInverseJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
- table.addInverseJoinColumn(2).setName("FOO");
-
- Iterator<JoinColumnAnnotation> inverseJoinColumns = table.inverseJoinColumns();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- table.removeInverseJoinColumn(1);
- assertSourceContains("@JoinTable(inverseJoinColumns={@JoinColumn(name=\"BAR\"), @JoinColumn(name=\"FOO\")})", cu);
- inverseJoinColumns = table.inverseJoinColumns();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- table.removeInverseJoinColumn(0);
- assertSourceContains("@JoinTable(inverseJoinColumns=@JoinColumn(name=\"FOO\"))", cu);
- inverseJoinColumns = table.inverseJoinColumns();
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- table.removeInverseJoinColumn(0);
- assertSourceDoesNotContain("@JoinTable", cu);
- }
-
- public void testMoveInverseJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithInverseJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
- table.addInverseJoinColumn(0).setName("FOO");
-
- Iterator<JoinColumnAnnotation> inverseJoinColumns = table.inverseJoinColumns();
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
-
- table.moveInverseJoinColumn(2, 0);
- inverseJoinColumns = table.inverseJoinColumns();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
-
- assertSourceContains("@JoinTable(inverseJoinColumns={@JoinColumn(name=\"BAR\"), @JoinColumn, @JoinColumn(name=\"FOO\")})", cu);
- }
-
- public void testMoveInverseJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithInverseJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
- table.addInverseJoinColumn(1).setName("FOO");
-
- Iterator<JoinColumnAnnotation> inverseJoinColumns = table.inverseJoinColumns();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
-
- table.moveInverseJoinColumn(0, 2);
- inverseJoinColumns = table.inverseJoinColumns();
- assertNull(inverseJoinColumns.next().getName());
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
-
- assertSourceContains("@JoinTable(inverseJoinColumns={@JoinColumn, @JoinColumn(name=\"BAR\"), @JoinColumn(name=\"FOO\")})", cu);
- }
-
- public void testSetInverseJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithInverseJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JoinTableAnnotation table = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JPA.JOIN_TABLE);
-
- assertEquals(2, table.inverseJoinColumnsSize());
-
- JoinColumnAnnotation joinColumn = table.inverseJoinColumns().next();
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@JoinTable(inverseJoinColumns={@JoinColumn(name=\"foo\"), @JoinColumn})", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JptJavaResourceTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JptJavaResourceTests.java
deleted file mode 100644
index 096dc3b131..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JptJavaResourceTests.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.core.tests.internal.resource.java;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptJavaResourceTests {
-
- public static Test suite() {
- return suite(true);
- }
-
- public static Test suite(boolean all) {
- TestSuite suite = new TestSuite(JptJavaResourceTests.class.getName());
- suite.addTestSuite(JavaResourcePersistentTypeTests.class);
- suite.addTestSuite(JavaResourcePersistentAttributeTests.class);
- suite.addTestSuite(JPTToolsTests.class);
-
- suite.addTestSuite(AssociationOverrideTests.class);
- suite.addTestSuite(AssociationOverridesTests.class);
- suite.addTestSuite(AttributeOverrideTests.class);
- suite.addTestSuite(AttributeOverridesTests.class);
- suite.addTestSuite(BasicTests.class);
- suite.addTestSuite(ColumnTests.class);
- suite.addTestSuite(DiscriminatorValueTests.class);
- suite.addTestSuite(DiscriminatorColumnTests.class);
- suite.addTestSuite(EmbeddableTests.class);
- suite.addTestSuite(EmbeddedTests.class);
- suite.addTestSuite(EmbeddedIdTests.class);
- suite.addTestSuite(EntityTests.class);
- suite.addTestSuite(EnumeratedTests.class);
- suite.addTestSuite(GeneratedValueTests.class);
- suite.addTestSuite(IdClassTests.class);
- suite.addTestSuite(IdTests.class);
- suite.addTestSuite(InheritanceTests.class);
- suite.addTestSuite(JoinColumnTests.class);
- suite.addTestSuite(JoinColumnsTests.class);
- suite.addTestSuite(JoinTableTests.class);
- suite.addTestSuite(LobTests.class);
- suite.addTestSuite(ManyToManyTests.class);
- suite.addTestSuite(ManyToOneTests.class);
- suite.addTestSuite(MapKeyTests.class);
- suite.addTestSuite(MappedSuperclassTests.class);
- suite.addTestSuite(NamedNativeQueryTests.class);
- suite.addTestSuite(NamedNativeQueriesTests.class);
- suite.addTestSuite(NamedQueryTests.class);
- suite.addTestSuite(NamedQueriesTests.class);
- suite.addTestSuite(OneToManyTests.class);
- suite.addTestSuite(OneToOneTests.class);
- suite.addTestSuite(OrderByTests.class);
- suite.addTestSuite(PrimaryKeyJoinColumnTests.class);
- suite.addTestSuite(PrimaryKeyJoinColumnsTests.class);
- suite.addTestSuite(QueryHintTests.class);
- suite.addTestSuite(SecondaryTableTests.class);
- suite.addTestSuite(SecondaryTablesTests.class);
- suite.addTestSuite(SequenceGeneratorTests.class);
- suite.addTestSuite(TableGeneratorTests.class);
- suite.addTestSuite(TableTests.class);
- suite.addTestSuite(TemporalTests.class);
- suite.addTestSuite(TransientTests.class);
- suite.addTestSuite(VersionTests.class);
-
- return suite;
- }
-
- private JptJavaResourceTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/LobTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/LobTests.java
deleted file mode 100644
index 55af8011c5..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/LobTests.java
+++ /dev/null
@@ -1,48 +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.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.core.resource.java.LobAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class LobTests extends JavaResourceModelTestCase {
-
- public LobTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestLob() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.LOB);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Lob");
- }
- });
- }
-
- public void testLob() throws Exception {
- ICompilationUnit cu = this.createTestLob();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- LobAnnotation lob = (LobAnnotation) attributeResource.getSupportingAnnotation(JPA.LOB);
- assertNotNull(lob);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ManyToManyTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ManyToManyTests.java
deleted file mode 100644
index 179d399f2e..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ManyToManyTests.java
+++ /dev/null
@@ -1,393 +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.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.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class ManyToManyTests extends JavaResourceModelTestCase {
-
- public ManyToManyTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestManyToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(fetch=FetchType.EAGER)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithTargetEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(targetEntity=AnnotationTestType.class)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithMappedBy() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(mappedBy=\"foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(cascade=CascadeType.ALL)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithMultipleCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(cascade={CascadeType.MERGE, CascadeType.REMOVE})");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithDuplicateCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(cascade={CascadeType.MERGE, CascadeType.MERGE})");
- }
- });
- }
-
- public void testManyToMany() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_MANY);
- assertNotNull(manyToMany);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithFetch();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_MANY);
- assertEquals(FetchType.EAGER, manyToMany.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithFetch();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_MANY);
- assertEquals(FetchType.EAGER, manyToMany.getFetch());
-
- manyToMany.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, manyToMany.getFetch());
-
- assertSourceContains("@ManyToMany(fetch=LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithFetch();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_MANY);
- assertEquals(FetchType.EAGER, manyToMany.getFetch());
-
- manyToMany.setFetch(null);
- assertNull(manyToMany.getFetch());
-
- assertSourceContains("@ManyToMany", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-
- public void testGetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithTargetEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_MANY);
- assertEquals(TYPE_NAME, manyToMany.getTargetEntity());
- }
-
- public void testSetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithTargetEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_MANY);
- assertEquals(TYPE_NAME, manyToMany.getTargetEntity());
-
- manyToMany.setTargetEntity("Foo");
-
- assertSourceContains("@ManyToMany(targetEntity=Foo.class)", cu);
- }
-
- public void testSetTargetEntityNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithTargetEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_MANY);
- assertEquals(TYPE_NAME, manyToMany.getTargetEntity());
-
- manyToMany.setTargetEntity(null);
-
- assertSourceContains("@ManyToMany", cu);
- assertSourceDoesNotContain("targetEntity", cu);
- }
-
-
- public void testGetFullyQualifiedTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithTargetEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_MANY);
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, manyToMany.getFullyQualifiedTargetEntity());
-
- manyToMany.setTargetEntity("Foo");
-
- assertSourceContains("@ManyToMany(targetEntity=Foo.class)", cu);
-
- assertEquals("Foo", manyToMany.getTargetEntity());
-
- assertEquals("Foo", manyToMany.getFullyQualifiedTargetEntity()); //bug 196200 changed this
- }
-
- public void testGetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithMappedBy();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_MANY);
- assertEquals("foo", manyToMany.getMappedBy());
- }
-
- public void testGetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_MANY);
- assertEquals(null, manyToMany.getMappedBy());
- }
-
- public void testSetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_MANY);
- assertNull(manyToMany.getMappedBy());
- manyToMany.setMappedBy("bar");
- assertEquals("bar", manyToMany.getMappedBy());
-
- assertSourceContains("@ManyToMany(mappedBy=\"bar\")", cu);
- }
-
- public void testSetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithMappedBy();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_MANY);
- assertEquals("foo", manyToMany.getMappedBy());
-
- manyToMany.setMappedBy(null);
- assertNull(manyToMany.getMappedBy());
-
- assertSourceContains("@ManyToMany", cu);
- assertSourceDoesNotContain("mappedBy", cu);
- }
-
- public void testSetCascadeAll() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadeAll());
-
- manyToMany.setCascadeAll(true);
- assertSourceContains("@ManyToMany(cascade=ALL)", cu);
-
- assertTrue(manyToMany.isCascadeAll());
- }
-
- public void testSetCascadeMerge() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadeMerge());
-
- manyToMany.setCascadeMerge(true);
- assertSourceContains("@ManyToMany(cascade=MERGE)", cu);
-
- assertTrue(manyToMany.isCascadeMerge());
- }
-
- public void testSetCascadePersist() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadePersist());
-
- manyToMany.setCascadePersist(true);
- assertSourceContains("@ManyToMany(cascade=PERSIST)", cu);
-
- assertTrue(manyToMany.isCascadePersist());
- }
-
- public void testSetCascadeRemove() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadeRemove());
-
- manyToMany.setCascadeRemove(true);
- assertSourceContains("@ManyToMany(cascade=REMOVE)", cu);
-
- assertTrue(manyToMany.isCascadeRemove());
- }
-
- public void testSetCascadeRefresh() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadeRefresh());
-
- manyToMany.setCascadeRefresh(true);
- assertSourceContains("@ManyToMany(cascade=REFRESH)", cu);
-
- assertTrue(manyToMany.isCascadeRefresh());
- }
-
- public void testCascadeMoreThanOnce() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithCascade();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_MANY);
- assertTrue(manyToMany.isCascadeAll());
-
- manyToMany.setCascadeAll(true);
- assertTrue(manyToMany.isCascadeAll());
- //a second CascadeType.All should not have been added
- assertSourceContains("@ManyToMany(cascade=CascadeType.ALL)", cu);
-
- manyToMany.setCascadeAll(false);
- assertFalse(manyToMany.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
-
- //test setting cascadeAll to false again, should just do nothing
- manyToMany.setCascadeAll(false);
- assertFalse(manyToMany.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testDuplicateCascade() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithDuplicateCascade();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_MANY);
- assertTrue(manyToMany.isCascadeMerge());
-
- manyToMany.setCascadeMerge(false); //TODO should the resource model handle this and remove both MERGE
- //settings instead of having to set it false twice?
- assertTrue(manyToMany.isCascadeMerge());
-
- manyToMany.setCascadeMerge(false);
- assertFalse(manyToMany.isCascadeMerge());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testMultipleCascade() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithMultipleCascade();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_MANY);
- assertTrue(manyToMany.isCascadeMerge());
- assertTrue(manyToMany.isCascadeRemove());
-
- manyToMany.setCascadeMerge(false);
- assertSourceContains("@ManyToMany(cascade=REMOVE)", cu);
-
- manyToMany.setCascadeRemove(false);
- assertSourceDoesNotContain("cascade", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ManyToOneTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ManyToOneTests.java
deleted file mode 100644
index 9adfeca2e7..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ManyToOneTests.java
+++ /dev/null
@@ -1,386 +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.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.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class ManyToOneTests extends JavaResourceModelTestCase {
-
- public ManyToOneTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestManyToOne() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(fetch=FetchType.EAGER)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithTargetEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(targetEntity=AnnotationTestType.class)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithOptional() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(optional=true)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(cascade=CascadeType.ALL)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithMultipleCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(cascade={CascadeType.MERGE, CascadeType.REMOVE})");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithDuplicateCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(cascade={CascadeType.MERGE, CascadeType.MERGE})");
- }
- });
- }
-
- public void testManyToOne() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_ONE);
- assertNotNull(manyToOne);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithFetch();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_ONE);
- assertEquals(FetchType.EAGER, manyToOne.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithFetch();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_ONE);
- assertEquals(FetchType.EAGER, manyToOne.getFetch());
-
- manyToOne.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, manyToOne.getFetch());
-
- assertSourceContains("@ManyToOne(fetch=LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithFetch();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_ONE);
- assertEquals(FetchType.EAGER, manyToOne.getFetch());
-
- manyToOne.setFetch(null);
- assertNull(manyToOne.getFetch());
-
- assertSourceContains("@ManyToOne", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-
-
- public void testGetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithTargetEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_ONE);
- assertEquals(TYPE_NAME, manyToOne.getTargetEntity());
- }
-
- public void testSetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithTargetEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_ONE);
- assertEquals(TYPE_NAME, manyToOne.getTargetEntity());
-
- manyToOne.setTargetEntity("Foo");
-
- assertSourceContains("@ManyToOne(targetEntity=Foo.class)", cu);
- }
-
- public void testSetTargetEntityNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithTargetEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_ONE);
- assertEquals(TYPE_NAME, manyToOne.getTargetEntity());
-
- manyToOne.setTargetEntity(null);
-
- assertSourceContains("@ManyToOne", cu);
- assertSourceDoesNotContain("targetEntity", cu);
- }
-
-
- public void testGetFullyQualifiedTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithTargetEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_ONE);
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, manyToOne.getFullyQualifiedTargetEntity());
-
- manyToOne.setTargetEntity("Foo");
-
- assertSourceContains("@ManyToOne(targetEntity=Foo.class)", cu);
-
- assertEquals("Foo", manyToOne.getTargetEntity());
-
- assertEquals("Foo", manyToOne.getFullyQualifiedTargetEntity());//bug 196200 changed this
- }
-
- public void testGetOptional() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithOptional();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_ONE);
- assertEquals(Boolean.TRUE, manyToOne.getOptional());
- }
-
- public void testSetOptional() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithOptional();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_ONE);
- assertEquals(Boolean.TRUE, manyToOne.getOptional());
-
- manyToOne.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, manyToOne.getOptional());
-
- assertSourceContains("@ManyToOne(optional=false)", cu);
- }
-
- public void testSetOptionalNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithOptional();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_ONE);
- assertEquals(Boolean.TRUE, manyToOne.getOptional());
-
- manyToOne.setOptional(null);
- assertNull(manyToOne.getOptional());
-
- assertSourceContains("@ManyToOne", cu);
- assertSourceDoesNotContain("optional", cu);
- }
-
- public void testSetCascadeAll() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadeAll());
-
- manyToOne.setCascadeAll(true);
- assertSourceContains("@ManyToOne(cascade=ALL)", cu);
-
- assertTrue(manyToOne.isCascadeAll());
- }
-
- public void testSetCascadeMerge() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadeMerge());
-
- manyToOne.setCascadeMerge(true);
- assertSourceContains("@ManyToOne(cascade=MERGE)", cu);
-
- assertTrue(manyToOne.isCascadeMerge());
- }
-
- public void testSetCascadePersist() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadePersist());
-
- manyToOne.setCascadePersist(true);
- assertSourceContains("@ManyToOne(cascade=PERSIST)", cu);
-
- assertTrue(manyToOne.isCascadePersist());
- }
-
- public void testSetCascadeRemove() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadeRemove());
-
- manyToOne.setCascadeRemove(true);
- assertSourceContains("@ManyToOne(cascade=REMOVE)", cu);
-
- assertTrue(manyToOne.isCascadeRemove());
- }
-
- public void testSetCascadeRefresh() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadeRefresh());
-
- manyToOne.setCascadeRefresh(true);
- assertSourceContains("@ManyToOne(cascade=REFRESH)", cu);
-
- assertTrue(manyToOne.isCascadeRefresh());
- }
-
- public void testCascadeMoreThanOnce() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithCascade();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_ONE);
- assertTrue(manyToOne.isCascadeAll());
-
- manyToOne.setCascadeAll(true);
- assertTrue(manyToOne.isCascadeAll());
- //a second CascadeType.All should not have been added
- assertSourceContains("@ManyToOne(cascade=CascadeType.ALL)", cu);
-
- manyToOne.setCascadeAll(false);
- assertFalse(manyToOne.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
-
- //test setting cascadeAll to false again, should just do nothing
- manyToOne.setCascadeAll(false);
- assertFalse(manyToOne.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testDuplicateCascade() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithDuplicateCascade();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_ONE);
- assertTrue(manyToOne.isCascadeMerge());
-
- manyToOne.setCascadeMerge(false);//TODO should the resource model handle this and remove both MERGE
- //settings instead of having to set it false twice?
- assertTrue(manyToOne.isCascadeMerge());
-
- manyToOne.setCascadeMerge(false);
- assertFalse(manyToOne.isCascadeMerge());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testMultipleCascade() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithMultipleCascade();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation(JPA.MANY_TO_ONE);
- assertTrue(manyToOne.isCascadeMerge());
- assertTrue(manyToOne.isCascadeRemove());
-
- manyToOne.setCascadeMerge(false);
- assertSourceContains("@ManyToOne(cascade=REMOVE)", cu);
-
- manyToOne.setCascadeRemove(false);
- assertSourceDoesNotContain("cascade", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/MapKeyTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/MapKeyTests.java
deleted file mode 100644
index a13d665524..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/MapKeyTests.java
+++ /dev/null
@@ -1,87 +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.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.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class MapKeyTests extends JavaResourceModelTestCase {
-
- public MapKeyTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestMapKey() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAP_KEY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKey");
- }
- });
- }
-
- private ICompilationUnit createTestMapKeyWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAP_KEY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKey(name=\"key\")");
- }
- });
- }
-
- public void testMapKey() throws Exception {
- ICompilationUnit cu = this.createTestMapKey();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- MapKeyAnnotation mapKey = (MapKeyAnnotation) attributeResource.getSupportingAnnotation(JPA.MAP_KEY);
- assertNotNull(mapKey);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestMapKeyWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- MapKeyAnnotation mapKey = (MapKeyAnnotation) attributeResource.getSupportingAnnotation(JPA.MAP_KEY);
- assertEquals("key", mapKey.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestMapKey();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- MapKeyAnnotation mapKey = (MapKeyAnnotation) attributeResource.getSupportingAnnotation(JPA.MAP_KEY);
-
- mapKey.setName("foo");
-
- assertSourceContains("@MapKey(name=\"foo\")", cu);
-
- mapKey.setName(null);
-
- assertSourceContains("@MapKey", cu);
- assertSourceDoesNotContain("@MapKey(name=\"foo\")", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/MappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/MappedSuperclassTests.java
deleted file mode 100644
index 9ab47ea88d..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/MappedSuperclassTests.java
+++ /dev/null
@@ -1,73 +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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.MappedSuperclassAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class MappedSuperclassTests extends JavaResourceModelTestCase {
-
- public MappedSuperclassTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassAndEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- sb.append("@Entity");
- }
- });
- }
-
- public void testMappedSuperclass() throws Exception {
- ICompilationUnit cu = this.createTestMappedSuperclass();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- JavaResourceNode mappingAnnotation = typeResource.getMappingAnnotation();
- assertTrue(mappingAnnotation instanceof MappedSuperclassAnnotation);
- }
-
- public void testMappedSuperclassAndEntity() throws Exception {
- ICompilationUnit cu = this.createTestMappedSuperclassAndEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- JavaResourceNode mappingAnnotation = typeResource.getMappingAnnotation();
- assertTrue(mappingAnnotation instanceof EntityAnnotation);
-
- MappedSuperclassAnnotation mappedSuperclass = (MappedSuperclassAnnotation) typeResource.getMappingAnnotation(JPA.MAPPED_SUPERCLASS);
- assertNotNull(mappedSuperclass);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedNativeQueriesTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedNativeQueriesTests.java
deleted file mode 100644
index bbe55c305e..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedNativeQueriesTests.java
+++ /dev/null
@@ -1,421 +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.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.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.NamedNativeQueriesAnnotation;
-import org.eclipse.jpt.core.resource.java.NamedNativeQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class NamedNativeQueriesTests extends JavaResourceModelTestCase {
-
- private static final String QUERY_NAME = "myQuery";
- private static final String QUERY_QUERY = "SELECT name FROM Employee";
- private static final String QUERY_RESULT_CLASS = "Result";
- private static final String QUERY_RESULT_SET_MAPPING = "resultSetMapping";
-
- public NamedNativeQueriesTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestNamedNativeQueries() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERIES, JPA.NAMED_NATIVE_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQueries(@NamedNativeQuery)");
- }
- });
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithName() throws Exception {
- return createTestNamedNativeQueryWithStringElement("name", QUERY_NAME);
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithQuery() throws Exception {
- return createTestNamedNativeQueryWithStringElement("query", QUERY_QUERY);
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithResultSetMapping() throws Exception {
- return createTestNamedNativeQueryWithStringElement("resultSetMapping", QUERY_RESULT_SET_MAPPING);
- }
-
-
- private ICompilationUnit createTestNamedNativeQueryWithStringElement(final String elementName, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERIES, JPA.NAMED_NATIVE_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQueries(@NamedNativeQuery(" + elementName + "=\"" + value + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithResultClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERIES, JPA.NAMED_NATIVE_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQueries(@NamedNativeQuery(resultClass=" + QUERY_RESULT_CLASS + ".class))");
- }
- });
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithQueryHints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERIES, JPA.NAMED_NATIVE_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQueries(@NamedNativeQuery(hints={@QueryHint(name=\"BAR\", value=\"FOO\"), @QueryHint}))");
- }
- });
- }
-
- private ICompilationUnit createTestNamedNativeQuery() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQuery(name=\"foo\", query=\"bar\", hints=@QueryHint(name=\"BAR\", value=\"FOO\"), resultClass=Foo.class, resultSetMapping=\"mapping\")");
- }
- });
- }
-
- public void testNamedNativeQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueries();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERIES);
- NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
- assertNotNull(namedQuery);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERIES);
- NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
- assertEquals(QUERY_NAME, namedQuery.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERIES);
- NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
- assertEquals(QUERY_NAME, namedQuery.getName());
-
- namedQuery.setName("foo");
- assertEquals("foo", namedQuery.getName());
-
- assertSourceContains("@NamedNativeQuery(name=\"foo\")", cu);
-
- namedQuery.setName(null);
- assertNull(namedQuery.getName());
-
- assertSourceDoesNotContain("@NamedNativeQuery", cu);
- }
-
- public void testGetQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQuery();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERIES);
- NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
- }
-
- public void testSetQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQuery();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERIES);
- NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
-
- namedQuery.setQuery("foo");
- assertEquals("foo", namedQuery.getQuery());
-
- assertSourceContains("@NamedNativeQuery(query=\"foo\")", cu);
-
- namedQuery.setQuery(null);
- assertNull(namedQuery.getQuery());
-
- assertSourceDoesNotContain("@NamedNativeQuery", cu);
- }
-
- public void testGetResultClass() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultClass();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERIES);
- NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
- assertEquals(QUERY_RESULT_CLASS, namedQuery.getResultClass());
- }
-
- public void testSetResultClass() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultClass();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERIES);
- NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
- assertEquals(QUERY_RESULT_CLASS, namedQuery.getResultClass());
-
- namedQuery.setResultClass("foo");
- assertEquals("foo", namedQuery.getResultClass());
-
- assertSourceContains("@NamedNativeQuery(resultClass=foo.class)", cu);
-
- namedQuery.setResultClass(null);
- assertNull(namedQuery.getResultClass());
-
- assertSourceDoesNotContain("@NamedNativeQuery", cu);
- }
-
- public void testGetFullyQualifiedClass() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultClass();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERIES);
- NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
- assertNotNull(namedQuery.getResultClass());
- assertEquals("Result", namedQuery.getFullyQualifiedResultClass());//bug 196200 changed this
-
- namedQuery.setResultClass(TYPE_NAME);
-
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, namedQuery.getFullyQualifiedResultClass());
- assertSourceContains("@NamedNativeQuery(resultClass=" + TYPE_NAME + ".class)", cu);
- }
-
- public void testGetResultSetMapping() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultSetMapping();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERIES);
- NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
- assertEquals(QUERY_RESULT_SET_MAPPING, namedQuery.getResultSetMapping());
- }
-
- public void testSetResultSetMapping() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultSetMapping();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERIES);
- NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
- assertEquals(QUERY_RESULT_SET_MAPPING, namedQuery.getResultSetMapping());
-
- namedQuery.setResultSetMapping("foo");
- assertEquals("foo", namedQuery.getResultSetMapping());
-
- assertSourceContains("@NamedNativeQuery(resultSetMapping=\"foo\")", cu);
-
- namedQuery.setResultSetMapping(null);
- assertNull(namedQuery.getResultSetMapping());
-
- assertSourceDoesNotContain("@NamedNativeQuery", cu);
- }
-
- public void testHints() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueries();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERIES);
- NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
-
- assertEquals(0, namedQuery.hintsSize());
- }
-
- public void testHints2() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueries();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERIES);
- NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
-
- namedQuery.addHint(0);
- namedQuery.addHint(1);
-
- assertEquals(2, namedQuery.hintsSize());
- }
-
- public void testHints3() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQueryHints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERIES);
- NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
-
- assertEquals(2, namedQuery.hintsSize());
- }
-
- public void testAddHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueries();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERIES);
- NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
-
- namedQuery.addHint(0).setName("FOO");
- namedQuery.addHint(1);
- namedQuery.addHint(0).setName("BAR");
-
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertEquals("FOO", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertSourceContains("@NamedNativeQuery(hints={@QueryHint(name=\"BAR\"),@QueryHint(name=\"FOO\"), @QueryHint})", cu);
- }
-
- public void testRemoveHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQueryHints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERIES);
- NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.hintsSize());
-
- namedQuery.removeHint(2);
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertEquals(2, namedQuery.hintsSize());
- assertSourceContains("@NamedNativeQueries(@NamedNativeQuery(hints={@QueryHint(name=\"BAZ\"), @QueryHint(name=\"BAR\", value=\"FOO\")}))", cu);
-
- namedQuery.removeHint(0);
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertEquals(1, namedQuery.hintsSize());
- assertSourceContains("@NamedNativeQueries(@NamedNativeQuery(hints=@QueryHint(name=\"BAR\", value=\"FOO\")))", cu);
-
-
- namedQuery.removeHint(0);
- assertEquals(0, namedQuery.hintsSize());
- assertSourceDoesNotContain("@NamedNativeQuery", cu);
- }
-
- public void testMoveHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQueryHints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERIES);
- NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
-
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.hintsSize());
-
- namedQuery.moveHint(2, 0);
-
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertNull(namedQuery.hintAt(1).getName());
- assertEquals("BAZ", namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.hintsSize());
- assertSourceContains("@NamedNativeQueries(@NamedNativeQuery(hints={@QueryHint(name=\"BAR\", value=\"FOO\"), @QueryHint, @QueryHint(name=\"BAZ\")}))", cu);
- }
-
- public void testMoveHint2() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQueryHints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERIES);
- NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
-
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.hintsSize());
-
- namedQuery.moveHint(0, 2);
-
- assertNull(namedQuery.hintAt(0).getName());
- assertEquals("BAZ", namedQuery.hintAt(1).getName());
- assertEquals("BAR", namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.hintsSize());
- assertSourceContains("@NamedNativeQueries(@NamedNativeQuery(hints={@QueryHint, @QueryHint(name=\"BAZ\"), @QueryHint(name=\"BAR\", value=\"FOO\")}))", cu);
- }
-
- public void testAddNamedNativeQueryCopyExisting() throws Exception {
- ICompilationUnit cu = createTestNamedNativeQuery();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) typeResource.addSupportingAnnotation(1, JPA.NAMED_NATIVE_QUERY, JPA.NAMED_NATIVE_QUERIES);
- namedQuery.setName("BAR");
- assertSourceContains("@NamedNativeQueries({@NamedNativeQuery(name=\"foo\", query = \"bar\", hints = @QueryHint(name=\"BAR\", value = \"FOO\"), resultClass = Foo.class, resultSetMapping = \"mapping\"),@NamedNativeQuery(name=\"BAR\")})", cu);
-
- assertNull(typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERY));
- assertNotNull(typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERIES));
- assertEquals(2, CollectionTools.size(typeResource.supportingAnnotations(JPA.NAMED_NATIVE_QUERY, JPA.NAMED_NATIVE_QUERIES)));
- }
-
- public void testAddNamedNativeQueryToBeginningOfList() throws Exception {
- ICompilationUnit cu = createTestNamedNativeQuery();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) typeResource.addSupportingAnnotation(1, JPA.NAMED_NATIVE_QUERY, JPA.NAMED_NATIVE_QUERIES);
- namedQuery.setName("BAR");
- assertSourceContains("@NamedNativeQueries({@NamedNativeQuery(name=\"foo\", query = \"bar\", hints = @QueryHint(name=\"BAR\", value = \"FOO\"), resultClass = Foo.class, resultSetMapping = \"mapping\"),@NamedNativeQuery(name=\"BAR\")})", cu);
-
- namedQuery = (NamedNativeQueryAnnotation) typeResource.addSupportingAnnotation(0, JPA.NAMED_NATIVE_QUERY, JPA.NAMED_NATIVE_QUERIES);
- namedQuery.setName("BAZ");
- assertSourceContains("@NamedNativeQueries({@NamedNativeQuery(name=\"BAZ\"),@NamedNativeQuery(name=\"foo\", query = \"bar\", hints = @QueryHint(name=\"BAR\", value = \"FOO\"), resultClass = Foo.class, resultSetMapping = \"mapping\"), @NamedNativeQuery(name=\"BAR\")})", cu);
-
- Iterator<NestableAnnotation> namedQueries = typeResource.supportingAnnotations(JPA.NAMED_NATIVE_QUERY, JPA.NAMED_NATIVE_QUERIES);
- assertEquals("BAZ", ((NamedNativeQueryAnnotation) namedQueries.next()).getName());
- assertEquals("foo", ((NamedNativeQueryAnnotation) namedQueries.next()).getName());
- assertEquals("BAR", ((NamedNativeQueryAnnotation) namedQueries.next()).getName());
-
- assertNull(typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERY));
- assertNotNull(typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERIES));
- assertEquals(3, CollectionTools.size(typeResource.supportingAnnotations(JPA.NAMED_NATIVE_QUERY, JPA.NAMED_NATIVE_QUERIES)));
- }
-
- public void testRemoveNamedNativeQueryCopyExisting() throws Exception {
- ICompilationUnit cu = createTestNamedNativeQuery();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) typeResource.addSupportingAnnotation(1, JPA.NAMED_NATIVE_QUERY, JPA.NAMED_NATIVE_QUERIES);
- namedQuery.setName("BAR");
- assertSourceContains("@NamedNativeQueries({@NamedNativeQuery(name=\"foo\", query = \"bar\", hints = @QueryHint(name=\"BAR\", value = \"FOO\"), resultClass = Foo.class, resultSetMapping = \"mapping\"),@NamedNativeQuery(name=\"BAR\")})", cu);
-
- typeResource.removeSupportingAnnotation(1, JPA.NAMED_NATIVE_QUERY, JPA.NAMED_NATIVE_QUERIES);
- assertSourceContains("@NamedNativeQuery(name=\"foo\", query = \"bar\", hints = @QueryHint(name=\"BAR\", value = \"FOO\"), resultClass = Foo.class, resultSetMapping = \"mapping\")", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedNativeQueryTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedNativeQueryTests.java
deleted file mode 100644
index d204997c32..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedNativeQueryTests.java
+++ /dev/null
@@ -1,340 +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.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.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.NamedNativeQueryAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class NamedNativeQueryTests extends JavaResourceModelTestCase {
-
- private static final String QUERY_NAME = "myQuery";
- private static final String QUERY_QUERY = "SELECT name FROM Employee";
- private static final String QUERY_RESULT_CLASS = "Result";
- private static final String QUERY_RESULT_SET_MAPPING = "resultSetMapping";
-
- public NamedNativeQueryTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestNamedNativeQuery() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQuery");
- }
- });
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithName() throws Exception {
- return createTestNamedNativeQueryWithStringElement("name", QUERY_NAME);
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithQuery() throws Exception {
- return createTestNamedNativeQueryWithStringElement("query", QUERY_QUERY);
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithResultSetMapping() throws Exception {
- return createTestNamedNativeQueryWithStringElement("resultSetMapping", QUERY_RESULT_SET_MAPPING);
- }
-
-
- private ICompilationUnit createTestNamedNativeQueryWithStringElement(final String elementName, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQuery(" + elementName + "=\"" + value + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithResultClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQuery(resultClass=" + QUERY_RESULT_CLASS + ".class)");
- }
- });
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithQueryHints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQuery(hints={@QueryHint(name=\"BAR\", value=\"FOO\"), @QueryHint})");
- }
- });
- }
-
- public void testNamedNativeQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQuery();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERY);
- assertNotNull(namedQuery);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_NAME, namedQuery.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_NAME, namedQuery.getName());
-
- namedQuery.setName("foo");
- assertEquals("foo", namedQuery.getName());
-
- assertSourceContains("@NamedNativeQuery(name=\"foo\")", cu);
-
- namedQuery.setName(null);
- assertNull(namedQuery.getName());
-
- assertSourceDoesNotContain("@NamedNativeQuery", cu);
- }
-
- public void testGetQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQuery();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
- }
-
- public void testSetQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQuery();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
-
- namedQuery.setQuery("foo");
- assertEquals("foo", namedQuery.getQuery());
-
- assertSourceContains("@NamedNativeQuery(query=\"foo\")", cu);
-
- namedQuery.setQuery(null);
- assertNull(namedQuery.getQuery());
-
- assertSourceDoesNotContain("@NamedNativeQuery", cu);
- }
-
- public void testGetResultClass() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultClass();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_RESULT_CLASS, namedQuery.getResultClass());
- }
-
- public void testSetResultClass() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultClass();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_RESULT_CLASS, namedQuery.getResultClass());
-
- namedQuery.setResultClass("foo");
- assertEquals("foo", namedQuery.getResultClass());
-
- assertSourceContains("@NamedNativeQuery(resultClass=foo.class)", cu);
-
- namedQuery.setResultClass(null);
- assertNull(namedQuery.getResultClass());
-
- assertSourceDoesNotContain("@NamedNativeQuery", cu);
- }
-
- public void testGetFullyQualifiedClass() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultClass();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERY);
- assertNotNull(namedQuery.getResultClass());
- assertEquals("Result", namedQuery.getFullyQualifiedResultClass());//bug 196200 changed this
-
- namedQuery.setResultClass(TYPE_NAME);
-
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, namedQuery.getFullyQualifiedResultClass());
- assertSourceContains("@NamedNativeQuery(resultClass=" + TYPE_NAME + ".class)", cu);
- }
-
- public void testGetResultSetMapping() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultSetMapping();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_RESULT_SET_MAPPING, namedQuery.getResultSetMapping());
- }
-
- public void testSetResultSetMapping() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultSetMapping();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_RESULT_SET_MAPPING, namedQuery.getResultSetMapping());
-
- namedQuery.setResultSetMapping("foo");
- assertEquals("foo", namedQuery.getResultSetMapping());
-
- assertSourceContains("@NamedNativeQuery(resultSetMapping=\"foo\")", cu);
-
- namedQuery.setResultSetMapping(null);
- assertNull(namedQuery.getResultSetMapping());
-
- assertSourceDoesNotContain("@NamedNativeQuery", cu);
- }
-
- public void testHints() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQuery();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERY);
-
- assertEquals(0, namedQuery.hintsSize());
- }
-
- public void testHints2() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQuery();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERY);
-
- namedQuery.addHint(0);
- namedQuery.addHint(1);
-
- assertEquals(2, namedQuery.hintsSize());
- }
-
- public void testHints3() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQueryHints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERY);
-
- assertEquals(2, namedQuery.hintsSize());
- }
-
-
- public void testAddHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQuery();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERY);
-
- namedQuery.addHint(0).setName("FOO");
- namedQuery.addHint(1);
- namedQuery.addHint(0).setName("BAR");
-
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertEquals("FOO", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertSourceContains("@NamedNativeQuery(hints={@QueryHint(name=\"BAR\"),@QueryHint(name=\"FOO\"), @QueryHint})", cu);
- }
-
- public void testRemoveHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQueryHints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERY);
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.hintsSize());
-
- namedQuery.removeHint(2);
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertEquals(2, namedQuery.hintsSize());
- assertSourceContains("@NamedNativeQuery(hints={@QueryHint(name=\"BAZ\"), @QueryHint(name=\"BAR\", value=\"FOO\")})", cu);
-
- namedQuery.removeHint(0);
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertEquals(1, namedQuery.hintsSize());
- assertSourceContains("@NamedNativeQuery(hints=@QueryHint(name=\"BAR\", value=\"FOO\"))", cu);
-
-
- namedQuery.removeHint(0);
- assertEquals(0, namedQuery.hintsSize());
- assertSourceDoesNotContain("@NamedNativeQuery", cu);
- }
-
- public void testMoveHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQueryHints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERY);
-
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.hintsSize());
-
- namedQuery.moveHint(2, 0);
-
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertNull(namedQuery.hintAt(1).getName());
- assertEquals("BAZ", namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.hintsSize());
- assertSourceContains("@NamedNativeQuery(hints={@QueryHint(name=\"BAR\", value=\"FOO\"), @QueryHint, @QueryHint(name=\"BAZ\")})", cu);
- }
-
- public void testMoveHint2() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQueryHints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_NATIVE_QUERY);
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.hintsSize());
-
- namedQuery.moveHint(0, 2);
-
- assertNull(namedQuery.hintAt(0).getName());
- assertEquals("BAZ", namedQuery.hintAt(1).getName());
- assertEquals("BAR", namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.hintsSize());
- assertSourceContains("@NamedNativeQuery(hints={@QueryHint, @QueryHint(name=\"BAZ\"), @QueryHint(name=\"BAR\", value=\"FOO\")})", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedQueriesTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedQueriesTests.java
deleted file mode 100644
index 0bd1f90d19..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedQueriesTests.java
+++ /dev/null
@@ -1,331 +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.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.JavaResourcePersistentType;
-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.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class NamedQueriesTests extends JavaResourceModelTestCase {
-
- private static final String QUERY_NAME = "myQuery";
- private static final String QUERY_QUERY = "SELECT name FROM Employee";
-
- public NamedQueriesTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestNamedQueries() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_QUERIES, JPA.NAMED_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedQueries(@NamedQuery)");
- }
- });
- }
-
- private ICompilationUnit createTestNamedQueryWithName() throws Exception {
- return createTestNamedQueryWithStringElement("name", QUERY_NAME);
- }
-
- private ICompilationUnit createTestNamedQueryWithQuery() throws Exception {
- return createTestNamedQueryWithStringElement("query", QUERY_QUERY);
- }
-
- private ICompilationUnit createTestNamedQueryWithStringElement(final String elementName, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_QUERIES, JPA.NAMED_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedQueries(@NamedQuery(" + elementName + "=\"" + value + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestNamedQueryWithQueryHints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_QUERIES, JPA.NAMED_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedQueries(@NamedQuery(hints={@QueryHint(name=\"BAR\", value=\"FOO\"), @QueryHint}))");
- }
- });
- }
-
-
- private ICompilationUnit createTestNamedQuery() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedQuery(name=\"foo\", query=\"bar\", hints=@QueryHint(name=\"BAR\", value=\"FOO\"))");
- }
- });
- }
-
- public void testNamedQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueries();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueriesAnnotation namedQueries = (NamedQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERIES);
- NamedQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
- assertNotNull(namedQuery);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueriesAnnotation namedQueries = (NamedQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERIES);
- NamedQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
- assertEquals(QUERY_NAME, namedQuery.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueriesAnnotation namedQueries = (NamedQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERIES);
- NamedQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
- assertEquals(QUERY_NAME, namedQuery.getName());
-
- namedQuery.setName("foo");
- assertEquals("foo", namedQuery.getName());
-
- assertSourceContains("@NamedQuery(name=\"foo\")", cu);
-
- namedQuery.setName(null);
- assertNull(namedQuery.getName());
-
- assertSourceDoesNotContain("@NamedQuery", cu);
- }
-
- public void testGetQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQuery();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueriesAnnotation namedQueries = (NamedQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERIES);
- NamedQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
- }
-
- public void testSetQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQuery();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueriesAnnotation namedQueries = (NamedQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERIES);
- NamedQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
-
- namedQuery.setQuery("foo");
- assertEquals("foo", namedQuery.getQuery());
-
- assertSourceContains("@NamedQuery(query=\"foo\")", cu);
-
- namedQuery.setQuery(null);
- assertNull(namedQuery.getQuery());
-
- assertSourceDoesNotContain("@NamedQuery", cu);
- }
-
- public void testHints() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueries();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueriesAnnotation namedQueries = (NamedQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERIES);
- NamedQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
-
- assertEquals(0, namedQuery.hintsSize());
- }
-
- public void testHints2() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueries();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueriesAnnotation namedQueries = (NamedQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERIES);
- NamedQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
-
- namedQuery.addHint(0);
- namedQuery.addHint(1);
-
- assertEquals(2, namedQuery.hintsSize());
- }
-
- public void testHints3() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueriesAnnotation namedQueries = (NamedQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERIES);
- NamedQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
-
- assertEquals(2, namedQuery.hintsSize());
- }
-
- public void testAddHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueries();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueriesAnnotation namedQueries = (NamedQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERIES);
- NamedQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
-
- namedQuery.addHint(0).setName("FOO");
- namedQuery.addHint(1);
- namedQuery.addHint(0).setName("BAR");
-
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertEquals("FOO", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
-
- assertSourceContains("@NamedQuery(hints={@QueryHint(name=\"BAR\"),@QueryHint(name=\"FOO\"), @QueryHint})", cu);
- }
-
- public void testRemoveHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueriesAnnotation namedQueries = (NamedQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERIES);
- NamedQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.hintsSize());
-
- namedQuery.removeHint(2);
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertEquals(2, namedQuery.hintsSize());
- assertSourceContains("@NamedQueries(@NamedQuery(hints={@QueryHint(name=\"BAZ\"), @QueryHint(name=\"BAR\", value=\"FOO\")}))", cu);
-
- namedQuery.removeHint(0);
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertEquals(1, namedQuery.hintsSize());
- assertSourceContains("@NamedQueries(@NamedQuery(hints=@QueryHint(name=\"BAR\", value=\"FOO\")))", cu);
-
- namedQuery.removeHint(0);
- assertEquals(0, namedQuery.hintsSize());
- assertSourceDoesNotContain("@NamedQueries", cu);
- }
-
- public void testMoveHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueriesAnnotation namedQueries = (NamedQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERIES);
- NamedQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.hintsSize());
-
- namedQuery.moveHint(2, 0);
-
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertNull(namedQuery.hintAt(1).getName());
- assertEquals("BAZ", namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.hintsSize());
- assertSourceContains("@NamedQueries(@NamedQuery(hints={@QueryHint(name=\"BAR\", value=\"FOO\"), @QueryHint, @QueryHint(name=\"BAZ\")}))", cu);
- }
-
- public void testMoveHint2() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueriesAnnotation namedQueries = (NamedQueriesAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERIES);
- NamedQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next();
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.hintsSize());
-
- namedQuery.moveHint(0, 2);
-
- assertNull(namedQuery.hintAt(0).getName());
- assertEquals("BAZ", namedQuery.hintAt(1).getName());
- assertEquals("BAR", namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.hintsSize());
- assertSourceContains("@NamedQueries(@NamedQuery(hints={@QueryHint, @QueryHint(name=\"BAZ\"), @QueryHint(name=\"BAR\", value=\"FOO\")}))", cu);
- }
-
- public void testAddNamedQueryCopyExisting() throws Exception {
- ICompilationUnit cu = createTestNamedQuery();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) typeResource.addSupportingAnnotation(1, JPA.NAMED_QUERY, JPA.NAMED_QUERIES);
- namedQuery.setName("BAR");
- assertSourceContains("@NamedQueries({@NamedQuery(name=\"foo\", query = \"bar\", hints = @QueryHint(name=\"BAR\", value = \"FOO\")),@NamedQuery(name=\"BAR\")})", cu);
-
- assertNull(typeResource.getSupportingAnnotation(JPA.NAMED_QUERY));
- assertNotNull(typeResource.getSupportingAnnotation(JPA.NAMED_QUERIES));
- assertEquals(2, CollectionTools.size(typeResource.supportingAnnotations(JPA.NAMED_QUERY, JPA.NAMED_QUERIES)));
- }
-
- public void testAddNamedQueryToBeginningOfList() throws Exception {
- ICompilationUnit cu = createTestNamedQuery();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) typeResource.addSupportingAnnotation(1, JPA.NAMED_QUERY, JPA.NAMED_QUERIES);
- namedQuery.setName("BAR");
- assertSourceContains("@NamedQueries({@NamedQuery(name=\"foo\", query = \"bar\", hints = @QueryHint(name=\"BAR\", value = \"FOO\")),@NamedQuery(name=\"BAR\")})", cu);
-
-
- namedQuery = (NamedQueryAnnotation) typeResource.addSupportingAnnotation(0, JPA.NAMED_QUERY, JPA.NAMED_QUERIES);
- namedQuery.setName("BAZ");
- assertSourceContains("@NamedQueries({@NamedQuery(name=\"BAZ\"),@NamedQuery(name=\"foo\", query = \"bar\", hints = @QueryHint(name=\"BAR\", value = \"FOO\")), @NamedQuery(name=\"BAR\")})", cu);
-
- Iterator<NestableAnnotation> namedQueries = typeResource.supportingAnnotations(JPA.NAMED_QUERY, JPA.NAMED_QUERIES);
- assertEquals("BAZ", ((NamedQueryAnnotation) namedQueries.next()).getName());
- assertEquals("foo", ((NamedQueryAnnotation) namedQueries.next()).getName());
- assertEquals("BAR", ((NamedQueryAnnotation) namedQueries.next()).getName());
-
- assertNull(typeResource.getSupportingAnnotation(JPA.NAMED_QUERY));
- assertNotNull(typeResource.getSupportingAnnotation(JPA.NAMED_QUERIES));
- assertEquals(3, CollectionTools.size(typeResource.supportingAnnotations(JPA.NAMED_QUERY, JPA.NAMED_QUERIES)));
- }
-
- public void testRemoveNamedQueryCopyExisting() throws Exception {
- ICompilationUnit cu = createTestNamedQuery();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) typeResource.addSupportingAnnotation(1, JPA.NAMED_QUERY, JPA.NAMED_QUERIES);
- namedQuery.setName("BAR");
- assertSourceContains("@NamedQueries({@NamedQuery(name=\"foo\", query = \"bar\", hints = @QueryHint(name=\"BAR\", value = \"FOO\")),@NamedQuery(name=\"BAR\")})", cu);
-
- typeResource.removeSupportingAnnotation(1, JPA.NAMED_QUERY, JPA.NAMED_QUERIES);
- assertSourceContains("@NamedQuery(name=\"foo\", query = \"bar\", hints = @QueryHint(name=\"BAR\", value = \"FOO\"))", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedQueryTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedQueryTests.java
deleted file mode 100644
index dd04b381bf..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedQueryTests.java
+++ /dev/null
@@ -1,258 +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.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.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.QueryHintAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class NamedQueryTests extends JavaResourceModelTestCase {
-
- private static final String QUERY_NAME = "myQuery";
- private static final String QUERY_QUERY = "SELECT name FROM Employee";
-
- public NamedQueryTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestNamedQuery() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedQuery");
- }
- });
- }
-
- private ICompilationUnit createTestNamedQueryWithName() throws Exception {
- return createTestNamedQueryWithStringElement("name", QUERY_NAME);
- }
-
- private ICompilationUnit createTestNamedQueryWithQuery() throws Exception {
- return createTestNamedQueryWithStringElement("query", QUERY_QUERY);
- }
-
- private ICompilationUnit createTestNamedQueryWithStringElement(final String elementName, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedQuery(" + elementName + "=\"" + value + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestNamedQueryWithQueryHints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedQuery(hints={@QueryHint(name=\"BAR\", value=\"FOO\"), @QueryHint})");
- }
- });
- }
-
- public void testNamedQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedQuery();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERY);
- assertNotNull(namedQuery);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERY);
- assertEquals(QUERY_NAME, namedQuery.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERY);
- assertEquals(QUERY_NAME, namedQuery.getName());
-
- namedQuery.setName("foo");
- assertEquals("foo", namedQuery.getName());
-
- assertSourceContains("@NamedQuery(name=\"foo\")", cu);
-
- namedQuery.setName(null);
- assertNull(namedQuery.getName());
-
- assertSourceDoesNotContain("@NamedQuery", cu);
- }
-
- public void testGetQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQuery();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERY);
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
- }
-
- public void testSetQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQuery();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERY);
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
-
- namedQuery.setQuery("foo");
- assertEquals("foo", namedQuery.getQuery());
-
- assertSourceContains("@NamedQuery(query=\"foo\")", cu);
-
- namedQuery.setQuery(null);
- assertNull(namedQuery.getQuery());
-
- assertSourceDoesNotContain("@NamedQuery", cu);
- }
-
- public void testHints() throws Exception {
- ICompilationUnit cu = this.createTestNamedQuery();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERY);
-
- assertEquals(0, namedQuery.hintsSize());
- }
-
- public void testHints2() throws Exception {
- ICompilationUnit cu = this.createTestNamedQuery();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERY);
-
- namedQuery.addHint(0);
- namedQuery.addHint(1);
-
- assertEquals(2, namedQuery.hintsSize());
- }
-
- public void testHints3() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERY);
-
- assertEquals(2, namedQuery.hintsSize());
-
- ListIterator<QueryHintAnnotation> iterator = namedQuery.hints();
- assertEquals("BAR", iterator.next().getName());
- assertNull(iterator.next().getName());
- }
-
- public void testAddHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedQuery();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERY);
-
- namedQuery.addHint(0).setName("FOO");
- namedQuery.addHint(1);
- QueryHintAnnotation queryHint = namedQuery.addHint(0);
- queryHint.setName("BAR");
-
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertEquals("FOO", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertSourceContains("@NamedQuery(hints={@QueryHint(name=\"BAR\"),@QueryHint(name=\"FOO\"), @QueryHint})", cu);
- }
-
- public void testRemoveHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERY);
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.hintsSize());
-
- namedQuery.removeHint(2);
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertEquals(2, namedQuery.hintsSize());
- assertSourceContains("@NamedQuery(hints={@QueryHint(name=\"BAZ\"), @QueryHint(name=\"BAR\", value=\"FOO\")})", cu);
-
- namedQuery.removeHint(0);
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertEquals(1, namedQuery.hintsSize());
- assertSourceContains("@NamedQuery(hints=@QueryHint(name=\"BAR\", value=\"FOO\"))", cu);
-
- namedQuery.removeHint(0);
- assertEquals(0, namedQuery.hintsSize());
- assertSourceDoesNotContain("@NamedQuery", cu);
- }
-
- public void testMoveHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERY);
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.hintsSize());
-
- namedQuery.moveHint(2, 0);
-
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertNull(namedQuery.hintAt(1).getName());
- assertEquals("BAZ", namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.hintsSize());
- assertSourceContains("@NamedQuery(hints={@QueryHint(name=\"BAR\", value=\"FOO\"), @QueryHint, @QueryHint(name=\"BAZ\")})", cu);
- }
-
- public void testMoveHint2() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERY);
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.hintsSize());
-
- namedQuery.moveHint(0, 2);
-
- assertNull(namedQuery.hintAt(0).getName());
- assertEquals("BAZ", namedQuery.hintAt(1).getName());
- assertEquals("BAR", namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.hintsSize());
- assertSourceContains("@NamedQuery(hints={@QueryHint, @QueryHint(name=\"BAZ\"), @QueryHint(name=\"BAR\", value=\"FOO\")})", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OneToManyTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OneToManyTests.java
deleted file mode 100644
index fa348fc10e..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OneToManyTests.java
+++ /dev/null
@@ -1,396 +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.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.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class OneToManyTests extends JavaResourceModelTestCase {
-
- public OneToManyTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestOneToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(fetch=FetchType.EAGER)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithTargetEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(targetEntity=AnnotationTestType.class)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithMappedBy() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(mappedBy=\"foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(cascade=CascadeType.ALL)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithMultipleCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(cascade={CascadeType.MERGE, CascadeType.REMOVE})");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithDuplicateCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(cascade={CascadeType.MERGE, CascadeType.MERGE})");
- }
- });
- }
-
- public void testOneToMany() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_MANY);
- assertNotNull(oneToMany);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithFetch();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_MANY);
- assertEquals(FetchType.EAGER, oneToMany.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithFetch();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_MANY);
- assertEquals(FetchType.EAGER, oneToMany.getFetch());
-
- oneToMany.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, oneToMany.getFetch());
-
- assertSourceContains("@OneToMany(fetch=LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithFetch();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_MANY);
- assertEquals(FetchType.EAGER, oneToMany.getFetch());
-
- oneToMany.setFetch(null);
- assertNull(oneToMany.getFetch());
-
- assertSourceContains("@OneToMany", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-
-
- public void testGetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithTargetEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_MANY);
- assertEquals(TYPE_NAME, oneToMany.getTargetEntity());
- }
-
- public void testSetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithTargetEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_MANY);
- assertEquals(TYPE_NAME, oneToMany.getTargetEntity());
-
- oneToMany.setTargetEntity("Foo");
-
- assertSourceContains("@OneToMany(targetEntity=Foo.class)", cu);
- }
-
- public void testSetTargetEntityNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithTargetEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_MANY);
- assertEquals(TYPE_NAME, oneToMany.getTargetEntity());
-
- oneToMany.setTargetEntity(null);
-
- assertSourceContains("@OneToMany", cu);
- assertSourceDoesNotContain("targetEntity", cu);
- }
-
-
- public void testGetFullyQualifiedTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithTargetEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_MANY);
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, oneToMany.getFullyQualifiedTargetEntity());
-
- oneToMany.setTargetEntity("Foo");
-
- assertSourceContains("@OneToMany(targetEntity=Foo.class)", cu);
-
- assertEquals("Foo", oneToMany.getTargetEntity());
-
- assertEquals("Foo", oneToMany.getFullyQualifiedTargetEntity()); //bug 196200 changed this
- }
-
- public void testGetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithMappedBy();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_MANY);
- assertEquals("foo", oneToMany.getMappedBy());
- }
-
-
- public void testGetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_MANY);
- assertEquals(null, oneToMany.getMappedBy());
- }
-
- public void testSetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_MANY);
- assertNull(oneToMany.getMappedBy());
- oneToMany.setMappedBy("bar");
- assertEquals("bar", oneToMany.getMappedBy());
-
- assertSourceContains("@OneToMany(mappedBy=\"bar\")", cu);
- }
-
- public void testSetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithMappedBy();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_MANY);
- assertEquals("foo", oneToMany.getMappedBy());
-
- oneToMany.setMappedBy(null);
- assertNull(oneToMany.getMappedBy());
-
- assertSourceContains("@OneToMany", cu);
- assertSourceDoesNotContain("mappedBy", cu);
- }
-
- public void testSetCascadeAll() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadeAll());
-
- oneToMany.setCascadeAll(true);
- assertSourceContains("@OneToMany(cascade=ALL)", cu);
-
- assertTrue(oneToMany.isCascadeAll());
- }
-
- public void testSetCascadeMerge() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadeMerge());
-
- oneToMany.setCascadeMerge(true);
- assertSourceContains("@OneToMany(cascade=MERGE)", cu);
-
- assertTrue(oneToMany.isCascadeMerge());
- }
-
- public void testSetCascadePersist() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadePersist());
-
- oneToMany.setCascadePersist(true);
- assertSourceContains("@OneToMany(cascade=PERSIST)", cu);
-
- assertTrue(oneToMany.isCascadePersist());
- }
-
- public void testSetCascadeRemove() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadeRemove());
-
- oneToMany.setCascadeRemove(true);
- assertSourceContains("@OneToMany(cascade=REMOVE)", cu);
-
- assertTrue(oneToMany.isCascadeRemove());
- }
-
- public void testSetCascadeRefresh() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadeRefresh());
-
- oneToMany.setCascadeRefresh(true);
- assertSourceContains("@OneToMany(cascade=REFRESH)", cu);
-
- assertTrue(oneToMany.isCascadeRefresh());
- }
-
- public void testCascadeMoreThanOnce() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithCascade();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_MANY);
- assertTrue(oneToMany.isCascadeAll());
-
- oneToMany.setCascadeAll(true);
- assertTrue(oneToMany.isCascadeAll());
- //a second CascadeType.All should not have been added
- assertSourceContains("@OneToMany(cascade=CascadeType.ALL)", cu);
-
- oneToMany.setCascadeAll(false);
- assertFalse(oneToMany.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
-
- //test setting cascadeAll to false again, should just do nothing
- oneToMany.setCascadeAll(false);
- assertFalse(oneToMany.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testDuplicateCascade() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithDuplicateCascade();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_MANY);
- assertTrue(oneToMany.isCascadeMerge());
-
- oneToMany.setCascadeMerge(false);//TODO should the resource model handle this and remove both MERGE
- //settings instead of having to set it false twice?
- assertTrue(oneToMany.isCascadeMerge());
-
- oneToMany.setCascadeMerge(false);
- assertFalse(oneToMany.isCascadeMerge());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testMultipleCascade() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithMultipleCascade();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_MANY);
- assertTrue(oneToMany.isCascadeMerge());
- assertTrue(oneToMany.isCascadeRemove());
-
- oneToMany.setCascadeMerge(false);
- assertSourceContains("@OneToMany(cascade=REMOVE)", cu);
-
- oneToMany.setCascadeRemove(false);
- assertSourceDoesNotContain("cascade", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OneToOneTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OneToOneTests.java
deleted file mode 100644
index c671e4f25a..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OneToOneTests.java
+++ /dev/null
@@ -1,446 +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.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.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class OneToOneTests extends JavaResourceModelTestCase {
-
- public OneToOneTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestOneToOne() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(fetch=FetchType.EAGER)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithTargetEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(targetEntity=AnnotationTestType.class)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithOptional() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(optional=true)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithMappedBy() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(mappedBy=\"foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(cascade=CascadeType.ALL)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithMultipleCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(cascade={CascadeType.MERGE, CascadeType.REMOVE})");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithDuplicateCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(cascade={CascadeType.MERGE, CascadeType.MERGE})");
- }
- });
- }
-
- public void testOneToOne() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_ONE);
- assertNotNull(oneToOne);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithFetch();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_ONE);
- assertEquals(FetchType.EAGER, oneToOne.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithFetch();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_ONE);
- assertEquals(FetchType.EAGER, oneToOne.getFetch());
-
- oneToOne.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, oneToOne.getFetch());
-
- assertSourceContains("@OneToOne(fetch=LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithFetch();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_ONE);
- assertEquals(FetchType.EAGER, oneToOne.getFetch());
-
- oneToOne.setFetch(null);
- assertNull(oneToOne.getFetch());
-
- assertSourceContains("@OneToOne", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-
-
- public void testGetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithTargetEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_ONE);
- assertEquals(TYPE_NAME, oneToOne.getTargetEntity());
- }
-
- public void testSetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithTargetEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_ONE);
- assertEquals(TYPE_NAME, oneToOne.getTargetEntity());
-
- oneToOne.setTargetEntity("Foo");
-
- assertSourceContains("@OneToOne(targetEntity=Foo.class)", cu);
- }
-
- public void testSetTargetEntityNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithTargetEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_ONE);
- assertEquals(TYPE_NAME, oneToOne.getTargetEntity());
-
- oneToOne.setTargetEntity(null);
-
- assertSourceContains("@OneToOne", cu);
- assertSourceDoesNotContain("targetEntity", cu);
- }
-
-
- public void testGetFullyQualifiedTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithTargetEntity();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_ONE);
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, oneToOne.getFullyQualifiedTargetEntity());
-
- oneToOne.setTargetEntity("Foo");
-
- assertSourceContains("@OneToOne(targetEntity=Foo.class)", cu);
-
- assertEquals("Foo", oneToOne.getTargetEntity());
-
- assertEquals("Foo", oneToOne.getFullyQualifiedTargetEntity()); //bug 196200 changed this
- }
-
- public void testGetOptional() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithOptional();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_ONE);
- assertEquals(Boolean.TRUE, oneToOne.getOptional());
- }
-
- public void testSetOptional() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithOptional();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_ONE);
- assertEquals(Boolean.TRUE, oneToOne.getOptional());
-
- oneToOne.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, oneToOne.getOptional());
-
- assertSourceContains("@OneToOne(optional=false)", cu);
- }
-
- public void testSetOptionalNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithOptional();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_ONE);
- assertEquals(Boolean.TRUE, oneToOne.getOptional());
-
- oneToOne.setOptional(null);
- assertNull(oneToOne.getOptional());
-
- assertSourceContains("@OneToOne", cu);
- assertSourceDoesNotContain("optional", cu);
- }
-
- public void testGetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithMappedBy();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_ONE);
- assertEquals("foo", oneToOne.getMappedBy());
- }
-
- public void testGetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_ONE);
- assertEquals(null, oneToOne.getMappedBy());
- }
-
- public void testSetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_ONE);
- assertNull(oneToOne.getMappedBy());
- oneToOne.setMappedBy("bar");
- assertEquals("bar", oneToOne.getMappedBy());
-
- assertSourceContains("@OneToOne(mappedBy=\"bar\")", cu);
- }
-
- public void testSetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithMappedBy();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_ONE);
- assertEquals("foo", oneToOne.getMappedBy());
-
- oneToOne.setMappedBy(null);
- assertNull(oneToOne.getMappedBy());
-
- assertSourceContains("@OneToOne", cu);
- assertSourceDoesNotContain("mappedBy", cu);
- }
-
- public void testSetCascadeAll() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadeAll());
-
- oneToOne.setCascadeAll(true);
- assertSourceContains("@OneToOne(cascade=ALL)", cu);
-
- assertTrue(oneToOne.isCascadeAll());
- }
-
- public void testSetCascadeMerge() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadeMerge());
-
- oneToOne.setCascadeMerge(true);
- assertSourceContains("@OneToOne(cascade=MERGE)", cu);
-
- assertTrue(oneToOne.isCascadeMerge());
- }
-
- public void testSetCascadePersist() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadePersist());
-
- oneToOne.setCascadePersist(true);
- assertSourceContains("@OneToOne(cascade=PERSIST)", cu);
-
- assertTrue(oneToOne.isCascadePersist());
- }
-
- public void testSetCascadeRemove() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadeRemove());
-
- oneToOne.setCascadeRemove(true);
- assertSourceContains("@OneToOne(cascade=REMOVE)", cu);
-
- assertTrue(oneToOne.isCascadeRemove());
- }
-
- public void testSetCascadeRefresh() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadeRefresh());
-
- oneToOne.setCascadeRefresh(true);
- assertSourceContains("@OneToOne(cascade=REFRESH)", cu);
-
- assertTrue(oneToOne.isCascadeRefresh());
- }
-
- public void testCascadeMoreThanOnce() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithCascade();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_ONE);
- assertTrue(oneToOne.isCascadeAll());
-
- oneToOne.setCascadeAll(true);
- assertTrue(oneToOne.isCascadeAll());
- //a second CascadeType.All should not have been added
- assertSourceContains("@OneToOne(cascade=CascadeType.ALL)", cu);
-
- oneToOne.setCascadeAll(false);
- assertFalse(oneToOne.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
-
- //test setting cascadeAll to false again, should just do nothing
- oneToOne.setCascadeAll(false);
- assertFalse(oneToOne.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testDuplicateCascade() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithDuplicateCascade();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_ONE);
- assertTrue(oneToOne.isCascadeMerge());
-
- oneToOne.setCascadeMerge(false);//TODO should the resource model handle this and remove both MERGE
- //settings instead of having to set it false twice?
- assertTrue(oneToOne.isCascadeMerge());
-
- oneToOne.setCascadeMerge(false);
- assertFalse(oneToOne.isCascadeMerge());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testMultipleCascade() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithMultipleCascade();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(JPA.ONE_TO_ONE);
- assertTrue(oneToOne.isCascadeMerge());
- assertTrue(oneToOne.isCascadeRemove());
-
- oneToOne.setCascadeMerge(false);
- assertSourceContains("@OneToOne(cascade=REMOVE)", cu);
-
- oneToOne.setCascadeRemove(false);
- assertSourceDoesNotContain("cascade", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OrderByTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OrderByTests.java
deleted file mode 100644
index 61c727e0c4..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OrderByTests.java
+++ /dev/null
@@ -1,86 +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.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.core.resource.java.OrderByAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class OrderByTests extends JavaResourceModelTestCase {
-
- public OrderByTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestOrderBy() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ORDER_BY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OrderBy");
- }
- });
- }
-
- private ICompilationUnit createTestOrderByWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ORDER_BY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OrderBy(value=\"key\")");
- }
- });
- }
-
- public void testOrderBy() throws Exception {
- ICompilationUnit cu = this.createTestOrderBy();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OrderByAnnotation orderBy = (OrderByAnnotation) attributeResource.getSupportingAnnotation(JPA.ORDER_BY);
- assertNotNull(orderBy);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestOrderByWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OrderByAnnotation orderBy = (OrderByAnnotation) attributeResource.getSupportingAnnotation(JPA.ORDER_BY);
- assertEquals("key", orderBy.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestOrderBy();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- OrderByAnnotation orderBy = (OrderByAnnotation) attributeResource.getSupportingAnnotation(JPA.ORDER_BY);
-
- orderBy.setValue("foo");
-
- assertSourceContains("@OrderBy(\"foo\")", cu);
-
- orderBy.setValue(null);
-
- assertSourceContains("@OrderBy", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/PrimaryKeyJoinColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/PrimaryKeyJoinColumnTests.java
deleted file mode 100644
index c83b997017..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/PrimaryKeyJoinColumnTests.java
+++ /dev/null
@@ -1,186 +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.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.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class PrimaryKeyJoinColumnTests extends JavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
- private static final String COLUMN_REFERENCED_COLUMN_NAME = "MY_REF_COLUMN_NAME";
-
- public PrimaryKeyJoinColumnTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumn");
- }
- });
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumn(name=\"" + COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumnWithReferencedColumnName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumn(referencedColumnName=\"" + COLUMN_REFERENCED_COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumn(columnDefinition=\"" + COLUMN_COLUMN_DEFINITION + "\")");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumnWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertNotNull(column);
- assertNull(column.getReferencedColumnName());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@PrimaryKeyJoinColumn(name=\"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumnWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("@PrimaryKeyJoinColumn", cu);
- }
-
-
-
- public void testGetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumnWithReferencedColumnName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertEquals(COLUMN_REFERENCED_COLUMN_NAME, column.getReferencedColumnName());
- }
-
- public void testSetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getReferencedColumnName());
-
- column.setReferencedColumnName("Foo");
- assertEquals("Foo", column.getReferencedColumnName());
-
- assertSourceContains("@PrimaryKeyJoinColumn(referencedColumnName=\"Foo\")", cu);
-
-
- column.setReferencedColumnName(null);
- assertSourceDoesNotContain("@PrimaryKeyJoinColumn", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumnWithColumnDefinition();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@PrimaryKeyJoinColumn(columnDefinition=\"Foo\")", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("@PrimaryKeyJoinColumn", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/PrimaryKeyJoinColumnsTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/PrimaryKeyJoinColumnsTests.java
deleted file mode 100644
index 06b6b524c3..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/PrimaryKeyJoinColumnsTests.java
+++ /dev/null
@@ -1,252 +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.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.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class PrimaryKeyJoinColumnsTests extends JavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
- private static final String COLUMN_REFERENCED_COLUMN_NAME = "MY_REF_COLUMN_NAME";
-
- public PrimaryKeyJoinColumnsTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumns(@PrimaryKeyJoinColumn)");
- }
- });
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumns(@PrimaryKeyJoinColumn(name=\"" + COLUMN_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumnWithReferencedColumnName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumns(@PrimaryKeyJoinColumn(referencedColumnName=\"" + COLUMN_REFERENCED_COLUMN_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumns(@PrimaryKeyJoinColumn(columnDefinition=\"" + COLUMN_COLUMN_DEFINITION + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumn(name=\"BAR\", columnDefinition = \"COLUMN_DEF\", referencedColumnName = \"REF_NAME\")");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumnWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS).next();
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS).next();
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getReferencedColumnName());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS).next();
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@PrimaryKeyJoinColumns(@PrimaryKeyJoinColumn(name=\"Foo\"))", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumnWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS).next();
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("@PrimaryKeyJoinColumn", cu);
- }
-
- public void testGetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumnWithReferencedColumnName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS).next();
- assertEquals(COLUMN_REFERENCED_COLUMN_NAME, column.getReferencedColumnName());
- }
-
- public void testSetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS).next();
-
- assertNotNull(column);
- assertNull(column.getReferencedColumnName());
-
- column.setReferencedColumnName("Foo");
- assertEquals("Foo", column.getReferencedColumnName());
-
- assertSourceContains("@PrimaryKeyJoinColumns(@PrimaryKeyJoinColumn(referencedColumnName=\"Foo\"))", cu);
-
-
- column.setReferencedColumnName(null);
- assertSourceDoesNotContain("@PrimaryKeyJoinColumn", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumnWithColumnDefinition();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS).next();
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) attributeResource.supportingAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS).next();
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@PrimaryKeyJoinColumns(@PrimaryKeyJoinColumn(columnDefinition=\"Foo\"))", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("@PrimaryKeyJoinColumn", cu);
- }
-
-
- public void testAddPrimaryKeyJoinColumnCopyExisting() throws Exception {
- ICompilationUnit cu = createTestPrimaryKeyJoinColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- PrimaryKeyJoinColumnAnnotation joinColumn = (PrimaryKeyJoinColumnAnnotation) attributeResource.addSupportingAnnotation(1, JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- joinColumn.setName("FOO");
- assertSourceContains("@PrimaryKeyJoinColumns({@PrimaryKeyJoinColumn(name=\"BAR\", columnDefinition = \"COLUMN_DEF\", referencedColumnName = \"REF_NAME\"),@PrimaryKeyJoinColumn(name=\"FOO\")})", cu);
-
- assertNull(attributeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(attributeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMNS));
- assertEquals(2, CollectionTools.size(attributeResource.supportingAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS)));
- }
- public void testAddPrimaryKeyJoinColumnToBeginningOfList() throws Exception {
- ICompilationUnit cu = createTestPrimaryKeyJoinColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- PrimaryKeyJoinColumnAnnotation joinColumn = (PrimaryKeyJoinColumnAnnotation) attributeResource.addSupportingAnnotation(1, JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- joinColumn.setName("FOO");
- assertSourceContains("@PrimaryKeyJoinColumns({@PrimaryKeyJoinColumn(name=\"BAR\", columnDefinition = \"COLUMN_DEF\", referencedColumnName = \"REF_NAME\"),@PrimaryKeyJoinColumn(name=\"FOO\")})", cu);
-
- joinColumn = (PrimaryKeyJoinColumnAnnotation) attributeResource.addSupportingAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- joinColumn.setName("BAZ");
- assertSourceContains("@PrimaryKeyJoinColumns({@PrimaryKeyJoinColumn(name=\"BAZ\"),@PrimaryKeyJoinColumn(name=\"BAR\", columnDefinition = \"COLUMN_DEF\", referencedColumnName = \"REF_NAME\"), @PrimaryKeyJoinColumn(name=\"FOO\")})", cu);
-
- Iterator<NestableAnnotation> pkJoinColumns = attributeResource.supportingAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
-
- assertNull(attributeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(attributeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMNS));
- assertEquals(3, CollectionTools.size(attributeResource.supportingAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS)));
- }
-
- public void testRemovePrimaryKeyJoinColumnCopyExisting() throws Exception {
- ICompilationUnit cu = createTestPrimaryKeyJoinColumn();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- PrimaryKeyJoinColumnAnnotation joinColumn = (PrimaryKeyJoinColumnAnnotation) attributeResource.addSupportingAnnotation(1, JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- joinColumn.setName("FOO");
- assertSourceContains("@PrimaryKeyJoinColumns({@PrimaryKeyJoinColumn(name=\"BAR\", columnDefinition = \"COLUMN_DEF\", referencedColumnName = \"REF_NAME\"),@PrimaryKeyJoinColumn(name=\"FOO\")})", cu);
-
- attributeResource.removeSupportingAnnotation(1, JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- assertSourceContains("@PrimaryKeyJoinColumn(name=\"BAR\", columnDefinition = \"COLUMN_DEF\", referencedColumnName = \"REF_NAME\")", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/QueryHintTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/QueryHintTests.java
deleted file mode 100644
index 33e1eae121..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/QueryHintTests.java
+++ /dev/null
@@ -1,64 +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.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.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.QueryHintAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class QueryHintTests extends JavaResourceModelTestCase {
-
- private static final String QUERY_HINT_NAME = "myHint";
- private static final String QUERY_HINT_VALUE = "myValue";
-
- public QueryHintTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestNamedQueryWithQueryHints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedQuery(hints={@QueryHint(name=\"" + QUERY_HINT_NAME + "\", value=\"" + QUERY_HINT_VALUE + "\"), @QueryHint})");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERY);
- QueryHintAnnotation queryHint = namedQuery.hints().next();
- assertEquals(QUERY_HINT_NAME, queryHint.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(JPA.NAMED_QUERY);
- QueryHintAnnotation queryHint = namedQuery.hints().next();
- assertEquals(QUERY_HINT_NAME, queryHint.getName());
-
- queryHint.setName("foo");
- assertEquals("foo", queryHint.getName());
-
- assertSourceContains("@QueryHint(name=\"foo\", value=\"" + QUERY_HINT_VALUE + "\")", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SecondaryTableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SecondaryTableTests.java
deleted file mode 100644
index 63ec66b916..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SecondaryTableTests.java
+++ /dev/null
@@ -1,435 +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.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.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.SecondaryTableAnnotation;
-import org.eclipse.jpt.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class SecondaryTableTests extends JavaResourceModelTestCase {
-
- private static final String TABLE_NAME = "MY_TABLE";
- private static final String SCHEMA_NAME = "MY_SCHEMA";
- private static final String CATALOG_NAME = "MY_CATALOG";
-
- public SecondaryTableTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestSecondaryTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTable");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTableWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTable(name=\"" + TABLE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTableWithSchema() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTable(schema=\"" + SCHEMA_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTableWithCatalog() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTable(catalog=\"" + CATALOG_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTableWithUniqueConstraints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE, JPA.UNIQUE_CONSTRAINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTable(uniqueConstraints={@UniqueConstraint(columnNames={\"BAR\"}), @UniqueConstraint(columnNames={\"FOO\"}), @UniqueConstraint(columnNames={\"BAZ\"})})");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTableWithPkJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE, JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTable(pkJoinColumns={@PrimaryKeyJoinColumn(name=\"BAR\"), @PrimaryKeyJoinColumn(name=\"FOO\"), @PrimaryKeyJoinColumn(name=\"BAZ\")})");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
- assertNotNull(table);
- assertEquals(TABLE_NAME, table.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
- assertNotNull(table);
- assertNull(table.getName());
- assertNull(table.getCatalog());
- assertNull(table.getSchema());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
- assertNotNull(table);
- assertNull(table.getName());
-
- table.setName("Foo");
- assertEquals("Foo", table.getName());
-
- assertSourceContains("@SecondaryTable(name=\"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
- assertEquals(TABLE_NAME, table.getName());
-
- table.setName(null);
- assertNull(table.getName());
-
- assertSourceDoesNotContain("@SecondaryTable", cu);
- }
-
- public void testGetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithCatalog();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
- assertNotNull(table);
- assertEquals(CATALOG_NAME, table.getCatalog());
- }
-
- public void testSetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
- assertNotNull(table);
- assertNull(table.getCatalog());
-
- table.setCatalog("Foo");
- assertEquals("Foo", table.getCatalog());
-
- assertSourceContains("@SecondaryTable(catalog=\"Foo\")", cu);
- }
-
- public void testSetCatalogNull() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithCatalog();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
- assertEquals(CATALOG_NAME, table.getCatalog());
-
- table.setCatalog(null);
- assertNull(table.getCatalog());
-
- assertSourceDoesNotContain("@SecondaryTable", cu);
- }
-
- public void testGetSchema() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithSchema();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
- assertNotNull(table);
- assertEquals(SCHEMA_NAME, table.getSchema());
- }
-
- public void testSetSchema() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
- assertNotNull(table);
- assertNull(table.getSchema());
-
- table.setSchema("Foo");
- assertEquals("Foo", table.getSchema());
-
- assertSourceContains("@SecondaryTable(schema=\"Foo\")", cu);
- }
-
- public void testSetSchemaNull() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithSchema();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
- assertEquals(SCHEMA_NAME, table.getSchema());
-
- table.setSchema(null);
- assertNull(table.getSchema());
-
- assertSourceDoesNotContain("@SecondaryTable", cu);
- }
-
-
- public void testUniqueConstraints() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
-
- assertEquals(0, table.uniqueConstraintsSize());
- }
-
- public void testUniqueConstraints2() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
-
- table.addUniqueConstraint(0);
- table.addUniqueConstraint(1);
-
- assertEquals(2, table.uniqueConstraintsSize());
- }
-
- public void testUniqueConstraints3() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
-
- assertEquals(3, table.uniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
-
- table.addUniqueConstraint(0).addColumnName("FOO");
- table.addUniqueConstraint(1);
- table.addUniqueConstraint(0).addColumnName("BAR");
-
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNames().next());
- assertEquals("FOO", table.uniqueConstraintAt(1).columnNames().next());
- assertEquals(0, table.uniqueConstraintAt(2).columnNamesSize());
-
- assertSourceContains("@SecondaryTable(uniqueConstraints={@UniqueConstraint(columnNames=\"BAR\"),@UniqueConstraint(columnNames=\"FOO\"), @UniqueConstraint})", cu);
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
-
- table.removeUniqueConstraint(1);
- Iterator<UniqueConstraintAnnotation> uniqueConstraints = table.uniqueConstraints();
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
- assertSourceContains("@SecondaryTable(uniqueConstraints={@UniqueConstraint(columnNames={\"BAR\"}), @UniqueConstraint(columnNames={\"BAZ\"})})", cu);
-
- table.removeUniqueConstraint(0);
- uniqueConstraints = table.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
- assertSourceContains("@SecondaryTable(uniqueConstraints=@UniqueConstraint(columnNames={\"BAZ\"}))", cu);
-
- table.removeUniqueConstraint(0);
- uniqueConstraints = table.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
- assertSourceDoesNotContain("@SecondaryTable", cu);
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
-
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(0).columnNames().next());
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(1).columnNames().next());
- assertEquals("BAZ", secondaryTable.uniqueConstraintAt(2).columnNames().next());
- assertEquals(3, secondaryTable.uniqueConstraintsSize());
-
- secondaryTable.moveUniqueConstraint(2, 0);
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(0).columnNames().next());
- assertEquals("BAZ", secondaryTable.uniqueConstraintAt(1).columnNames().next());
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(2).columnNames().next());
- assertEquals(3, secondaryTable.uniqueConstraintsSize());
- assertSourceContains("@SecondaryTable(uniqueConstraints={@UniqueConstraint(columnNames={\"FOO\"}), @UniqueConstraint(columnNames={\"BAZ\"}), @UniqueConstraint(columnNames={\"BAR\"})})", cu);
- }
-
- public void testMoveUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
-
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(0).columnNames().next());
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(1).columnNames().next());
- assertEquals("BAZ", secondaryTable.uniqueConstraintAt(2).columnNames().next());
- assertEquals(3, secondaryTable.uniqueConstraintsSize());
-
- secondaryTable.moveUniqueConstraint(0, 2);
- assertEquals("BAZ", secondaryTable.uniqueConstraintAt(0).columnNames().next());
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(1).columnNames().next());
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(2).columnNames().next());
- assertEquals(3, secondaryTable.uniqueConstraintsSize());
- assertSourceContains("@SecondaryTable(uniqueConstraints={@UniqueConstraint(columnNames={\"BAZ\"}), @UniqueConstraint(columnNames={\"BAR\"}), @UniqueConstraint(columnNames={\"FOO\"})})", cu);
- }
-
-
- public void testPkJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
-
- assertEquals(0, table.pkJoinColumnsSize());
- }
-
- public void testPkJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
-
- table.addPkJoinColumn(0);
- table.addPkJoinColumn(1);
-
- assertEquals(2, table.pkJoinColumnsSize());
- }
-
- public void testPkJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithPkJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
-
- assertEquals(3, table.pkJoinColumnsSize());
- }
-
- public void testAddPkJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
-
-
- table.addPkJoinColumn(0).setName("FOO");
- table.addPkJoinColumn(0);
- table.addPkJoinColumn(0).setName("BAR");//test adding a pkJoinColumn in front of 2 other joinColumns
-
- assertEquals("BAR", table.pkJoinColumnAt(0).getName());
- assertNull(table.pkJoinColumnAt(1).getName());
- assertEquals("FOO", table.pkJoinColumnAt(2).getName());
-
- assertEquals(3, table.pkJoinColumnsSize());
- assertSourceContains("@SecondaryTable(pkJoinColumns={@PrimaryKeyJoinColumn(name=\"BAR\"),@PrimaryKeyJoinColumn, @PrimaryKeyJoinColumn(name=\"FOO\")})", cu);
- }
-
- public void testRemovePkJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithPkJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
-
- table.removePkJoinColumn(1);
- assertSourceContains("@SecondaryTable(pkJoinColumns={@PrimaryKeyJoinColumn(name=\"BAR\"), @PrimaryKeyJoinColumn(name=\"BAZ\")})", cu);
-
- table.removePkJoinColumn(0);
- assertSourceContains("@SecondaryTable(pkJoinColumns=@PrimaryKeyJoinColumn(name=\"BAZ\"))", cu);
-
-
- table.removePkJoinColumn(0);
- assertSourceDoesNotContain("@SecondaryTable", cu);
- }
-
- public void testMovePkJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithPkJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
- PrimaryKeyJoinColumnAnnotation joinColumn = table.pkJoinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setColumnDefinition("COLUMN_DEF");
- table.movePkJoinColumn(2, 0);
- assertSourceContains("@SecondaryTable(pkJoinColumns={@PrimaryKeyJoinColumn(name=\"FOO\"), @PrimaryKeyJoinColumn(name=\"BAZ\"), @PrimaryKeyJoinColumn(name=\"BAR\", referencedColumnName = \"REF_NAME\", columnDefinition = \"COLUMN_DEF\")})", cu);
- }
-
- public void testMovePkJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithPkJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
-
-
- PrimaryKeyJoinColumnAnnotation joinColumn = table.pkJoinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setColumnDefinition("COLUMN_DEF");
- table.movePkJoinColumn(0, 2);
- assertSourceContains("@SecondaryTable(pkJoinColumns={@PrimaryKeyJoinColumn(name=\"BAZ\"), @PrimaryKeyJoinColumn(name=\"BAR\", referencedColumnName = \"REF_NAME\", columnDefinition = \"COLUMN_DEF\"), @PrimaryKeyJoinColumn(name=\"FOO\")})", cu);
- }
-
- public void testSetPkJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithPkJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
-
- assertEquals(3, table.pkJoinColumnsSize());
-
- PrimaryKeyJoinColumnAnnotation joinColumn = table.pkJoinColumns().next();
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@SecondaryTable(pkJoinColumns={@PrimaryKeyJoinColumn(name=\"foo\"), @PrimaryKeyJoinColumn(name=\"FOO\"), @PrimaryKeyJoinColumn(name=\"BAZ\")})", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SecondaryTablesTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SecondaryTablesTests.java
deleted file mode 100644
index 85d4c937ac..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SecondaryTablesTests.java
+++ /dev/null
@@ -1,503 +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.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.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.SecondaryTableAnnotation;
-import org.eclipse.jpt.core.resource.java.SecondaryTablesAnnotation;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class SecondaryTablesTests extends JavaResourceModelTestCase {
-
- private static final String TABLE_NAME = "MY_TABLE";
- private static final String SCHEMA_NAME = "MY_SCHEMA";
- private static final String CATALOG_NAME = "MY_CATALOG";
-
- public SecondaryTablesTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestSecondaryTables() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTables(@SecondaryTable)");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTableWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTables(@SecondaryTable(name=\"" + TABLE_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTableWithSchema() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTables(@SecondaryTable(schema=\"" + SCHEMA_NAME + "\"))");
- }
- });
- }
- private ICompilationUnit createTestSecondaryTableWithCatalog() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTables(@SecondaryTable(catalog=\"" + CATALOG_NAME + "\"))");
- }
- });
- }
-
-
- private ICompilationUnit createTestSecondaryTableWithUniqueConstraints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES, JPA.UNIQUE_CONSTRAINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTables(@SecondaryTable(uniqueConstraints={@UniqueConstraint(columnNames={\"BAR\"}), @UniqueConstraint}))");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE, JPA.UNIQUE_CONSTRAINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@SecondaryTable(name=\"FOO\", catalog=\"BAR\", schema=\"BAZ\", uniqueConstraints=@UniqueConstraint(columnNames={\"BAR\"}))");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTablesWithPkJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLES, JPA.SECONDARY_TABLE, JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTables(@SecondaryTable(pkJoinColumns={@PrimaryKeyJoinColumn(name=\"BAR\"), @PrimaryKeyJoinColumn(name=\"FOO\"), @PrimaryKeyJoinColumn(name=\"BAZ\")}))");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE);
- assertNull(table);
- SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES);
- assertNotNull(secondaryTables);
-
- SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotationAt(0);
- assertEquals(TABLE_NAME, secondaryTable.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES);
- SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotationAt(0);
- assertNull(secondaryTable.getName());
- assertNull(secondaryTable.getCatalog());
- assertNull(secondaryTable.getSchema());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES);
- SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotationAt(0);
-
- assertNull(secondaryTable.getName());
-
- secondaryTable.setName("Foo");
- assertEquals("Foo", secondaryTable.getName());
-
- assertSourceContains("@SecondaryTables(@SecondaryTable(name=\"Foo\"))", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES);
- SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotationAt(0);
- assertEquals(TABLE_NAME, secondaryTable.getName());
-
- secondaryTable.setName(null);
- assertNull(secondaryTable.getName());
-
- assertSourceDoesNotContain("@SecondaryTable", cu);
- }
-
- public void testGetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithCatalog();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES);
- SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotationAt(0);
- assertEquals(CATALOG_NAME, secondaryTable.getCatalog());
- }
-
- public void testSetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES);
- SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotationAt(0);
- assertNull(secondaryTable.getCatalog());
-
- secondaryTable.setCatalog("Foo");
- assertEquals("Foo", secondaryTable.getCatalog());
-
- assertSourceContains("@SecondaryTables(@SecondaryTable(catalog=\"Foo\"))", cu);
- }
-
- public void testSetCatalogNull() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithCatalog();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES);
- SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotationAt(0);
- assertEquals(CATALOG_NAME, secondaryTable.getCatalog());
-
- secondaryTable.setCatalog(null);
- assertNull(secondaryTable.getCatalog());
-
- assertSourceDoesNotContain("@SecondaryTable", cu);
- }
-
- public void testGetSchema() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithSchema();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES);
- SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotationAt(0);
- assertNotNull(secondaryTable);
- assertEquals(SCHEMA_NAME, secondaryTable.getSchema());
- }
-
- public void testSetSchema() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES);
- SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotationAt(0);
- assertNull(secondaryTable.getSchema());
-
- secondaryTable.setSchema("Foo");
- assertEquals("Foo", secondaryTable.getSchema());
-
- assertSourceContains("@SecondaryTables(@SecondaryTable(schema=\"Foo\"))", cu);
- }
-
- public void testSetSchemaNull() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithSchema();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES);
- SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotationAt(0);
- assertEquals(SCHEMA_NAME, secondaryTable.getSchema());
-
- secondaryTable.setSchema(null);
- assertNull(secondaryTable.getSchema());
-
- assertSourceDoesNotContain("@SecondaryTable", cu);
- }
-
-
- public void testUniqueConstraints() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES);
- SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotationAt(0);
-
- assertEquals(0, secondaryTable.uniqueConstraintsSize());
- }
-
- public void testUniqueConstraints2() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES);
- SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotationAt(0);
-
- secondaryTable.addUniqueConstraint(0);
- secondaryTable.addUniqueConstraint(1);
-
- assertEquals(2, secondaryTable.uniqueConstraintsSize());
- }
-
- public void testUniqueConstraints3() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES);
- SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotationAt(0);
-
- assertEquals(2, secondaryTable.uniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES);
- SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotationAt(0);
-
- secondaryTable.addUniqueConstraint(0).addColumnName("FOO");
- secondaryTable.addUniqueConstraint(1);
- secondaryTable.addUniqueConstraint(0).addColumnName("BAR");
-
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(0).columnNames().next());
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(1).columnNames().next());
- assertEquals(0, secondaryTable.uniqueConstraintAt(2).columnNamesSize());
-
- assertSourceContains("@SecondaryTables(@SecondaryTable(uniqueConstraints={@UniqueConstraint(columnNames=\"BAR\"),@UniqueConstraint(columnNames=\"FOO\"), @UniqueConstraint}))", cu);
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES);
- SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotationAt(0);
- secondaryTable.addUniqueConstraint(0).addColumnName("FOO");
-
- secondaryTable.removeUniqueConstraint(2);
- assertSourceContains("@SecondaryTables(@SecondaryTable(uniqueConstraints={@UniqueConstraint(columnNames=\"FOO\"), @UniqueConstraint(columnNames={\"BAR\"})})", cu);
-
- secondaryTable.removeUniqueConstraint(0);
- assertSourceContains("@SecondaryTables(@SecondaryTable(uniqueConstraints=@UniqueConstraint(columnNames={\"BAR\"}))", cu);
-
- secondaryTable.removeUniqueConstraint(0);
- assertSourceDoesNotContain("@SecondaryTable", cu);
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES);
- SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotationAt(0);
- secondaryTable.addUniqueConstraint(0).addColumnName("FOO");
-
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(0).columnNames().next());
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(1).columnNames().next());
- assertFalse(secondaryTable.uniqueConstraintAt(2).columnNames().hasNext());
-
- secondaryTable.moveUniqueConstraint(2, 0);
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(0).columnNames().next());
- assertFalse(secondaryTable.uniqueConstraintAt(1).columnNames().hasNext());
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(2).columnNames().next());
- assertSourceContains("@SecondaryTables(@SecondaryTable(uniqueConstraints={@UniqueConstraint(columnNames={\"BAR\"}), @UniqueConstraint, @UniqueConstraint(columnNames=\"FOO\")}))", cu);
- }
-
- public void testMoveUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES);
- SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotationAt(0);
- secondaryTable.addUniqueConstraint(0).addColumnName("FOO");
-
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(0).columnNames().next());
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(1).columnNames().next());
- assertFalse(secondaryTable.uniqueConstraintAt(2).columnNames().hasNext());
-
- secondaryTable.moveUniqueConstraint(0, 2);
- assertFalse(secondaryTable.uniqueConstraintAt(0).columnNames().hasNext());
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(1).columnNames().next());
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(2).columnNames().next());
- assertSourceContains("@SecondaryTables(@SecondaryTable(uniqueConstraints={@UniqueConstraint, @UniqueConstraint(columnNames=\"FOO\"), @UniqueConstraint(columnNames={\"BAR\"})}))", cu);
- }
-
-
- // @Entity -->> @Entity
- // @SecondaryTable(name="FOO") @SecondaryTables({@SecondaryTable(name="FOO"), @SecondaryTable(name="BAR")})
- public void testAddSecondaryTableCopyExisting() throws Exception {
- ICompilationUnit cu = createTestSecondaryTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) typeResource.addSupportingAnnotation(1, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- secondaryTable.setName("BAR");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name=\"FOO\", catalog = \"BAR\", schema = \"BAZ\", uniqueConstraints = @UniqueConstraint(columnNames=\"BAR\")),@SecondaryTable(name=\"BAR\")})", cu);
-
- assertNull(typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE));
- assertNotNull(typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES));
- assertEquals(2, CollectionTools.size(typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES)));
- }
-
- public void testAddSecondaryTable() throws Exception {
- ICompilationUnit cu = createTestSecondaryTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) typeResource.addSupportingAnnotation(1, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- secondaryTable.setName("BAR");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name=\"FOO\", catalog = \"BAR\", schema = \"BAZ\", uniqueConstraints = @UniqueConstraint(columnNames=\"BAR\")),@SecondaryTable(name=\"BAR\")})", cu);
-
- secondaryTable = (SecondaryTableAnnotation) typeResource.addSupportingAnnotation(0, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- secondaryTable.setName("BAZ");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name=\"BAZ\"),@SecondaryTable(name=\"FOO\", catalog = \"BAR\", schema = \"BAZ\", uniqueConstraints = @UniqueConstraint(columnNames=\"BAR\")), @SecondaryTable(name=\"BAR\")})", cu);
-
- Iterator<NestableAnnotation> secondaryTables = typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- assertEquals("BAZ", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
- assertEquals("FOO", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
- assertEquals("BAR", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
-
- assertNull(typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE));
- assertNotNull(typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLES));
- assertEquals(3, CollectionTools.size(typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES)));
- }
-
- public void testRemoveSecondaryTableCopyExisting() throws Exception {
- ICompilationUnit cu = createTestSecondaryTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) typeResource.addSupportingAnnotation(1, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- secondaryTable.setName("BAR");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name=\"FOO\", catalog = \"BAR\", schema = \"BAZ\", uniqueConstraints = @UniqueConstraint(columnNames=\"BAR\")),@SecondaryTable(name=\"BAR\")})", cu);
-
- typeResource.removeSupportingAnnotation(1, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- assertSourceContains("@SecondaryTable(name=\"FOO\", catalog = \"BAR\", schema = \"BAZ\", uniqueConstraints = @UniqueConstraint(columnNames=\"BAR\"))", cu);
- }
-
-
- public void testPkJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES).next();
-
- assertEquals(0, table.pkJoinColumnsSize());
- }
-
- public void testPkJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES).next();
-
- table.addPkJoinColumn(0);
- table.addPkJoinColumn(1);
-
- assertEquals(2, table.pkJoinColumnsSize());
- }
-
- public void testPkJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTablesWithPkJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES).next();
-
- assertEquals(3, table.pkJoinColumnsSize());
- }
-
- public void testAddPkJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES).next();
-
- table.addPkJoinColumn(0).setName("FOO");
- table.addPkJoinColumn(1);
- table.addPkJoinColumn(0).setName("BAR");
-
- assertSourceContains("@SecondaryTables(@SecondaryTable(pkJoinColumns={@PrimaryKeyJoinColumn(name=\"BAR\"),@PrimaryKeyJoinColumn(name=\"FOO\"), @PrimaryKeyJoinColumn}))", cu);
- }
-
- public void testRemovePkJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTablesWithPkJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES).next();
-
- table.removePkJoinColumn(1);
- assertSourceContains("@SecondaryTables(@SecondaryTable(pkJoinColumns={@PrimaryKeyJoinColumn(name=\"BAR\"), @PrimaryKeyJoinColumn(name=\"BAZ\")}))", cu);
-
- table.removePkJoinColumn(0);
- assertSourceContains("@SecondaryTables(@SecondaryTable(pkJoinColumns=@PrimaryKeyJoinColumn(name=\"BAZ\")))", cu);
-
- table.removePkJoinColumn(0);
- assertSourceDoesNotContain("@SecondaryTable", cu);
- }
-
- public void testMovePkJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTablesWithPkJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES).next();
- PrimaryKeyJoinColumnAnnotation joinColumn = table.pkJoinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setColumnDefinition("COLUMN_DEF");
- table.movePkJoinColumn(2, 0);
- assertSourceContains("@SecondaryTables(@SecondaryTable(pkJoinColumns={@PrimaryKeyJoinColumn(name=\"FOO\"), @PrimaryKeyJoinColumn(name=\"BAZ\"), @PrimaryKeyJoinColumn(name=\"BAR\", referencedColumnName = \"REF_NAME\", columnDefinition = \"COLUMN_DEF\")}))", cu);
- }
-
- public void testMovePkJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTablesWithPkJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES).next();
-
-
- PrimaryKeyJoinColumnAnnotation joinColumn = table.pkJoinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setColumnDefinition("COLUMN_DEF");
- table.movePkJoinColumn(0, 2);
- assertSourceContains("@SecondaryTables(@SecondaryTable(pkJoinColumns={@PrimaryKeyJoinColumn(name=\"BAZ\"), @PrimaryKeyJoinColumn(name=\"BAR\", referencedColumnName = \"REF_NAME\", columnDefinition = \"COLUMN_DEF\"), @PrimaryKeyJoinColumn(name=\"FOO\")}))", cu);
- }
-
- public void testSetPkJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTablesWithPkJoinColumns();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES).next();
-
- assertEquals(3, table.pkJoinColumnsSize());
-
- PrimaryKeyJoinColumnAnnotation joinColumn = table.pkJoinColumns().next();
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@SecondaryTables(@SecondaryTable(pkJoinColumns={@PrimaryKeyJoinColumn(name=\"foo\"), @PrimaryKeyJoinColumn(name=\"FOO\"), @PrimaryKeyJoinColumn(name=\"BAZ\")}))", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SequenceGeneratorTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SequenceGeneratorTests.java
deleted file mode 100644
index bff5089003..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SequenceGeneratorTests.java
+++ /dev/null
@@ -1,230 +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.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.core.resource.java.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class SequenceGeneratorTests extends JavaResourceModelTestCase {
-
- private static final String GENERATOR_NAME = "MY_GENERATOR";
- private static final String GENERATOR_SEQUENCE_NAME = "MY_SEQUENCE";
- private static final Integer GENERATOR_ALLOCATION_SIZE = Integer.valueOf(5);
- private static final Integer GENERATOR_INITIAL_VALUE = Integer.valueOf(5);
-
- public SequenceGeneratorTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestSequenceGeneratorOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SEQUENCE_GENERATOR);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@SequenceGenerator");
- }
- });
- }
-
- private ICompilationUnit createTestSequenceGeneratorOnType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SEQUENCE_GENERATOR);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SequenceGenerator");
- }
- });
- }
-
- private ICompilationUnit createTestSequenceGeneratorWithName() throws Exception {
- return createTestSequenceGeneratorWithStringElement("name", GENERATOR_NAME);
- }
-
- private ICompilationUnit createTestSequenceGeneratorWithSequenceName() throws Exception {
- return createTestSequenceGeneratorWithStringElement("sequenceName", GENERATOR_SEQUENCE_NAME);
- }
-
- private ICompilationUnit createTestSequenceGeneratorWithStringElement(final String elementName, final String value) throws Exception { return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SEQUENCE_GENERATOR);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@SequenceGenerator(" + elementName + "=\"" + value + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestSequenceGeneratorWithAllocationSize() throws Exception {
- return createTestSequenceGeneratorWithIntElement("allocationSize", GENERATOR_ALLOCATION_SIZE);
- }
-
- private ICompilationUnit createTestSequenceGeneratorWithInitialValue() throws Exception {
- return createTestSequenceGeneratorWithIntElement("initialValue", GENERATOR_INITIAL_VALUE);
- }
-
- private ICompilationUnit createTestSequenceGeneratorWithIntElement(final String elementName, final int value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SEQUENCE_GENERATOR);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@SequenceGenerator(" + elementName + "=" + value + ")");
- }
- });
- }
-
- public void testSequenceGeneratorOnField() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR);
- assertNotNull(sequenceGenerator);
- }
-
- public void testSequenceGeneratorOnType() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorOnType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) typeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR);
- assertNotNull(sequenceGenerator);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_NAME, sequenceGenerator.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_NAME, sequenceGenerator.getName());
-
- sequenceGenerator.setName("foo");
- assertEquals("foo", sequenceGenerator.getName());
-
- assertSourceContains("@SequenceGenerator(name=\"foo\")", cu);
-
- sequenceGenerator.setName(null);
- assertNull(sequenceGenerator.getName());
-
- assertSourceDoesNotContain("@SequenceGenerator", cu);
- }
-
- public void testGetSequenceName() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithSequenceName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_SEQUENCE_NAME, sequenceGenerator.getSequenceName());
- }
-
- public void testSetSequenceName() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithSequenceName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_SEQUENCE_NAME, sequenceGenerator.getSequenceName());
-
- sequenceGenerator.setSequenceName("foo");
- assertEquals("foo", sequenceGenerator.getSequenceName());
-
- assertSourceContains("@SequenceGenerator(sequenceName=\"foo\")", cu);
-
- sequenceGenerator.setSequenceName(null);
- assertNull(sequenceGenerator.getSequenceName());
-
- assertSourceDoesNotContain("@SequenceGenerator", cu);
- }
-
- public void testGetAllocationSize() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithAllocationSize();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_ALLOCATION_SIZE, sequenceGenerator.getAllocationSize());
- }
-
- public void testSetAllocationSize() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithAllocationSize();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_ALLOCATION_SIZE, sequenceGenerator.getAllocationSize());
-
- sequenceGenerator.setAllocationSize(Integer.valueOf(500));
- assertEquals(Integer.valueOf(500), sequenceGenerator.getAllocationSize());
-
- assertSourceContains("@SequenceGenerator(allocationSize=500)", cu);
-
- sequenceGenerator.setAllocationSize(null);
-
- assertSourceDoesNotContain("@SequenceGenerator", cu);
-
- sequenceGenerator.setAllocationSize(Integer.valueOf(0));
- assertSourceContains("@SequenceGenerator(allocationSize=0)", cu);
- }
-
- public void testGetInitialValue() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithInitialValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_INITIAL_VALUE, sequenceGenerator.getInitialValue());
- }
-
- public void testSetInitialValue() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithInitialValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_INITIAL_VALUE, sequenceGenerator.getInitialValue());
-
- sequenceGenerator.setInitialValue(Integer.valueOf(500));
- assertEquals(Integer.valueOf(500), sequenceGenerator.getInitialValue());
-
- assertSourceContains("@SequenceGenerator(initialValue=500)", cu);
-
- sequenceGenerator.setInitialValue(null);
-
- assertSourceDoesNotContain("@SequenceGenerator", cu);
-
- sequenceGenerator.setInitialValue(Integer.valueOf(0));
- assertSourceContains("@SequenceGenerator(initialValue=0)", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TableGeneratorTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TableGeneratorTests.java
deleted file mode 100644
index 32bfe379c3..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TableGeneratorTests.java
+++ /dev/null
@@ -1,500 +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.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.core.resource.java.TableGeneratorAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class TableGeneratorTests extends JavaResourceModelTestCase {
-
- private static final String GENERATOR_NAME = "MY_GENERATOR";
- private static final String GENERATOR_TABLE = "MY_TABLE";
- private static final String GENERATOR_CATALOG = "MY_CATALOG";
- private static final String GENERATOR_SCHEMA = "MY_SCHEMA";
- private static final String GENERATOR_PK_COLUMN_NAME = "MY_PK_COLUMN_NAME";
- private static final String GENERATOR_VALUE_COLUMN_NAME = "MY_VALUE_COLUMN_NAME";
- private static final String GENERATOR_PK_COLUMN_VALUE = "MY_PK_COLUMN_VALUE";
- private static final Integer GENERATOR_ALLOCATION_SIZE = Integer.valueOf(5);
- private static final Integer GENERATOR_INITIAL_VALUE = Integer.valueOf(5);
-
- public TableGeneratorTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTableGeneratorOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE_GENERATOR);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@TableGenerator");
- }
- });
- }
-
- private ICompilationUnit createTestTableGeneratorOnType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE_GENERATOR);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@TableGenerator");
- }
- });
- }
-
- private ICompilationUnit createTestTableGeneratorWithName() throws Exception {
- return createTestTableGeneratorWithStringElement("name", GENERATOR_NAME);
- }
-
- private ICompilationUnit createTestTableGeneratorWithTable() throws Exception {
- return createTestTableGeneratorWithStringElement("table", GENERATOR_TABLE);
- }
-
- private ICompilationUnit createTestTableGeneratorWithCatalog() throws Exception {
- return createTestTableGeneratorWithStringElement("catalog", GENERATOR_CATALOG);
- }
-
- private ICompilationUnit createTestTableGeneratorWithSchema() throws Exception {
- return createTestTableGeneratorWithStringElement("schema", GENERATOR_SCHEMA);
- }
- private ICompilationUnit createTestTableGeneratorWithPkColumnName() throws Exception {
- return createTestTableGeneratorWithStringElement("pkColumnName", GENERATOR_PK_COLUMN_NAME);
- }
-
- private ICompilationUnit createTestTableGeneratorWithValueColumnName() throws Exception {
- return createTestTableGeneratorWithStringElement("valueColumnName", GENERATOR_VALUE_COLUMN_NAME);
- }
-
- private ICompilationUnit createTestTableGeneratorWithPkColumnValue() throws Exception {
- return createTestTableGeneratorWithStringElement("pkColumnValue", GENERATOR_PK_COLUMN_VALUE);
- }
-
- private ICompilationUnit createTestTableGeneratorWithStringElement(final String elementName, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE_GENERATOR);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@TableGenerator(" + elementName + "=\"" + value + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestTableGeneratorWithAllocationSize() throws Exception {
- return createTestTableGeneratorWithIntElement("allocationSize", GENERATOR_ALLOCATION_SIZE);
- }
-
- private ICompilationUnit createTestTableGeneratorWithInitialValue() throws Exception {
- return createTestTableGeneratorWithIntElement("initialValue", GENERATOR_INITIAL_VALUE);
- }
-
- private ICompilationUnit createTestTableGeneratorWithIntElement(final String elementName, final int value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE_GENERATOR);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@TableGenerator(" + elementName + "=" + value + ")");
- }
- });
- }
-
- private ICompilationUnit createTestTableGeneratorWithUniqueConstraints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE_GENERATOR, JPA.UNIQUE_CONSTRAINT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@TableGenerator(uniqueConstraints={@UniqueConstraint(columnNames={\"BAR\"}), @UniqueConstraint(columnNames={\"FOO\"}), @UniqueConstraint(columnNames={\"BAZ\"})})");
- }
- });
- }
-
- public void testTableGeneratorOnField() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
- assertNotNull(tableGenerator);
- }
-
- public void testTableGeneratorOnType() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorOnType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
- assertNotNull(tableGenerator);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_NAME, tableGenerator.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_NAME, tableGenerator.getName());
-
- tableGenerator.setName("foo");
- assertEquals("foo", tableGenerator.getName());
-
- assertSourceContains("@TableGenerator(name=\"foo\")", cu);
-
- tableGenerator.setName(null);
- assertNull(tableGenerator.getName());
-
- assertSourceDoesNotContain("@TableGenerator", cu);
- }
-
- public void testGetTable() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_TABLE, tableGenerator.getTable());
- }
-
- public void testSetTable() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_TABLE, tableGenerator.getTable());
-
- tableGenerator.setTable("foo");
- assertEquals("foo", tableGenerator.getTable());
-
- assertSourceContains("@TableGenerator(table=\"foo\")", cu);
-
- tableGenerator.setTable(null);
- assertNull(tableGenerator.getTable());
-
- assertSourceDoesNotContain("@TableGenerator", cu);
- }
-
- public void testGetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithCatalog();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_CATALOG, tableGenerator.getCatalog());
- }
-
- public void testSetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithCatalog();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_CATALOG, tableGenerator.getCatalog());
-
- tableGenerator.setCatalog("foo");
- assertEquals("foo", tableGenerator.getCatalog());
-
- assertSourceContains("@TableGenerator(catalog=\"foo\")", cu);
-
- tableGenerator.setCatalog(null);
- assertNull(tableGenerator.getCatalog());
-
- assertSourceDoesNotContain("@TableGenerator", cu);
- }
-
- public void testGetSchema() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithSchema();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_SCHEMA, tableGenerator.getSchema());
- }
-
- public void testSetSchema() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithSchema();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_SCHEMA, tableGenerator.getSchema());
-
- tableGenerator.setSchema("foo");
- assertEquals("foo", tableGenerator.getSchema());
-
- assertSourceContains("@TableGenerator(schema=\"foo\")", cu);
-
- tableGenerator.setSchema(null);
- assertNull(tableGenerator.getSchema());
-
- assertSourceDoesNotContain("@TableGenerator", cu);
- }
-
- public void testGetPkColumnName() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithPkColumnName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_PK_COLUMN_NAME, tableGenerator.getPkColumnName());
- }
-
- public void testSetPkColumnName() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithPkColumnName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_PK_COLUMN_NAME, tableGenerator.getPkColumnName());
-
- tableGenerator.setPkColumnName("foo");
- assertEquals("foo", tableGenerator.getPkColumnName());
-
- assertSourceContains("@TableGenerator(pkColumnName=\"foo\")", cu);
-
- tableGenerator.setPkColumnName(null);
- assertNull(tableGenerator.getPkColumnName());
-
- assertSourceDoesNotContain("@TableGenerator", cu);
- }
-
- public void testGetValueColumnName() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithValueColumnName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_VALUE_COLUMN_NAME, tableGenerator.getValueColumnName());
- }
-
- public void testSetValueColumnName() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithValueColumnName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_VALUE_COLUMN_NAME, tableGenerator.getValueColumnName());
-
- tableGenerator.setValueColumnName("foo");
- assertEquals("foo", tableGenerator.getValueColumnName());
-
- assertSourceContains("@TableGenerator(valueColumnName=\"foo\")", cu);
-
- tableGenerator.setValueColumnName(null);
- assertNull(tableGenerator.getValueColumnName());
-
- assertSourceDoesNotContain("@TableGenerator", cu);
- }
-
- public void testGetPkColumnValue() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithPkColumnValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_PK_COLUMN_VALUE, tableGenerator.getPkColumnValue());
- }
-
- public void testSetPkColumnValue() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithPkColumnValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_PK_COLUMN_VALUE, tableGenerator.getPkColumnValue());
-
- tableGenerator.setPkColumnValue("foo");
- assertEquals("foo", tableGenerator.getPkColumnValue());
-
- assertSourceContains("@TableGenerator(pkColumnValue=\"foo\")", cu);
-
- tableGenerator.setPkColumnValue(null);
- assertNull(tableGenerator.getPkColumnValue());
-
- assertSourceDoesNotContain("@TableGenerator", cu);
- }
-
- public void testGetAllocationSize() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithAllocationSize();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_ALLOCATION_SIZE, tableGenerator.getAllocationSize());
- }
-
- public void testSetAllocationSize() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithAllocationSize();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_ALLOCATION_SIZE, tableGenerator.getAllocationSize());
-
- tableGenerator.setAllocationSize(Integer.valueOf(500));
- assertEquals(Integer.valueOf(500), tableGenerator.getAllocationSize());
-
- assertSourceContains("@TableGenerator(allocationSize=500)", cu);
-
- tableGenerator.setAllocationSize(null);
-
- assertSourceDoesNotContain("@TableGenerator", cu);
-
- tableGenerator.setAllocationSize(Integer.valueOf(0));
- assertSourceContains("@TableGenerator(allocationSize=0)", cu);
- }
-
- public void testGetInitialValue() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithInitialValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_INITIAL_VALUE, tableGenerator.getInitialValue());
- }
-
- public void testSetInitialValue() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithInitialValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_INITIAL_VALUE, tableGenerator.getInitialValue());
-
- tableGenerator.setInitialValue(Integer.valueOf(500));
- assertEquals(Integer.valueOf(500), tableGenerator.getInitialValue());
-
- assertSourceContains("@TableGenerator(initialValue=500)", cu);
-
- tableGenerator.setInitialValue(null);
-
- assertSourceDoesNotContain("@TableGenerator", cu);
-
- tableGenerator.setInitialValue(Integer.valueOf(0));
- assertSourceContains("@TableGenerator(initialValue=0)", cu);
- }
-
- public void testUniqueConstraints() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals(0, tableGenerator.uniqueConstraintsSize());
- }
-
- public void testUniqueConstraints2() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.addUniqueConstraint(0);
- tableGenerator.addUniqueConstraint(1);
-
- assertEquals(2, tableGenerator.uniqueConstraintsSize());
- }
-
- public void testUniqueConstraints3() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithUniqueConstraints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals(3, tableGenerator.uniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorOnField();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.addUniqueConstraint(0).addColumnName("FOO");
- tableGenerator.addUniqueConstraint(1);
- tableGenerator.addUniqueConstraint(0).addColumnName("BAR");
-
- assertEquals("BAR", tableGenerator.uniqueConstraintAt(0).columnNames().next());
- assertEquals("FOO", tableGenerator.uniqueConstraintAt(1).columnNames().next());
- assertEquals(0, tableGenerator.uniqueConstraintAt(2).columnNamesSize());
-
- assertEquals(3, tableGenerator.uniqueConstraintsSize());
- assertSourceContains("@TableGenerator(uniqueConstraints={@UniqueConstraint(columnNames=\"BAR\"),@UniqueConstraint(columnNames=\"FOO\"), @UniqueConstraint})", cu);
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithUniqueConstraints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.removeUniqueConstraint(1);
- assertSourceContains("@TableGenerator(uniqueConstraints={@UniqueConstraint(columnNames={\"BAR\"}), @UniqueConstraint(columnNames={\"BAZ\"})})", cu);
-
- tableGenerator.removeUniqueConstraint(0);
- assertSourceContains("@TableGenerator(uniqueConstraints=@UniqueConstraint(columnNames={\"BAZ\"}))", cu);
-
- tableGenerator.removeUniqueConstraint(0);
- assertSourceDoesNotContain("@TableGenerator", cu);
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithUniqueConstraints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.moveUniqueConstraint(2, 0);
- assertSourceContains("@TableGenerator(uniqueConstraints={@UniqueConstraint(columnNames={\"FOO\"}), @UniqueConstraint(columnNames={\"BAZ\"}), @UniqueConstraint(columnNames={\"BAR\"})})", cu);
- }
-
- public void testMoveUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithUniqueConstraints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.moveUniqueConstraint(0, 2);
- assertSourceContains("@TableGenerator(uniqueConstraints={@UniqueConstraint(columnNames={\"BAZ\"}), @UniqueConstraint(columnNames={\"BAR\"}), @UniqueConstraint(columnNames={\"FOO\"})})", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TableTests.java
deleted file mode 100644
index 88092e7627..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TableTests.java
+++ /dev/null
@@ -1,345 +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.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.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.TableAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class TableTests extends JavaResourceModelTestCase {
-
- private static final String TABLE_NAME = "MY_TABLE";
- private static final String SCHEMA_NAME = "MY_SCHEMA";
- private static final String CATALOG_NAME = "MY_CATALOG";
-
- public TableTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Table");
- }
- });
- }
-
- private ICompilationUnit createTestTableWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Table(name=\"" + TABLE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestTableWithSchema() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Table(schema=\"" + SCHEMA_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestTableWithCatalog() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Table(catalog=\"" + CATALOG_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestTableWithUniqueConstraints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE, JPA.UNIQUE_CONSTRAINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Table(uniqueConstraints={@UniqueConstraint(columnNames={\"BAR\"}), @UniqueConstraint(columnNames={\"FOO\"}), @UniqueConstraint(columnNames={\"BAZ\"})})");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestTableWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
- assertNotNull(table);
- assertEquals(TABLE_NAME, table.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
- assertNotNull(table);
- assertNull(table.getName());
- assertNull(table.getCatalog());
- assertNull(table.getSchema());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
- assertNotNull(table);
- assertNull(table.getName());
-
- table.setName("Foo");
- assertEquals("Foo", table.getName());
-
- assertSourceContains("@Table(name=\"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestTableWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
- assertEquals(TABLE_NAME, table.getName());
-
- table.setName(null);
- assertNull(table.getName());
-
- assertSourceDoesNotContain("@Table", cu);
- }
-
- public void testGetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestTableWithCatalog();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
- assertNotNull(table);
- assertEquals(CATALOG_NAME, table.getCatalog());
- }
-
- public void testSetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
- assertNotNull(table);
- assertNull(table.getCatalog());
-
- table.setCatalog("Foo");
- assertEquals("Foo", table.getCatalog());
-
- assertSourceContains("@Table(catalog=\"Foo\")", cu);
- }
-
- public void testSetCatalogNull() throws Exception {
- ICompilationUnit cu = this.createTestTableWithCatalog();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
- assertEquals(CATALOG_NAME, table.getCatalog());
-
- table.setCatalog(null);
- assertNull(table.getCatalog());
-
- assertSourceDoesNotContain("@Table", cu);
- }
-
- public void testGetSchema() throws Exception {
- ICompilationUnit cu = this.createTestTableWithSchema();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
- assertNotNull(table);
- assertEquals(SCHEMA_NAME, table.getSchema());
- }
-
- public void testSetSchema() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
- assertNotNull(table);
- assertNull(table.getSchema());
-
- table.setSchema("Foo");
- assertEquals("Foo", table.getSchema());
-
- assertSourceContains("@Table(schema=\"Foo\")", cu);
- }
-
- public void testSetSchemaNull() throws Exception {
- ICompilationUnit cu = this.createTestTableWithSchema();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
- assertEquals(SCHEMA_NAME, table.getSchema());
-
- table.setSchema(null);
- assertNull(table.getSchema());
-
- assertSourceDoesNotContain("@Table", cu);
- }
-
- public void testUniqueConstraints() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
-
- assertEquals(0, table.uniqueConstraintsSize());
- }
-
- public void testUniqueConstraints2() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
-
- table.addUniqueConstraint(0);
- table.addUniqueConstraint(1);
-
- assertEquals(2, table.uniqueConstraintsSize());
- }
-
- public void testUniqueConstraints3() throws Exception {
- ICompilationUnit cu = this.createTestTableWithUniqueConstraints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
-
- assertEquals(3, table.uniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
-
- table.addUniqueConstraint(0).addColumnName("FOO");
- table.addUniqueConstraint(1);
- table.addUniqueConstraint(0).addColumnName("BAR");
-
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNames().next());
- assertEquals("FOO", table.uniqueConstraintAt(1).columnNames().next());
- assertEquals(0, table.uniqueConstraintAt(2).columnNamesSize());
-
- assertSourceContains("@Table(uniqueConstraints={@UniqueConstraint(columnNames=\"BAR\"),@UniqueConstraint(columnNames=\"FOO\"), @UniqueConstraint})", cu);
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
-
- table.addUniqueConstraint(0).addColumnName("FOO");
- table.addUniqueConstraint(0);
- table.addUniqueConstraint(1).addColumnName("BAR");
- table.uniqueConstraintAt(1).addColumnName("BAZ");
-
- assertSourceContains("@Table(uniqueConstraints={@UniqueConstraint,@UniqueConstraint(columnNames={ \"BAR\", \"BAZ\" }), @UniqueConstraint(columnNames=\"FOO\")})", cu);
-
- assertEquals("FOO", table.uniqueConstraintAt(2).columnNames().next());
- ListIterator<String> columnNames = table.uniqueConstraintAt(1).columnNames();
- assertEquals("BAR", columnNames.next());
- assertEquals("BAZ", columnNames.next());
- }
- public void testRemoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestTableWithUniqueConstraints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
-
- table.removeUniqueConstraint(1);
- assertSourceContains("@Table(uniqueConstraints={@UniqueConstraint(columnNames={\"BAR\"}), @UniqueConstraint(columnNames={\"BAZ\"})})", cu);
-
- table.removeUniqueConstraint(0);
- assertSourceContains("@Table(uniqueConstraints=@UniqueConstraint(columnNames={\"BAZ\"}))", cu);
-
- table.removeUniqueConstraint(0);
- assertSourceDoesNotContain("@Table", cu);
- }
-
- public void testRemoveUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
- table.addUniqueConstraint(0).addColumnName("FOO");
- table.addUniqueConstraint(1).addColumnName("BAR");
- table.addUniqueConstraint(2).addColumnName("BAZ");
- assertSourceContains("@Table(uniqueConstraints={@UniqueConstraint(columnNames=\"FOO\"),@UniqueConstraint(columnNames=\"BAR\"), @UniqueConstraint(columnNames=\"BAZ\")})", cu);
-
- table.removeUniqueConstraint(0);
- assertSourceContains("@Table(uniqueConstraints={@UniqueConstraint(columnNames=\"BAR\"),@UniqueConstraint(columnNames=\"BAZ\")})", cu);
-
- table.removeUniqueConstraint(0);
- assertSourceContains("@Table(uniqueConstraints=@UniqueConstraint(columnNames=\"BAZ\"))", cu);
-
- table.removeUniqueConstraint(0);
- assertSourceDoesNotContain("@Table", cu);
- }
-
- public void testRemoveUniqueConstraint3() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
- table.addUniqueConstraint(0).addColumnName("FOO");
- table.addUniqueConstraint(1).addColumnName("BAR");
- table.addUniqueConstraint(2).addColumnName("BAZ");
- assertSourceContains("@Table(uniqueConstraints={@UniqueConstraint(columnNames=\"FOO\"),@UniqueConstraint(columnNames=\"BAR\"), @UniqueConstraint(columnNames=\"BAZ\")})", cu);
-
- table.removeUniqueConstraint(2);
- assertSourceContains("@Table(uniqueConstraints={@UniqueConstraint(columnNames=\"FOO\"),@UniqueConstraint(columnNames=\"BAR\")})", cu);
-
- table.removeUniqueConstraint(1);
- assertSourceContains("@Table(uniqueConstraints=@UniqueConstraint(columnNames=\"FOO\"))", cu);
-
- table.removeUniqueConstraint(0);
- assertSourceDoesNotContain("@Table", cu);
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestTableWithUniqueConstraints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
-
- table.moveUniqueConstraint(2, 0);
- assertSourceContains("@Table(uniqueConstraints={@UniqueConstraint(columnNames={\"FOO\"}), @UniqueConstraint(columnNames={\"BAZ\"}), @UniqueConstraint(columnNames={\"BAR\"})})", cu);
- }
-
- public void testMoveUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestTableWithUniqueConstraints();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE);
-
- table.moveUniqueConstraint(0, 2);
- assertSourceContains("@Table(uniqueConstraints={@UniqueConstraint(columnNames={\"BAZ\"}), @UniqueConstraint(columnNames={\"BAR\"}), @UniqueConstraint(columnNames={\"FOO\"})})", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TemporalTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TemporalTests.java
deleted file mode 100644
index e095aa7bda..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TemporalTests.java
+++ /dev/null
@@ -1,87 +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.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.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.core.resource.java.TemporalType;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class TemporalTests extends JavaResourceModelTestCase {
-
- public TemporalTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTemporal() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TEMPORAL);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Temporal");
- }
- });
- }
-
- private ICompilationUnit createTestTemporalWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TEMPORAL, JPA.TEMPORAL_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Temporal(TemporalType.DATE)");
- }
- });
- }
-
- public void testTemporal() throws Exception {
- ICompilationUnit cu = this.createTestTemporal();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TemporalAnnotation temporal = (TemporalAnnotation) attributeResource.getSupportingAnnotation(JPA.TEMPORAL);
- assertNotNull(temporal);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestTemporalWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TemporalAnnotation temporal = (TemporalAnnotation) attributeResource.getSupportingAnnotation(JPA.TEMPORAL);
- assertEquals(TemporalType.DATE, temporal.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestTemporal();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- TemporalAnnotation temporal = (TemporalAnnotation) attributeResource.getSupportingAnnotation(JPA.TEMPORAL);
-
- temporal.setValue(TemporalType.TIME);
-
- assertSourceContains("@Temporal(TIME)", cu);
-
- temporal.setValue(null);
-
- assertSourceDoesNotContain("@Temporal", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TransientTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TransientTests.java
deleted file mode 100644
index 912877343a..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TransientTests.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.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.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class TransientTests extends JavaResourceModelTestCase {
-
- public TransientTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTransient() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TRANSIENT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Transient");
- }
- });
- }
-
- public void testTransient() throws Exception {
- ICompilationUnit cu = this.createTestTransient();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JavaResourceNode mappingAnnotation = attributeResource.getMappingAnnotation();
- assertTrue(mappingAnnotation instanceof TransientAnnotation);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/VersionTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/VersionTests.java
deleted file mode 100644
index 7e43758f03..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/VersionTests.java
+++ /dev/null
@@ -1,48 +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.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.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class VersionTests extends JavaResourceModelTestCase {
-
- public VersionTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestVersion() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.VERSION);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version");
- }
- });
- }
-
- public void testVersion() throws Exception {
- ICompilationUnit cu = this.createTestVersion();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- JavaResourceNode mappingAnnotation = attributeResource.getMappingAnnotation();
- assertTrue(mappingAnnotation instanceof VersionAnnotation);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/AnnotationTestCase.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/AnnotationTestCase.java
deleted file mode 100644
index 81c8d7f83b..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/AnnotationTestCase.java
+++ /dev/null
@@ -1,512 +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.tests.internal.utility.jdt;
-
-import java.io.File;
-import java.util.Iterator;
-import java.util.List;
-import junit.framework.TestCase;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.NumberLiteral;
-import org.eclipse.jdt.core.dom.SimpleName;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jdt.core.dom.StringLiteral;
-import org.eclipse.jpt.core.internal.utility.jdt.JDTFieldAttribute;
-import org.eclipse.jpt.core.internal.utility.jdt.JDTMethodAttribute;
-import org.eclipse.jpt.core.internal.utility.jdt.JDTTools;
-import org.eclipse.jpt.core.internal.utility.jdt.JDTType;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-/**
- * Provide an easy(?) way to build an annotated source file.
- * The type must be created by calling one of the #createType() methods
- * before calling any of the various helper methods (i.e. the type is *not*
- * created during #setUp()).
- */
-@SuppressWarnings("nls")
-public abstract class AnnotationTestCase extends TestCase {
- protected TestJavaProject javaProject;
-
- public static final String CR = System.getProperty("line.separator");
- public static final String SEP = File.separator;
- public static final String PROJECT_NAME = "AnnotationTestProject";
- public static final String PACKAGE_NAME = "test";
- public static final String TYPE_NAME = "AnnotationTestType";
- public static final String FULLY_QUALIFIED_TYPE_NAME = PACKAGE_NAME + "." + TYPE_NAME;
- public static final String FILE_NAME = TYPE_NAME + ".java";
- public static final IPath FILE_PATH = new Path("src" + SEP + PACKAGE_NAME + SEP + FILE_NAME);
-
- public static final String[] EMPTY_STRING_ARRAY = new String[0];
-
-
- // ********** TestCase behavior **********
-
- protected AnnotationTestCase(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.javaProject = this.buildJavaProject(false); // false = no auto-build
- }
-
- protected TestJavaProject buildJavaProject(boolean autoBuild) throws Exception {
- return this.buildJavaProject(PROJECT_NAME, autoBuild);
- }
-
- protected TestJavaProject buildJavaProject(String projectName, boolean autoBuild) throws Exception {
- return new TestJavaProject(projectName, autoBuild);
- }
-
- @Override
- protected void tearDown() throws Exception {
-// this.dumpSource();
- this.javaProject.getProject().delete(true, true, null);
- TestTools.clear(this);
- super.tearDown();
- }
-
- protected void dumpSource(ICompilationUnit cu) throws Exception {
- System.out.println("*** " + this.getName() + " ****");
- System.out.println(this.getSource(cu));
- System.out.println();
- }
-
-
- // ********** type creation **********
-
- /**
- * create an un-annotated type
- */
- protected ICompilationUnit createTestType() throws CoreException {
- return this.createTestType(new DefaultAnnotationWriter());
- }
-
- /**
- * shortcut for simply adding an annotation to the 'id' field
- */
- protected ICompilationUnit createTestType(final String annotationImport, final String idFieldAnnotation) throws CoreException {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return (annotationImport == null) ?
- EmptyIterator.<String>instance()
- :
- new SingleElementIterator<String>(annotationImport);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(idFieldAnnotation);
- }
- });
- }
-
- /**
- * shortcut for simply adding a fully-qualified annotation to the 'id' field
- */
- protected ICompilationUnit createTestType(final String idFieldAnnotation) throws CoreException {
- return this.createTestType(null, idFieldAnnotation);
- }
-
-
- protected ICompilationUnit createTestType(AnnotationWriter annotationWriter) throws CoreException {
- return this.javaProject.createCompilationUnit(PACKAGE_NAME, FILE_NAME, this.createSourceWriter(annotationWriter));
- }
-
- protected ICompilationUnit createTestType(String packageName, String fileName, String typeName, AnnotationWriter annotationWriter) throws CoreException {
- return this.javaProject.createCompilationUnit(packageName, fileName, this.createSourceWriter(annotationWriter, typeName));
- }
-
- protected SourceWriter createSourceWriter(AnnotationWriter annotationWriter) {
- return new AnnotatedSourceWriter(annotationWriter);
- }
-
- protected SourceWriter createSourceWriter(AnnotationWriter annotationWriter, String typeName) {
- return new AnnotatedSourceWriter(annotationWriter, typeName);
- }
-
- protected void appendSourceTo(StringBuilder sb, AnnotationWriter annotationWriter, String typeName) {
- sb.append(CR);
- for (Iterator<String> stream = annotationWriter.imports(); stream.hasNext(); ) {
- sb.append("import ");
- sb.append(stream.next());
- sb.append(";");
- sb.append(CR);
- }
- sb.append(CR);
- annotationWriter.appendTypeAnnotationTo(sb);
- sb.append(CR);
- sb.append("public class ").append(typeName).append(" ");
- annotationWriter.appendExtendsImplementsTo(sb);
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" ");
- annotationWriter.appendIdFieldAnnotationTo(sb);
- sb.append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" ");
- annotationWriter.appendNameFieldAnnotationTo(sb);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" ");
- annotationWriter.appendGetIdMethodAnnotationTo(sb);
- sb.append(CR);
- sb.append(" public int getId() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" ");
- annotationWriter.appendSetIdMethodAnnotationTo(sb);
- sb.append(CR);
- sb.append(" public void setId(int id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" ");
- annotationWriter.appendGetNameMethodAnnotationTo(sb);
- sb.append(CR);
- sb.append(" public String getName() {").append(CR);
- sb.append(" return this.name;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" ");
- annotationWriter.appendSetNameMethodAnnotationTo(sb);
- sb.append(CR);
- sb.append(" public void setTestField(String testField) {").append(CR);
- sb.append(" this.testField = testField;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- annotationWriter.appendMemberTypeTo(sb);
- sb.append(CR);
- sb.append("}").append(CR);
- annotationWriter.appendTopLevelTypesTo(sb);
- sb.append(CR);
- }
-
-
- // ********** queries **********
-
- protected TestJavaProject getJavaProject() {
- return this.javaProject;
- }
-
- protected JDTType testType(ICompilationUnit cu) {
- return this.buildType(TYPE_NAME, cu);
- }
-
- protected JDTType buildType(String name, ICompilationUnit cu) {
- return this.buildType(name, 1, cu);
- }
-
- protected JDTType buildType(String name, int occurrence, ICompilationUnit cu) {
- return this.buildType(null, name, occurrence, cu);
- }
-
- protected JDTType buildType(Type declaringType, String name, int occurrence, ICompilationUnit cu) {
- return new JDTType(declaringType, name, occurrence, cu);
- }
-
- protected JDTFieldAttribute idField(ICompilationUnit cu) {
- return this.buildField("id", cu);
- }
-
- protected JDTFieldAttribute nameField(ICompilationUnit cu) {
- return this.buildField("name", cu);
- }
-
- protected JDTFieldAttribute buildField(String name, ICompilationUnit cu) {
- return this.buildField(name, 1, cu);
- }
-
- protected JDTFieldAttribute buildField(String name, int occurrence, ICompilationUnit cu) {
- return this.buildField(this.testType(cu), name, occurrence, cu);
- }
-
- protected JDTFieldAttribute buildField(Type declaringType, String name, int occurrence, ICompilationUnit cu) {
- return new JDTFieldAttribute(declaringType, name, occurrence, cu);
- }
-
- protected JDTMethodAttribute idGetMethod(ICompilationUnit cu) {
- return this.buildMethod("getId", cu);
- }
-
- protected JDTMethodAttribute idSetMethod(ICompilationUnit cu) {
- return this.buildMethod("setId", new String[] {"int"}, cu);
- }
-
- protected JDTMethodAttribute nameGetMethod(ICompilationUnit cu) {
- return this.buildMethod("getName", cu);
- }
-
- protected JDTMethodAttribute buildMethod(String name, ICompilationUnit cu) {
- return this.buildMethod(name, EMPTY_STRING_ARRAY, cu);
- }
-
- protected JDTMethodAttribute buildMethod(String name, String[] parameterTypeNames, ICompilationUnit cu) {
- return this.buildMethod(name, parameterTypeNames, 1, cu);
- }
-
- protected JDTMethodAttribute buildMethod(String name, String[] parameterTypeNames, int occurrence, ICompilationUnit cu) {
- return new JDTMethodAttribute(this.testType(cu), name, parameterTypeNames, occurrence, cu);
- }
-
- protected JDTMethodAttribute buildMethod(Type declaringType, String name, String[] parameterTypeNames, int occurrence, ICompilationUnit cu) {
- return new JDTMethodAttribute(declaringType, name, parameterTypeNames, occurrence, cu);
- }
-
- protected String getSource(ICompilationUnit cu) throws JavaModelException {
- return cu.getBuffer().getContents();
- }
-
- protected CompilationUnit buildASTRoot(ICompilationUnit cu) {
- return JDTTools.buildASTRoot(cu);
- }
-
-
- // ********** test validation **********
-
- protected void assertSourceContains(String s, ICompilationUnit cu) throws JavaModelException {
- String source = this.getSource(cu);
- boolean found = source.indexOf(s) > -1;
- if ( ! found) {
- String msg = "source does not contain the expected string: " + s + " (see System console)";
- System.out.println("*** " + this.getName() + " ****");
- System.out.println(msg);
- System.out.println(source);
- System.out.println();
- fail(msg);
- }
- }
-
- protected void assertSourceDoesNotContain(String s, ICompilationUnit cu) throws JavaModelException {
- String source = this.getSource(cu);
- int pos = source.indexOf(s);
- if (pos != -1) {
- String msg = "unexpected string in source (position: " + pos + "): " + s + " (see System console)";
- System.out.println("*** " + this.getName() + " ****");
- System.out.println(msg);
- System.out.println(source);
- System.out.println();
- fail(msg);
- }
- }
-
-
- // ********** manipulate annotations **********
-
- /**
- * Return the *first* member value pair for the specified annotation element
- * with the specified name.
- * Return null if the annotation has no such element.
- */
- protected MemberValuePair memberValuePair(NormalAnnotation annotation, String elementName) {
- for (MemberValuePair pair : this.values(annotation)) {
- if (pair.getName().getFullyQualifiedName().equals(elementName)) {
- return pair;
- }
- }
- return null;
- }
-
- /**
- * minimize the scope of the suppressed warnings
- */
- @SuppressWarnings("unchecked")
- protected List<MemberValuePair> values(NormalAnnotation na) {
- return na.values();
- }
-
- /**
- * check for null member value pair
- */
- protected Expression value_(MemberValuePair pair) {
- return (pair == null) ? null : pair.getValue();
- }
-
- /**
- * Return the value of the *first* annotation element
- * with the specified name.
- * Return null if the annotation has no such element.
- */
- protected Expression annotationElementValue(NormalAnnotation annotation, String elementName) {
- return this.value_(this.memberValuePair(annotation, elementName));
- }
-
- /**
- * Return the value of the *first* annotation element
- * with the specified name.
- * Return null if the annotation has no such element.
- */
- protected Expression annotationElementValue(SingleMemberAnnotation annotation, String elementName) {
- return elementName.equals("value") ? annotation.getValue() : null;
- }
-
- /**
- * Return the value of the *first* annotation element
- * with the specified name.
- * Return null if the annotation has no such element.
- * (An element name of "value" will return the value of a single
- * member annotation.)
- */
- protected Expression annotationElementValue(Annotation annotation, String elementName) {
- if (annotation.isNormalAnnotation()) {
- return this.annotationElementValue((NormalAnnotation) annotation, elementName);
- }
- if (annotation.isSingleMemberAnnotation()) {
- return this.annotationElementValue((SingleMemberAnnotation) annotation, elementName);
- }
- return null;
- }
-
- /**
- * Build a number literal and set its initial value to the specified literal.
- */
- protected NumberLiteral newNumberLiteral(AST ast, int value) {
- return ast.newNumberLiteral(Integer.toString(value));
- }
-
- /**
- * Build a string literal and set its initial value.
- */
- protected StringLiteral newStringLiteral(AST ast, String value) {
- StringLiteral stringLiteral = ast.newStringLiteral();
- stringLiteral.setLiteralValue(value);
- return stringLiteral;
- }
-
- protected MemberValuePair newMemberValuePair(AST ast, SimpleName name, Expression value) {
- MemberValuePair pair = ast.newMemberValuePair();
- pair.setName(name);
- pair.setValue(value);
- return pair;
- }
-
- protected MemberValuePair newMemberValuePair(AST ast, String name, Expression value) {
- return this.newMemberValuePair(ast, ast.newSimpleName(name), value);
- }
-
- protected MemberValuePair newMemberValuePair(AST ast, String name, String value) {
- return this.newMemberValuePair(ast, name, this.newStringLiteral(ast, value));
- }
-
- protected MemberValuePair newMemberValuePair(AST ast, String name, int value) {
- return this.newMemberValuePair(ast, name, this.newNumberLiteral(ast, value));
- }
-
- /**
- * Add the specified member value pair to the specified annotation.
- * Return the resulting annotation.
- */
- protected NormalAnnotation addMemberValuePair(NormalAnnotation annotation, MemberValuePair pair) {
- this.values(annotation).add(pair);
- return annotation;
- }
-
- /**
- * Add the specified member value pair to the specified annotation.
- * Return the resulting annotation.
- */
- protected NormalAnnotation addMemberValuePair(NormalAnnotation annotation, String name, int value) {
- return this.addMemberValuePair(annotation, this.newMemberValuePair(annotation.getAST(), name, value));
- }
-
- /**
- * Add the specified member value pair to the specified annotation.
- * Return the resulting annotation.
- */
- protected NormalAnnotation addMemberValuePair(NormalAnnotation annotation, String name, String value) {
- return this.addMemberValuePair(annotation, this.newMemberValuePair(annotation.getAST(), name, value));
- }
-
-
- // ********** member classes **********
-
- public interface AnnotationWriter {
- Iterator<String> imports();
- void appendTypeAnnotationTo(StringBuilder sb);
- void appendExtendsImplementsTo(StringBuilder sb);
- void appendIdFieldAnnotationTo(StringBuilder sb);
- void appendNameFieldAnnotationTo(StringBuilder sb);
- void appendGetIdMethodAnnotationTo(StringBuilder sb);
- void appendSetIdMethodAnnotationTo(StringBuilder sb);
- void appendGetNameMethodAnnotationTo(StringBuilder sb);
- void appendSetNameMethodAnnotationTo(StringBuilder sb);
- void appendMemberTypeTo(StringBuilder sb);
- void appendTopLevelTypesTo(StringBuilder sb);
- }
-
- public static class DefaultAnnotationWriter implements AnnotationWriter {
- public Iterator<String> imports() {return EmptyIterator.instance();}
- public void appendTypeAnnotationTo(StringBuilder sb) {/* do nothing */}
- public void appendExtendsImplementsTo(StringBuilder sb) {/* do nothing */}
- public void appendIdFieldAnnotationTo(StringBuilder sb) {/* do nothing */}
- public void appendNameFieldAnnotationTo(StringBuilder sb) {/* do nothing */}
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {/* do nothing */}
- public void appendSetIdMethodAnnotationTo(StringBuilder sb) {/* do nothing */}
- public void appendGetNameMethodAnnotationTo(StringBuilder sb) {/* do nothing */}
- public void appendSetNameMethodAnnotationTo(StringBuilder sb) {/* do nothing */}
- public void appendMemberTypeTo(StringBuilder sb) {/* do nothing */}
- public void appendTopLevelTypesTo(StringBuilder sb) {/* do nothing */}
- }
-
- public static class AnnotationWriterWrapper implements AnnotationWriter {
- private final AnnotationWriter aw;
- public AnnotationWriterWrapper(AnnotationWriter aw) {
- super();
- this.aw = aw;
- }
- public Iterator<String> imports() {return aw.imports();}
- public void appendTypeAnnotationTo(StringBuilder sb) {aw.appendTypeAnnotationTo(sb);}
- public void appendExtendsImplementsTo(StringBuilder sb) {aw.appendExtendsImplementsTo(sb);}
- public void appendIdFieldAnnotationTo(StringBuilder sb) {aw.appendIdFieldAnnotationTo(sb);}
- public void appendNameFieldAnnotationTo(StringBuilder sb) {aw.appendNameFieldAnnotationTo(sb);}
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {aw.appendGetIdMethodAnnotationTo(sb);}
- public void appendSetIdMethodAnnotationTo(StringBuilder sb) {aw.appendSetIdMethodAnnotationTo(sb);}
- public void appendGetNameMethodAnnotationTo(StringBuilder sb) {aw.appendGetNameMethodAnnotationTo(sb);}
- public void appendSetNameMethodAnnotationTo(StringBuilder sb) {aw.appendSetNameMethodAnnotationTo(sb);}
- public void appendMemberTypeTo(StringBuilder sb) {aw.appendMemberTypeTo(sb);}
- public void appendTopLevelTypesTo(StringBuilder sb) {aw.appendTopLevelTypesTo(sb);}
- }
-
- public class AnnotatedSourceWriter implements SourceWriter {
- private AnnotationWriter annotationWriter;
- private String typeName;
- public AnnotatedSourceWriter(AnnotationWriter annotationWriter) {
- this(annotationWriter, TYPE_NAME);
- }
- public AnnotatedSourceWriter(AnnotationWriter annotationWriter, String typeName) {
- super();
- this.annotationWriter = annotationWriter;
- this.typeName = typeName;
- }
- public void appendSourceTo(StringBuilder sb) {
- AnnotationTestCase.this.appendSourceTo(sb, this.annotationWriter, typeName);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapterTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapterTests.java
deleted file mode 100644
index ddcb9209a7..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapterTests.java
+++ /dev/null
@@ -1,731 +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.tests.internal.utility.jdt;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.StringLiteral;
-import org.eclipse.jpt.core.internal.utility.jdt.CombinationIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.JDTTools;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter;
-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;
-
-@SuppressWarnings("nls")
-public class CombinationIndexedDeclarationAnnotationAdapterTests extends AnnotationTestCase {
-
- public CombinationIndexedDeclarationAnnotationAdapterTests(String name) {
- super(name);
- }
-
- private void createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception {
- this.javaProject.createCompilationUnit("annot", annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }");
- }
-
- public void testAnnotation1() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumn(name=\"ADDRESS_ID\")");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 0);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNotNull(annotation);
- assertEquals("annot.JoinColumn", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isNormalAnnotation());
- }
-
- public void testAnnotation2() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumn(name=\"ADDRESS_ID\")");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testAnnotation3() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(@annot.JoinColumn(name=\"ADDRESS_ID\"))");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 0);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNotNull(annotation);
- assertEquals("annot.JoinColumn", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isNormalAnnotation());
- }
-
- public void testAnnotation4() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(@annot.JoinColumn(name=\"ADDRESS_ID\"))");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testAnnotation5() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNotNull(annotation);
- assertEquals("annot.JoinColumn", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isNormalAnnotation());
- String value = ((StringLiteral) ((MemberValuePair) ((NormalAnnotation) annotation).values().get(0)).getValue()).getLiteralValue();
- assertEquals("ADDRESS_ID2", value);
- }
-
- public void testAnnotation6() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testAnnotation7() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNotNull(annotation);
- assertEquals("annot.JoinColumn", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isNormalAnnotation());
- String value = ((StringLiteral) ((MemberValuePair) ((NormalAnnotation) annotation).values().get(0)).getValue()).getLiteralValue();
- assertEquals("ADDRESS_ID2", value);
- }
-
- public void testAnnotation8() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testRemoveAnnotation1() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumn(name=\"ADDRESS_ID\")");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 0);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("JoinColumn", cu);
- }
-
- public void testRemoveAnnotation2() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(@annot.JoinColumn(name=\"ADDRESS_ID\"))");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 0);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("JoinColumns", cu);
- this.assertSourceDoesNotContain("JoinColumn", cu);
- }
-
- public void testRemoveAnnotation3() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("JoinColumns", cu);
- this.assertSourceDoesNotContain("ADDRESS_ID2", cu);
- this.assertSourceContains("@JoinColumn(name=\"ADDRESS_ID1\")", cu);
- }
-
- public void testRemoveAnnotation4() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("JoinColumns", cu);
- this.assertSourceDoesNotContain("ADDRESS_ID2", cu);
- this.assertSourceContains("@JoinColumn(name=\"ADDRESS_ID1\")", cu);
- }
-
- public void testRemoveAnnotation5() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "String comment(); JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(comment=\"test\",columns={@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- aa.removeAnnotation();
- this.assertSourceContains("@annot.JoinColumns(comment=\"test\",columns=@annot.JoinColumn(name=\"ADDRESS_ID1\"))", cu);
- }
-
- public void testRemoveAnnotation6() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(null)");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 0);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- aa.removeAnnotation();
- this.assertSourceContains("@annot.JoinColumns(null)", cu);
- }
-
- public void testRemoveAnnotation12() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- String expected = "@JoinColumn(name=\"ADDRESS_ID0\")";
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 2);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(expected, cu);
- this.assertSourceDoesNotContain("JoinColumns", cu);
- }
-
- public void testRemoveAnnotation13() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns({null, @annot.JoinColumn(name=\"ADDRESS_ID1\")})");
- this.assertSourceContains("@annot.JoinColumn", cu);
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("JoinColumn", cu);
- }
-
- public void testRemoveAnnotation14() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\"), null})");
- String expected = "@JoinColumn(name=\"ADDRESS_ID0\")";
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 2);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation15() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\"), @annot.JoinColumn(name=\"ADDRESS_ID3\")})");
- String expected = "@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, null, @annot.JoinColumn(name=\"ADDRESS_ID3\")})";
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 2);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation16() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\"), @annot.JoinColumn(name=\"ADDRESS_ID3\")})");
- String expected = "@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\")})";
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 3);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation17() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns({null, null, @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- this.assertSourceContains("@annot.JoinColumn", cu);
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 2);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("JoinColumn", cu);
- }
-
- public void testNewMarkerAnnotation1() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("JoinColumn", cu);
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 0);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("JoinColumn", cu);
- this.assertSourceDoesNotContain("JoinColumns", cu);
- }
-
- public void testNewMarkerAnnotation2() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumn");
- this.assertSourceDoesNotContain("JoinColumns", cu);
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@JoinColumns(columns={@JoinColumn,@JoinColumn})", cu);
- }
-
- public void testNewMarkerAnnotation3() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn, @annot.JoinColumn})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 2);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@annot.JoinColumns(columns={@annot.JoinColumn, @annot.JoinColumn," + CR + " @JoinColumn})", cu);
- }
-
- public void testNewMarkerAnnotation4() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumn(77)");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 0);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("JoinColumn", cu);
- this.assertSourceDoesNotContain("JoinColumns", cu);
- this.assertSourceDoesNotContain("77", cu);
- }
-
- public void testNewMarkerAnnotation5() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns=@annot.JoinColumn(77))");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 0);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@annot.JoinColumns(columns=@JoinColumn)", cu);
- this.assertSourceDoesNotContain("77", cu);
- }
-
- public void testNewMarkerAnnotation6() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns=@annot.JoinColumn(77))");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@annot.JoinColumns(columns={@annot.JoinColumn(77),@JoinColumn})", cu);
- }
-
- public void testNewMarkerAnnotation7() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumn(77)");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@JoinColumns(columns={@JoinColumn(77),@JoinColumn})", cu);
- }
-
- public void testNewMarkerAnnotation8() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(77),@annot.JoinColumn(88)})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@annot.JoinColumns(columns={@annot.JoinColumn(77),@JoinColumn})", cu);
- }
-
- public void testNewMarkerAnnotation9() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name(); String text(); int num();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumn(text=\"blah\",num=42)");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@JoinColumns(columns={@JoinColumn(text=\"blah\", num=42),@JoinColumn})", cu);
- }
-
- public void testNewMarkerAnnotation23() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name(); String text(); int num();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumn(text=\"blah\",num=42)");
- String expected = "@JoinColumns(columns={@JoinColumn(text=\"blah\", num=42),null,@JoinColumn})";
- this.assertSourceDoesNotContain(expected, cu);
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 2);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation24() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name(); String text(); int num();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumn(text=\"blah\",num=42)");
- String expected1 = "@JoinColumns({";
- String expected2 = "@JoinColumn(text=\"blah\", num=42),null,";
- String expected3 = "@JoinColumn" + CR + " })";
- this.assertSourceDoesNotContain(expected1, cu);
- this.assertSourceDoesNotContain(expected2, cu);
- this.assertSourceDoesNotContain(expected3, cu);
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 2);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected1, cu);
- this.assertSourceContains(expected2, cu);
- this.assertSourceContains(expected3, cu);
- }
-
- public void testNewMarkerAnnotation25() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\")})");
- String expected1 = "@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), null, null,"; // the line gets split
- String expected2 = "@JoinColumn})";
- this.assertSourceDoesNotContain(expected1, cu);
- this.assertSourceDoesNotContain(expected2, cu);
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 4);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected1, cu);
- this.assertSourceContains(expected2, cu);
- }
-
- public void testNewMarkerAnnotation26() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\")})");
- String expected1 = "@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), null, null,"; // the line gets split
- String expected2 = "@JoinColumn})";
- this.assertSourceDoesNotContain(expected1, cu);
- this.assertSourceDoesNotContain(expected2, cu);
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 4);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected1, cu);
- this.assertSourceContains(expected2, cu);
- }
-
- public void testMoveAnnotation1() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumn(name=\"ADDRESS_ID0\")");
- String expected = "@JoinColumns(columns={null,@JoinColumn(name=\"ADDRESS_ID0\")})";
- this.assertSourceDoesNotContain(expected, cu);
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 0);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(1);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation2() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={null,@annot.JoinColumn(name=\"ADDRESS_ID1\")})");
- String expected = "@JoinColumn(name=\"ADDRESS_ID1\")";
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- this.assertSourceDoesNotContain("JoinColumns", cu);
- }
-
- public void testMoveAnnotation2a() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns({null,@annot.JoinColumn(name=\"ADDRESS_ID1\")})");
- String expected = "@JoinColumn(name=\"ADDRESS_ID1\")";
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 1);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- this.assertSourceDoesNotContain("JoinColumns", cu);
- }
-
- public void testMoveAnnotation3() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\"), @annot.JoinColumn(name=\"ADDRESS_ID3\")})");
- String expected = "@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID3\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})";
- this.assertSourceDoesNotContain(expected, cu);
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 3);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation4() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\"), @annot.JoinColumn(name=\"ADDRESS_ID3\"), @annot.JoinColumn(name=\"ADDRESS_ID4\")})");
- String expected = "@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID3\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\"), null, @annot.JoinColumn(name=\"ADDRESS_ID4\")})";
- this.assertSourceDoesNotContain(expected, cu);
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 3);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation5() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- String expected = "@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\")})";
- this.assertSourceDoesNotContain(expected, cu);
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 2);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(3);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation6() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- String expected = "@annot.JoinColumns(columns={null, @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\"), @annot.JoinColumn(name=\"ADDRESS_ID0\")})";
- this.assertSourceDoesNotContain(expected, cu);
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 0);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(3);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation7() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- String expected = "@annot.JoinColumns(columns={null, @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})";
- this.assertSourceDoesNotContain(expected, cu);
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 3);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation8() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\"), null, @annot.JoinColumn(name=\"ADDRESS_ID4\")})");
- String expected = "@annot.JoinColumns(columns={null, @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\"), null, @annot.JoinColumn(name=\"ADDRESS_ID4\")})";
- this.assertSourceDoesNotContain(expected, cu);
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 3);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation9() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- String expected = "@annot.JoinColumns(columns={null, @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})";
- ICompilationUnit cu = this.createTestType(expected); // the source should be unchanged
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 0);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNull(annotation);
-
- iaa.moveAnnotation(3);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation10() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\")})");
- String expected = "@JoinColumn(name=\"ADDRESS_ID0\")";
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 2);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNull(annotation);
-
- iaa.moveAnnotation(1);
- this.assertSourceContains(expected, cu);
- this.assertSourceDoesNotContain("@annot.JoinColumns", cu);
- }
-
- public void testMoveAnnotation10a() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\")})");
- String expected = "@JoinColumn(name=\"ADDRESS_ID0\")";
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 2);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNull(annotation);
-
- iaa.moveAnnotation(1);
- this.assertSourceContains(expected, cu);
- this.assertSourceDoesNotContain("@annot.JoinColumns", cu);
- }
-
- public void testMoveAnnotation11() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumn(name=\"ADDRESS_ID0\")");
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceDoesNotContain("JoinColumn", cu);
- }
-
- public void testMoveAnnotation12() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- String expected = "@JoinColumn(name=\"ADDRESS_ID2\")";
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 2);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- this.assertSourceDoesNotContain("@annot.JoinColumns", cu);
- }
-
- public void testMoveAnnotation13() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), null, @annot.JoinColumn(name=\"ADDRESS_ID3\")})");
- String expected = "@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID3\"), @annot.JoinColumn(name=\"ADDRESS_ID1\")})";
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 3);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(JDTTools.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/DefaultAnnotationEditFormatterTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/DefaultAnnotationEditFormatterTests.java
deleted file mode 100644
index e3e909794a..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/DefaultAnnotationEditFormatterTests.java
+++ /dev/null
@@ -1,74 +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.tests.internal.utility.jdt;
-
-import org.eclipse.jpt.core.internal.utility.jdt.DefaultAnnotationEditFormatter;
-import org.eclipse.jpt.utility.internal.ClassTools;
-
-public class DefaultAnnotationEditFormatterTests extends AnnotationTestCase {
-
-
- // ********** TestCase behavior **********
-
- public DefaultAnnotationEditFormatterTests(String name) {
- super(name);
- }
-
-
- // ********** tests **********
-
- public void testCommaLength() throws Exception {
- assertEquals(1, this.commaLength(","));
- assertEquals(1, this.commaLength(", "));
- assertEquals(1, this.commaLength(", "));
-
- assertEquals(2, this.commaLength(" ,"));
- assertEquals(2, this.commaLength(" , "));
- assertEquals(2, this.commaLength(" , "));
-
- assertEquals(3, this.commaLength(" ,"));
- assertEquals(3, this.commaLength(" , "));
- assertEquals(3, this.commaLength(" , "));
-
- assertEquals(0, this.commaLength(" ,,,"));
- assertEquals(0, this.commaLength(" ,,, "));
- assertEquals(0, this.commaLength(" , ,"));
-
- assertEquals(0, this.commaLength(" ,x"));
- assertEquals(0, this.commaLength(" ,x "));
- assertEquals(0, this.commaLength(" , x"));
-
- assertEquals(0, this.commaLength("x ,"));
- assertEquals(0, this.commaLength("x , "));
- assertEquals(0, this.commaLength("x , "));
- }
-
- private int commaLength(String s) {
- Integer len = (Integer) ClassTools.executeMethod(DefaultAnnotationEditFormatter.instance(), "commaLength", String.class, s);
- return len.intValue();
- }
-
- public void testStringIsAnnotation() throws Exception {
- assertTrue(this.stringIsAnnotation("@F"));
- assertTrue(this.stringIsAnnotation("@Foo"));
- assertTrue(this.stringIsAnnotation("@org.bar.Foo"));
-
- assertFalse(this.stringIsAnnotation(""));
- assertFalse(this.stringIsAnnotation("@"));
- assertFalse(this.stringIsAnnotation("Foo"));
- assertFalse(this.stringIsAnnotation("Foo@"));
- }
-
- private boolean stringIsAnnotation(String s) {
- Boolean b = (Boolean) ClassTools.executeMethod(DefaultAnnotationEditFormatter.instance(), "stringIsAnnotation", String.class, s);
- return b.booleanValue();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/JDTToolsTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/JDTToolsTests.java
deleted file mode 100644
index f644cabc17..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/JDTToolsTests.java
+++ /dev/null
@@ -1,87 +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.tests.internal.utility.jdt;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Name;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.JDTFieldAttribute;
-import org.eclipse.jpt.core.internal.utility.jdt.JDTTools;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-
-public class JDTToolsTests extends AnnotationTestCase {
-
- public JDTToolsTests(String name) {
- super(name);
- }
-
- private void createEnumAndMembers(String enumName, String enumBody) throws Exception {
- this.javaProject.createCompilationUnit("enums", enumName + ".java", "public enum " + enumName + " { " + enumBody + " }");
- }
-
- private void createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception {
- this.javaProject.createCompilationUnit("annot", annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }");
- }
-
- public void testResolveEnum1() throws Exception {
- this.createEnumAndMembers("TestEnum", "FOO, BAR, BAZ");
- this.createAnnotationAndMembers("TestAnnotation", "TestEnum foo();");
-
- ICompilationUnit cu = this.createTestType("@annot.TestAnnotation(foo=enums.TestEnum.BAZ)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.TestAnnotation");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "foo");
- JDTFieldAttribute field = this.idField(cu);
-
- String actual = JDTTools.resolveEnum((Name) daea.getExpression(field.getModifiedDeclaration(this.buildASTRoot(cu))));
- assertEquals("enums.TestEnum.BAZ", actual);
- }
-
- public void testResolveEnum2() throws Exception {
- this.createEnumAndMembers("TestEnum", "FOO, BAR, BAZ");
- this.createAnnotationAndMembers("TestAnnotation", "TestEnum foo();");
-
- ICompilationUnit cu = this.createTestType("static enums.TestEnum.BAZ", "@annot.TestAnnotation(foo=BAZ)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.TestAnnotation");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "foo");
- JDTFieldAttribute field = this.idField(cu);
-
- String actual = JDTTools.resolveEnum((Name) daea.getExpression(field.getModifiedDeclaration(this.buildASTRoot(cu))));
- assertEquals("enums.TestEnum.BAZ", actual);
- }
-
- public void testResolveEnum3() throws Exception {
- this.createEnumAndMembers("TestEnum", "FOO, BAR, BAZ");
- this.createAnnotationAndMembers("TestAnnotation", "TestEnum foo();");
-
- ICompilationUnit cu = this.createTestType("static enums.TestEnum.*", "@annot.TestAnnotation(foo=BAZ)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.TestAnnotation");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "foo");
- JDTFieldAttribute field = this.idField(cu);
-
- String actual = JDTTools.resolveEnum((Name)daea.getExpression(field.getModifiedDeclaration(this.buildASTRoot(cu))));
- assertEquals("enums.TestEnum.BAZ", actual);
- }
-
- public void testResolveEnum4() throws Exception {
- this.createEnumAndMembers("TestEnum", "FOO, BAR, BAZ");
- this.createAnnotationAndMembers("TestAnnotation", "TestEnum foo();");
-
- ICompilationUnit cu = this.createTestType("enums.TestEnum", "@annot.TestAnnotation(foo=TestEnum.BAZ)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.TestAnnotation");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "foo");
- JDTFieldAttribute field = this.idField(cu);
-
- String actual = JDTTools.resolveEnum((Name) daea.getExpression(field.getModifiedDeclaration(this.buildASTRoot(cu))));
- assertEquals("enums.TestEnum.BAZ", actual);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/JptCoreUtilityJdtTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/JptCoreUtilityJdtTests.java
deleted file mode 100644
index e95256f3e5..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/JptCoreUtilityJdtTests.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.tests.internal.utility.jdt;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptCoreUtilityJdtTests {
-
- public static Test suite() {
- return suite(true);
- }
-
- public static Test suite(boolean all) {
- TestSuite suite = new TestSuite(JptCoreUtilityJdtTests.class.getPackage().getName());
- suite.addTestSuite(CombinationIndexedDeclarationAnnotationAdapterTests.class);
- suite.addTestSuite(DefaultAnnotationEditFormatterTests.class);
- suite.addTestSuite(JDTToolsTests.class);
- suite.addTestSuite(MemberAnnotationElementAdapterTests.class);
- suite.addTestSuite(NestedDeclarationAnnotationAdapterTests.class);
- suite.addTestSuite(NestedIndexedDeclarationAnnotationAdapterTests.class);
- suite.addTestSuite(SimpleDeclarationAnnotationAdapterTests.class);
- suite.addTestSuite(TypeTests.class);
- return suite;
- }
-
- private JptCoreUtilityJdtTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/MemberAnnotationElementAdapterTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/MemberAnnotationElementAdapterTests.java
deleted file mode 100644
index d39bc59c15..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/MemberAnnotationElementAdapterTests.java
+++ /dev/null
@@ -1,1297 +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.tests.internal.utility.jdt;
-
-import java.util.Arrays;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ASTNodeTextRange;
-import org.eclipse.jpt.core.internal.utility.jdt.AnnotationStringArrayExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.BooleanExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.CharacterStringExpressionConverter;
-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.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NestedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NumberIntegerExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.PrimitiveTypeStringExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.StringExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.TypeStringExpressionConverter;
-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.ExpressionConverter;
-
-@SuppressWarnings("nls")
-public class MemberAnnotationElementAdapterTests extends AnnotationTestCase {
-
- public MemberAnnotationElementAdapterTests(String name) {
- super(name);
- }
-
- private void createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception {
- this.javaProject.createCompilationUnit("annot", annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }");
- }
-
- private void createEnum(String enumName, String enumBody) throws Exception {
- this.createEnum("enums", enumName, enumBody);
- }
-
- private void createEnum(String packageName, String enumName, String enumBody) throws Exception {
- this.javaProject.createCompilationUnit(packageName, enumName + ".java", "public enum " + enumName + " { " + enumBody + " }");
- }
-
- public void testValue1() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=\"xxx\")");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("xxx", aea.getValue());
- }
-
- public void testValue2() throws Exception {
- this.createAnnotationAndMembers("Foo", "int bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=48)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<Integer> daea = new ConversionDeclarationAnnotationElementAdapter<Integer>(daa, "bar", NumberIntegerExpressionConverter.instance());
- AnnotationElementAdapter<Integer> aea = new MemberAnnotationElementAdapter<Integer>(this.idField(cu), daea);
- assertEquals(Integer.valueOf(48), aea.getValue());
- }
-
- public void testValue3() throws Exception {
- this.createAnnotationAndMembers("Foo", "char bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar='c')");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", CharacterStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("c", aea.getValue());
- }
-
- public void testValue4() throws Exception {
- this.createAnnotationAndMembers("Foo", "boolean bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=false)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<Boolean> daea = new ConversionDeclarationAnnotationElementAdapter<Boolean>(daa, "bar", BooleanExpressionConverter.instance());
- AnnotationElementAdapter<Boolean> aea = new MemberAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
- assertEquals(Boolean.FALSE, aea.getValue());
- }
-
- public void testValue5() throws Exception {
- this.createAnnotationAndMembers("Baz", "boolean fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(@annot.Bar(jimmy=@annot.Baz(fred=false)))");
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz");
- DeclarationAnnotationElementAdapter<Boolean> daea = new ConversionDeclarationAnnotationElementAdapter<Boolean>(daa3, "fred", BooleanExpressionConverter.instance());
- AnnotationElementAdapter<Boolean> aea = new MemberAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
- assertEquals(Boolean.FALSE, aea.getValue());
- }
-
- public void testValue6() throws Exception {
- this.createAnnotationAndMembers("Foo", "boolean value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(false)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<Boolean> daea = new ConversionDeclarationAnnotationElementAdapter<Boolean>(daa, BooleanExpressionConverter.instance());
- AnnotationElementAdapter<Boolean> aea = new MemberAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
- assertEquals(Boolean.FALSE, aea.getValue());
- }
-
- public void testValueNull1() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testValueNull2() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- ICompilationUnit cu = this.createTestType();
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testValueNull3() throws Exception {
- this.createAnnotationAndMembers("Baz", "String fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(@annot.Bar(jimmy=@annot.Baz))");
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa3, "fred");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testValueStringConcatenation() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=\"xxx\" + \"yyy\" + \"zzz\")");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("xxxyyyzzz", aea.getValue());
- }
-
- public void testValueStringConstant() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- // just a bit hacky:
- ICompilationUnit cu = this.createTestType("private static final String FOO_BAR = \"xxx\"; @annot.Foo(bar=FOO_BAR + \"yyy\" + \"zzz\")");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("xxxyyyzzz", aea.getValue());
- }
-
- public void testValueNumberArithmetic() throws Exception {
- this.createAnnotationAndMembers("Foo", "int bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=47 - 7 + 2 * 1 / 1)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<Integer> daea = ConversionDeclarationAnnotationElementAdapter.forNumbers(daa, "bar");
- AnnotationElementAdapter<Integer> aea = new MemberAnnotationElementAdapter<Integer>(this.idField(cu), daea);
- assertEquals(Integer.valueOf(42), aea.getValue());
- }
-
- public void testValueNumberShift() throws Exception {
- this.createAnnotationAndMembers("Foo", "int bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=2 << 2)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<Integer> daea = ConversionDeclarationAnnotationElementAdapter.forNumbers(daa, "bar");
- AnnotationElementAdapter<Integer> aea = new MemberAnnotationElementAdapter<Integer>(this.idField(cu), daea);
- assertEquals(Integer.valueOf(8), aea.getValue());
- }
-
- public void testValueNumberConstant() throws Exception {
- this.createAnnotationAndMembers("Foo", "int bar();");
- // just a bit hacky:
- ICompilationUnit cu = this.createTestType("private static final int FOO_BAR = 77; @annot.Foo(bar=FOO_BAR)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<Integer> daea = ConversionDeclarationAnnotationElementAdapter.forNumbers(daa, "bar");
- AnnotationElementAdapter<Integer> aea = new MemberAnnotationElementAdapter<Integer>(this.idField(cu), daea);
- assertEquals(Integer.valueOf(77), aea.getValue());
- }
-
- public void testValueCharacterConstant() throws Exception {
- this.createAnnotationAndMembers("Foo", "char bar();");
- // just a bit hacky:
- ICompilationUnit cu = this.createTestType("private static final char FOO_BAR = 'Q'; @annot.Foo(bar=FOO_BAR)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forCharacters(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("Q", aea.getValue());
- }
-
- public void testValueCharacterCast() throws Exception {
- this.createAnnotationAndMembers("Foo", "char bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=(char) 0x41)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forCharacters(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("A", aea.getValue());
- }
-
- public void testValueBooleanOperator1() throws Exception {
- this.createAnnotationAndMembers("Foo", "boolean bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=7 > 2)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<Boolean> daea = ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, "bar");
- AnnotationElementAdapter<Boolean> aea = new MemberAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
- assertEquals(Boolean.TRUE, aea.getValue());
- }
-
- public void testValueBooleanOperator2() throws Exception {
- this.createAnnotationAndMembers("Foo", "boolean bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=7 == 2)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<Boolean> daea = ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, "bar");
- AnnotationElementAdapter<Boolean> aea = new MemberAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
- assertEquals(Boolean.FALSE, aea.getValue());
- }
-
- public void testValueBooleanOperator3() throws Exception {
- this.createAnnotationAndMembers("Foo", "boolean bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=(7 != 2) && false)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<Boolean> daea = ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, "bar");
- AnnotationElementAdapter<Boolean> aea = new MemberAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
- assertEquals(Boolean.FALSE, aea.getValue());
- }
-
- public void testValueBooleanOperator4() throws Exception {
- this.createAnnotationAndMembers("Foo", "boolean bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=(7 != 2) ? false : true)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<Boolean> daea = ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, "bar");
- AnnotationElementAdapter<Boolean> aea = new MemberAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
- assertEquals(Boolean.FALSE, aea.getValue());
- }
-
- public void testValueInvalidValue1() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=77)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testValueInvalidValue2() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=bazzzz)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testValueInvalidValue3() throws Exception {
- this.createAnnotationAndMembers("Foo", "boolean bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=bazzzz)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<Boolean> daea = ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, "bar");
- AnnotationElementAdapter<Boolean> aea = new MemberAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testValueInvalidValue4() throws Exception {
- this.createAnnotationAndMembers("Foo", "char bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=\"bazzzz\")");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forCharacters(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testValueInvalidValue5() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=\"java.lang.Object\")");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", SimpleTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testValueInvalidValue6() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=enums.TestEnum.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testValueInvalidValue7() throws Exception {
- this.createAnnotationAndMembers("Baz", "boolean fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- String value = "\"false\"";
- String element = "fred=" + value;
- String annotation = "@annot.Foo(@annot.Bar(jimmy=@annot.Baz(" + element + ")))";
- ICompilationUnit cu = this.createTestType(annotation);
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz");
- DeclarationAnnotationElementAdapter<Boolean> daea = new ConversionDeclarationAnnotationElementAdapter<Boolean>(daa3, "fred", BooleanExpressionConverter.instance());
- AnnotationElementAdapter<Boolean> aea = new MemberAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testValueInvalidValue8() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar={true, false})");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new ConversionDeclarationAnnotationElementAdapter<String[]>(daa, "bar", AnnotationStringArrayExpressionConverter.forStrings());
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[] {null, null}, aea.getValue()));
- }
-
- public void testValueInvalidValue9() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=77)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new ConversionDeclarationAnnotationElementAdapter<String[]>(daa, "bar", AnnotationStringArrayExpressionConverter.forStrings());
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[] {null}, aea.getValue()));
- }
-
- public void testASTNode1() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- String value = "\"xxx\"";
- String element = "bar=" + value;
- String annotation = "@annot.Foo(" + element + ")";
- ICompilationUnit cu = this.createTestType(annotation);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
-
- TextRange textRange = new ASTNodeTextRange(aea.getAstNode(this.buildASTRoot(cu)));
- assertEquals(this.getSource(cu).indexOf(value), textRange.getOffset());
- assertEquals(value.length(), textRange.getLength());
- assertEquals(8, textRange.getLineNumber());
- }
-
- public void testASTNode2() throws Exception {
- this.createAnnotationAndMembers("Baz", "boolean fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- String value = "false";
- String element = "fred=" + value;
- String annotation = "@annot.Foo(@annot.Bar(jimmy=@annot.Baz(" + element + ")))";
- ICompilationUnit cu = this.createTestType(annotation);
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz");
- DeclarationAnnotationElementAdapter<Boolean> daea = new ConversionDeclarationAnnotationElementAdapter<Boolean>(daa3, "fred", BooleanExpressionConverter.instance());
- AnnotationElementAdapter<Boolean> aea = new MemberAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
- assertEquals(Boolean.FALSE, aea.getValue());
- TextRange textRange = new ASTNodeTextRange(aea.getAstNode(this.buildASTRoot(cu)));
- assertEquals(value.length(), textRange.getLength());
- }
-
- public void testASTNode3() throws Exception {
- this.createAnnotationAndMembers("Foo", "String value();");
- String element = "\"xxx\"";
- String annotation = "@annot.Foo(" + element + ")";
- ICompilationUnit cu = this.createTestType(annotation);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa);
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
-
- TextRange textRange = new ASTNodeTextRange(aea.getAstNode(this.buildASTRoot(cu)));
- assertEquals(this.getSource(cu).indexOf(element), textRange.getOffset());
- assertEquals(element.length(), textRange.getLength());
- }
-
- public void testASTNode4() throws Exception {
- this.createAnnotationAndMembers("Foo", "String value();");
- String annotation = "@annot.Foo";
- ICompilationUnit cu = this.createTestType(annotation);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa);
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
-
- TextRange textRange = new ASTNodeTextRange(aea.getAstNode(this.buildASTRoot(cu)));
- assertEquals(this.getSource(cu).indexOf(annotation), textRange.getOffset());
- assertEquals(annotation.length(), textRange.getLength());
- }
-
- public void testSetValue1() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- String annotation = "@annot.Foo(bar=\"xxx\")";
- ICompilationUnit cu = this.createTestType(annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
-
- aea.setValue(null);
- this.assertSourceDoesNotContain("Foo", cu);
- }
-
- public void testSetValue2() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- String annotation = "@annot.Foo(bar=\"xxx\")";
- ICompilationUnit cu = this.createTestType(annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar", false);
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
-
- aea.setValue(null);
- this.assertSourceDoesNotContain(annotation, cu);
- this.assertSourceContains("@Foo", cu);
- }
-
- public void testSetValue3() throws Exception {
- this.createAnnotationAndMembers("Baz", "boolean fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- String annotation = "@annot.Foo(@annot.Bar(jimmy=@annot.Baz(fred=false)))";
- ICompilationUnit cu = this.createTestType(annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz");
- DeclarationAnnotationElementAdapter<Boolean> daea = new ConversionDeclarationAnnotationElementAdapter<Boolean>(daa3, "fred", BooleanExpressionConverter.instance());
- AnnotationElementAdapter<Boolean> aea = new MemberAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
-
- aea.setValue(null);
- this.assertSourceDoesNotContain(annotation, cu);
- this.assertSourceDoesNotContain("Foo", cu);
- this.assertSourceDoesNotContain("Bar", cu);
- }
-
- public void testSetValue3a() throws Exception {
- this.createAnnotationAndMembers("Baz", "boolean fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- String annotation = "@annot.Foo(@annot.Bar(jimmy=@annot.Baz(fred=false)))";
- ICompilationUnit cu = this.createTestType(annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar", false);
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz", false);
- DeclarationAnnotationElementAdapter<Boolean> daea = new ConversionDeclarationAnnotationElementAdapter<Boolean>(daa3, "fred", BooleanExpressionConverter.instance());
- AnnotationElementAdapter<Boolean> aea = new MemberAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
-
- aea.setValue(null);
- this.assertSourceDoesNotContain(annotation, cu);
- this.assertSourceContains("@annot.Foo(@Bar)", cu);
- }
-
- public void testSetValue4() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- ICompilationUnit cu = this.createTestType();
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
-
- aea.setValue("xxx");
- this.assertSourceContains("@Foo(bar=\"xxx\")", cu);
- }
-
- public void testSetValue5() throws Exception {
- this.createAnnotationAndMembers("Baz", "boolean fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- String annotation = "@annot.Foo(@annot.Bar(jimmy=@annot.Baz(fred=false)))";
- ICompilationUnit cu = this.createTestType(annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz");
- DeclarationAnnotationElementAdapter<Boolean> daea = new ConversionDeclarationAnnotationElementAdapter<Boolean>(daa3, "fred", BooleanExpressionConverter.instance());
- AnnotationElementAdapter<Boolean> aea = new MemberAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
-
- aea.setValue(Boolean.TRUE);
- this.assertSourceDoesNotContain(annotation, cu);
- this.assertSourceContains("@annot.Foo(@annot.Bar(jimmy=@annot.Baz(fred=true)))", cu);
- }
-
- public void testSetValue6() throws Exception {
- this.createAnnotationAndMembers("Baz", "boolean fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- ICompilationUnit cu = this.createTestType();
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz");
- DeclarationAnnotationElementAdapter<Boolean> daea = new ConversionDeclarationAnnotationElementAdapter<Boolean>(daa3, "fred", BooleanExpressionConverter.instance());
- AnnotationElementAdapter<Boolean> aea = new MemberAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
-
- aea.setValue(Boolean.TRUE);
- this.assertSourceContains("@Foo(@Bar(jimmy=@Baz(fred=true)))", cu);
- }
-
- public void testSetValue7() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- String annotation = "@annot.Foo(bar=\"xxx\")";
- ICompilationUnit cu = this.createTestType(annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
-
- aea.setValue("yyy");
- this.assertSourceDoesNotContain(annotation, cu);
- this.assertSourceContains("@annot.Foo(bar=\"yyy\")", cu);
- }
-
- public void testSetValue8() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- String annotation = "@annot.Foo";
- ICompilationUnit cu = this.createTestType(annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
-
- aea.setValue("xxx");
- this.assertSourceContains("@Foo(bar=\"xxx\")", cu);
- }
-
- public void testSetValue9() throws Exception {
- this.createAnnotationAndMembers("Foo", "String value(); String bar();");
- String annotation = "@annot.Foo(\"zzz\")";
- ICompilationUnit cu = this.createTestType(annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
-
- aea.setValue("xxx");
- this.assertSourceDoesNotContain(annotation, cu);
- this.assertSourceContains("@Foo(value=\"zzz\", bar=\"xxx\")", cu);
- }
-
- public void testSetValue10() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar(); String baz();");
- String annotation = "@annot.Foo(bar=\"xxx\")";
- ICompilationUnit cu = this.createTestType(annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "baz");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
-
- aea.setValue("yyy");
- this.assertSourceDoesNotContain(annotation, cu);
- this.assertSourceContains("@annot.Foo(bar=\"xxx\", baz = \"yyy\")", cu);
- }
-
- public void testSetValue11() throws Exception {
- this.createAnnotationAndMembers("Baz", "int fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz[] jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- String annotation = "@annot.Foo(@annot.Bar(jimmy={@annot.Baz(fred=0), @annot.Baz(fred=1), @annot.Baz(fred=2), @annot.Baz(fred=3)}))";
- ICompilationUnit cu = this.createTestType(annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedIndexedDeclarationAnnotationAdapter(daa2, "jimmy", 2, "annot.Baz");
- DeclarationAnnotationElementAdapter<Integer> daea = new ConversionDeclarationAnnotationElementAdapter<Integer>(daa3, "fred", NumberIntegerExpressionConverter.instance());
- AnnotationElementAdapter<Integer> aea = new MemberAnnotationElementAdapter<Integer>(this.idField(cu), daea);
-
- assertEquals(Integer.valueOf(2), aea.getValue());
- aea.setValue(Integer.valueOf(48));
- this.assertSourceContains("@annot.Foo(@annot.Bar(jimmy={@annot.Baz(fred=0), @annot.Baz(fred=1), @annot.Baz(fred=48), @annot.Baz(fred=3)}))", cu);
- }
-
- public void testSetValue12() throws Exception {
- this.createAnnotationAndMembers("Foo", "String value();");
- String annotation = "@annot.Foo";
- ICompilationUnit cu = this.createTestType(annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "value");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
-
- aea.setValue("xxx");
- this.assertSourceContains("@Foo(\"xxx\")", cu);
- }
-
- public void testSetValue13() throws Exception {
- this.createAnnotationAndMembers("Foo", "String value();");
- String annotation = "@annot.Foo(\"zzz\")";
- ICompilationUnit cu = this.createTestType(annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "value");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
-
- aea.setValue("xxx");
- this.assertSourceDoesNotContain(annotation, cu);
- this.assertSourceContains("@annot.Foo(\"xxx\")", cu);
- }
-
- public void testSimpleTypeLiteral1() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=java.lang.Object.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", SimpleTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("java.lang.Object", aea.getValue());
- }
-
- public void testSimpleTypeLiteral2() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType();
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", SimpleTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- aea.setValue("java.lang.Object");
- this.assertSourceContains("@Foo(bar=java.lang.Object.class)", cu);
- }
-
- public void testSimpleTypeLiteral3() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=int.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", SimpleTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testSimpleTypeLiteral4() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=java.util.Map.Entry.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", SimpleTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("java.util.Map.Entry", aea.getValue());
- }
-
- public void testPrimitiveTypeLiteral1() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=int.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", PrimitiveTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("int", aea.getValue());
- }
-
- public void testPrimitiveTypeLiteral2() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType();
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", PrimitiveTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- aea.setValue("int");
- this.assertSourceContains("@Foo(bar=int.class)", cu);
- }
-
- public void testPrimitiveTypeLiteral3() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=java.lang.Object.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", PrimitiveTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testPrimitiveTypeLiteral4() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=void.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", PrimitiveTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("void", aea.getValue());
- }
-
- public void testTypeLiteral1() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=java.lang.Object.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", TypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("java.lang.Object", aea.getValue());
- }
-
- public void testTypeLiteral2() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType();
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", TypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- aea.setValue("java.lang.Object");
- this.assertSourceContains("@Foo(bar=java.lang.Object.class)", cu);
- }
-
- public void testTypeLiteral3() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=java.util.Map.Entry.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", TypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("java.util.Map.Entry", aea.getValue());
- }
-
- public void testTypeLiteral14() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=int.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", TypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("int", aea.getValue());
- }
-
- public void testTypeLiteral5() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType();
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", TypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- aea.setValue("int");
- this.assertSourceContains("@Foo(bar=int.class)", cu);
- }
-
- public void testTypeLiteral6() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=void.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", TypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("void", aea.getValue());
- }
-
- public void testValueEnum1() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=enums.TestEnum.XXX)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("enums.TestEnum.XXX", aea.getValue());
- }
-
- public void testValueEnum2() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();");
- ICompilationUnit cu = this.createTestType("static enums.TestEnum.XXX", "@annot.Foo(bar=XXX)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("enums.TestEnum.XXX", aea.getValue());
- }
-
- public void testValueEnum3() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testValueEnum4() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();");
- ICompilationUnit cu = this.createTestType("enums.TestEnum", "@annot.Foo(bar=TestEnum.XXX)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("enums.TestEnum.XXX", aea.getValue());
- }
-
- public void testSetValueEnum1() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();");
- String annotation = "@annot.Foo(bar=XXX)";
- ICompilationUnit cu = this.createTestType("static enums.TestEnum.XXX", annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- aea.setValue(null);
- this.assertSourceDoesNotContain("Foo", cu);
- }
-
- public void testSetValueEnum2() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();");
- String annotation = "@Foo(bar=XXX)";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea);
- aea.setValue("enums.TestEnum.XXX");
- this.assertSourceContains("import static enums.TestEnum.XXX;", cu);
- this.assertSourceContains(annotation, cu);
- }
-
- public void testSetValueEnumImportCollision1() throws Exception {
- this.createEnum("enums1", "TestEnum", "XXX, YYY, ZZZ");
- this.createEnum("enums2", "TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums1.TestEnum bar1(); enums2.TestEnum bar2();");
- String annotation = "@Foo(bar1=XXX, bar2 = TestEnum.XXX)";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(annotation, cu);
-
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
-
- DeclarationAnnotationElementAdapter<String> daea1 = new EnumDeclarationAnnotationElementAdapter(daa, "bar1");
- AnnotationElementAdapter<String> aea1 = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea1);
- aea1.setValue("enums1.TestEnum.XXX");
-
- DeclarationAnnotationElementAdapter<String> daea2 = new EnumDeclarationAnnotationElementAdapter(daa, "bar2");
- AnnotationElementAdapter<String> aea2 = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea2);
- aea2.setValue("enums2.TestEnum.XXX");
-
- this.assertSourceContains("import static enums1.TestEnum.XXX;", cu);
- this.assertSourceDoesNotContain("import static enums2.TestEnum.XXX;", cu);
- this.assertSourceContains("import enums2.TestEnum;", cu);
- this.assertSourceContains(annotation, cu);
- }
-
- public void testSetValueEnumImportCollision2() throws Exception {
- this.createEnum("enums1", "TestEnum", "XXX, YYY, ZZZ");
- this.createEnum("enums2", "TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums1.TestEnum bar1(); enums2.TestEnum bar2();");
- String annotation = "@annot.Foo(bar1=XXX, bar2 = TestEnum.XXX)";
- ICompilationUnit cu = this.createTestType("static enums1.TestEnum.*", "@annot.Foo(bar1=XXX)");
- this.assertSourceDoesNotContain(annotation, cu);
-
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
-
- DeclarationAnnotationElementAdapter<String> daea1 = new EnumDeclarationAnnotationElementAdapter(daa, "bar1");
- AnnotationElementAdapter<String> aea1 = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea1);
- assertNotNull(aea1.getValue());
-
- DeclarationAnnotationElementAdapter<String> daea2 = new EnumDeclarationAnnotationElementAdapter(daa, "bar2");
- AnnotationElementAdapter<String> aea2 = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea2);
- aea2.setValue("enums2.TestEnum.XXX");
-
- this.assertSourceContains("import static enums1.TestEnum.*;", cu);
- this.assertSourceDoesNotContain("import static enums2.TestEnum.XXX;", cu);
- this.assertSourceContains("import enums2.TestEnum;", cu);
- this.assertSourceContains(annotation, cu);
- }
-
- public void testSetValueEnumImportCollision3() throws Exception {
- this.createEnum("TestEnum1", "XXX, YYY, ZZZ");
- this.createEnum("TestEnum2", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum1 bar1(); enums.TestEnum2 bar2();");
- String annotation = "@Foo(bar1=XXX, bar2 = TestEnum2.XXX)";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(annotation, cu);
-
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
-
- DeclarationAnnotationElementAdapter<String> daea1 = new EnumDeclarationAnnotationElementAdapter(daa, "bar1");
- AnnotationElementAdapter<String> aea1 = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea1);
- aea1.setValue("enums.TestEnum1.XXX");
-
- DeclarationAnnotationElementAdapter<String> daea2 = new EnumDeclarationAnnotationElementAdapter(daa, "bar2");
- AnnotationElementAdapter<String> aea2 = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea2);
- aea2.setValue("enums.TestEnum2.XXX");
-
- this.assertSourceContains("import static enums.TestEnum1.XXX;", cu);
- this.assertSourceContains("import enums.TestEnum2;", cu);
- this.assertSourceContains(annotation, cu);
- }
-
- public void testSetValueEnumImportCollision4() throws Exception {
- this.createEnum("TestEnum1", "XXX, YYY, ZZZ");
- this.createEnum("TestEnum2", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum1 bar1(); enums.TestEnum2 bar2();");
- String annotation = "@annot.Foo(bar1=XXX, bar2 = TestEnum2.XXX)";
- ICompilationUnit cu = this.createTestType("static enums.TestEnum1.*", "@annot.Foo(bar1=XXX)");
- this.assertSourceDoesNotContain(annotation, cu);
-
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
-
- DeclarationAnnotationElementAdapter<String> daea1 = new EnumDeclarationAnnotationElementAdapter(daa, "bar1");
- AnnotationElementAdapter<String> aea1 = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea1);
- assertNotNull(aea1.getValue());
-
- DeclarationAnnotationElementAdapter<String> daea2 = new EnumDeclarationAnnotationElementAdapter(daa, "bar2");
- AnnotationElementAdapter<String> aea2 = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea2);
- aea2.setValue("enums.TestEnum2.XXX");
-
- this.assertSourceContains("import static enums.TestEnum1.*;", cu);
- this.assertSourceContains("import enums.TestEnum2;", cu);
- this.assertSourceContains(annotation, cu);
- }
-
- /**
- * not sure this is exactly what we want...
- * it would be nice if we just skip the static import; but it's a matter of taste...
- */
- public void testSetValueEnumImportCollision5() throws Exception {
- this.createEnum("TestEnum1", "XXX, YYY, ZZZ");
- this.createEnum("TestEnum2", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum1 bar1(); enums.TestEnum2 bar2();");
- String annotation = "@Foo(bar1=XXX, bar2 = TestEnum2.XXX)";
- ICompilationUnit cu = this.createTestType("enums.*", "");
- this.assertSourceDoesNotContain(annotation, cu);
-
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
-
- DeclarationAnnotationElementAdapter<String> daea1 = new EnumDeclarationAnnotationElementAdapter(daa, "bar1");
- AnnotationElementAdapter<String> aea1 = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea1);
- aea1.setValue("enums.TestEnum1.XXX");
-
- DeclarationAnnotationElementAdapter<String> daea2 = new EnumDeclarationAnnotationElementAdapter(daa, "bar2");
- AnnotationElementAdapter<String> aea2 = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea2);
- aea2.setValue("enums.TestEnum2.XXX");
-
- this.assertSourceContains("import enums.*;", cu);
- this.assertSourceContains("import static enums.TestEnum1.XXX;", cu);
- this.assertSourceDoesNotContain("import enums.TestEnum2;", cu);
- this.assertSourceContains(annotation, cu);
- }
-
- public void testSetValueEnumImportCollision6() throws Exception {
- this.createEnum("enums1", "TestEnum", "XXX, YYY, ZZZ");
- this.createEnum("enums2", "TestEnum", "XXX, YYY, ZZZ");
- this.createEnum("enums3", "TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums1.TestEnum bar1(); enums2.TestEnum bar2(); enums3.TestEnum bar3();");
- String annotation = "@Foo(bar1=XXX, bar2 = TestEnum.XXX, bar3 = enums3.TestEnum.XXX)";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(annotation, cu);
-
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
-
- DeclarationAnnotationElementAdapter<String> daea1 = new EnumDeclarationAnnotationElementAdapter(daa, "bar1");
- AnnotationElementAdapter<String> aea1 = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea1);
- aea1.setValue("enums1.TestEnum.XXX");
-
- DeclarationAnnotationElementAdapter<String> daea2 = new EnumDeclarationAnnotationElementAdapter(daa, "bar2");
- AnnotationElementAdapter<String> aea2 = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea2);
- aea2.setValue("enums2.TestEnum.XXX");
-
- DeclarationAnnotationElementAdapter<String> daea3 = new EnumDeclarationAnnotationElementAdapter(daa, "bar3");
- AnnotationElementAdapter<String> aea3 = new MemberAnnotationElementAdapter<String>(this.idField(cu), daea3);
- aea3.setValue("enums3.TestEnum.XXX");
-
- this.assertSourceContains("import static enums1.TestEnum.XXX;", cu);
- this.assertSourceDoesNotContain("import static enums2.TestEnum.XXX;", cu);
- this.assertSourceContains("import enums2.TestEnum;", cu);
- this.assertSourceDoesNotContain("import static enums3", cu);
- this.assertSourceDoesNotContain("import enums3", cu);
- this.assertSourceContains(annotation, cu);
- }
-
- public void testValueStringArray() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar={\"string0\", \"string1\"})");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new ConversionDeclarationAnnotationElementAdapter<String[]>(daa, "bar", AnnotationStringArrayExpressionConverter.forStrings());
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[] {"string0", "string1"}, aea.getValue()));
- }
-
- public void testValueStringArrayConcatenation() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar={\"stri\" + \"ng0\", \"s\" + \"tring1\"})");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new ConversionDeclarationAnnotationElementAdapter<String[]>(daa, "bar", AnnotationStringArrayExpressionConverter.forStrings());
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[] {"string0", "string1"}, aea.getValue()));
- }
-
- public void testValueStringArrayEmpty() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar={})");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new ConversionDeclarationAnnotationElementAdapter<String[]>(daa, "bar", AnnotationStringArrayExpressionConverter.forStrings());
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[0], aea.getValue()));
- }
-
- public void testValueStringArraySingleElement() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=\"string0\")");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new ConversionDeclarationAnnotationElementAdapter<String[]>(daa, "bar", AnnotationStringArrayExpressionConverter.forStrings());
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[] {"string0"}, aea.getValue()));
- }
-
- public void testValueNullStringArray() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo()");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new ConversionDeclarationAnnotationElementAdapter<String[]>(daa, "bar", AnnotationStringArrayExpressionConverter.forStrings());
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[0], aea.getValue()));
- }
-
- public void testSetValueStringArray() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- String annotation = "@Foo(bar={\"string0\",\"string1\"})";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new ConversionDeclarationAnnotationElementAdapter<String[]>(daa, "bar", AnnotationStringArrayExpressionConverter.forStrings());
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- aea.setValue(new String[] {"string0", "string1"});
- this.assertSourceContains(annotation, cu);
- }
-
- public void testSetValueStringArrayEmptyRemove() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- String annotation = "@Foo";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new ConversionDeclarationAnnotationElementAdapter<String[]>(daa, "bar", AnnotationStringArrayExpressionConverter.forStrings());
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- aea.setValue(new String[0]);
- this.assertSourceDoesNotContain(annotation, cu);
- }
-
- public void testSetValueStringArrayEmpty() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- String annotation = "@Foo(bar={})";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- ExpressionConverter<String[]> expressionConverter = new AnnotationStringArrayExpressionConverter(StringExpressionConverter.instance(), false);
- DeclarationAnnotationElementAdapter<String[]> daea = new ConversionDeclarationAnnotationElementAdapter<String[]>(daa, "bar", expressionConverter);
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- aea.setValue(new String[0]);
- this.assertSourceContains(annotation, cu);
- }
-
- public void testSetValueStringArraySingleElement() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- String annotation = "@Foo(bar=\"string0\")";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new ConversionDeclarationAnnotationElementAdapter<String[]>(daa, "bar", AnnotationStringArrayExpressionConverter.forStrings());
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- aea.setValue(new String[] {"string0"});
- this.assertSourceContains(annotation, cu);
- }
-
- public void testValueEnumArray() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar={enums.TestEnum.XXX, enums.TestEnum.YYY})");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[] {"enums.TestEnum.XXX", "enums.TestEnum.YYY"}, aea.getValue()));
- }
-
- public void testValueEnumArrayInvalidEntry() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar={enums.TestEnum.XXX, 88})");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[] {"enums.TestEnum.XXX", null}, aea.getValue()));
- }
-
- public void testValueEnumArrayEmpty() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar={})");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[0], aea.getValue()));
- }
-
- public void testValueEnumArraySingleElement() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=enums.TestEnum.XXX)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[] {"enums.TestEnum.XXX"}, aea.getValue()));
- }
-
- public void testValueEnumArraySingleElementInvalid() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=\"\")");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[] {null}, aea.getValue()));
- }
-
- public void testValueNullEnumArray() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo()");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[0], aea.getValue()));
- }
-
- public void testSetValueEnumArray() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();");
- String annotation = "@Foo(bar={XXX,YYY})";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- aea.setValue(new String[] {"enums.TestEnum.XXX", "enums.TestEnum.YYY"});
- this.assertSourceContains("import static enums.TestEnum.XXX;", cu);
- this.assertSourceContains("import static enums.TestEnum.YYY;", cu);
- this.assertSourceContains(annotation, cu);
- }
-
- public void testSetValueEnumArrayEmptyRemove() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();");
- String annotation = "@Foo";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- aea.setValue(new String[0]);
- this.assertSourceDoesNotContain(annotation, cu);
- }
-
- public void testSetValueEnumArrayEmpty() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();");
- String annotation = "@Foo(bar={})";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar", true, false);
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- aea.setValue(new String[0]);
- this.assertSourceContains(annotation, cu);
- }
-
- public void testSetValueEnumArraySingleElement() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();");
- String annotation = "@Foo(bar=XXX)";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- aea.setValue(new String[] {"enums.TestEnum.XXX"});
- this.assertSourceContains("import static enums.TestEnum.XXX;", cu);
- this.assertSourceContains(annotation, cu);
- }
-
- public void testSetValueEnumArrayImportCollision1() throws Exception {
- this.createEnum("enums1", "TestEnum", "XXX, YYY, ZZZ");
- this.createEnum("enums2", "TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums1.TestEnum[] bar1(); enums2.TestEnum[] bar2();");
- String annotation = "@Foo(bar1={XXX,YYY}, bar2 = { TestEnum.XXX, TestEnum.YYY })";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(annotation, cu);
-
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
-
- DeclarationAnnotationElementAdapter<String[]> daea1 = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar1");
- AnnotationElementAdapter<String[]> aea1 = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea1);
- aea1.setValue(new String[] {"enums1.TestEnum.XXX", "enums1.TestEnum.YYY"});
-
- DeclarationAnnotationElementAdapter<String[]> daea2 = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar2");
- AnnotationElementAdapter<String[]> aea2 = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea2);
- aea2.setValue(new String[] {"enums2.TestEnum.XXX", "enums2.TestEnum.YYY"});
-
- this.assertSourceContains("import static enums1.TestEnum.XXX;", cu);
- this.assertSourceContains("import static enums1.TestEnum.YYY;", cu);
- this.assertSourceDoesNotContain("import static enums2.TestEnum.XXX;", cu);
- this.assertSourceDoesNotContain("import static enums2.TestEnum.YYY;", cu);
- this.assertSourceContains("import enums2.TestEnum;", cu);
- this.assertSourceContains(annotation, cu);
- }
-
- public void testSetValueEnumArrayImportCollision2() throws Exception {
- this.createEnum("enums1", "TestEnum", "XXX, YYY, ZZZ");
- this.createEnum("enums2", "TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums1.TestEnum[] bar1(); enums2.TestEnum[] bar2();");
- String annotation = "@annot.Foo(bar1={XXX,YYY}, bar2 = { TestEnum.XXX, TestEnum.YYY })";
- ICompilationUnit cu = this.createTestType("static enums1.TestEnum.*", "@annot.Foo(bar1={XXX,YYY})");
- this.assertSourceDoesNotContain(annotation, cu);
-
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
-
- DeclarationAnnotationElementAdapter<String[]> daea1 = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar1");
- AnnotationElementAdapter<String[]> aea1 = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea1);
- assertNotNull(aea1.getValue());
-
- DeclarationAnnotationElementAdapter<String[]> daea2 = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar2");
- AnnotationElementAdapter<String[]> aea2 = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea2);
- aea2.setValue(new String[] {"enums2.TestEnum.XXX", "enums2.TestEnum.YYY"});
-
- this.assertSourceContains("import static enums1.TestEnum.*;", cu);
- this.assertSourceDoesNotContain("import static enums2.TestEnum.XXX;", cu);
- this.assertSourceDoesNotContain("import static enums2.TestEnum.YYY;", cu);
- this.assertSourceContains("import enums2.TestEnum;", cu);
- this.assertSourceContains(annotation, cu);
- }
-
- public void testSetValueEnumArrayImportCollision3() throws Exception {
- this.createEnum("TestEnum1", "XXX, YYY, ZZZ");
- this.createEnum("TestEnum2", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum1[] bar1(); enums.TestEnum2[] bar2();");
- String annotation = "@Foo(bar1={XXX,YYY}, bar2 = { TestEnum2.XXX, TestEnum2.YYY })";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(annotation, cu);
-
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
-
- DeclarationAnnotationElementAdapter<String[]> daea1 = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar1");
- AnnotationElementAdapter<String[]> aea1 = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea1);
- aea1.setValue(new String[] {"enums.TestEnum1.XXX", "enums.TestEnum1.YYY"});
-
- DeclarationAnnotationElementAdapter<String[]> daea2 = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar2");
- AnnotationElementAdapter<String[]> aea2 = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea2);
- aea2.setValue(new String[] {"enums.TestEnum2.XXX", "enums.TestEnum2.YYY"});
-
- this.assertSourceContains("import static enums.TestEnum1.XXX;", cu);
- this.assertSourceContains("import static enums.TestEnum1.YYY;", cu);
- this.assertSourceDoesNotContain("import static enums.TestEnum2.XXX;", cu);
- this.assertSourceDoesNotContain("import static enums.TestEnum2.YYY;", cu);
- this.assertSourceContains("import enums.TestEnum2;", cu);
- this.assertSourceContains(annotation, cu);
- }
-
- public void testSetValueEnumArrayImportCollision4() throws Exception {
- this.createEnum("TestEnum1", "XXX, YYY, ZZZ");
- this.createEnum("TestEnum2", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum1[] bar1(); enums.TestEnum2[] bar2();");
- String annotation = "@annot.Foo(bar1={XXX,YYY}, bar2 = { TestEnum2.XXX, TestEnum2.YYY })";
- ICompilationUnit cu = this.createTestType("static enums.TestEnum1.*", "@annot.Foo(bar1={XXX,YYY})");
- this.assertSourceDoesNotContain(annotation, cu);
-
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
-
- DeclarationAnnotationElementAdapter<String[]> daea1 = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar1");
- AnnotationElementAdapter<String[]> aea1 = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea1);
- assertNotNull(aea1.getValue());
-
- DeclarationAnnotationElementAdapter<String[]> daea2 = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar2");
- AnnotationElementAdapter<String[]> aea2 = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea2);
- aea2.setValue(new String[] {"enums.TestEnum2.XXX", "enums.TestEnum2.YYY"});
-
- this.assertSourceContains("import static enums.TestEnum1.*;", cu);
- this.assertSourceDoesNotContain("import static enums.TestEnum2.XXX;", cu);
- this.assertSourceDoesNotContain("import static enums.TestEnum2.YYY;", cu);
- this.assertSourceContains("import enums.TestEnum2;", cu);
- this.assertSourceContains(annotation, cu);
- }
-
- public void testSetValueEnumArrayImportCollision6() throws Exception {
- this.createEnum("enums1", "TestEnum", "XXX, YYY, ZZZ");
- this.createEnum("enums2", "TestEnum", "XXX, YYY, ZZZ");
- this.createEnum("enums3", "TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums1.TestEnum[] bar1(); enums2.TestEnum[] bar2(); enums3.TestEnum[] bar3();");
- String annotation = "@Foo(bar1={XXX,YYY}, bar2 = { TestEnum.XXX, TestEnum.YYY }, bar3 = { enums3.TestEnum.XXX, enums3.TestEnum.YYY })";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(annotation, cu);
-
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
-
- DeclarationAnnotationElementAdapter<String[]> daea1 = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar1");
- AnnotationElementAdapter<String[]> aea1 = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea1);
- aea1.setValue(new String[] {"enums1.TestEnum.XXX", "enums1.TestEnum.YYY"});
-
- DeclarationAnnotationElementAdapter<String[]> daea2 = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar2");
- AnnotationElementAdapter<String[]> aea2 = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea2);
- aea2.setValue(new String[] {"enums2.TestEnum.XXX", "enums2.TestEnum.YYY"});
-
- DeclarationAnnotationElementAdapter<String[]> daea3 = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar3");
- AnnotationElementAdapter<String[]> aea3 = new MemberAnnotationElementAdapter<String[]>(this.idField(cu), daea3);
- aea3.setValue(new String[] {"enums3.TestEnum.XXX", "enums3.TestEnum.YYY"});
-
- this.assertSourceContains("import static enums1.TestEnum.XXX;", cu);
- this.assertSourceContains("import static enums1.TestEnum.YYY;", cu);
- this.assertSourceDoesNotContain("import static enums2", cu);
- this.assertSourceContains("import enums2.TestEnum;", cu);
- this.assertSourceDoesNotContain("import static enums3", cu);
- this.assertSourceDoesNotContain("import enums3", cu);
- this.assertSourceContains(annotation, cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/NestedDeclarationAnnotationAdapterTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/NestedDeclarationAnnotationAdapterTests.java
deleted file mode 100644
index ff46aa3ab0..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/NestedDeclarationAnnotationAdapterTests.java
+++ /dev/null
@@ -1,764 +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.tests.internal.utility.jdt;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jdt.core.dom.StringLiteral;
-import org.eclipse.jpt.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.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;
-
-public class NestedDeclarationAnnotationAdapterTests extends AnnotationTestCase {
-
- public NestedDeclarationAnnotationAdapterTests(String name) {
- super(name);
- }
-
- private void createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception {
- this.javaProject.createCompilationUnit("annot", annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }");
- }
-
- public void testAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotation=@annot.Bar)");
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
- assertEquals("annot.Bar", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isMarkerAnnotation());
- }
-
- public void testAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Baz", "String value();");
- this.createAnnotationAndMembers("Bar", "annot.Baz yana();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotation=@annot.Bar(yana=@annot.Baz))");
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "nestedAnnotation", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "yana", "annot.Baz");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa3);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
- assertEquals("annot.Baz", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isMarkerAnnotation());
- }
-
- public void testAnnotationNull1() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType("@annot.Foo()");
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testAnnotationNull2() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType();
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testAnnotationNull3() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "String nestedAnnotation();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotation=\"annot.Bar\")");
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testAnnotationNull4() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Bar2", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar2 nestedAnnotation();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotation=@annot.Bar2)");
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testRemoveAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- String na = "@annot.Foo(nestedAnnotation=@annot.Bar)";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceDoesNotContain("Foo", cu);
- }
-
- public void testRemoveAnnotation1a() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- String na = "@annot.Foo(nestedAnnotation=@annot.Bar)";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar", false);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains("Foo", cu);
- }
-
- public void testRemoveAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("Foo", cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("Foo", cu);
- }
-
- public void testRemoveAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "String nestedAnnotation();");
- String na = "@annot.Foo(nestedAnnotation=\"annot.Bar\")";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(na, cu);
- }
-
- public void testRemoveAnnotation4() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Bar2", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar2 nestedAnnotation();");
- String na = "@annot.Foo(nestedAnnotation=@annot.Bar2)";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(na, cu);
- }
-
- public void testRemoveAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Baz", "String value();");
- this.createAnnotationAndMembers("Bar", "annot.Baz nestedAnnotation2();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation1();");
- String na = "@annot.Foo(nestedAnnotation1=@annot.Bar(nestedAnnotation2=@annot.Baz))";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daaFoo = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daaBar = new NestedDeclarationAnnotationAdapter(daaFoo, "nestedAnnotation1", "annot.Bar");
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(daaBar, "nestedAnnotation2", "annot.Baz");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceDoesNotContain("Foo", cu);
- this.assertSourceDoesNotContain("Bar", cu);
- this.assertSourceDoesNotContain("Baz", cu);
- }
-
- public void testRemoveAnnotation5a() throws Exception {
- this.createAnnotationAndMembers("Baz", "String value();");
- this.createAnnotationAndMembers("Bar", "annot.Baz nestedAnnotation2();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation1();");
- String na = "@annot.Foo(nestedAnnotation1=@annot.Bar(nestedAnnotation2=@annot.Baz))";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daaFoo = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daaBar = new NestedDeclarationAnnotationAdapter(daaFoo, "nestedAnnotation1", "annot.Bar", false);
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(daaBar, "nestedAnnotation2", "annot.Baz", false);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains("@annot.Foo(nestedAnnotation1=@Bar)", cu);
- }
-
- public void testNewMarkerAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("Foo", cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@Foo(nestedAnnotation=@Bar)", cu);
- }
-
- public void testNewMarkerAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("Foo", cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@Foo(@Bar)", cu);
- }
-
- public void testNewMarkerAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- String expected = "@Foo(nestedAnnotation=@Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation4() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- String expected = "@Foo(@Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation(); String value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected = "@Foo(value=\"something\", nestedAnnotation=@Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation6() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "Object value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected = "@annot.Foo(@Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation7() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", nestedAnnotation = @Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation8() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", value = @Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewSingleMemberAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("Foo", cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation1(declaration);
- }
- });
- this.assertSourceContains("@Foo(nestedAnnotation=@Bar(\"test string literal\"))", cu);
- }
-
- void editNewSingleMemberAnnotation1(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewSingleMemberAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("Foo", cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation2(declaration);
- }
- });
- this.assertSourceContains("@Foo(@Bar(\"test string literal\"))", cu);
- }
-
- void editNewSingleMemberAnnotation2(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewSingleMemberAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- String expected = "@Foo(nestedAnnotation=@Bar(\"test string literal\"))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation3(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation3(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewSingleMemberAnnotation4() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- String expected = "@Foo(@Bar(\"test string literal\"))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation4(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation4(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewSingleMemberAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation(); String value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected = "@Foo(value=\"something\", nestedAnnotation=@Bar(\"test string literal\"))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation5(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation5(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewSingleMemberAnnotation6() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "Object value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected = "@annot.Foo(@Bar(\"test string literal\"))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation6(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation6(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewSingleMemberAnnotation7() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation(); String xxx();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", nestedAnnotation = @Bar(\"test string literal\"))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation7(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation7(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewSingleMemberAnnotation8() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value(); String xxx();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", value = @Bar(\"test string literal\"))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation8(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation8(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewNormalAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "String yyy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("Foo", cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation1(declaration);
- }
- });
- this.assertSourceContains("@Foo(nestedAnnotation=@Bar(yyy=\"test string literal\"))", cu);
- }
-
- void editNewNormalAnnotation1(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "yyy", "test string literal");
- }
-
- public void testNewNormalAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "String yyy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("Foo", cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation2(declaration);
- }
- });
- this.assertSourceContains("@Foo(@Bar(yyy=\"test string literal\"))", cu);
- }
-
- void editNewNormalAnnotation2(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "yyy", "test string literal");
- }
-
- public void testNewNormalAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "String yyy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- String expected = "@Foo(nestedAnnotation=@Bar(yyy=\"test string literal\"))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation3(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation3(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "yyy", "test string literal");
- }
-
- public void testNewNormalAnnotation4() throws Exception {
- this.createAnnotationAndMembers("Bar", "String yyy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- String expected = "@Foo(@Bar(yyy=\"test string literal\"))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation4(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation4(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "yyy", "test string literal");
- }
-
- public void testNewNormalAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Bar", "String yyy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation(); String value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected = "@Foo(value=\"something\", nestedAnnotation=@Bar(yyy=\"test string literal\"))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation5(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation5(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "yyy", "test string literal");
- }
-
- public void testNewNormalAnnotation6() throws Exception {
- this.createAnnotationAndMembers("Bar", "String yyy();");
- this.createAnnotationAndMembers("Foo", "Object value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected = "@annot.Foo(@Bar(yyy=\"test string literal\"))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation6(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation6(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "yyy", "test string literal");
- }
-
- public void testNewNormalAnnotation7() throws Exception {
- this.createAnnotationAndMembers("Bar", "String yyy();");
- this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", nestedAnnotation = @Bar(yyy = \"test string literal\"))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation7(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation7(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "yyy", "test string literal");
- }
-
- public void testNewNormalAnnotation8() throws Exception {
- this.createAnnotationAndMembers("Bar", "String yyy();");
- this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", value = @Bar(yyy = \"test string literal\"))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation8(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation8(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "yyy", "test string literal");
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/NestedIndexedDeclarationAnnotationAdapterTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/NestedIndexedDeclarationAnnotationAdapterTests.java
deleted file mode 100644
index 697a2d2fc5..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/NestedIndexedDeclarationAnnotationAdapterTests.java
+++ /dev/null
@@ -1,2220 +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.tests.internal.utility.jdt;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.NumberLiteral;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jpt.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.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;
-import org.eclipse.jpt.core.utility.jdt.ModifiedDeclaration;
-
-@SuppressWarnings("nls")
-public class NestedIndexedDeclarationAnnotationAdapterTests extends AnnotationTestCase {
-
- public NestedIndexedDeclarationAnnotationAdapterTests(String name) {
- super(name);
- }
-
- private void createAnnotation(String annotationName) throws Exception {
- this.createAnnotationAndMembers(annotationName, "");
- }
-
- private void createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception {
- this.javaProject.createCompilationUnit("annot", annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }");
- }
-
- public void testAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations={@annot.Bar, @annot.Bar(\"two\")})");
- // 0
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- Annotation annotation = aa.getAnnotation(astRoot);
- assertNotNull(annotation);
- assertEquals("annot.Bar", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isMarkerAnnotation());
-
- // 1
- daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 1, "annot.Bar");
- aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- annotation = aa.getAnnotation(astRoot);
- assertNotNull(annotation);
- assertEquals("annot.Bar", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isSingleMemberAnnotation());
- }
-
- public void testAnnotation2() throws Exception {
- this.createAnnotation("Baz");
- this.createAnnotationAndMembers("Bar", "annot.Baz[] yana();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(yana=@annot.Baz))");
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 0, "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedIndexedDeclarationAnnotationAdapter(daa2, "yana", 0, "annot.Baz");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa3);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
- assertEquals("annot.Baz", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isMarkerAnnotation());
- }
-
- public void testAnnotation3() throws Exception {
- this.createAnnotation("Baz");
- this.createAnnotationAndMembers("Bar", "annot.Baz[] yana();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(yana={@annot.Baz}))");
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 0, "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedIndexedDeclarationAnnotationAdapter(daa2, "yana", 0, "annot.Baz");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa3);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- Annotation annotation = aa.getAnnotation(astRoot);
- assertNotNull(annotation);
- assertEquals("annot.Baz", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isMarkerAnnotation());
-
- // name mismatch
- daa3 = new NestedIndexedDeclarationAnnotationAdapter(daa2, "yana", 0, "annot.Xyz");
- aa = new MemberAnnotationAdapter(this.idField(cu), daa3);
- annotation = aa.getAnnotation(astRoot);
- assertNull(annotation);
- }
-
- public void testAnnotationNull1() throws Exception {
- this.createAnnotation("Bar");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo()");
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testAnnotationNull2() throws Exception {
- this.createAnnotation("Bar");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType();
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testAnnotationNull3() throws Exception {
- this.createAnnotation("Bar");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=\"annot.Bar\")");
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testAnnotationNull4() throws Exception {
- this.createAnnotation("NotBar");
- this.createAnnotation("Bar");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)");
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testAnnotationNull5() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations={@annot.Bar, @annot.Bar(\"two\")})");
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 2, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testAnnotationNull6() throws Exception {
- this.createAnnotation("Xyz");
- this.createAnnotation("Baz");
- this.createAnnotationAndMembers("Bar", "annot.Baz[] yana();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(yana={@annot.Baz}))");
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("Foo");
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 0, "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedIndexedDeclarationAnnotationAdapter(daa2, "yana", 0, "annot.Xyz");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa3);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testRemoveAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={@annot.Bar(0), @annot.Bar(1)})";
- String expected = "@annot.Foo(nestedAnnotations={null, @annot.Bar(1)})";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceDoesNotContain(expected, cu);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("Foo", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("Foo", cu);
- }
-
- public void testRemoveAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={\"annot.Bar1\", \"annot.Bar2\", \"annot.Bar3\"})";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(na, cu);
- }
-
- public void testRemoveAnnotation4() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int value();");
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.NotBar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={@annot.NotBar(0), @annot.NotBar(1)})";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(na, cu);
- }
-
- public void testRemoveAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations=@annot.Bar)";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- assertNull(aa.getAnnotation(this.buildASTRoot(cu)));
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceDoesNotContain("Foo", cu);
- }
-
- public void testRemoveAnnotation5a() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations=@annot.Bar)";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(cu), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 0, "annot.Bar", false);
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation = aa2.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertTrue(aa1.getAnnotation(this.buildASTRoot(cu)).isMarkerAnnotation());
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains("import annot.Foo;", cu);
- this.assertSourceContains("@Foo", cu);
- }
-
- public void testRemoveAnnotation6() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations=\"annot.Bar\")";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(na, cu);
- }
-
- public void testRemoveAnnotation7() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int value();");
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.NotBar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations=@annot.NotBar)";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(na, cu);
- }
-
- public void testRemoveAnnotation8() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={@annot.Bar(0), @annot.Bar(1), @annot.Bar(2), @annot.Bar(3)})";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(cu), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 2, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(cu), daa2);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- Annotation annotation = aa2.getAnnotation(astRoot);
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertTrue(aa1.getAnnotation(astRoot).isNormalAnnotation());
- assertEquals(ASTNode.ARRAY_INITIALIZER, this.annotationElementValue(aa1.getAnnotation(astRoot), "nestedAnnotations").getNodeType());
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains("@annot.Foo(nestedAnnotations={@annot.Bar(0), @annot.Bar(1), null, @annot.Bar(3)})", cu);
- }
-
- public void testRemoveAnnotation9() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String na = "@annot.Foo({@annot.Bar(0), @annot.Bar(1), @annot.Bar(2), @annot.Bar(3)})";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(cu), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 2, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(cu), daa2);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- Annotation annotation = aa2.getAnnotation(astRoot);
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertTrue(aa1.getAnnotation(astRoot).isSingleMemberAnnotation());
- assertEquals(ASTNode.ARRAY_INITIALIZER, this.annotationElementValue(aa1.getAnnotation(astRoot), "value").getNodeType());
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains("@annot.Foo({@annot.Bar(0), @annot.Bar(1), null, @annot.Bar(3)})", cu);
- }
-
- public void testRemoveAnnotation10() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String na = "@annot.Foo({@annot.Bar(0), @annot.Bar(1)})";
- String expected = "@annot.Foo({null, @annot.Bar(1)})";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceDoesNotContain(expected, cu);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 0, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation = aa2.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation11() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String na = "@annot.Foo({@annot.Bar(0), @annot.Bar(1)})";
- String expected = "@annot.Foo(@annot.Bar(0))";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceDoesNotContain(expected, cu);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(cu), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 1, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation = aa2.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.SINGLE_MEMBER_ANNOTATION, this.annotationElementValue(aa1.getAnnotation(this.buildASTRoot(cu)), "value").getNodeType());
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation12() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String na = "@annot.Foo({@annot.Bar(0), null, @annot.Bar(2)})";
- String expected = "@annot.Foo(@annot.Bar(0))";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceDoesNotContain(expected, cu);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(cu), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 2, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation = aa2.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.SINGLE_MEMBER_ANNOTATION, this.annotationElementValue(aa1.getAnnotation(this.buildASTRoot(cu)), "value").getNodeType());
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation13() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String na = "@annot.Foo({null, @annot.Bar(1)})";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 1, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation = aa2.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- this.assertSourceDoesNotContain("Foo", cu);
- }
-
- public void testRemoveAnnotation14() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String na = "@annot.Foo({@annot.Bar(0), null, @annot.Bar(2), null})";
- String expected = "@annot.Foo(@annot.Bar(0))";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceDoesNotContain(expected, cu);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(cu), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 2, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation = aa2.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.SINGLE_MEMBER_ANNOTATION, this.annotationElementValue(aa1.getAnnotation(this.buildASTRoot(cu)), "value").getNodeType());
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation15() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String na = "@annot.Foo({@annot.Bar(0), null, @annot.Bar(2), @annot.Bar(3)})";
- String expected = "@annot.Foo({@annot.Bar(0), null, null, @annot.Bar(3)})";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceDoesNotContain(expected, cu);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(cu), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 2, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(cu), daa2);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- Annotation annotation = aa2.getAnnotation(astRoot);
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.ARRAY_INITIALIZER, this.annotationElementValue(aa1.getAnnotation(astRoot), "value").getNodeType());
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation16() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String na = "@annot.Foo({@annot.Bar(0), null, @annot.Bar(2), @annot.Bar(3)})";
- String expected = "@annot.Foo({@annot.Bar(0), null, @annot.Bar(2)})";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceDoesNotContain(expected, cu);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(cu), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 3, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(cu), daa2);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- Annotation annotation = aa2.getAnnotation(astRoot);
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.ARRAY_INITIALIZER, this.annotationElementValue(aa1.getAnnotation(astRoot), "value").getNodeType());
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation17() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={@annot.Bar(0), null, @annot.Bar(2)})";
- String expected = "@annot.Foo(nestedAnnotations=@annot.Bar(0))";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceDoesNotContain(expected, cu);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(cu), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 2, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation = aa2.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.SINGLE_MEMBER_ANNOTATION, this.annotationElementValue(aa1.getAnnotation(this.buildASTRoot(cu)), "nestedAnnotations").getNodeType());
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation18() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={null, @annot.Bar(1)})";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 1, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation = aa2.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- this.assertSourceDoesNotContain("Foo", cu);
- }
-
- public void testRemoveAnnotation19() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={@annot.Bar(0), null, @annot.Bar(2), null})";
- String expected = "@annot.Foo(nestedAnnotations=@annot.Bar(0))";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceDoesNotContain(expected, cu);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(cu), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 2, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation = aa2.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.SINGLE_MEMBER_ANNOTATION, this.annotationElementValue(aa1.getAnnotation(this.buildASTRoot(cu)), "nestedAnnotations").getNodeType());
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation20() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={@annot.Bar(0), null, @annot.Bar(2), @annot.Bar(3)})";
- String expected = "@annot.Foo(nestedAnnotations={@annot.Bar(0), null, null, @annot.Bar(3)})";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceDoesNotContain(expected, cu);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(cu), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 2, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(cu), daa2);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- Annotation annotation = aa2.getAnnotation(astRoot);
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.ARRAY_INITIALIZER, this.annotationElementValue(aa1.getAnnotation(astRoot), "nestedAnnotations").getNodeType());
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation21() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={@annot.Bar(0), null, @annot.Bar(2), @annot.Bar(3)})";
- String expected = "@annot.Foo(nestedAnnotations={@annot.Bar(0), null, @annot.Bar(2)})";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceDoesNotContain(expected, cu);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(cu), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 3, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(cu), daa2);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- Annotation annotation = aa2.getAnnotation(astRoot);
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.ARRAY_INITIALIZER, this.annotationElementValue(aa1.getAnnotation(astRoot), "nestedAnnotations").getNodeType());
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("Foo", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@Foo(nestedAnnotations=@Bar)", cu);
- }
-
- public void testNewMarkerAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("Foo", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@Foo(@Bar)", cu);
- }
-
- public void testNewMarkerAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- String expected = "@Foo(nestedAnnotations=@Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation4() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- String expected = "@Foo(@Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String value(); annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected = "@Foo(value=\"something\", nestedAnnotations=@Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation6() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected = "@annot.Foo(@Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation7() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", nestedAnnotations = @Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation8() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", value = @Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation9() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType();
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- assertNull(aa.getAnnotation(this.buildASTRoot(cu)));
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@Foo(nestedAnnotations={null,null,null,null,null,@Bar})", cu);
- }
-
- public void testNewMarkerAnnotation10() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String value(); annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- this.assertSourceDoesNotContain("Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@Foo(value=\"something\", nestedAnnotations={null,null,null,null,null,@Bar})", cu);
- }
-
- public void testNewMarkerAnnotation11() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({\"one\", \"two\"})");
- String expected = "@annot.Foo({@Bar, \"two\"})";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation12() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({\"one\", \"two\"})");
- this.assertSourceDoesNotContain("Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("Bar})", cu); // split line
- }
-
- public void testNewMarkerAnnotation13() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(7)");
- String expected = "@annot.Foo(@Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation14() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(7)");
- this.assertSourceDoesNotContain("Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@annot.Foo({7,null,null,null,null,@Bar})", cu);
- }
-
- public void testNewMarkerAnnotation15() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int value();");
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(@annot.NotBar)");
- String expected = "@annot.Foo(@Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation16() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(@annot.Bar(55))");
- String expected = "@annot.Foo({@annot.Bar(55),@Bar})";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 1, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation17() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations={\"something\"})");
- String expected = "@annot.Foo(nestedAnnotations={@Bar})";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation18() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations={\"something\"})");
- this.assertSourceDoesNotContain("Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("Bar})", cu); // split line
- }
-
- public void testNewMarkerAnnotation19() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=\"something\")");
- String expected = "@annot.Foo(nestedAnnotations=@Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation20() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int value();");
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)");
- String expected = "@annot.Foo(nestedAnnotations=@Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation21() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int value();");
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)");
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@annot.Foo(nestedAnnotations={@annot.NotBar,null,null,null,null,@Bar})", cu);
- }
-
- public void testNewMarkerAnnotation22() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(88))");
- String expected = "@annot.Foo(nestedAnnotations=@Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation23() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(88))");
- String expected = "@annot.Foo(nestedAnnotations={@annot.Bar(88),null,@Bar})";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 2, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation24() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(@annot.Bar(88))");
- String expected = "@annot.Foo({@annot.Bar(88),null,@Bar})";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 2, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation25() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations={@annot.Bar(88), @annot.Bar(77)})");
- String expected1 = "@annot.Foo(nestedAnnotations={@annot.Bar(88), @annot.Bar(77), null, null,"; // the line gets split
- String expected2 = "@Bar})";
- this.assertSourceDoesNotContain(expected1, cu);
- this.assertSourceDoesNotContain(expected2, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 4, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected1, cu);
- this.assertSourceContains(expected2, cu);
- }
-
- public void testNewMarkerAnnotation26() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({@annot.Bar(88), @annot.Bar(77)})");
- String expected1 = "@annot.Foo({@annot.Bar(88), @annot.Bar(77), null, null,"; // the line gets split
- String expected2 = "@Bar})";
- this.assertSourceDoesNotContain(expected1, cu);
- this.assertSourceDoesNotContain(expected2, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 4, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected1, cu);
- this.assertSourceContains(expected2, cu);
- }
-
- public void testNewSingleMemberAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("@Foo", cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation1(declaration);
- }
- });
- this.assertSourceContains("@Foo(nestedAnnotations=@Bar(88))", cu);
- }
-
- void editNewSingleMemberAnnotation1(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("@Foo", cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation2(declaration);
- }
- });
- this.assertSourceContains("@Foo(@Bar(88))", cu);
- }
-
- void editNewSingleMemberAnnotation2(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- String expected = "@Foo(nestedAnnotations=@Bar(88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation3(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation3(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation4() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- String expected = "@Foo(@Bar(88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation4(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation4(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String value(); annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected = "@Foo(value=\"something\", nestedAnnotations=@Bar(88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation5(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation5(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation6() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected = "@annot.Foo(@Bar(88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation6(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation6(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation7() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", nestedAnnotations = @Bar(88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation7(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation7(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation8() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", value = @Bar(88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation8(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation8(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation9() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newSingleMemberAnnotation();
- this.assertSourceContains("@Foo(nestedAnnotations={null,null,null,null,null,@Bar(MISSING)})", cu); // ???
- }
-
- public void testNewSingleMemberAnnotation10() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String value(); annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newSingleMemberAnnotation();
- this.assertSourceContains("@Foo(value=\"something\", nestedAnnotations={null,null,null,null,null,@Bar(MISSING)})", cu); // ???
- }
-
- public void testNewSingleMemberAnnotation11() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({\"one\", \"two\"})");
- String expected = "@annot.Foo({@Bar(88), \"two\"})";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation11(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation11(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation12() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({\"one\", \"two\"})");
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newSingleMemberAnnotation();
- this.assertSourceContains("@Bar(MISSING)})", cu); // split line
- }
-
- public void testNewSingleMemberAnnotation13() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(7)");
- String expected = "@annot.Foo(@Bar(88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation13(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation13(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation14() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(7)");
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newSingleMemberAnnotation();
- this.assertSourceContains("@annot.Foo({7,null,null,null,null,@Bar(MISSING)})", cu);
- }
-
- public void testNewSingleMemberAnnotation15() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int value();");
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(@annot.NotBar)");
- String expected = "@annot.Foo(@Bar(88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation15(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation15(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation16() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(@annot.Bar(55))");
- String expected = "@annot.Foo({@annot.Bar(55),@Bar(88)})";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation16(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation16(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 1, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation17() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations={\"something\"})");
- String expected = "@annot.Foo(nestedAnnotations={@Bar(88)})";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation17(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation17(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation18() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations={\"something\"})");
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newSingleMemberAnnotation();
- this.assertSourceContains("@Bar(MISSING)})", cu); // ???
- }
-
- public void testNewSingleMemberAnnotation19() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=\"something\")");
- String expected = "@annot.Foo(nestedAnnotations=@Bar(88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation19(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation19(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation20() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int value();");
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)");
- String expected = "@annot.Foo(nestedAnnotations=@Bar(88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation20(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation20(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation21() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int value();");
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)");
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newSingleMemberAnnotation();
- this.assertSourceContains("@annot.Foo(nestedAnnotations={@annot.NotBar,null,null,null,null,@Bar(MISSING)})", cu);
- }
-
- public void testNewSingleMemberAnnotation22() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(77))");
- String expected = "@annot.Foo(nestedAnnotations=@Bar(88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation22(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation22(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- SingleMemberAnnotation annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewNormalAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("@Foo", cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation1(declaration);
- }
- });
- this.assertSourceContains("@Foo(nestedAnnotations=@Bar(xxx=88))", cu);
- }
-
- void editNewNormalAnnotation1(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("@Foo", cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation2(declaration);
- }
- });
- this.assertSourceContains("@Foo(@Bar(xxx=88))", cu);
- }
-
- void editNewNormalAnnotation2(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- String expected = "@Foo(nestedAnnotations=@Bar(xxx=88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation3(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation3(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation4() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- String expected = "@Foo(@Bar(xxx=88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation4(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation4(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations(); String value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected = "@Foo(value=\"something\", nestedAnnotations=@Bar(xxx=88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation5(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation5(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation6() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected = "@annot.Foo(@Bar(xxx=88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation6(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation6(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation7() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations(); String xxx();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", nestedAnnotations = @Bar(xxx = 88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation7(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation7(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation8() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value(); String xxx();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", value = @Bar(xxx = 88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation8(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation8(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation9() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations(); String xxx();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newNormalAnnotation();
- this.assertSourceContains("@Foo(nestedAnnotations={null,null,null,null,null,@Bar()})", cu);
- }
-
- public void testNewNormalAnnotation10() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations(); String value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newNormalAnnotation();
- this.assertSourceContains("@Foo(value=\"something\", nestedAnnotations={null,null,null,null,null,@Bar()})", cu);
- }
-
- public void testNewNormalAnnotation11() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({\"one\", \"two\"})");
- String expected = "@annot.Foo({@Bar(xxx=88), \"two\"})";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation11(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation11(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation12() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({\"one\", \"two\"})");
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newNormalAnnotation();
- this.assertSourceContains("@Bar()})", cu); // split line
- }
-
- public void testNewNormalAnnotation13() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(7)");
- String expected = "@annot.Foo(@Bar(xxx=88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation13(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation13(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation14() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(7)");
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newNormalAnnotation();
- this.assertSourceContains("@annot.Foo({7,null,null,null,null,@Bar()})", cu);
- }
-
- public void testNewNormalAnnotation15() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int xxx();");
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(@annot.NotBar)");
- String expected = "@annot.Foo(@Bar(xxx=88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation15(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation15(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation16() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(@annot.Bar(55))");
- String expected = "@annot.Foo({@annot.Bar(55),@Bar(xxx=88)})";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation16(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation16(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 1, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation17() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations={\"something\"})");
- String expected = "@annot.Foo(nestedAnnotations={@Bar(xxx=88)})";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation17(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation17(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation18() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations={\"something\"})");
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newNormalAnnotation();
- this.assertSourceContains("@Bar()})", cu); // split line
- }
-
- public void testNewNormalAnnotation19() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=\"something\")");
- String expected = "@annot.Foo(nestedAnnotations=@Bar(xxx=88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation19(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation19(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation20() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int xxx();");
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)");
- String expected = "@annot.Foo(nestedAnnotations=@Bar(xxx=88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation20(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation20(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation21() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int xxx();");
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)");
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newNormalAnnotation();
- this.assertSourceContains("@annot.Foo(nestedAnnotations={@annot.NotBar,null,null,null,null,@Bar()})", cu);
- }
-
- public void testNewNormalAnnotation22() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(77))");
- String expected = "@annot.Foo(nestedAnnotations=@Bar(xxx=88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation22(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation22(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- NormalAnnotation annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testMoveAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(@annot.Bar(00))");
- String expected = "@annot.Foo({null,@annot.Bar(00)})";
- this.assertSourceDoesNotContain(expected, cu);
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(1);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({null, @annot.Bar(11)})");
- String expected = "@annot.Foo(@annot.Bar(11))";
- this.assertSourceDoesNotContain(expected, cu);
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 1, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), @annot.Bar(22), @annot.Bar(33)})");
- String expected = "@annot.Foo({@annot.Bar(33), @annot.Bar(11), @annot.Bar(22)})";
- this.assertSourceDoesNotContain(expected, cu);
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 3, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation4() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), @annot.Bar(22), @annot.Bar(33), @annot.Bar(44)})");
- String expected = "@annot.Foo({@annot.Bar(33), @annot.Bar(11), @annot.Bar(22), null, @annot.Bar(44)})";
- this.assertSourceDoesNotContain(expected, cu);
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 3, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), @annot.Bar(22)})");
- String expected = "@annot.Foo({@annot.Bar(00), @annot.Bar(11), null, @annot.Bar(22)})";
- this.assertSourceDoesNotContain(expected, cu);
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 2, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(3);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation6() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), @annot.Bar(22)})");
- String expected = "@annot.Foo({null, @annot.Bar(11), @annot.Bar(22), @annot.Bar(00)})";
- this.assertSourceDoesNotContain(expected, cu);
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(3);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation7() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), @annot.Bar(22)})");
- String expected = "@annot.Foo({null, @annot.Bar(11), @annot.Bar(22)})";
- this.assertSourceDoesNotContain(expected, cu);
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 3, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation8() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), @annot.Bar(22), null, @annot.Bar(44)})");
- String expected = "@annot.Foo({null, @annot.Bar(11), @annot.Bar(22), null, @annot.Bar(44)})";
- this.assertSourceDoesNotContain(expected, cu);
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 3, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation9() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String expected = "@annot.Foo({null, @annot.Bar(11), @annot.Bar(22)})";
- ICompilationUnit cu = this.createTestType(expected); // the source should be unchanged
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- iaa.moveAnnotation(3);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation10() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11)})");
- String expected = "@annot.Foo(@annot.Bar(00))";
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 2, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- iaa.moveAnnotation(1);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation11() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(@annot.Bar(00))");
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 1, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceDoesNotContain("Foo", cu);
- }
-
- public void testMoveAnnotation12() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({@annot.Bar(00), null, @annot.Bar(22)})");
- String expected = "@annot.Foo(@annot.Bar(22))";
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 2, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation13() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), null, @annot.Bar(33)})");
- String expected = "@annot.Foo({@annot.Bar(33), @annot.Bar(11)})";
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 3, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/SimpleDeclarationAnnotationAdapterTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/SimpleDeclarationAnnotationAdapterTests.java
deleted file mode 100644
index 0082dbfc95..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/SimpleDeclarationAnnotationAdapterTests.java
+++ /dev/null
@@ -1,274 +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.tests.internal.utility.jdt;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.NumberLiteral;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jdt.core.dom.StringLiteral;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-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;
-
-@SuppressWarnings("nls")
-public class SimpleDeclarationAnnotationAdapterTests extends AnnotationTestCase {
-
- public SimpleDeclarationAnnotationAdapterTests(String name) {
- super(name);
- }
-
- private void createAnnotation(String annotationName) throws Exception {
- this.createAnnotation("annot", annotationName);
- }
-
- private void createAnnotation(String packageName, String annotationName) throws Exception {
- this.javaProject.createCompilationUnit(packageName, annotationName + ".java", "public @interface " + annotationName + " {}");
- }
-
- public void testAnnotation1() throws Exception {
- this.createAnnotation("Foo");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
- assertEquals("annot.Foo", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isMarkerAnnotation());
- }
-
- public void testAnnotation2() throws Exception {
- this.createAnnotation("Foo");
- ICompilationUnit cu = this.createTestType("@annot.Foo(1) @annot.Foo(2)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
- assertEquals("annot.Foo", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isSingleMemberAnnotation());
- Expression value = ((SingleMemberAnnotation) annotation).getValue();
- assertEquals(ASTNode.NUMBER_LITERAL, value.getNodeType());
- assertEquals("1", ((NumberLiteral) value).getToken());
- }
-
- public void testAnnotation3() throws Exception {
- this.createAnnotation("Foo");
- ICompilationUnit cu = this.createTestType("annot.Foo", "@Foo");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
- assertEquals("Foo", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isMarkerAnnotation());
- }
-
- public void testAnnotationNull1() throws Exception {
- this.createAnnotation("Foo");
- ICompilationUnit cu = this.createTestType();
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testAnnotationNull2() throws Exception {
- this.createAnnotation("Foo");
- this.createAnnotation("Fop");
- ICompilationUnit cu = this.createTestType("@annot.Fop");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- this.assertSourceContains("@annot.Fop", cu);
- }
-
- public void testAnnotationNull3() throws Exception {
- this.createAnnotation("Foo");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- // un-qualified name
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("Foo");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- this.assertSourceContains("@annot.Foo", cu);
- }
-
- public void testRemoveAnnotation1() throws Exception {
- this.createAnnotation("Foo");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- this.assertSourceContains("@annot.Foo", cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("@annot.Foo", cu);
- }
-
- public void testRemoveAnnotation2() throws Exception {
- this.createAnnotation("Foo");
- ICompilationUnit cu = this.createTestType("@annot.Foo(1) @annot.Foo(2)");
- this.assertSourceContains("@annot.Foo(1) @annot.Foo(2)", cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("@annot.Foo(1)", cu);
- this.assertSourceContains("@annot.Foo(2)", cu);
- }
-
- public void testNewMarkerAnnotation1() throws Exception {
- this.createAnnotation("Foo");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("import annot.Foo;", cu);
- this.assertSourceDoesNotContain("@Foo", cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("import annot.Foo;", cu);
- this.assertSourceContains("@Foo", cu);
- }
-
- public void testNewMarkerAnnotation2() throws Exception {
- this.createAnnotation("Foo");
- ICompilationUnit cu = this.createTestType("@annot.Foo(88)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("import annot.Foo;", cu);
- this.assertSourceContains("@Foo", cu);
- this.assertSourceDoesNotContain("@annot.Foo(88)", cu);
- }
-
- public void testNewSingleMemberAnnotation() throws Exception {
- this.createAnnotation("Foo");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("@Foo", cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- SimpleDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation(declaration);
- }
- });
- this.assertSourceContains("import annot.Foo;", cu);
- this.assertSourceContains("@Foo(\"test string literal\")", cu);
- }
-
- void editNewSingleMemberAnnotation(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewNormalAnnotation() throws Exception {
- this.createAnnotation("Foo");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("@Foo", cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- SimpleDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation(declaration);
- }
- });
- this.assertSourceContains("import annot.Foo;", cu);
- this.assertSourceContains("@Foo(bar=\"test string literal\")", cu);
- }
-
- void editNewNormalAnnotation(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- MemberValuePair mvp = this.newMemberValuePair(annotation.getAST(), "bar", "test string literal");
- this.values(annotation).add(mvp);
- }
-
- public void testImportCollision1() throws Exception {
- this.createAnnotation("annot1", "Foo");
- this.createAnnotation("annot2", "Foo");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("@Foo", cu);
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot1.Foo");
- DeclarationAnnotationAdapter daa2 = new SimpleDeclarationAnnotationAdapter("annot2.Foo");
-
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(cu), daa1);
- Annotation annotation1 = aa1.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation1);
-
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation2 = aa2.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation2);
-
- aa1.newMarkerAnnotation();
- this.assertSourceContains("import annot1.Foo;", cu);
- this.assertSourceContains("@Foo", cu);
-
- aa2.newMarkerAnnotation();
- this.assertSourceDoesNotContain("import annot2.Foo;", cu);
- this.assertSourceContains("@annot2.Foo", cu);
- }
-
- public void testImportCollision2() throws Exception {
- this.createAnnotation("annot1", "Foo");
- this.createAnnotation("annot2", "Foo");
- ICompilationUnit cu = this.createTestType("annot1.*", "@Foo");
- this.assertSourceContains("import annot1.*;", cu);
- this.assertSourceContains("@Foo", cu);
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot1.Foo");
- DeclarationAnnotationAdapter daa2 = new SimpleDeclarationAnnotationAdapter("annot2.Foo");
-
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(cu), daa1);
- Annotation annotation1 = aa1.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation1);
-
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation2 = aa2.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation2);
-
- aa2.newMarkerAnnotation();
- this.assertSourceDoesNotContain("import annot2.Foo;", cu);
- this.assertSourceContains("@annot2.Foo", cu);
- }
-
- public void testImportWildCard() throws Exception {
- this.createAnnotation("Foo");
- ICompilationUnit cu = this.createTestType("annot.*", "");
- this.assertSourceContains("import annot.*;", cu);
- this.assertSourceDoesNotContain("@Foo", cu);
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
-
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(cu), daa1);
- Annotation annotation1 = aa1.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation1);
-
- aa1.newMarkerAnnotation();
- this.assertSourceDoesNotContain("import annot.Foo;", cu);
- this.assertSourceContains("@Foo", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/TypeTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/TypeTests.java
deleted file mode 100644
index 8efb3bef1b..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/TypeTests.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.tests.internal.utility.jdt;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-
-public class TypeTests extends AnnotationTestCase {
-
- public TypeTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- protected ICompilationUnit createCompilationUnit(String source) throws CoreException {
- return this.javaProject.createCompilationUnit(PACKAGE_NAME, FILE_NAME, source);
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void test1() throws Exception {
- ICompilationUnit jdtCompilationUnit = this.createCompilationUnit(this.buildTest1Source());
- assertNotNull(jdtCompilationUnit);
- }
-
- private String buildTest1Source() {
- StringBuilder sb = new StringBuilder();
- sb.append("public class ").append(TYPE_NAME).append(" {").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(" public int getId() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append("}").append(CR);
- return sb.toString();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/test.xml b/jpa/tests/org.eclipse.jpt.core.tests/test.xml
deleted file mode 100644
index a670c0f697..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/test.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0"?>
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name -->
- <property name="plugin-name" value="org.eclipse.jpt.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="suite">
- <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.core.tests.internal.JptCoreTests" />
- <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
- <property name="extraVMargs" value="-Dorg.eclipse.jpt.jpa.jar=${testDir}/${jpt-persistence-jar}"/>
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init, suite, cleanup">
- </target>
-</project> \ No newline at end of file
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/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.db.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 7ef2abe95e..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/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.tests
-Bundle-Version: 1.0.0.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.junit;bundle-version="[3.8.2,4.0.0)",
- org.eclipse.datatools.connectivity;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.datatools.connectivity.db.generic;bundle-version="[1.0.0,1.2.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)"
-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 cd0d010fd1..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/build.properties
+++ /dev/null
@@ -1,15 +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 b04fe27976..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/plugin.properties
+++ /dev/null
@@ -1,25 +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/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 11c2a7e84a..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies 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 plugin;
-
- public static final String BUNDLE_ID = "org.eclipse.jpt.db.tests"; //$NON-NLS-1$
-
- /**
- * Returns the shared instance
- */
- public static JptDbTestsPlugin getDefault() {
- return plugin;
- }
-
- /**
- * The constructor
- */
- public JptDbTestsPlugin() {
- super();
- plugin = 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 {
- plugin = 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 0388d34e2a..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DTPPlatformTests.java
+++ /dev/null
@@ -1,1080 +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 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.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import junit.framework.TestCase;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.datatools.connectivity.ConnectionProfileException;
-import org.eclipse.datatools.connectivity.IConnectionProfile;
-import org.eclipse.datatools.connectivity.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.DatabaseFinder;
-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.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.IndentingPrintWriter;
-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(), DatabaseFinder.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.schemataSize() >= 0);
-
- Schema schema = database.getDefaultSchema();
- if (schema != null) {
- if (schema.tablesSize() > 0) {
- Table table = schema.tables().next();
- assertTrue(table.columnsSize() >= 0);
- assertTrue(table.primaryKeyColumnsSize() >= 0);
- assertTrue(table.foreignKeysSize() >= 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.tablesSize() >= 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);
-
- assertEquals(this.supportsCatalogs(), this.connectionProfile.getDatabase().supportsCatalogs());
-
- 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 getCatalogNamed(String catalogName) {
- return this.connectionProfile.getDatabase().getCatalogNamed(catalogName);
- }
-
- protected Schema getSchemaForIdentifier(String schemaName) {
- return this.connectionProfile.getDatabase().getSchemaForIdentifier(schemaName);
- }
-
- 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) ClassTools.executeMethod(cp, "hasAnyListeners")).booleanValue();
- }
-
- protected boolean connectionProfileHasNoListeners() {
- return connectionProfileHasNoListeners(this.connectionProfile);
- }
-
- protected static boolean connectionProfileHasNoListeners(ConnectionProfile cp) {
- return ((Boolean) ClassTools.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) ClassTools.fieldValue(cp, "dtpConnectionProfile");
- }
-
- protected IManagedConnection getDTPManagedConnection() {
- return (IManagedConnection) ClassTools.fieldValue(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) ClassTools.fieldValue(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) ClassTools.fieldValue(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) ClassTools.fieldValue(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 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 ArrayList<HashMap<String, Object>> execute2(String sql) throws SQLException {
- Statement jdbcStatement = this.createJDBCStatement();
- jdbcStatement.execute(sql);
- ArrayList<HashMap<String, Object>> rows = this.buildMaps(jdbcStatement.getResultSet());
- jdbcStatement.close();
- return rows;
- }
-
- protected ArrayList<HashMap<String, Object>> buildMaps(ResultSet resultSet) throws SQLException {
- ArrayList<HashMap<String, Object>> rows = new ArrayList<HashMap<String, Object>>();
- for (Iterator<HashMap<String, Object>> stream = this.buildMapIterator(resultSet); stream.hasNext(); ) {
- rows.add(stream.next());
- }
- return rows;
- }
-
- protected Iterator<HashMap<String, Object>> buildMapIterator(ResultSet resultSet) throws SQLException {
- return new ResultSetIterator<HashMap<String, Object>>(resultSet, new MapResultSetIteratorAdapter(this.buildColumnNames(resultSet)));
- }
-
- protected 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 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;
- }
- }
-
- 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 (Iterator<Catalog> stream = database.catalogs(); stream.hasNext(); ) {
- this.dumpCatalogOn(stream.next(), 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 (Iterator<Schema> stream = schemaContainer.schemata(); stream.hasNext(); ) {
- this.dumpSchemaOn(stream.next(), 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 (Iterator<Table> stream = schema.tables(); stream.hasNext(); ) {
- this.dumpTableOn(stream.next(), pw);
- }
- for (Iterator<Sequence> stream = schema.sequences(); stream.hasNext(); ) {
- this.dumpSequenceOn(stream.next(), pw);
- }
- pw.undent();
- }
- }
-
- protected void dumpTableOn(Table table, IndentingPrintWriter pw) {
- pw.print("table: ");
- pw.println(table.getName());
- pw.indent();
- for (Iterator<Column> stream = table.columns(); stream.hasNext(); ) {
- this.dumpColumnOn(stream.next(), pw);
- }
- for (Iterator<ForeignKey> stream = table.foreignKeys(); stream.hasNext(); ) {
- this.dumpForeignKeyOn(stream.next(), 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.columnPairs(); 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.getJDBCConnection().getMetaData().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.getJDBCConnection().getMetaData().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();
- }
-
- protected void dump(ResultSet resultSet) throws SQLException {
- IndentingPrintWriter pw = new IndentingPrintWriter(new OutputStreamWriter(System.out));
- // synchronize the console so everything is contiguous
- synchronized (System.out) {
- this.dumpOn(resultSet, pw);
- }
- pw.flush();
- }
-
- protected void dumpOn(ResultSet resultSet, IndentingPrintWriter pw) throws SQLException {
- ArrayList<HashMap<String, Object>> maps = this.buildMaps(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();
- }
- }
- }
-
-
- // ********** connection profile listener **********
-
- protected 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 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 28ea244d11..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DerbyTests.java
+++ /dev/null
@@ -1,433 +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 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.columnsSize());
- assertEquals(1, fooTable.primaryKeyColumnsSize());
- assertEquals(1, fooTable.foreignKeysSize());
-
- 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.foreignKeys().next(); // there should only be 1 foreign key
- assertEquals(1, barFK.columnPairsSize());
- 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.columnsSize());
- assertEquals(1, barTable.primaryKeyColumnsSize());
- assertEquals(0, barTable.foreignKeysSize());
- 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.columnsSize());
- assertEquals(0, foo_bazTable.primaryKeyColumnsSize());
- assertEquals(2, foo_bazTable.foreignKeysSize());
- 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();
- }
-
- private void dropTable(String schemaName, String tableName) throws Exception {
- Schema schema= this.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.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 d08d290b7e..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/MySQLTests.java
+++ /dev/null
@@ -1,366 +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;
-
-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.getDatabase().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.getDatabase().getDefaultSchema();
-
- // foo
- Table fooTable = schema.getTableNamed("foo");
- assertEquals(3, fooTable.columnsSize());
- assertEquals(1, fooTable.primaryKeyColumnsSize());
- assertEquals(1, fooTable.foreignKeysSize());
-
- 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.foreignKeys().next(); // there should only be 1 foreign key
- assertEquals(1, barFK.columnPairsSize());
- 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.columnsSize());
- assertEquals(1, barTable.primaryKeyColumnsSize());
- assertEquals(0, barTable.foreignKeysSize());
- 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.columnsSize());
- assertEquals(0, foo_bazTable.primaryKeyColumnsSize());
- assertEquals(2, foo_bazTable.foreignKeysSize());
- 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.getDatabase().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.getDatabase().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.getDatabase().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.getDatabase().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.getDatabase().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();
- }
-
- 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 8639cfceb6..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gTests.java
+++ /dev/null
@@ -1,342 +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;
-
-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 {
- 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.getDatabase().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.getDatabase().getDefaultSchema();
-
- // foo
- Table fooTable = schema.getTableForIdentifier("foo");
- assertEquals(3, fooTable.columnsSize());
- assertEquals(1, fooTable.primaryKeyColumnsSize());
- assertEquals(1, fooTable.foreignKeysSize());
-
- 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.foreignKeys().next(); // there should only be 1 foreign key
- assertEquals(1, barFK.columnPairsSize());
- 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.columnsSize());
- assertEquals(1, barTable.primaryKeyColumnsSize());
- assertEquals(0, barTable.foreignKeysSize());
- 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.columnsSize());
- assertEquals(0, foo_bazTable.primaryKeyColumnsSize());
- assertEquals(2, foo_bazTable.foreignKeysSize());
- 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.getDatabase().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.getDatabase().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.getDatabase().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.getDatabase().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.getDatabase().getDefaultSchema().getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("\"Id\""));
- assertNotNull(table.getColumnForIdentifier("\"Name\""));
-
- this.dropTable("test");
-
- 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 723b7faa15..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/PostgreSQLTests.java
+++ /dev/null
@@ -1,433 +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;
-
-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() {
- 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 false;
- }
-
- @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.getDatabase().getSchemaForIdentifier("TEST1");
- assertNotNull(schema1);
-
- this.executeUpdate("CREATE SCHEMA TEST2");
- Schema schema2 = this.getDatabase().getSchemaForIdentifier("TEST2");
- assertNull(schema2); // should be null until refresh
-
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- assertSame(this.getDatabase(), listener.changedDatabase);
-
- schema2 = this.getDatabase().getSchemaForIdentifier("TEST2");
- assertNotNull(schema2);
- assertNotSame(schema1, this.getDatabase().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.getDatabase().getSchemaNamed("LOOKUP_TEST"));
- assertNotNull(this.getDatabase().getSchemaForIdentifier("LOOKUP_TEST"));
-
- assertNotNull(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\""));
- 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 lowercase
- 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().getSchemaNamed("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 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.getDatabase().getSchemaForIdentifier("TABLE_TEST");
-
- // FOO
- Table fooTable = schema.getTableForIdentifier("FOO");
- assertEquals(3, fooTable.columnsSize());
- assertEquals(1, fooTable.primaryKeyColumnsSize());
- assertEquals(1, fooTable.foreignKeysSize());
-
- 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.foreignKeys().next(); // there should only be 1 foreign key
- assertEquals(1, barFK.columnPairsSize());
- 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.columnsSize());
- assertEquals(1, barTable.primaryKeyColumnsSize());
- assertEquals(0, barTable.foreignKeysSize());
- 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.columnsSize());
- assertEquals(0, foo_bazTable.primaryKeyColumnsSize());
- assertEquals(2, foo_bazTable.foreignKeysSize());
- 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.getDatabase().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.getDatabase().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.getDatabase().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.getDatabase().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();
- }
-
- private void dropTable(String schemaName, String tableName) throws Exception {
- Schema schema= this.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.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.getDatabase().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.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 07917b2374..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SybaseTests.java
+++ /dev/null
@@ -1,383 +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;
-
-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().getSchemaNamed("test1")); // 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.columnsSize());
- assertEquals(1, fooTable.primaryKeyColumnsSize());
- assertEquals(1, fooTable.foreignKeysSize());
-
- 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.foreignKeys().next(); // there should only be 1 foreign key
- assertEquals(1, barFK.columnPairsSize());
- 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.columnsSize());
- assertEquals(1, barTable.primaryKeyColumnsSize());
- assertEquals(0, barTable.foreignKeysSize());
- 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.columnsSize());
- assertEquals(1, bazTable.primaryKeyColumnsSize());
- assertEquals(0, bazTable.foreignKeysSize());
-
- 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.columnsSize());
- assertEquals(0, foo_bazTable.primaryKeyColumnsSize());
- assertEquals(2, foo_bazTable.foreignKeysSize());
- 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();
- }
-
-}
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 84744e7e8a..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="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="src" path="src"/>
- <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.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 b9425307fe..0000000000
--- a/jpa/tests/org.eclipse.jpt.gen.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,13 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jpt.gen.tests
-Bundle-Version: 2.0.0
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Vendor: %providerName
-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.2"
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 269a5dc154..0000000000
--- a/jpa/tests/org.eclipse.jpt.gen.tests/plugin.properties
+++ /dev/null
@@ -1,22 +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 9ff221c28f..0000000000
--- a/jpa/tests/org.eclipse.jpt.gen.tests/src/org/eclipse/jpt/gen/tests/internal/EntityGenToolsTests.java
+++ /dev/null
@@ -1,144 +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 java.util.HashSet;
-
-import org.eclipse.jpt.gen.internal.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 11d311ae85..0000000000
--- a/jpa/tests/org.eclipse.jpt.gen.tests/test.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0"?>
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name -->
- <property name="plugin-name" value="org.eclipse.jpt.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 370877baf6..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"/>
- <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/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.ui.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 6a66ed67ae..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,23 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.ui.tests
-Bundle-Version: 1.0.0
-Require-Bundle:
- org.junit4;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.workbench;bundle-version="3.4.0",
- org.eclipse.ui.forms;bundle-version="3.3.100"
-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
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 34d2e4d2da..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/build.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-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 ca8ab879ff..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/plugin.properties
+++ /dev/null
@@ -1,22 +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 1eec469a66..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingLabelProviderUiTest.java
+++ /dev/null
@@ -1,599 +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.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.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-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.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.StaticListValueModel;
-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.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.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(ClassTools.shortClassNameForObject(this));
- 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 ListValueModel<Vehicle> buildChildrenModel() {
- return new StaticListValueModel<Vehicle>(CollectionTools.list(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 ListValueModel buildChildrenModel() {
- return new NullListValueModel();
- }
- }
-
-
- 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<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<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();
- }
- };
- }
- }
-
-
- 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 0039cca5ec..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java
+++ /dev/null
@@ -1,569 +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.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.ClassTools;
-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.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.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;
-
-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(ClassTools.shortClassNameForObject(this));
- 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);
- }
-
-
- private static abstract class AbstractTreeItemContentProviderFactory
- implements TreeItemContentProviderFactory
- {
- public TreeItemContentProvider buildItemContentProvider(
- Object item, DelegatingContentAndLabelProvider contentAndLabelProvider) {
- return new GenericTreeItemContentProvider(
- (TreeNode) item, (DelegatingTreeContentAndLabelProvider) contentAndLabelProvider);
- }
- }
-
-
- private static class ControlTreeItemContentProviderFactory extends AbstractTreeItemContentProviderFactory
- {
-
- }
-
-
- private 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);
- }
- }
-
-
- private 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 ListValueModel<TreeNode> buildChildrenModel() {
- return new ListAspectAdapter<TreeNode, TreeNode>(TreeNode.CHILDREN_LIST, treeNode()) {
- @Override
- protected ListIterator<TreeNode> listIterator_() {
- return treeNode().children();
- }
- };
- }
- }
-
- private 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 ListValueModel<TreeNode> buildChildrenModel() {
- return buildChildrenModel(
- 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();
- }
- }
- );
- }
- else {
- return new StaticCollectionValueModel<TreeNode>(CollectionTools.collection(value));
- }
- }
- }
- );
- }
- }
-
-
- private static class LabelProvider extends BaseLabelProvider
- implements ILabelProvider
- {
- public Image getImage(Object element) {
- return null;
- }
-
- public String getText(Object element) {
- return ((TreeNode) element).getName();
- }
- }
-
-
- private 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());
- }
- }
-
-
- private 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));
- }
- }
-
-
- private 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, 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;
- }
- };
- }
- }
-
-
- private 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);
- }
- }
-
-
- private 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 d8fa173036..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.eclipse.jpt.ui.tests.internal.platform;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.internal.platform.JpaPlatformRegistry;
-import org.eclipse.jpt.core.tests.extension.resource.ExtensionTestPlugin;
-import org.eclipse.jpt.core.tests.extension.resource.TestJpaPlatform;
-import org.eclipse.jpt.core.tests.extension.resource.TestJpaPlatformUi;
-import org.eclipse.jpt.core.tests.internal.projects.TestJpaProject;
-
-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 = TestJpaPlatform.ID;
- public static final String TEST_PLATFORM_CLASS = TestJpaPlatform.class.getName();
- public static final String TEST_PLATFORM_LABEL = "Test Jpa Platform";
-
- public static final String TEST_UI_PLATFORM_ID = TEST_PLATFORM_ID;
- public static final String TEST_UI_PLATFORM_CLASS = TestJpaPlatformUi.class.getName();
-
- 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(jpaProject().getJpaPlatform().getId()));
- }
-
-}
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/CComboModelAdapterTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/CComboModelAdapterTest.java
deleted file mode 100644
index 4cf143eb90..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/CComboModelAdapterTest.java
+++ /dev/null
@@ -1,75 +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.CComboModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.SimpleDisplayable;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.junit.After;
-
-public class CComboModelAdapterTest extends AbstractComboModelAdapterTest {
-
- private CCombo combo;
-
- @Override
- protected AbstractComboModelAdapter<SimpleDisplayable> buildEditableComboModelAdapter() {
-
- combo = new CCombo(shell(), SWT.NULL);
-
- return CComboModelAdapter.adapt(
- buildListHolder(),
- selectedItemHolder(),
- combo,
- buildStringConverter()
- );
- }
-
- @Override
- protected AbstractComboModelAdapter<SimpleDisplayable> buildReadOnlyComboModelAdapter() {
-
- combo = new CCombo(shell(), SWT.READ_ONLY);
-
- return CComboModelAdapter.adapt(
- buildListHolder(),
- selectedItemHolder(),
- combo,
- buildStringConverter()
- );
- }
-
- @Override
- public String comboSelectedItem() {
- return combo.getText();
- }
-
- @Override
- protected boolean emptyComboCanHaveSelectedValue() {
- return true;
- }
-
- @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/CheckBoxModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/CheckBoxModelAdapterUITest.java
deleted file mode 100644
index d2cf139f45..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/CheckBoxModelAdapterUITest.java
+++ /dev/null
@@ -1,318 +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.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.BooleanButtonModelAdapter;
-import org.eclipse.jpt.utility.internal.ClassTools;
-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.
- */
-public class CheckBoxModelAdapterUITest
- 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 CheckBoxModelAdapterUITest(args);
- window.setBlockOnOpen(true);
- window.open();
- Display.getCurrent().dispose();
- System.exit(0);
- }
-
- private CheckBoxModelAdapterUITest(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(ClassTools.shortClassNameForObject(this));
- 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");
- BooleanButtonModelAdapter.adapt(this.flag1Holder, checkBox);
- }
-
- private void buildFlag2CheckBox(Composite parent) {
- Button checkBox = new Button(parent, SWT.CHECK);
- checkBox.setText("flag 2");
- BooleanButtonModelAdapter.adapt(this.flag2Holder, checkBox);
- }
-
- private void buildNotFlag2CheckBox(Composite parent) {
- Button checkBox = new Button(parent, SWT.CHECK);
- checkBox.setText("not flag 2");
- BooleanButtonModelAdapter.adapt(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() {
- CheckBoxModelAdapterUITest.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");
- BooleanButtonModelAdapter.adapt(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() {
- CheckBoxModelAdapterUITest.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() {
- CheckBoxModelAdapterUITest.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() {
- CheckBoxModelAdapterUITest.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 = ! 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/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 12a8c2fbce..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/JptUiSWTTests.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.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
-({
- CComboModelAdapterTest.class,
- 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/ListBoxModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/ListBoxModelAdapterUITest.java
deleted file mode 100644
index 0f2dafef5d..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/ListBoxModelAdapterUITest.java
+++ /dev/null
@@ -1,640 +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.ui.tests.internal.swt;
-
-import java.text.Collator;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Date;
-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.swt.ListBoxModelAdapter;
-import org.eclipse.jpt.ui.internal.swt.ListBoxModelAdapter.SelectionChangeEvent;
-import org.eclipse.jpt.utility.internal.ClassTools;
-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.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.model.Model;
-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.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;
-
-/**
- * an example UI for testing various permutations of the
- * StructuredContentProviderAdapter
- */
-public class ListBoxModelAdapterUITest
- extends ApplicationWindow
-{
- final TaskList taskList;
- private final WritablePropertyValueModel<TaskList> taskListHolder;
- private Text taskTextField;
-
- public static void main(String[] args) throws Exception {
- Window window = new ListBoxModelAdapterUITest(args);
- window.setBlockOnOpen(true);
- window.open();
- Display.getCurrent().dispose();
- System.exit(0);
- }
-
- private ListBoxModelAdapterUITest(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(ClassTools.shortClassNameForObject(this));
- 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.buildListPanel2(parent, "object unsorted", this.buildUnsortedObjectListModel(), this.buildPriorityTaskListAdapter());
- }
-
- private void buildStandardSortedObjectListPanel(Composite parent) {
- this.buildListPanel2(parent, "object sorted", this.buildStandardSortedObjectListModel(), this.buildPriorityTaskListAdapter());
- }
-
- private void buildCustomSortedObjectListPanel(Composite parent) {
- this.buildListPanel2(parent, "object reverse sorted", this.buildCustomSortedObjectListModel(), this.buildPriorityTaskListAdapter());
- }
-
- private ListValueModel<String> buildUnsortedPrimitiveListModel() {
- return this.buildPrimitiveTaskListAdapter();
- }
-
- private ListValueModel<String> buildStandardSortedPrimitiveListModel() {
- return new SortedListValueModelAdapter<String>(this.buildPrimitiveTaskListAdapter());
- }
-
- private ListValueModel<String> buildCustomSortedPrimitiveListModel() {
- return new SortedListValueModelAdapter<String>(this.buildPrimitiveTaskListAdapter(), this.buildCustomStringComparator());
- }
-
- private ListValueModel<Task> buildUnsortedObjectListModel() {
- return this.buildObjectTaskListAdapter();
- }
-
- private ListValueModel<Task> buildStandardSortedObjectListModel() {
- return new SortedListValueModelAdapter<Task>(this.buildObjectTaskListAdapter());
- }
-
- private ListValueModel<Task> buildCustomSortedObjectListModel() {
- return new SortedListValueModelAdapter<Task>(this.buildObjectTaskListAdapter(), this.buildCustomTaskComparator());
- }
-
- private <E> ListBoxModelAdapter<E> buildListPanel(Composite parent, String label, ListValueModel<E> model, CollectionValueModel<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);
- return ListBoxModelAdapter.adapt(model, selectedItemsModel, listBox); // use #toString()
- }
-
- private void buildListPanel2(Composite parent, String label, ListValueModel<Task> model, CollectionValueModel<Task> selectedItemsModel) {
- ListBoxModelAdapter<Task> adapter = this.buildListPanel(parent, label, model, selectedItemsModel);
- adapter.addDoubleClickListener(this.buildDoubleClickListener());
- adapter.addSelectionChangeListener(this.buildSelectionChangeListener());
- }
-
- private ListBoxModelAdapter.DoubleClickListener<Task> buildDoubleClickListener() {
- return new ListBoxModelAdapter.DoubleClickListener<Task>() {
- public void doubleClick(ListBoxModelAdapter.DoubleClickEvent<Task> event) {
- System.out.println("double-click: " + event.selection());
- }
- };
- }
-
- private ListBoxModelAdapter.SelectionChangeListener<Task> buildSelectionChangeListener() {
- return new ListBoxModelAdapter.SelectionChangeListener<Task>() {
- public void selectionChanged(SelectionChangeEvent<Task> event) {
- ListBoxModelAdapterUITest.this.taskList.setPriorityTasks(event.selection());
- }
- };
- }
-
- 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 CollectionValueModel<Task> buildPriorityTaskListAdapter() {
- return new CollectionAspectAdapter<TaskList, Task>(this.taskListHolder, TaskList.PRIORITY_TASKS_COLLECTION) {
- @Override
- protected Iterator<Task> iterator_() {
- return this.subject.priorityTasks();
- }
- };
- }
-
- 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() {
- ListBoxModelAdapterUITest.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() {
- ListBoxModelAdapterUITest.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() {
- ListBoxModelAdapterUITest.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() {
- ListBoxModelAdapterUITest.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() {
- ListBoxModelAdapterUITest.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() {
- ListBoxModelAdapterUITest.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() {
- ListBoxModelAdapterUITest.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() {
- ListBoxModelAdapterUITest.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...
- private 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";
- 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.taskNames.clear();
- this.fireListCleared(TASK_NAMES_LIST);
- this.tasks.clear();
- this.fireListCleared(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(Iterator<Task> tasks) {
- this.priorityTasks.clear();
- while (tasks.hasNext()) {
- this.priorityTasks.add(tasks.next());
- }
- this.fireCollectionChanged(PRIORITY_TASKS_COLLECTION);
- }
- }
-
-
- // ********** Task **********
-
- private 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 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/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 94da99053b..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies 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);
- }
-
- 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/TextFieldModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TextFieldModelAdapterUITest.java
deleted file mode 100644
index 6f812805de..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TextFieldModelAdapterUITest.java
+++ /dev/null
@@ -1,252 +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.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.TextFieldModelAdapter;
-import org.eclipse.jpt.utility.internal.ClassTools;
-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.
- */
-public class TextFieldModelAdapterUITest
- 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 TextFieldModelAdapterUITest(args);
- window.setBlockOnOpen(true);
- window.open();
- Display.getCurrent().dispose();
- System.exit(0);
- }
-
- private TextFieldModelAdapterUITest(String[] args) {
- 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(ClassTools.shortClassNameForObject(this));
- 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);
- TextFieldModelAdapter.adapt(this.nameHolder, textField);
- }
-
- private void buildReadOnlyNameTextField(Composite parent) {
- Text textField = new Text(parent, SWT.SINGLE);
- textField.setEnabled(false);
- TextFieldModelAdapter.adapt(this.nameHolder, textField);
- }
-
- private void buildAllCapsNameTextField(Composite parent) {
- Text textField = new Text(parent, SWT.SINGLE);
- textField.setEnabled(false);
- TextFieldModelAdapter.adapt(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() {
- TextFieldModelAdapterUITest.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() {
- TextFieldModelAdapterUITest.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() {
- TextFieldModelAdapterUITest.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() {
- TextFieldModelAdapterUITest.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.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 80b8840a85..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TriStateCheckBoxModelAdapterUITest.java
+++ /dev/null
@@ -1,320 +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.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.ClassTools;
-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(ClassTools.shortClassNameForObject(this));
- 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 eccd44e811..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies 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.ClassTools;
-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(ClassTools.attemptToGetFieldValue(controlAligner, "locked"), Boolean.FALSE);
- assertEquals(ClassTools.attemptToGetFieldValue(controlAligner2, "locked"), Boolean.FALSE);
- assertEquals(ClassTools.attemptToGetFieldValue(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(ClassTools.attemptToGetFieldValue(controlAligner, "locked"), Boolean.FALSE);
- assertEquals(ClassTools.attemptToGetFieldValue(controlAligner2, "locked"), Boolean.FALSE);
- assertEquals(ClassTools.attemptToGetFieldValue(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(ClassTools.attemptToGetFieldValue(controlAligner, "locked"), Boolean.FALSE);
- assertEquals(ClassTools.attemptToGetFieldValue(controlAligner2, "locked"), Boolean.FALSE);
- assertEquals(ClassTools.attemptToGetFieldValue(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(ClassTools.attemptToGetFieldValue(controlAligner, "locked"), Boolean.FALSE);
- assertEquals(ClassTools.attemptToGetFieldValue(controlAligner2, "locked"), Boolean.FALSE);
- assertEquals(ClassTools.attemptToGetFieldValue(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 58e8e6739c..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies 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.ControlEnabler;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-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);
-
- new ControlEnabler(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 658ce0b09d..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies 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.ClassTools;
-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) ClassTools.fieldValue(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) ClassTools.fieldValue(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 c0cd39c02a..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlVisibilityEnablerTest.java
+++ /dev/null
@@ -1,84 +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.*;
-import org.eclipse.jpt.ui.internal.util.ControlVisibilityEnabler;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-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);
-
- new ControlVisibilityEnabler(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 072686a307..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneEnablerTest.java
+++ /dev/null
@@ -1,93 +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.*;
-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) {
- }
- };
-
- pane.populate();
- 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 644acfc1b2..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneVisibilityEnablerTest.java
+++ /dev/null
@@ -1,93 +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.*;
-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) {
- }
- };
-
- pane.populate();
- 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.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 a5a719738e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,18 +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.3.0
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.jpt.utility;bundle-version="[1.2.0,2.0.0)",
- org.junit;bundle-version="[3.0.0,4.0.0)"
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.jpt.utility.tests.internal;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
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 9995768587..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/plugin.properties
+++ /dev/null
@@ -1,24 +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 Utility Tests
-providerName = Eclipse.org
-
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/BitToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BitToolsTests.java
deleted file mode 100644
index 8f2e9b8492..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BitToolsTests.java
+++ /dev/null
@@ -1,243 +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.utility.tests.internal;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.BitTools;
-
-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 }));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BooleanHolderTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BooleanHolderTests.java
deleted file mode 100644
index 106eae1a86..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BooleanHolderTests.java
+++ /dev/null
@@ -1,80 +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.tests.internal;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.BooleanHolder;
-
-public class BooleanHolderTests extends TestCase {
-
- public BooleanHolderTests(String name) {
- super(name);
- }
-
- public void testGetValue() {
- BooleanHolder bh = new BooleanHolder(true);
- assertTrue(bh.getValue());
- }
-
- public void testIsTrue() {
- BooleanHolder bh = new BooleanHolder(true);
- assertTrue(bh.isTrue());
- }
-
- public void testIsFalse() {
- BooleanHolder bh = new BooleanHolder(true);
- assertFalse(bh.isFalse());
- }
-
- public void testIs() {
- BooleanHolder bh = new BooleanHolder(true);
- assertTrue(bh.is(true));
- assertFalse(bh.is(false));
- }
-
- public void testSetValue() {
- BooleanHolder bh = new BooleanHolder(true);
- assertTrue(bh.getValue());
- bh.setValue(false);
- assertFalse(bh.getValue());
- }
-
- public void testSetTrue() {
- BooleanHolder bh = new BooleanHolder(false);
- assertFalse(bh.getValue());
- bh.setTrue();
- assertTrue(bh.getValue());
- }
-
-
- public void testSetFalse() {
- BooleanHolder bh = new BooleanHolder(true);
- assertTrue(bh.getValue());
- bh.setFalse();
- assertFalse(bh.getValue());
- }
-
- public void testClone() {
- BooleanHolder bh = new BooleanHolder(true);
- BooleanHolder clone = (BooleanHolder) bh.clone();
- assertTrue(clone.getValue());
- assertEquals(bh, clone);
- }
-
- public void testEquals() {
- BooleanHolder bh1 = new BooleanHolder(true);
- BooleanHolder bh2 = new BooleanHolder(true);
- assertEquals(bh1, bh2);
-
- BooleanHolder bh3 = new BooleanHolder(false);
- assertFalse(bh1.equals(bh3));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClassToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClassToolsTests.java
deleted file mode 100644
index f2e4eae173..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClassToolsTests.java
+++ /dev/null
@@ -1,633 +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.lang.reflect.Array;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Vector;
-import java.util.Map.Entry;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-public class ClassToolsTests extends TestCase {
-
- private static String testStaticField;
-
- public ClassToolsTests(String name) {
- super(name);
- }
-
- /**
- * 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;
- Field[] fields = ClassTools.allFields(java.util.Vector.class);
- assertEquals(fieldCount, fields.length);
- assertTrue(CollectionTools.contains(this.names(fields), "modCount"));
- assertTrue(CollectionTools.contains(this.names(fields), "serialVersionUID"));
- assertTrue(CollectionTools.contains(this.names(fields), "capacityIncrement"));
- assertTrue(CollectionTools.contains(this.names(fields), "elementCount"));
- assertTrue(CollectionTools.contains(this.names(fields), "elementData"));
- assertTrue(fields[0].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;
- Method[] methods = ClassTools.allMethods(java.util.Vector.class);
- assertEquals(methodCount, methods.length);
- assertTrue(CollectionTools.contains(this.names(methods), "wait"));
- assertTrue(CollectionTools.contains(this.names(methods), "addElement"));
- assertTrue(methods[0].isAccessible());
- }
-
- public void testNewInstanceClass() {
- Vector<?> v = ClassTools.newInstance(java.util.Vector.class);
- assertNotNull(v);
- assertEquals(0, v.size());
- }
-
- public void testNewInstanceClassClassObject() {
- int initialCapacity = 200;
- Vector<?> v = ClassTools.newInstance(java.util.Vector.class, int.class, new Integer(initialCapacity));
- assertNotNull(v);
- assertEquals(0, v.size());
- Object[] elementData = (Object[]) ClassTools.fieldValue(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 = ClassTools.newInstance(java.util.Vector.class, parmTypes, parms);
- assertNotNull(v);
- assertEquals(0, v.size());
- Object[] elementData = (Object[]) ClassTools.fieldValue(v, "elementData");
- assertEquals(initialCapacity, elementData.length);
-
- parms[0] = new Integer(-1);
- boolean exCaught = false;
- try {
- v = ClassTools.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 = ClassTools.attemptNewInstance(java.util.Vector.class, parmTypes, parms);
- } catch (NoSuchMethodException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchMethodException not thrown", exCaught);
- }
-
- public void testFieldValue() {
- int initialCapacity = 200;
- Vector<?> v = new Vector<Object>(initialCapacity);
- Object[] elementData = (Object[]) ClassTools.fieldValue(v, "elementData");
- assertEquals(initialCapacity, elementData.length);
-
- // test inherited field
- Integer modCountInteger = (Integer) ClassTools.fieldValue(v, "modCount");
- int modCount = modCountInteger.intValue();
- assertEquals(0, modCount);
-
- boolean exCaught = false;
- Object bogusFieldValue = null;
- try {
- bogusFieldValue = ClassTools.attemptToGetFieldValue(v, "bogusField");
- } catch (NoSuchFieldException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchFieldException not thrown: " + bogusFieldValue, exCaught);
- }
-
- public void testExecuteMethodObjectString() {
- Vector<String> v = new Vector<String>();
- int size = ((Integer) ClassTools.executeMethod(v, "size")).intValue();
- assertEquals(0, size);
-
- v.addElement("foo");
- size = ((Integer) ClassTools.executeMethod(v, "size")).intValue();
- assertEquals(1, size);
- }
-
- public void testExecuteMethodObjectStringClassObject() {
- Vector<String> v = new Vector<String>();
- boolean booleanResult = ((Boolean) ClassTools.executeMethod(v, "add", Object.class, "foo")).booleanValue();
- assertTrue(booleanResult);
- assertTrue(v.contains("foo"));
- Object voidResult = ClassTools.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) ClassTools.executeMethod(v, "add", parmTypes, parms)).booleanValue();
- assertTrue(booleanResult);
- assertTrue(v.contains("foo"));
-
- boolean exCaught = false;
- Object bogusMethodReturnValue = null;
- try {
- bogusMethodReturnValue = ClassTools.attemptToExecuteMethod(v, "bogusMethod", parmTypes, parms);
- } catch (NoSuchMethodException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchMethodException not thrown: " + bogusMethodReturnValue, exCaught);
- }
-
- public void testExecuteStaticMethodClassString() {
- Double randomObject = (Double) ClassTools.executeStaticMethod(java.lang.Math.class, "random");
- assertNotNull(randomObject);
- double random = randomObject.doubleValue();
- assertTrue(random >= 0);
- assertTrue(random < 1);
- }
-
- public void testExecuteStaticMethodClassStringClassObject() {
- String s = (String) ClassTools.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) ClassTools.executeStaticMethod(java.lang.String.class, "valueOf", parmTypes, parms);
- assertNotNull(s);
- assertEquals("true", s);
-
- boolean exCaught = false;
- Object bogusStaticMethodReturnValue = null;
- try {
- bogusStaticMethodReturnValue = ClassTools.attemptToExecuteStaticMethod(java.lang.String.class, "bogusStaticMethod", parmTypes, parms);
- } catch (NoSuchMethodException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchMethodException not thrown: " + bogusStaticMethodReturnValue, exCaught);
-
- // test non-static method
- exCaught = false;
- try {
- bogusStaticMethodReturnValue = ClassTools.attemptToExecuteStaticMethod(java.lang.String.class, "toString");
- } catch (NoSuchMethodException ex) {
- 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";
- ClassTools.setFieldValue(v, "elementData", newElementData);
- ClassTools.setFieldValue(v, "elementCount", new Integer(1));
- // test inherited field
- ClassTools.setFieldValue(v, "modCount", new Integer(1));
- assertTrue(v.contains("foo"));
-
- boolean exCaught = false;
- try {
- ClassTools.attemptToSetFieldValue(v, "bogusField", "foo");
- } catch (NoSuchFieldException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchFieldException not thrown", exCaught);
- }
-
- public void testSetStaticFieldValue() {
- ClassTools.setStaticFieldValue(this.getClass(), "testStaticField", "new value");
- assertEquals(testStaticField, "new value");
-
- boolean exCaught = false;
- try {
- ClassTools.attemptToSetStaticFieldValue(this.getClass(), "bogusStaticField", "new value");
- } catch (NoSuchFieldException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchFieldException not thrown", exCaught);
- }
-
- public void testShortName() {
- assertEquals("Vector", ClassTools.shortClassNameForObject(new java.util.Vector<Object>()));
- assertEquals("Vector", ClassTools.shortNameFor(java.util.Vector.class));
- }
-
- public void testNestedName() {
- Map<String, String> map = new HashMap<String, String>();
- map.put("foo", "bar");
- Entry<String, String> entry = map.entrySet().iterator().next();
- assertEquals("Entry", ClassTools.nestedClassNameForObject(entry));
- assertEquals("Entry", ClassTools.nestedNameFor(java.util.Map.Entry.class));
- }
-
- public void testPackageName() {
- assertEquals("java.util", ClassTools.packageNameFor(java.util.Vector.class));
- assertEquals("java.util", ClassTools.packageNameFor(java.util.Map.Entry.class));
- }
-
- public void testArrayDepthFor() {
- assertEquals(0, ClassTools.arrayDepthFor(java.util.Vector.class));
- assertEquals(0, ClassTools.arrayDepthFor(int.class));
- assertEquals(0, ClassTools.arrayDepthFor(void.class));
- assertEquals(1, ClassTools.arrayDepthFor(java.util.Vector[].class));
- assertEquals(1, ClassTools.arrayDepthFor(int[].class));
- assertEquals(3, ClassTools.arrayDepthFor(java.util.Vector[][][].class));
- assertEquals(3, ClassTools.arrayDepthFor(int[][][].class));
- }
-
- public void testArrayDepthForObject() {
- assertEquals(0, ClassTools.arrayDepthForObject(new java.util.Vector<Object>()));
- assertEquals(1, ClassTools.arrayDepthForObject(new java.util.Vector[0]));
- assertEquals(1, ClassTools.arrayDepthForObject(new int[0]));
- assertEquals(3, ClassTools.arrayDepthForObject(new java.util.Vector[0][0][0]));
- assertEquals(3, ClassTools.arrayDepthForObject(new int[0][0][0]));
- }
-
- public void testArrayDepthForClassNamed() {
- assertEquals(0, ClassTools.arrayDepthForClassNamed(java.util.Vector.class.getName()));
- assertEquals(0, ClassTools.arrayDepthForClassNamed(int.class.getName()));
- assertEquals(0, ClassTools.arrayDepthForClassNamed(void.class.getName()));
- assertEquals(1, ClassTools.arrayDepthForClassNamed(java.util.Vector[].class.getName()));
- assertEquals(1, ClassTools.arrayDepthForClassNamed(int[].class.getName()));
- assertEquals(3, ClassTools.arrayDepthForClassNamed(java.util.Vector[][][].class.getName()));
- assertEquals(3, ClassTools.arrayDepthForClassNamed(int[][][].class.getName()));
- }
-
- public void testElementTypeFor() {
- assertEquals(java.util.Vector.class, ClassTools.elementTypeFor(java.util.Vector.class));
- assertEquals(int.class, ClassTools.elementTypeFor(int.class));
- assertEquals(void.class, ClassTools.elementTypeFor(void.class));
- assertEquals(java.util.Vector.class, ClassTools.elementTypeFor(java.util.Vector[].class));
- assertEquals(int.class, ClassTools.elementTypeFor(int[].class));
- assertEquals(java.util.Vector.class, ClassTools.elementTypeFor(java.util.Vector[][][].class));
- assertEquals(int.class, ClassTools.elementTypeFor(int[][][].class));
- }
-
- public void testElementTypeForObject() {
- assertEquals(java.util.Vector.class, ClassTools.elementTypeForObject(new java.util.Vector<Object>()));
- assertEquals(java.util.Vector.class, ClassTools.elementTypeForObject(new java.util.Vector[0]));
- assertEquals(int.class, ClassTools.elementTypeForObject(new int[0]));
- assertEquals(java.util.Vector.class, ClassTools.elementTypeForObject(new java.util.Vector[0][0][0]));
- assertEquals(int.class, ClassTools.elementTypeForObject(new int[0][0][0]));
- }
-
- public void testElementTypeNameFor() {
- assertEquals(java.util.Vector.class.getName(), ClassTools.elementTypeNameFor(java.util.Vector.class));
- assertEquals(int.class.getName(), ClassTools.elementTypeNameFor(int.class));
- assertEquals(void.class.getName(), ClassTools.elementTypeNameFor(void.class));
- assertEquals(java.util.Vector.class.getName(), ClassTools.elementTypeNameFor(java.util.Vector[].class));
- assertEquals(int.class.getName(), ClassTools.elementTypeNameFor(int[].class));
- assertEquals(java.util.Vector.class.getName(), ClassTools.elementTypeNameFor(java.util.Vector[][][].class));
- assertEquals(int.class.getName(), ClassTools.elementTypeNameFor(int[][][].class));
- }
-
- public void testElementTypeNameForClassNamed() {
- assertEquals(java.util.Vector.class.getName(), ClassTools.elementTypeNameForClassNamed(java.util.Vector.class.getName()));
- assertEquals(int.class.getName(), ClassTools.elementTypeNameForClassNamed(int.class.getName()));
- assertEquals(void.class.getName(), ClassTools.elementTypeNameForClassNamed(void.class.getName()));
- assertEquals(java.util.Vector.class.getName(), ClassTools.elementTypeNameForClassNamed(java.util.Vector[].class.getName()));
- assertEquals(int.class.getName(), ClassTools.elementTypeNameForClassNamed(int[].class.getName()));
- assertEquals(java.util.Vector.class.getName(), ClassTools.elementTypeNameForClassNamed(java.util.Vector[][][].class.getName()));
- assertEquals(int.class.getName(), ClassTools.elementTypeNameForClassNamed(int[][][].class.getName()));
- }
-
- public void testClassCodes() {
- assertEquals("byte", ClassTools.classNameForCode('B'));
- assertEquals("char", ClassTools.classNameForCode('C'));
- assertEquals("double", ClassTools.classNameForCode('D'));
- assertEquals("float", ClassTools.classNameForCode('F'));
- assertEquals("int", ClassTools.classNameForCode('I'));
- assertEquals("long", ClassTools.classNameForCode('J'));
- assertEquals("short", ClassTools.classNameForCode('S'));
- assertEquals("boolean", ClassTools.classNameForCode('Z'));
- assertEquals("void", ClassTools.classNameForCode('V'));
-
- boolean exCaught = false;
- try {
- ClassTools.classNameForCode('X');
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue("IllegalArgumentException not thrown", exCaught);
- }
-
- public void testClassNamedIsTopLevel() throws Exception {
- assertTrue(ClassTools.classNamedIsTopLevel(java.util.Map.class.getName())); // top-level
- assertFalse(ClassTools.classNamedIsTopLevel(java.util.Map.Entry.class.getName())); // member
- assertFalse(ClassTools.classNamedIsTopLevel(Class.forName(munge(this.getClass().getName() + "$1$LocalClass")).getName())); // local
- assertFalse(ClassTools.classNamedIsTopLevel(Class.forName("java.util.Vector$1").getName())); // anonymous
-
- Object[] array = new java.util.Map[0]; // top-level
- assertFalse(ClassTools.classNamedIsTopLevel(array.getClass().getName()));
- array = new java.util.Map.Entry[0]; // member
- assertFalse(ClassTools.classNamedIsTopLevel(array.getClass().getName()));
- Class<?> localClass = Class.forName(munge(this.getClass().getName() + "$1$LocalClass")); // local
- array = (Object[]) Array.newInstance(localClass, 0);
- assertFalse(ClassTools.classNamedIsTopLevel(array.getClass().getName()));
- Class<?> anonClass = Class.forName("java.util.Vector$1"); // local
- array = (Object[]) Array.newInstance(anonClass, 0);
- assertFalse(ClassTools.classNamedIsTopLevel(array.getClass().getName()));
- }
-
- public void testClassNamedIsMember() throws Exception {
- assertFalse(ClassTools.classNamedIsMember(java.util.Map.class.getName())); // top-level
- assertTrue(ClassTools.classNamedIsMember(java.util.Map.Entry.class.getName())); // member
- assertFalse(ClassTools.classNamedIsMember(Class.forName(munge(this.getClass().getName() + "$1$LocalClass")).getName())); // local
- assertFalse(ClassTools.classNamedIsMember(Class.forName("java.util.Vector$1").getName())); // anonymous
-
- Object[] array = new java.util.Map[0]; // top-level
- assertFalse(ClassTools.classNamedIsMember(array.getClass().getName()));
- array = new java.util.Map.Entry[0]; // member
- assertFalse(ClassTools.classNamedIsMember(array.getClass().getName()));
- Class<?> localClass = Class.forName(munge(this.getClass().getName() + "$1$LocalClass")); // local
- array = (Object[]) Array.newInstance(localClass, 0);
- assertFalse(ClassTools.classNamedIsMember(array.getClass().getName()));
- Class<?> anonClass = Class.forName("java.util.Vector$1"); // local
- array = (Object[]) Array.newInstance(anonClass, 0);
- assertFalse(ClassTools.classNamedIsMember(array.getClass().getName()));
-
- // test a few edge cases
- assertTrue(ClassTools.classNamedIsMember("java.util.Map$a1"));
- assertTrue(ClassTools.classNamedIsMember("java.util.Map$a1$aaa$bbb"));
- assertFalse(ClassTools.classNamedIsMember("java.util.Map$1a1$aaa"));
- assertFalse(ClassTools.classNamedIsMember("java.util.Map$1a"));
- assertTrue(ClassTools.classNamedIsMember("java.util.Map$a12345$b12345"));
- assertFalse(ClassTools.classNamedIsMember("java.util.Map$12345a"));
- assertFalse(ClassTools.classNamedIsMember("java.util.Map$333"));
- assertFalse(ClassTools.classNamedIsMember("java.util.Map3$333"));
- }
-
- public void testClassNamedIsLocal() throws Exception {
- class LocalClass {
- void foo() {
- System.getProperty("foo");
- }
- }
- new LocalClass().foo();
- assertFalse(ClassTools.classNamedIsLocal(java.util.Map.class.getName())); // top-level
- assertFalse(ClassTools.classNamedIsLocal(java.util.Map.Entry.class.getName())); // member
- assertTrue(ClassTools.classNamedIsLocal(Class.forName(munge(this.getClass().getName() + "$1$LocalClass")).getName())); // local
- assertFalse(ClassTools.classNamedIsLocal(Class.forName("java.util.Vector$1").getName())); // anonymous
-
- Object[] array = new java.util.Map[0]; // top-level
- assertFalse(ClassTools.classNamedIsLocal(array.getClass().getName()));
- array = new java.util.Map.Entry[0]; // member
- assertFalse(ClassTools.classNamedIsLocal(array.getClass().getName()));
- Class<?> localClass = Class.forName(munge(this.getClass().getName() + "$1$LocalClass")); // local
- array = (Object[]) Array.newInstance(localClass, 0);
- assertFalse(ClassTools.classNamedIsLocal(array.getClass().getName()));
- Class<?> anonClass = Class.forName("java.util.Vector$1"); // local
- array = (Object[]) Array.newInstance(anonClass, 0);
- assertFalse(ClassTools.classNamedIsLocal(array.getClass().getName()));
-
- // test a few edge cases
- assertFalse(ClassTools.classNamedIsLocal("java.util.Map$a1"));
- assertFalse(ClassTools.classNamedIsLocal("java.util.Map$a1$aaa$bbb"));
- assertTrue(ClassTools.classNamedIsLocal("java.util.Map$11$aaa"));
- assertTrue(ClassTools.classNamedIsLocal("java.util.Map$1$a")); // eclipse naming convention
- assertTrue(ClassTools.classNamedIsLocal("java.util.Map$2$abc")); // eclipse naming convention
- assertTrue(ClassTools.classNamedIsLocal("java.util.Map$2$abc1")); // eclipse naming convention
- assertTrue(ClassTools.classNamedIsLocal("java.util.Map$1a")); // jdk naming convention
- assertTrue(ClassTools.classNamedIsLocal("java.util.Map$2abc")); // jdk naming convention
- assertTrue(ClassTools.classNamedIsLocal("java.util.Map$2abc1")); // jdk naming convention
- assertFalse(ClassTools.classNamedIsLocal("java.util.Map$a12345$b12345"));
- assertTrue(ClassTools.classNamedIsLocal("java.util.Map$12345$a1234"));
- assertFalse(ClassTools.classNamedIsLocal("java.util.Map$333"));
- assertFalse(ClassTools.classNamedIsLocal("java.util.Map3$333"));
- }
-
- public void testClassNamedIsAnonymous() throws Exception {
- assertFalse(ClassTools.classNamedIsAnonymous(java.util.Map.class.getName())); // top-level
- assertFalse(ClassTools.classNamedIsAnonymous(java.util.Map.Entry.class.getName())); // member
- assertFalse(ClassTools.classNamedIsAnonymous(Class.forName(munge(this.getClass().getName() + "$1$LocalClass")).getName())); // local
- assertTrue(ClassTools.classNamedIsAnonymous(Class.forName("java.util.Vector$1").getName())); // anonymous
-
- Object[] array = new java.util.Map[0]; // top-level
- assertFalse(ClassTools.classNamedIsAnonymous(array.getClass().getName()));
- array = new java.util.Map.Entry[0]; // member
- assertFalse(ClassTools.classNamedIsAnonymous(array.getClass().getName()));
- Class<?> localClass = Class.forName(munge(this.getClass().getName() + "$1$LocalClass")); // local
- array = (Object[]) Array.newInstance(localClass, 0);
- assertFalse(ClassTools.classNamedIsAnonymous(array.getClass().getName()));
- Class<?> anonClass = Class.forName("java.util.Vector$1"); // local
- array = (Object[]) Array.newInstance(anonClass, 0);
- assertFalse(ClassTools.classNamedIsAnonymous(array.getClass().getName()));
-
- // test a few edge cases
- assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$a1"));
- assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$a1$aaa$bbb"));
- assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$1a1$aaa"));
- assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$1$a"));
- assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$1a"));
- assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$a12345$b12345"));
- assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$12345$a1234"));
- assertTrue(ClassTools.classNamedIsAnonymous("java.util.Map$333"));
- assertTrue(ClassTools.classNamedIsAnonymous("java.util.Map3$333"));
- }
-
- public void testCodeForClass() {
- assertEquals('I', ClassTools.codeForClass(int.class));
- assertEquals('B', ClassTools.codeForClass(byte.class));
- }
-
- public void testCodeForClassNamed() {
- assertEquals('I', ClassTools.codeForClassNamed(int.class.getName()));
- assertEquals('I', ClassTools.codeForClassNamed("int"));
- assertEquals('B', ClassTools.codeForClassNamed(byte.class.getName()));
- assertEquals('B', ClassTools.codeForClassNamed("byte"));
- }
-
- public void testClassIsPrimitiveWrapperClass() {
- assertTrue(ClassTools.classIsPrimitiveWrapperClass(java.lang.Void.class));
- assertTrue(ClassTools.classIsPrimitiveWrapperClass(java.lang.Boolean.class));
- assertTrue(ClassTools.classIsPrimitiveWrapperClass(java.lang.Integer.class));
- assertTrue(ClassTools.classIsPrimitiveWrapperClass(java.lang.Float.class));
-
- assertFalse(ClassTools.classIsPrimitiveWrapperClass(java.lang.String.class));
- assertFalse(ClassTools.classIsPrimitiveWrapperClass(void.class));
- assertFalse(ClassTools.classIsPrimitiveWrapperClass(int.class));
- }
-
- public void testClassIsVariablePrimitiveWrapperClass() {
- assertFalse(ClassTools.classIsVariablePrimitiveWrapperClass(java.lang.Void.class));
-
- assertTrue(ClassTools.classIsVariablePrimitiveWrapperClass(java.lang.Boolean.class));
- assertTrue(ClassTools.classIsVariablePrimitiveWrapperClass(java.lang.Integer.class));
- assertTrue(ClassTools.classIsVariablePrimitiveWrapperClass(java.lang.Float.class));
-
- assertFalse(ClassTools.classIsVariablePrimitiveWrapperClass(java.lang.String.class));
- assertFalse(ClassTools.classIsVariablePrimitiveWrapperClass(void.class));
- assertFalse(ClassTools.classIsVariablePrimitiveWrapperClass(int.class));
- }
-
- public void testClassNamedIsPrimitive() {
- assertTrue(void.class.isPrimitive());
-
- assertTrue(ClassTools.classNamedIsPrimitive(void.class.getName()));
- assertTrue(ClassTools.classNamedIsPrimitive(int.class.getName()));
- assertTrue(ClassTools.classNamedIsPrimitive(float.class.getName()));
- assertTrue(ClassTools.classNamedIsPrimitive(boolean.class.getName()));
-
- assertFalse(ClassTools.classNamedIsPrimitive(java.lang.Number.class.getName()));
- assertFalse(ClassTools.classNamedIsPrimitive(java.lang.String.class.getName()));
- assertFalse(ClassTools.classNamedIsPrimitive(java.lang.Boolean.class.getName()));
- assertFalse(ClassTools.classNamedIsPrimitive(java.lang.Integer.class.getName()));
- }
-
- public void testClassNamedIsVariablePrimitive() {
- assertFalse(ClassTools.classNamedIsVariablePrimitive(void.class.getName()));
-
- assertTrue(ClassTools.classNamedIsVariablePrimitive(int.class.getName()));
- assertTrue(ClassTools.classNamedIsVariablePrimitive(float.class.getName()));
- assertTrue(ClassTools.classNamedIsVariablePrimitive(boolean.class.getName()));
-
- assertFalse(ClassTools.classNamedIsVariablePrimitive(java.lang.Number.class.getName()));
- assertFalse(ClassTools.classNamedIsVariablePrimitive(java.lang.String.class.getName()));
- assertFalse(ClassTools.classNamedIsVariablePrimitive(java.lang.Boolean.class.getName()));
- }
-
- public void testClassNamedIsVariablePrimitiveWrapperClass() {
- assertFalse(ClassTools.classNamedIsVariablePrimitiveWrapperClass(java.lang.Void.class.getName()));
-
- assertTrue(ClassTools.classNamedIsVariablePrimitiveWrapperClass(java.lang.Integer.class.getName()));
- assertTrue(ClassTools.classNamedIsVariablePrimitiveWrapperClass(java.lang.Float.class.getName()));
- assertTrue(ClassTools.classNamedIsVariablePrimitiveWrapperClass(java.lang.Boolean.class.getName()));
-
- assertFalse(ClassTools.classNamedIsVariablePrimitiveWrapperClass(java.lang.Number.class.getName()));
- assertFalse(ClassTools.classNamedIsVariablePrimitiveWrapperClass(java.lang.String.class.getName()));
- assertFalse(ClassTools.classNamedIsVariablePrimitiveWrapperClass(java.lang.Object.class.getName()));
- }
-
- public void testClassForTypeDeclarationStringInt() throws Exception {
- assertEquals(int.class, ClassTools.classForTypeDeclaration("int", 0));
- assertEquals(int[].class, ClassTools.classForTypeDeclaration("int", 1));
- assertEquals(int[][][].class, ClassTools.classForTypeDeclaration("int", 3));
-
- assertEquals(Object.class, ClassTools.classForTypeDeclaration("java.lang.Object", 0));
- assertEquals(Object[][][].class, ClassTools.classForTypeDeclaration("java.lang.Object", 3));
-
- assertEquals(void.class, ClassTools.classForTypeDeclaration("void", 0));
- try {
- ClassTools.classForTypeDeclaration(void.class.getName(), 1);
- fail("should not get here...");
- } catch (ClassNotFoundException ex) {
- // expected
- }
- }
-
- public void testClassNameForTypeDeclarationString() throws Exception {
- assertEquals("int", ClassTools.classNameForTypeDeclaration("int"));
- assertEquals("[I", ClassTools.classNameForTypeDeclaration("int[]"));
- assertEquals("[[I", ClassTools.classNameForTypeDeclaration("int [ ] [ ]"));
-
- assertEquals("java.lang.Object", ClassTools.classNameForTypeDeclaration("java.lang.Object"));
- assertEquals("[Ljava.lang.Object;", ClassTools.classNameForTypeDeclaration("java.lang.Object\t[]"));
- assertEquals("[[Ljava.lang.Object;", ClassTools.classNameForTypeDeclaration("java.lang.Object\t[]\t[]"));
- }
-
- public void testArrayDepthForTypeDeclarationString() throws Exception {
- assertEquals(0, ClassTools.arrayDepthForTypeDeclaration("java.lang.Object"));
- assertEquals(1, ClassTools.arrayDepthForTypeDeclaration("java.lang.Object[]"));
- assertEquals(3, ClassTools.arrayDepthForTypeDeclaration("java.lang.Object[][][]"));
-
- assertEquals(0, ClassTools.arrayDepthForTypeDeclaration("int"));
- assertEquals(1, ClassTools.arrayDepthForTypeDeclaration("int[]"));
- assertEquals(3, ClassTools.arrayDepthForTypeDeclaration("int[][][]"));
-
- assertEquals(0, ClassTools.arrayDepthForTypeDeclaration("float"));
- assertEquals(1, ClassTools.arrayDepthForTypeDeclaration("float [ ]"));
- assertEquals(3, ClassTools.arrayDepthForTypeDeclaration("float[] [] []"));
- }
-
- public void testClassNameForTypeDeclarationStringInt() throws Exception {
- assertEquals(int.class.getName(), ClassTools.classNameForTypeDeclaration("int", 0));
- assertEquals(int[].class.getName(), ClassTools.classNameForTypeDeclaration("int", 1));
- assertEquals(int[][][].class.getName(), ClassTools.classNameForTypeDeclaration("int", 3));
-
- assertEquals(Object.class.getName(), ClassTools.classNameForTypeDeclaration("java.lang.Object", 0));
- assertEquals(Object[][][].class.getName(), ClassTools.classNameForTypeDeclaration("java.lang.Object", 3));
-
- assertEquals(void.class.getName(), ClassTools.classNameForTypeDeclaration("void", 0));
- try {
- ClassTools.classNameForTypeDeclaration(void.class.getName(), 1);
- fail("should not get here...");
- } catch (IllegalArgumentException ex) {
- // expected
- }
- }
-
- private Iterator<String> names(Field[] fields) {
- return new TransformationIterator<Field, String>(CollectionTools.iterator(fields)) {
- @Override
- protected String transform(Field field) {
- return field.getName();
- }
- };
- }
-
- private Iterator<String> names(Method[] methods) {
- return new TransformationIterator<Method, String>(CollectionTools.iterator(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/ClasspathTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClasspathTests.java
deleted file mode 100644
index 4e19dac30c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClasspathTests.java
+++ /dev/null
@@ -1,289 +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.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.Classpath;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-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().path();
- 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().path();
- 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().path();
- 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().path();
- 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().path();
- 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().path();
- 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().path();
- 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().path();
- 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().path();
- 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().path();
- 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 testConvertToClassFileName() {
- char sc = File.separatorChar;
- String fileName = Classpath.convertToClassFileName(java.lang.String.class);
- assertEquals("java" + sc + "lang" + sc + "String.class", fileName);
- }
-
- public void testConvertToJavaFileName() {
- char sc = File.separatorChar;
- String fileName = Classpath.convertToJavaFileName(java.lang.String.class.getName());
- assertEquals("java" + sc + "lang" + sc + "String.java", fileName);
- }
-
- public void testConvertToURLs() {
- 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")).urls();
- int i = 0;
- assertEquals(this.morphURL("/C:/jdk/rt.jar"), entries[i++].getPath());
- assertEquals(this.morphURL("/C:/jdk/i18n.jar"), entries[i++].getPath());
- assertEquals(this.morphURL("/C:/jdk/jaws.jar"), entries[i++].getPath());
- assertEquals(this.morphURL("/C:/foo/classes"), entries[i++].getPath());
- assertEquals(this.morphURL("/C:/bar/bar.jar"), entries[i++].getPath());
- assertEquals(i, entries.length);
- }
-
- public void testEntries() {
- 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;"));
- Classpath.Entry[] entries = cp.entries();
- int i = 0;
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entries[i++].fileName());
- assertEquals(this.morph("."), entries[i++].fileName());
- assertEquals(this.morph("C:\\jdk\\i18n.jar"), entries[i++].fileName());
- assertEquals(this.morph("C:\\jdk\\jaws.jar"), entries[i++].fileName());
- assertEquals(this.morph("C:\\foo\\classes"), entries[i++].fileName());
- assertEquals(this.morph("C:\\bar\\bar.jar"), entries[i++].fileName());
- assertEquals(this.morph("C:\\bar\\bar.jar"), entries[i++].fileName());
- assertEquals(i, entries.length);
-
- cp = cp.compressed();
- entries = cp.entries();
- i = 0;
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entries[i++].fileName());
- assertEquals(this.morph("."), entries[i++].fileName());
- assertEquals(this.morph("C:\\jdk\\i18n.jar"), entries[i++].fileName());
- assertEquals(this.morph("C:\\jdk\\jaws.jar"), entries[i++].fileName());
- assertEquals(this.morph("C:\\foo\\classes"), entries[i++].fileName());
- assertEquals(this.morph("C:\\bar\\bar.jar"), entries[i++].fileName());
- assertEquals(i, entries.length);
- }
-
- public void testEntryForFileNamed() {
- 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")).entryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName());
-
- // 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")).entryForFileNamed("rt.jar");
- assertEquals("rt.jar", entry.fileName());
-
- // 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")).entryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName());
-
- // 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")).entryForFileNamed("rt.jar");
- assertEquals("rt.jar", entry.fileName());
-
- // 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")).entryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName());
-
- // 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")).entryForFileNamed("rt.jar");
- assertEquals("rt.jar", entry.fileName());
-
- // alone - qualified
- entry = new Classpath(this.morph("C:\\jdk\\rt.jar")).entryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName());
-
- // alone - unqualified
- entry = new Classpath("rt.jar").entryForFileNamed("rt.jar");
- assertEquals("rt.jar", entry.fileName());
-
- // 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")).entryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName());
-
- // 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")).entryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName());
-
- // 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")).entryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName());
-
- // 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")).entryForFileNamed("rt.jar");
- assertEquals("path entry should not be found", null, entry);
-
- }
-
- 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().classNames(), java.util.Vector.class.getName()));
- assertTrue("File is missing from JRE class names", CollectionTools.contains(Classpath.bootClasspath().classNames(), 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, CollectionTools.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(), CollectionTools.contains(Classpath.javaExtensionDirectories(), stdExtDir));
- }
-
- //Commented out due to incompatibility with IBM JDK (used in Eclipse WTP Build)
- //TODO Test should be revised to be compatible with IBM JDK
- // public void testJavaExtensionClasspathEntries() {
- // char sep = File.separatorChar;
- // String jdk = System.getProperty("java.version");
- // if (jdk.startsWith("1.4") || jdk.startsWith("1.5")) {
- // Collection jarNames = new ArrayList();
- // Classpath.Entry[] entries = Classpath.javaExtensionClasspath().getEntries();
- // for (int i = 0; i < entries.length; i++) {
- // jarNames.add(entries[i].fileName());
- // }
- // String stdExtJarName = JAVA_HOME + sep + "lib" + sep + "ext" + sep + "dnsns.jar";
- // assertTrue("jdk 1.4.x standard extension jar missing: " + stdExtJarName, jarNames.contains(stdExtJarName));
- // } else {
- // fail("we need to update this test for the current jdk");
- // }
- // }
-
- //Commented out due to incompatibility with IBM JDK (used in Eclipse WTP Build)
- //TODO Test should be revised to be compatible with IBM JDK
- // public void testJavaExtensionClassNames() {
- // String jdk = System.getProperty("java.version");
- // if (jdk.startsWith("1.4") || jdk.startsWith("1.5")) {
- // String className = "sun.net.spi.nameservice.dns.DNSNameService";
- // assertTrue("jdk 1.4.x standard extension class missing: " + className,
- // CollectionTools.contains(Classpath.javaExtensionClasspath().classNames(), className));
- // } 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().classNames(), className));
- }
- }
-
- /**
- * 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 (!CollectionTools.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 (!CollectionTools.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 ce4428b9c0..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CollectionToolsTests.java
+++ /dev/null
@@ -1,3906 +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.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.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.EmptyIterable;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.Range;
-import org.eclipse.jpt.utility.internal.ReverseComparator;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyEnumeration;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-@SuppressWarnings("nls")
-public class CollectionToolsTests extends TestCase {
-
- public CollectionToolsTests(String name) {
- super(name);
- }
-
- public void testAddObjectArrayObject_Object() {
- Object[] a = CollectionTools.add(this.buildObjectArray1(), "twenty");
- assertEquals(4, a.length);
- assertTrue(CollectionTools.contains(a, "twenty"));
- assertEquals("twenty", a[a.length-1]);
- }
-
- public void testAddObjectArrayObject_String() {
- String[] a = CollectionTools.add(this.buildStringArray1(), "twenty");
- assertEquals(4, a.length);
- assertTrue(CollectionTools.contains(a, "twenty"));
- assertEquals("twenty", a[a.length-1]);
- }
-
- public void testAddObjectArrayObject_EmptyArray() {
- String[] a = new String[0];
- a = CollectionTools.add(a, "twenty");
- assertEquals(1, a.length);
- assertTrue(CollectionTools.contains(a, "twenty"));
- assertEquals("twenty", a[0]);
- }
-
- public void testAddObjectArrayIntObject_Object() {
- Object[] a = new Object[] { "a", "b", "c", "d" };
- a = CollectionTools.add(a, 2, "X");
- assertEquals(5, a.length);
- assertTrue(CollectionTools.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 = CollectionTools.add(a, 2, "X");
- assertEquals(5, a.length);
- assertTrue(CollectionTools.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 = CollectionTools.add(a, 4, "X");
- assertEquals(5, a.length);
- assertTrue(CollectionTools.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 = CollectionTools.add(a, 0, "X");
- assertEquals(5, a.length);
- assertTrue(CollectionTools.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 = CollectionTools.add(a, 33, "X");
- } catch (IndexOutOfBoundsException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddCharArrayChar() {
- char[] a = CollectionTools.add(this.buildCharArray(), 'd');
- assertEquals(4, a.length);
- assertTrue(CollectionTools.contains(a, 'd'));
- }
-
- public void testAddCharArrayChar_Empty() {
- char[] a = new char[0];
- a = CollectionTools.add(a, 'd');
- assertEquals(1, a.length);
- assertTrue(CollectionTools.contains(a, 'd'));
- assertTrue(Arrays.equals(new char[] { 'd' }, a));
- }
-
- public void testAddCharArrayIntChar() {
- char[] a = new char[] { 'a', 'b', 'c', 'd' };
- a = CollectionTools.add(a, 2, 'X');
- assertEquals(5, a.length);
- assertTrue(CollectionTools.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 = CollectionTools.add(a, 0, 'X');
- assertEquals(5, a.length);
- assertTrue(CollectionTools.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 = CollectionTools.add(a, 4, 'X');
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, 'X'));
- assertTrue(Arrays.equals(new char[] { 'a', 'b', 'c', 'd', 'X' }, a));
- }
-
- public void testAddIntArrayInt() {
- int[] a = CollectionTools.add(this.buildIntArray(), 30);
- assertEquals(4, a.length);
- assertTrue(CollectionTools.contains(a, 30));
- }
-
- public void testAddIntArrayInt_Empty() {
- int[] a = new int[0];
- a = CollectionTools.add(a, 30);
- assertEquals(1, a.length);
- assertTrue(CollectionTools.contains(a, 30));
- assertTrue(Arrays.equals(new int[] { 30 }, a));
- }
-
- public void testAddIntArrayIntInt() {
- int[] a = new int[] { 1, 2, 3, 4 };
- a = CollectionTools.add(a, 2, 99);
- assertEquals(5, a.length);
- assertTrue(CollectionTools.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 = CollectionTools.add(a, 0, 99);
- assertEquals(5, a.length);
- assertTrue(CollectionTools.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 = CollectionTools.add(a, 4, 99);
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, 99));
- assertTrue(Arrays.equals(new int[] { 1, 2, 3, 4, 99 }, a));
- }
-
- 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.iterator(), 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.iterator(), 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()));
- }
-
- public void testAddAllObjectArrayCollection_String() {
- String[] a = this.buildStringArray1();
- Collection<String> c = this.buildStringList2();
- String[] newArray = CollectionTools.addAll(a, c);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, c));
- }
-
- public void testAddAllObjectArrayCollection_Object() {
- Object[] a = this.buildObjectArray1();
- Collection<String> c = this.buildStringList2();
- Object[] newArray = CollectionTools.addAll(a, c);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, c));
- }
-
- public void testAddAllObjectArrayCollection_EmptyArray() {
- String[] a = new String[0];
- Collection<String> c = this.buildStringList2();
- String[] newArray = CollectionTools.addAll(a, c);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, c));
- }
-
- public void testAddAllObjectArrayCollection_EmptyCollection() {
- String[] a = this.buildStringArray1();
- Collection<String> c = new ArrayList<String>();
- String[] newArray = CollectionTools.addAll(a, c);
-
- assertEquals(3, newArray.length);
- }
-
- public void testAddAllObjectArrayIntCollection_String() {
- String[] a = this.buildStringArray1();
- Collection<String> c = this.buildStringList2();
- String[] newArray = CollectionTools.addAll(a, 1, c);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, c));
- }
-
- public void testAddAllObjectArrayIntCollection_EmptyArray() {
- String[] a = new String[0];
- Collection<String> c = this.buildStringList2();
- String[] newArray = CollectionTools.addAll(a, 0, c);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, c));
- }
-
- public void testAddAllObjectArrayIntCollection_EmptyCollection() {
- String[] a = this.buildStringArray1();
- Collection<String> c = new ArrayList<String>();
- String[] newArray = CollectionTools.addAll(a, 1, c);
-
- assertEquals(3, newArray.length);
- }
-
- public void testAddAllObjectArrayIntIterable_String() {
- String[] a = this.buildStringArray1();
- Iterable<String> iterable = this.buildStringList2();
- String[] newArray = CollectionTools.addAll(a, 1, iterable);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, iterable));
- }
-
- public void testAddAllObjectArrayIntIterable_EmptyArray() {
- String[] a = new String[0];
- Iterable<String> iterable = this.buildStringList2();
- String[] newArray = CollectionTools.addAll(a, 0, iterable);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, iterable));
- }
-
- public void testAddAllObjectArrayIntIterable_EmptyIterable() {
- String[] a = this.buildStringArray1();
- Iterable<String> iterable = new ArrayList<String>();
- String[] newArray = CollectionTools.addAll(a, 1, iterable);
-
- assertEquals(3, newArray.length);
- }
-
- public void testAddAllObjectArrayIntIterableInt_String() {
- String[] a = this.buildStringArray1();
- Iterable<String> iterable = this.buildStringList2();
- String[] newArray = CollectionTools.addAll(a, 1, iterable, 3);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, iterable));
- }
-
- public void testAddAllObjectArrayIntIterableInt_EmptyArray() {
- String[] a = new String[0];
- Iterable<String> iterable = this.buildStringList2();
- String[] newArray = CollectionTools.addAll(a, 0, iterable, 3);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, iterable));
- }
-
- public void testAddAllObjectArrayIntIterableInt_EmptyIterable() {
- String[] a = this.buildStringArray1();
- Iterable<String> iterable = new ArrayList<String>();
- String[] newArray = CollectionTools.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 = CollectionTools.addAll(a, 1, iterator);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList2()));
- }
-
- public void testAddAllObjectArrayIntIterator_EmptyArray() {
- String[] a = new String[0];
- Iterator<String> iterator = this.buildStringList2().iterator();
- String[] newArray = CollectionTools.addAll(a, 0, iterator);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList2()));
- }
-
- public void testAddAllObjectArrayIntIterator_EmptyIterable() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = EmptyIterator.instance();
- String[] newArray = CollectionTools.addAll(a, 1, iterator);
-
- assertEquals(3, newArray.length);
- }
-
- public void testAddAllObjectArrayIntIteratorInt_String() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = this.buildStringList2().iterator();
- String[] newArray = CollectionTools.addAll(a, 1, iterator, 3);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList2()));
- }
-
- public void testAddAllObjectArrayIntIteratorInt_EmptyArray() {
- String[] a = new String[0];
- Iterator<String> iterator = this.buildStringList2().iterator();
- String[] newArray = CollectionTools.addAll(a, 0, iterator, 3);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList2()));
- }
-
- public void testAddAllObjectArrayIntIteratorInt_EmptyIterator() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = EmptyIterator.instance();
- String[] newArray = CollectionTools.addAll(a, 1, iterator, 0);
-
- assertEquals(3, newArray.length);
- }
-
- public void testAddAllObjectArrayIterable() {
- String[] a = this.buildStringArray1();
- Iterable<String> iterable = this.buildStringList1();
- String[] newArray = CollectionTools.addAll(a, iterable);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList1()));
- }
-
- public void testAddAllObjectArrayIterableInt() {
- String[] a = this.buildStringArray1();
- Iterable<String> iterable = this.buildStringList1();
- String[] newArray = CollectionTools.addAll(a, iterable, 33);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList1()));
- }
-
- public void testAddAllObjectArrayIterator_String() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = this.buildStringList1().iterator();
- String[] newArray = CollectionTools.addAll(a, iterator);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList1()));
- }
-
- public void testAddAllObjectArrayIterator_Object() {
- String[] a = this.buildStringArray1();
- Iterator<Object> iterator = this.buildObjectList1().iterator();
- Object[] newArray = CollectionTools.addAll(a, iterator);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildObjectList1()));
- }
-
- public void testAddAllObjectArrayIterator_EmptyIterator() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = EmptyIterator.instance();
- String[] newArray = CollectionTools.addAll(a, iterator);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList1()));
- }
-
- public void testAddAllObjectArrayIteratorInt() {
- String[] a = this.buildStringArray1();
- Iterator<Object> iterator = this.buildObjectList1().iterator();
- Object[] newArray = CollectionTools.addAll(a, iterator, 3);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildObjectList1()));
- }
-
- public void testAddAllObjectArrayIteratorInt_EmptyIterator() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = EmptyIterator.instance();
- String[] newArray = CollectionTools.addAll(a, iterator, 0);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList1()));
- }
-
- public void testAddAllObjectArrayObjectArray_Object() {
- Object[] a1 = this.buildObjectArray1();
- Object[] a2 = this.buildObjectArray2();
- Object[] newArray = CollectionTools.addAll(a1, a2);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, a1));
- assertTrue(CollectionTools.containsAll(newArray, a2));
- }
-
- public void testAddAllObjectArrayObjectArray_String() {
- String[] a1 = this.buildStringArray1();
- String[] a2 = this.buildStringArray2();
- String[] newArray = CollectionTools.addAll(a1, a2);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, a1));
- assertTrue(CollectionTools.containsAll(newArray, a2));
- }
-
- public void testAddAllObjectArrayObjectArray_ObjectString() {
- Object[] a1 = this.buildObjectArray1();
- String[] a2 = this.buildStringArray2();
- Object[] newArray = CollectionTools.addAll(a1, a2);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, a1));
- assertTrue(CollectionTools.containsAll(newArray, a2));
- }
-
- public void testAddAllObjectArrayObjectArray_EmptyArray1() {
- Object[] a1 = new Object[0];
- Object[] a2 = this.buildObjectArray2();
- Object[] newArray = CollectionTools.addAll(a1, a2);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, a2));
- }
-
- public void testAddAllObjectArrayObjectArray_EmptyArray2() {
- Object[] a1 = this.buildObjectArray1();
- Object[] a2 = new Object[0];
- Object[] newArray = CollectionTools.addAll(a1, a2);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, a1));
- }
-
- public void testAddAllObjectArrayIntObjectArray_Object() {
- Object[] a = new Object[] { "a", "b", "c", "d" };
- a = CollectionTools.addAll(a, 2, new Object[] { "X", "X", "X" });
- assertEquals(7, a.length);
- assertTrue(CollectionTools.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 = CollectionTools.addAll(a, 2, new String[] { "X", "X", "X" });
- assertEquals(7, a.length);
- assertTrue(CollectionTools.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 = CollectionTools.addAll(a, 2, new String[] { "X", "X", "X" });
- assertEquals(7, a.length);
- assertTrue(CollectionTools.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 = CollectionTools.addAll(a, 4, new String[] { "X", "X", "X" });
- assertEquals(7, a.length);
- assertTrue(CollectionTools.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 = CollectionTools.addAll(a, 0, new String[] { "X", "X", "X" });
- assertEquals(3, a.length);
- assertTrue(CollectionTools.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 = CollectionTools.addAll(a, 4, 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 = CollectionTools.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 = CollectionTools.addAll(this.buildCharArray(), new char[] { 'd', 'e' });
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, 'd'));
- assertTrue(CollectionTools.contains(a, 'e'));
- }
-
- public void testAddAllCharArrayCharArray_EmptyArray2() {
- char[] a = CollectionTools.addAll(this.buildCharArray(), new char[0]);
- assertEquals(3, a.length);
- }
-
- public void testAddAllCharArrayCharArrayEmptyArray1() {
- char[] a = CollectionTools.addAll(new char[0], new char[] { 'd', 'e' });
- assertEquals(2, a.length);
- assertTrue(CollectionTools.contains(a, 'd'));
- assertTrue(CollectionTools.contains(a, 'e'));
- }
-
- public void testAddAllCharArrayIntCharArray() {
- char[] a = new char[] { 'a', 'b', 'c', 'd' };
- a = CollectionTools.addAll(a, 2, new char[] { 'X', 'X', 'X' });
- assertEquals(7, a.length);
- assertTrue(CollectionTools.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 = CollectionTools.addAll(a, 4, new char[] { 'X', 'X', 'X' });
- assertEquals(7, a.length);
- assertTrue(CollectionTools.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 = CollectionTools.addAll(a, 0, new char[] { 'X', 'X', 'X' });
- assertEquals(3, a.length);
- assertTrue(CollectionTools.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 = CollectionTools.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 = CollectionTools.addAll(this.buildIntArray(), new int[] { 30, 40 });
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, 30));
- assertTrue(CollectionTools.contains(a, 40));
- }
-
- public void testAddAllIntArrayIntArray_EmptyArray2() {
- int[] a = CollectionTools.addAll(this.buildIntArray(), new int[0]);
- assertEquals(3, a.length);
- }
-
- public void testAddAllIntArrayIntArray_EmptyArray1() {
- int[] a = CollectionTools.addAll(new int[0], new int[] { 30, 40 });
- assertEquals(2, a.length);
- assertTrue(CollectionTools.contains(a, 30));
- assertTrue(CollectionTools.contains(a, 40));
- }
-
- public void testAddAllIntArrayIntIntArray() {
- int[] a = new int[] { 1, 2, 3, 4 };
- a = CollectionTools.addAll(a, 2, new int[] { 99, 99, 99 });
- assertEquals(7, a.length);
- assertTrue(CollectionTools.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 = CollectionTools.addAll(a, 4, new int[] { 99, 99, 99 });
- assertEquals(7, a.length);
- assertTrue(CollectionTools.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 = CollectionTools.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 = CollectionTools.addAll(a, 0, new int[] { 99, 99, 99 });
- assertEquals(3, a.length);
- assertTrue(CollectionTools.contains(a, 99));
- assertTrue(Arrays.equals(new int[] { 99, 99, 99 }, a));
- }
-
- public void testArrayIterable() {
- Iterable<String> iterable = this.buildStringList1();
- Object[] a = CollectionTools.array(iterable);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIterableInt() {
- Iterable<String> iterable = this.buildStringList1();
- Object[] a = CollectionTools.array(iterable, 3);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIterableObjectArray_String() {
- Iterable<String> iterable = this.buildStringList1();
- String[] a = CollectionTools.array(iterable, new String[0]);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIterableObjectArray_Object() {
- Iterable<String> iterable = this.buildStringList1();
- Object[] a = CollectionTools.array(iterable, new Object[0]);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIterableIntObjectArray() {
- Iterable<String> iterable = this.buildStringList1();
- String[] a = CollectionTools.array(iterable, 3, new String[0]);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIterator() {
- Object[] a = CollectionTools.array(this.buildStringList1().iterator());
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIterator_Empty() {
- Object[] a = CollectionTools.array(EmptyIterator.instance());
- assertEquals(0, a.length);
- }
-
- public void testArrayIteratorInt() {
- Object[] a = CollectionTools.array(this.buildStringList1().iterator(), 3);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIteratorInt_Empty() {
- Object[] a = CollectionTools.array(EmptyIterator.instance(), 3);
- assertEquals(0, a.length);
- }
-
- public void testArrayIteratorObjectArray_String() {
- String[] a = CollectionTools.array(this.buildStringList1().iterator(), new String[0]);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIteratorObjectArray_Empty() {
- String[] a = CollectionTools.array(EmptyIterator.<String>instance(), new String[0]);
- assertEquals(0, a.length);
- }
-
- public void testArrayIteratorObjectArray_Object() {
- Object[] a = CollectionTools.array(this.buildStringList1().iterator(), new Object[0]);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIteratorIntObjectArray() {
- String[] a = CollectionTools.array(this.buildStringList1().iterator(), 3, new String[0]);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIteratorIntObjectArray_Empty() {
- String[] a = CollectionTools.array(EmptyIterator.<String>instance(), 3, new String[0]);
- assertEquals(0, a.length);
- }
-
- 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, 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());
- }
-
- public void testClearObjectArray() {
- String[] a = this.buildStringArray1();
- assertEquals(3, a.length);
- a = CollectionTools.clear(a);
- assertEquals(0, a.length);
- }
-
- public void testClearObjectArray_Empty() {
- String[] a = new String[0];
- assertEquals(0, a.length);
- a = CollectionTools.clear(a);
- assertEquals(0, a.length);
- }
-
- 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, this.buildStringArray1()));
- }
-
- 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));
- }
-
- public void testContainsObjectArrayObject() {
- Object[] a = this.buildObjectArray1();
- assertTrue(CollectionTools.contains(a, "one"));
- assertFalse(CollectionTools.contains(a, null));
- Object[] a2 = CollectionTools.add(a, null);
- assertTrue(CollectionTools.contains(a2, null));
- }
-
- public void testContainsCharArrayChar() {
- char[] a = this.buildCharArray();
- assertTrue(CollectionTools.contains(a, 'a'));
- assertFalse(CollectionTools.contains(a, 'z'));
- char[] a2 = CollectionTools.add(a, 'z');
- assertTrue(CollectionTools.contains(a2, 'z'));
- }
-
- public void testContainsIntArrayInt() {
- int[] a = this.buildIntArray();
- assertTrue(CollectionTools.contains(a, 10));
- assertFalse(CollectionTools.contains(a, 55));
- int[] a2 = CollectionTools.add(a, 55);
- assertTrue(CollectionTools.contains(a2, 55));
- }
-
- 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()));
- }
-
- public void testContainsAllObjectArrayCollection() {
- assertTrue(CollectionTools.containsAll(this.buildObjectArray1(), this.buildStringList1()));
- assertFalse(CollectionTools.containsAll(this.buildObjectArray1(), this.buildStringList2()));
- }
-
- public void testContainsAllObjectArrayIterable() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(this.buildObjectArray1(), iterable));
- iterable = this.buildStringList2();
- assertFalse(CollectionTools.containsAll(this.buildObjectArray1(), iterable));
- }
-
- public void testContainsAllObjectArrayIterator() {
- assertTrue(CollectionTools.containsAll(this.buildObjectArray1(), this.buildStringList1().iterator()));
- assertFalse(CollectionTools.containsAll(this.buildObjectArray1(), this.buildStringList2().iterator()));
- }
-
- public void testContainsAllObjectArrayIterator_Empty() {
- assertTrue(CollectionTools.containsAll(this.buildObjectArray1(), EmptyIterator.instance()));
- }
-
- public void testContainsAllObjectArrayObjectArray() {
- assertTrue(CollectionTools.containsAll(this.buildObjectArray1(), this.buildObjectArray1()));
- assertFalse(CollectionTools.containsAll(this.buildObjectArray1(), this.buildObjectArray2()));
- }
-
- public void testContainsAllCharArrayCharArray() {
- assertTrue(CollectionTools.containsAll(this.buildCharArray(), this.buildCharArray()));
- assertFalse(CollectionTools.containsAll(this.buildCharArray(), new char[] { 'x', 'y' }));
- }
-
- public void testContainsAllIntArrayIntArray() {
- assertTrue(CollectionTools.containsAll(this.buildIntArray(), this.buildIntArray()));
- assertFalse(CollectionTools.containsAll(this.buildIntArray(), new int[] { 444, 888 }));
- }
-
- 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, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { a };
- array2 = new String[] { a_ };
- assertEquals(-1, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(4, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, d_, e_ };
- assertEquals(4, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[0];
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(4, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[0];
- assertEquals(4, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[0];
- array2 = new String[0];
- assertEquals(-1, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, a_, d_, e_ };
- assertEquals(2, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, c_, d_, e_ };
- assertEquals(0, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(3, CollectionTools.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, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(2, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, null, d_, e_ };
- assertEquals(-1, CollectionTools.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), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { a };
- array2 = new String[] { a_ };
- assertEquals(new Range(1, -1), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(0, 4), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, d_, e_ };
- assertEquals(new Range(0, 4), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[0];
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(0, 4), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[0];
- assertEquals(new Range(0, 4), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[0];
- array2 = new String[0];
- assertEquals(new Range(0, -1), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, a_, d_, e_ };
- assertEquals(new Range(0, 2), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, c_, d_, e_ };
- assertEquals(new Range(0, 0), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { a, b, c, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(new Range(3, 3), CollectionTools.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), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(2, 2), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, null, d_, e_ };
- assertEquals(new Range(5, -1), CollectionTools.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, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { a };
- array2 = new String[] { a_ };
- assertEquals(1, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(4, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(4, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[0];
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(0, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[0];
- assertEquals(0, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[0];
- array2 = new String[0];
- assertEquals(0, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, e_, c_, d_ };
- assertEquals(2, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, c, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(3, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, c_, d_, e_ };
- assertEquals(0, CollectionTools.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, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(2, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, null, d_, e_ };
- assertEquals(5, CollectionTools.diffStart(array1, array2));
- }
-
- public void testEqualsIteratorIterator() {
- 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.identical(list1.listIterator(), list2.listIterator()));
- assertTrue(CollectionTools.equals(list1.listIterator(), list2.listIterator()));
- }
-
- public void testGetListIteratorInt() {
- List<String> list = this.buildStringList1();
- String o = CollectionTools.get(list.listIterator(), 1);
- assertEquals("one", o);
- list.add(null);
- o = CollectionTools.get(list.listIterator(), list.size() - 1);
- assertNull(o);
-
- boolean exCaught = false;
- try {
- CollectionTools.get(list.listIterator(), list.size());
- } catch (IndexOutOfBoundsException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testIdenticalObjectArrayObjectArray() {
- 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(CollectionTools.identical(a1, a2));
- a2[2] = "2000";
- assertFalse(CollectionTools.identical(a1, a2));
- assertTrue(Arrays.equals(a1, a2));
- }
-
- public void testIdenticalObjectArrayObjectArray_BothNull() {
- Object[] a1 = null;
- Object[] a2 = null;
- assertTrue(CollectionTools.identical(a1, a2));
- }
-
- public void testIdenticalObjectArrayObjectArray_OneNull() {
- Object[] a1 = null;
- Object[] a2 = new Object[0];
- assertFalse(CollectionTools.identical(a1, a2));
- }
-
- public void testIdenticalObjectArrayObjectArray_DifferentLengths() {
- Object[] a1 = new String[] {"foo", "bar"};
- Object[] a2 = new String[] {"foo", "bar", "baz"};
- assertFalse(CollectionTools.identical(a1, a2));
- }
-
- public void testIdenticalListIteratorListIterator() {
- 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.identical(list1.listIterator(), list2.listIterator()));
- assertTrue(CollectionTools.equals(list1.listIterator(), list2.listIterator()));
- }
-
- public void testIdenticalListIteratorListIterator_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.identical(list1.listIterator(), list2.listIterator()));
- assertFalse(CollectionTools.equals(list1.listIterator(), list2.listIterator()));
- }
-
- public void testIdenticalListIteratorListIterator_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.identical(list1.listIterator(), list2.listIterator()));
- assertFalse(CollectionTools.equals(list1.listIterator(), list2.listIterator()));
- }
-
- 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, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a };
- array2 = new String[] { a_ };
- assertEquals(-1, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(4, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, d_, e_ };
- assertEquals(4, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[0];
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(4, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[0];
- assertEquals(4, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[0];
- array2 = new String[0];
- assertEquals(-1, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, a_, d_, e_ };
- assertEquals(2, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, c_, d_, e_ };
- assertEquals(0, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(3, CollectionTools.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, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(2, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, null, d_, e_ };
- assertEquals(-1, CollectionTools.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), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a };
- array2 = new String[] { a_ };
- assertEquals(new Range(1, -1), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(0, 4), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, d_, e_ };
- assertEquals(new Range(0, 4), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[0];
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(0, 4), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[0];
- assertEquals(new Range(0, 4), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[0];
- array2 = new String[0];
- assertEquals(new Range(0, -1), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, a_, d_, e_ };
- assertEquals(new Range(0, 2), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, c_, d_, e_ };
- assertEquals(new Range(0, 0), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a, b, c, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(new Range(3, 3), CollectionTools.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), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(2, 2), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, null, d_, e_ };
- assertEquals(new Range(5, -1), CollectionTools.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, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a };
- array2 = new String[] { a_ };
- assertEquals(1, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(4, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(4, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[0];
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(0, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[0];
- assertEquals(0, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[0];
- array2 = new String[0];
- assertEquals(0, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, e_, c_, d_ };
- assertEquals(2, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, c, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(3, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, c_, d_, e_ };
- assertEquals(0, CollectionTools.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, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(2, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, null, d_, e_ };
- assertEquals(5, CollectionTools.identityDiffStart(array1, array2));
- }
-
- public void testIndexOfListIteratorObject_String() {
- List<String> list = this.buildStringList1();
- assertEquals(1, CollectionTools.indexOf(list.listIterator(), "one"));
- }
-
- public void testIndexOfListIteratorObject_Null() {
- List<String> list = this.buildStringList1();
- list.add(null);
- assertEquals(list.size() - 1, CollectionTools.indexOf(list.listIterator(), null));
- }
-
- public void testIndexOfListIteratorObject_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.listIterator(), one));
- list.add(null);
- assertEquals(list.size() - 1, CollectionTools.indexOf(list.listIterator(), null));
- }
-
- public void testIndexOfObjectArrayObject() {
- Object[] a = this.buildObjectArray1();
- assertEquals(1, CollectionTools.indexOf(a, "one"));
- }
-
- public void testIndexOfObjectArrayObject_Null() {
- Object[] a = this.buildObjectArray1();
- a = CollectionTools.add(a, null);
- assertEquals(a.length - 1, CollectionTools.indexOf(a, null));
- }
-
- public void testIndexOfCharArrayChar() {
- char[] a = this.buildCharArray();
- assertEquals(1, CollectionTools.indexOf(a, 'b'));
- a = CollectionTools.add(a, 'd');
- assertEquals(a.length - 1, CollectionTools.indexOf(a, 'd'));
- }
-
- public void testIndexOfIntArrayInt() {
- int[] a = this.buildIntArray();
- assertEquals(1, CollectionTools.indexOf(a, 10));
- a = CollectionTools.add(a, 30);
- assertEquals(a.length - 1, CollectionTools.indexOf(a, 30));
- }
-
- 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));
- }
-
- public void testInsertionIndexOfObjectArrayComparable() {
- String[] a = new String[] { "A", "C", "D" };
- assertEquals(1, CollectionTools.insertionIndexOf(a, "B"));
-
- a = new String[] { "A", "B", "C", "D" };
- assertEquals(2, CollectionTools.insertionIndexOf(a, "B"));
-
- a = new String[] { "A", "B", "B", "B", "C", "D" };
- assertEquals(4, CollectionTools.insertionIndexOf(a, "B"));
-
- a = new String[] { "A", "B", "B", "B", "C", "D" };
- assertEquals(6, CollectionTools.insertionIndexOf(a, "E"));
-
- a = new String[] { "B", "B", "B", "C", "D" };
- assertEquals(0, CollectionTools.insertionIndexOf(a, "A"));
-
- a = new String[] { "A", "A", "B", "B", "C", "D" };
- assertEquals(2, CollectionTools.insertionIndexOf(a, "A"));
- }
-
- public void testInsertionIndexOfObjectArrayObjectComparator() {
- Comparator<String> c = new ReverseComparator<String>();
- String[] a = new String[] { "D", "C", "A" };
- assertEquals(2, CollectionTools.insertionIndexOf(a, "B", c));
-
- a = new String[] { "D", "C", "B", "A" };
- assertEquals(3, CollectionTools.insertionIndexOf(a, "B", c));
-
- a = new String[] { "D", "C", "B", "B", "B", "A" };
- assertEquals(5, CollectionTools.insertionIndexOf(a, "B", c));
-
- a = new String[] { "D", "C", "B", "B", "B", "A" };
- assertEquals(0, CollectionTools.insertionIndexOf(a, "E", c));
-
- a = new String[] { "D", "C", "B", "B", "B" };
- assertEquals(5, CollectionTools.insertionIndexOf(a, "A", c));
-
- a = new String[] { "D", "C", "B", "B", "A", "A" };
- assertEquals(6, CollectionTools.insertionIndexOf(a, "A", c));
- }
-
- 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 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());
- }
- }
-
- public void testLastIndexOfIteratorObject() {
- List<String> list = this.buildStringList1();
- assertEquals(1, CollectionTools.lastIndexOf(list.listIterator(), "one"));
- list.add(null);
- assertEquals(list.size() - 1, CollectionTools.lastIndexOf(list.listIterator(), null));
- }
-
- public void testLastIndexOfIteratorObject_Empty() {
- assertEquals(-1, CollectionTools.lastIndexOf(EmptyIterator.instance(), "foo"));
- }
-
- public void testLastIndexOfObjectArrayObject() {
- Object[] a = this.buildObjectArray1();
- assertEquals(1, CollectionTools.lastIndexOf(a, "one"));
- }
-
- public void testLastIndexOfObjectArrayObject_Null() {
- Object[] a = this.buildObjectArray1();
- a = CollectionTools.add(a, null);
- assertEquals(a.length - 1, CollectionTools.lastIndexOf(a, null));
- }
-
- public void testLastIndexOfCharArrayChar() {
- char[] a = this.buildCharArray();
- assertEquals(1, CollectionTools.lastIndexOf(a, 'b'));
- a = CollectionTools.add(a, 'd');
- assertEquals(a.length - 1, CollectionTools.lastIndexOf(a, 'd'));
- }
-
- public void testLastIndexOfIntArrayInt() {
- int[] a = this.buildIntArray();
- assertEquals(1, CollectionTools.lastIndexOf(a, 10));
- a = CollectionTools.add(a, 30);
- assertEquals(a.length - 1, CollectionTools.lastIndexOf(a, 30));
- }
-
- 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());
- }
- }
-
- public void testMaxCharArray() {
- assertEquals('c', CollectionTools.max(this.buildCharArray()));
- }
-
- public void testMaxIntArray() {
- assertEquals(20, CollectionTools.max(this.buildIntArray()));
- }
-
- public void testMinCharArray() {
- assertEquals('a', CollectionTools.min(this.buildCharArray()));
- }
-
- public void testMinIntArray() {
- assertEquals(0, CollectionTools.min(this.buildIntArray()));
- }
-
- public void testMoveObjectArrayIntInt() {
- String[] array = new String[] { "0", "1", "2", "3", "4", "5" };
-
- String[] result = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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));
- }
-
- 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()));
- }
-
- 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 = CollectionTools.removeAll(a1, 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 = CollectionTools.removeAll(a1, 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 = CollectionTools.removeAll(a1, 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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.removeAll(a1, iterable.iterator());
- assertTrue(Arrays.equals(new String[] { "A", "A", "C", "C", "D", "D", "F", "F" }, 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 = CollectionTools.removeAll(a1, iterable.iterator(), 7);
- assertTrue(Arrays.equals(new String[] { "A", "A", "C", "C", "D", "D", "F", "F" }, 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 = CollectionTools.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 = CollectionTools.removeAll(a1, collection);
- assertTrue(Arrays.equals(a1, a3));
- }
-
- 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 = CollectionTools.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' }, CollectionTools.removeAll(a1, a2)));
- }
-
- public void testRemoveAllCharArrayCharArray_Empty() {
- 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, CollectionTools.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, CollectionTools.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 }, CollectionTools.removeAll(a1, a2)));
- }
-
- public void testRemoveAllIntArrayIntArray_Empty() {
- 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, CollectionTools.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, CollectionTools.removeAll(a1, a2)));
- }
-
- public void testRemoveObjectArrayObject_Object() {
- Object[] a = this.buildObjectArray1();
- a = CollectionTools.add(a, "three");
- a = CollectionTools.add(a, "four");
- a = CollectionTools.add(a, "five");
-
- assertEquals(6, a.length);
- assertTrue(CollectionTools.contains(a, "three"));
- a = CollectionTools.remove(a, "three");
- assertEquals(5, a.length);
- assertFalse(CollectionTools.contains(a, "three"));
- assertTrue(CollectionTools.contains(a, "four"));
- assertTrue(CollectionTools.contains(a, "five"));
- }
-
- public void testRemoveObjectArrayObject_String() {
- String[] a = this.buildStringArray1();
- a = CollectionTools.add(a, "three");
- a = CollectionTools.add(a, "four");
- a = CollectionTools.add(a, "five");
-
- assertEquals(6, a.length);
- assertTrue(CollectionTools.contains(a, "three"));
- a = CollectionTools.remove(a, "three");
- assertEquals(5, a.length);
- assertFalse(CollectionTools.contains(a, "three"));
- assertTrue(CollectionTools.contains(a, "four"));
- assertTrue(CollectionTools.contains(a, "five"));
- }
-
- public void testRemoveCharArrayChar() {
- char[] a = this.buildCharArray();
- a = CollectionTools.add(a, 'd');
- a = CollectionTools.add(a, 'e');
- a = CollectionTools.add(a, 'f');
-
- assertEquals(6, a.length);
- assertTrue(CollectionTools.contains(a, 'd'));
- a = CollectionTools.remove(a, 'd');
- assertEquals(5, a.length);
- assertFalse(CollectionTools.contains(a, 'd'));
- assertTrue(CollectionTools.contains(a, 'e'));
- assertTrue(CollectionTools.contains(a, 'f'));
- }
-
- public void testRemoveIntArrayInt() {
- int[] a = this.buildIntArray();
- a = CollectionTools.add(a, 30);
- a = CollectionTools.add(a, 40);
- a = CollectionTools.add(a, 50);
-
- assertEquals(6, a.length);
- assertTrue(CollectionTools.contains(a, 30));
- a = CollectionTools.remove(a, 30);
- assertEquals(5, a.length);
- assertFalse(CollectionTools.contains(a, 30));
- assertTrue(CollectionTools.contains(a, 40));
- assertTrue(CollectionTools.contains(a, 50));
- }
-
- 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, 3));
- 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, 3));
- 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);
- }
-
- 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 testRemoveAllCollectionIteratotInt() {
- 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, 2));
- 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);
- }
-
- 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, 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, 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, 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, a));
- }
-
- 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());
- }
-
- public void testRemoveAllOccurrencesObjectArrayObject() {
- String[] a = this.buildStringArray1();
- assertEquals(3, a.length);
- a = CollectionTools.removeAllOccurrences(a, "three");
- assertEquals(3, a.length);
- a = CollectionTools.removeAllOccurrences(a, "two");
- assertEquals(2, a.length);
- a = CollectionTools.removeAllOccurrences(a, "two");
- assertEquals(2, a.length);
-
- a = CollectionTools.add(a, "five");
- a = CollectionTools.add(a, "five");
- a = CollectionTools.add(a, "five");
- assertEquals(5, a.length);
- a = CollectionTools.removeAllOccurrences(a, "five");
- assertEquals(2, a.length);
- a = CollectionTools.removeAllOccurrences(a, "five");
- assertEquals(2, a.length);
-
- a = CollectionTools.add(a, null);
- a = CollectionTools.add(a, null);
- a = CollectionTools.add(a, null);
- assertEquals(5, a.length);
- a = CollectionTools.removeAllOccurrences(a, null);
- assertEquals(2, a.length);
- a = CollectionTools.removeAllOccurrences(a, null);
- assertEquals(2, a.length);
- }
-
- public void testRemoveAllOccurrencesCharArrayChar() {
- char[] a = this.buildCharArray();
- assertEquals(3, a.length);
- a = CollectionTools.removeAllOccurrences(a, 'd');
- assertEquals(3, a.length);
- a = CollectionTools.removeAllOccurrences(a, 'b');
- assertEquals(2, a.length);
- a = CollectionTools.removeAllOccurrences(a, 'b');
- assertEquals(2, a.length);
-
- a = CollectionTools.add(a, 'g');
- a = CollectionTools.add(a, 'g');
- a = CollectionTools.add(a, 'g');
- assertEquals(5, a.length);
- a = CollectionTools.removeAllOccurrences(a, 'g');
- assertEquals(2, a.length);
- a = CollectionTools.removeAllOccurrences(a, 'g');
- assertEquals(2, a.length);
- }
-
- public void testRemoveAllOccurrencesIntArrayInt() {
- int[] a = this.buildIntArray();
- assertEquals(3, a.length);
- a = CollectionTools.removeAllOccurrences(a, 55);
- assertEquals(3, a.length);
- a = CollectionTools.removeAllOccurrences(a, 10);
- assertEquals(2, a.length);
- a = CollectionTools.removeAllOccurrences(a, 10);
- assertEquals(2, a.length);
-
- a = CollectionTools.add(a, 77);
- a = CollectionTools.add(a, 77);
- a = CollectionTools.add(a, 77);
- assertEquals(5, a.length);
- a = CollectionTools.removeAllOccurrences(a, 77);
- assertEquals(2, a.length);
- a = CollectionTools.removeAllOccurrences(a, 77);
- assertEquals(2, a.length);
- }
-
- public void testRemoveElementAtIndexObjectArrayInt() {
- String[] a = new String[] { "A", "B", "A", "C", "A", "D" };
- a = CollectionTools.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 = CollectionTools.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 = CollectionTools.removeElementsAtIndex(a, 3, 3);
- assertTrue(Arrays.equals(new int[] { 8, 6, 7 }, a));
- }
-
- 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()));
- }
-
- public void testRemoveElementsAtIndexObjectArrayIntInt() {
- String[] a = new String[] { "A", "B", "A", "C", "A", "D" };
- a = CollectionTools.removeElementsAtIndex(a, 3, 2);
- assertTrue(Arrays.equals(new String[] { "A", "B", "A", "D" }, a));
- }
-
- public void testRemoveElementsAtIndexObjectArrayIntInt_Empty() {
- String[] a = new String[] { "A", "B", "A", "C", "A", "D" };
- a = CollectionTools.removeElementsAtIndex(a, 0, 6);
- assertEquals(0, a.length);
- }
-
- public void testRemoveElementsAtIndexCharArrayIntInt() {
- char[] a = new char[] { 'A', 'B', 'A', 'C', 'A', 'D' };
- a = CollectionTools.removeElementsAtIndex(a, 0, 5);
- assertTrue(Arrays.equals(new char[] { 'D' }, a));
- }
-
- public void testRemoveElementsAtIndexCharArrayIntInt_Empty() {
- char[] a = new char[] { 'A', 'B', 'A', 'C', 'A', 'D' };
- a = CollectionTools.removeElementsAtIndex(a, 0, 6);
- assertEquals(0, a.length);
- }
-
- public void testRemoveElementsAtIndexIntArrayIntInt() {
- int[] a = new int[] { 8, 6, 7, 33, 2, 11 };
- a = CollectionTools.removeElementsAtIndex(a, 3, 3);
- assertTrue(Arrays.equals(new int[] { 8, 6, 7 }, a));
- }
-
- public void testRemoveElementsAtIndexIntArrayIntInt_Empty() {
- int[] a = new int[] { 8, 6, 7, 33, 2, 11 };
- a = CollectionTools.removeElementsAtIndex(a, 0, 6);
- assertEquals(0, a.length);
- }
-
- public void testReplaceAllObjectArrayObjectObject_Object() {
- Object[] a = new Object[] { "A", "B", "A", "C", "A", "D" };
- a = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.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 = CollectionTools.replaceAll(a, 0, 13);
- assertTrue(Arrays.equals(new int[] { 13, 1, 13, 7, 13, 99 }, a));
- }
-
- 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 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 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, new String[] { "foo" }));
- assertEquals(0, c.size());
- }
-
- 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" }, CollectionTools.retainAll(a1, a2)));
- }
-
- public void testRetainAllObjectArrayObjectArray_EmptyObjectArray1() {
- String[] a1 = new String[0];
- String[] a2 = new String[] { "E", "B", "" };
- String[] a3 = CollectionTools.retainAll(a1, a2);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayObjectArray_EmptyObjectArray2() {
- String[] a1 = new String[] { "E", "B", "" };
- String[] a2 = new String[0];
- String[] a3 = CollectionTools.retainAll(a1, a2);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayObjectArray_BothEmpty() {
- String[] a1 = new String[0];
- String[] a2 = new String[0];
- String[] a3 = CollectionTools.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" }, CollectionTools.retainAll(a1, iterable)));
- }
-
- public void testRetainAllObjectArrayIterable_EmptyObjectArray() {
- String[] a1 = new String[0];
- Iterable<String> iterable = Arrays.asList(new String[] { "E", "B", "" });
- String[] a3 = CollectionTools.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" }, CollectionTools.retainAll(a1, iterable, 3)));
- }
-
- public void testRetainAllObjectArrayIterableInt_EmptyObjectArray() {
- String[] a1 = new String[0];
- Iterable<String> iterable = Arrays.asList(new String[] { "E", "B", "" });
- String[] a3 = CollectionTools.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" }, CollectionTools.retainAll(a1, iterator)));
- }
-
- public void testRetainAllObjectArrayIterator_EmptyObjectArray() {
- String[] a1 = new String[0];
- Iterator<String> iterator = Arrays.asList(new String[] { "E", "B", "" }).iterator();
- String[] a3 = CollectionTools.retainAll(a1, iterator);
- assertEquals(0, a3.length);
- }
-
- 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" }, CollectionTools.retainAll(a1, iterator, 3)));
- }
-
- public void testRetainAllObjectArrayIteratorInt_EmptyObjectArray() {
- String[] a1 = new String[0];
- Iterator<String> iterator = Arrays.asList(new String[] { "E", "B", "" }).iterator();
- String[] a3 = CollectionTools.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" }, CollectionTools.retainAll(a1, collection)));
- }
-
- public void testRetainAllObjectArrayCollection_EmptyObjectArray() {
- String[] a1 = new String[0];
- Collection<String> collection = Arrays.asList(new String[] { "E", "B", "" });
- String[] a3 = CollectionTools.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 = CollectionTools.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, CollectionTools.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' }, CollectionTools.retainAll(a1, a2)));
- }
-
- public void testRetainAllCharArrayCharArray_EmptyCharArray1() {
- char[] a1 = new char[0];
- char[] a2 = new char[] { 'E', 'B' };
- assertSame(a1, CollectionTools.retainAll(a1, a2));
- }
-
- public void testRetainAllCharArrayCharArray_EmptyCharArray2() {
- char[] a1 = new char[] { 'E', 'B' };
- char[] a2 = new char[0];
- assertEquals(0, CollectionTools.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, CollectionTools.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 }, CollectionTools.retainAll(a1, a2)));
- }
-
- public void testRetainAllIntArrayIntArray_EmptyIntArray1() {
- int[] a1 = new int[0];
- int[] a2 = new int[] { 5, 2 };
- assertSame(a1, CollectionTools.retainAll(a1, a2));
- }
-
- public void testRetainAllIntArrayIntArray_EmptyIntArray2() {
- int[] a1 = new int[] { 5, 2 };
- int[] a2 = new int[0];
- assertEquals(0, CollectionTools.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, CollectionTools.retainAll(a1, a2));
- }
-
- public void testReverseObjectArray_Object() {
- Object[] a = this.buildObjectArray1();
- a = CollectionTools.reverse(a);
- assertEquals("two", a[0]);
- assertEquals("one", a[1]);
- assertEquals("zero", a[2]);
- }
-
- public void testReverseObjectArray_String() {
- String[] a = this.buildStringArray1();
- a = CollectionTools.reverse(a);
- assertEquals("two", a[0]);
- assertEquals("one", a[1]);
- assertEquals("zero", a[2]);
- }
-
- public void testReverseCharArray() {
- char[] a = this.buildCharArray();
- a = CollectionTools.reverse(a);
- assertEquals('c', a[0]);
- assertEquals('b', a[1]);
- assertEquals('a', a[2]);
- }
-
- public void testReverseIntArray() {
- int[] a = this.buildIntArray();
- a = CollectionTools.reverse(a);
- assertEquals(20, a[0]);
- assertEquals(10, a[1]);
- assertEquals(0, a[2]);
- }
-
- 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);
- }
-
- public void testRotateObjectArray() {
- String[] a = this.buildStringArray1();
- a = CollectionTools.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 = CollectionTools.rotate(a1);
- assertSame(a1, a2);
- }
-
- public void testRotateObjectArray_One() {
- String[] a1 = new String[] { "foo " };
- String[] a2 = CollectionTools.rotate(a1);
- assertSame(a1, a2);
- }
-
- public void testRotateObjectArrayInt() {
- String[] a = this.buildStringArray1();
- a = CollectionTools.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 = CollectionTools.rotate(a1, 0);
- assertSame(a1, a2);
- }
-
- public void testRotateObjectArrayInt_Zero() {
- String[] a1 = new String[0];
- String[] a2 = CollectionTools.rotate(a1, 7);
- assertSame(a1, a2);
- }
-
- public void testRotateObjectArrayInt_One() {
- String[] a1 = new String[] { "foo " };
- String[] a2 = CollectionTools.rotate(a1, 8);
- assertSame(a1, a2);
- }
-
- public void testRotateCharArray() {
- char[] a = this.buildCharArray();
- a = CollectionTools.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 = CollectionTools.rotate(a1);
- assertSame(a1, a2);
- }
-
- public void testRotateCharArray_One() {
- char[] a1 = new char[] { 'a' };
- char[] a2 = CollectionTools.rotate(a1);
- assertSame(a1, a2);
- }
-
- public void testRotateCharArrayInt() {
- char[] a = this.buildCharArray();
- a = CollectionTools.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 = CollectionTools.rotate(a1, 0);
- assertSame(a1, a2);
- }
-
- public void testRotateCharArrayInt_Zero() {
- char[] a1 = new char[0];
- char[] a2 = CollectionTools.rotate(a1, 2001);
- assertSame(a1, a2);
- }
-
- public void testRotateCharArrayInt_One() {
- char[] a1 = new char[] { 'a' };
- char[] a2 = CollectionTools.rotate(a1, 22);
- assertSame(a1, a2);
- }
-
- public void testRotateIntArray() {
- int[] a = this.buildIntArray();
- a = CollectionTools.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 = CollectionTools.rotate(a1);
- assertSame(a1, a2);
- }
-
- public void testRotateIntArray_One() {
- int[] a1 = new int[] { 77 };
- int[] a2 = CollectionTools.rotate(a1);
- assertSame(a1, a2);
- }
-
- public void testRotateIntArrayInt() {
- int[] a = this.buildIntArray();
- a = CollectionTools.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 = CollectionTools.rotate(a1, 0);
- assertSame(a1, a2);
- }
-
- public void testRotateIntArrayInt_Zero() {
- int[] a1 = new int[0];
- int[] a2 = CollectionTools.rotate(a1, 3);
- assertSame(a1, a2);
- }
-
- public void testRotateIntArrayInt_One() {
- int[] a1 = new int[] { 77 };
- int[] a2 = CollectionTools.rotate(a1, 44);
- assertSame(a1, a2);
- }
-
- 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() {
- Set<String> set1 = new HashSet<String>();
- set1.add("0");
- set1.add("1");
- set1.add("2");
- set1.add("3");
-
- Set<Object> set2 = CollectionTools.<Object>set(set1.iterator());
- assertEquals(set1, set2);
- }
-
- public void testSetIteratorInt() {
- assertEquals(this.buildStringSet1(), CollectionTools.set(this.buildStringSet1().iterator(), 3));
- }
-
- public void testSetObjectArray() {
- assertEquals(this.buildStringSet1(), CollectionTools.set(this.buildStringSet1().toArray()));
- }
-
- public void testShuffleObjectArray() {
- String[] array1 = this.buildStringArray1();
- String[] array2 = CollectionTools.shuffle(this.buildStringArray1());
- assertEquals(array1.length, array2.length);
- assertTrue(CollectionTools.containsAll(array1, array2));
- }
-
- public void testShuffleCharArray() {
- char[] array1 = this.buildCharArray();
- char[] array2 = CollectionTools.shuffle(this.buildCharArray());
- assertEquals(array1.length, array2.length);
- assertTrue(CollectionTools.containsAll(array1, array2));
- }
-
- public void testShuffleIntArray() {
- int[] array1 = this.buildIntArray();
- int[] array2 = CollectionTools.shuffle(this.buildIntArray());
- assertEquals(array1.length, array2.length);
- assertTrue(CollectionTools.containsAll(array1, array2));
- }
-
- 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 testSizeIterable() {
- Iterable<Object> iterable = this.buildObjectList1();
- assertEquals(3, CollectionTools.size(iterable));
- }
-
- public void testSizeIterator() {
- assertEquals(3, CollectionTools.size(this.buildObjectList1().iterator()));
- }
-
- public void testSortedSetIterable() {
- SortedSet<String> ss1 = new TreeSet<String>();
- ss1.add("0");
- ss1.add("2");
- ss1.add("3");
- ss1.add("1");
-
- Iterable<String> iterable = ss1;
- SortedSet<String> set2 = CollectionTools.<String>sortedSet(iterable);
- assertEquals(ss1, set2);
- }
-
- public void testSortedSetIterableInt() {
- SortedSet<String> ss1 = new TreeSet<String>();
- ss1.add("0");
- ss1.add("2");
- ss1.add("3");
- ss1.add("1");
-
- Iterable<String> iterable = ss1;
- SortedSet<String> set2 = CollectionTools.<String>sortedSet(iterable, 5);
- assertEquals(ss1, set2);
- }
-
- 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.set(this.buildSortedStringSet1().toArray()));
- }
-
- 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, CollectionTools.subArray(array, 0, 4)));
-
- result = new String[] {"jar"};
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 4, 1)));
-
- result = new String[0];
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 5, 0)));
-
- result = new String[] {"joo", "jar", "jaz"};
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 3, 3)));
- }
-
- 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, CollectionTools.subArray(array, 0, 4)));
-
- result = new int[] {9090};
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 4, 1)));
-
- result = new int[0];
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 5, 0)));
-
- result = new int[] {4, 9090, 42};
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 3, 3)));
- }
-
- 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, CollectionTools.subArray(array, 0, 4)));
-
- result = new char[] {'e'};
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 4, 1)));
-
- result = new char[0];
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 5, 0)));
-
- result = new char[] {'d', 'e', 'f'};
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 3, 3)));
- }
-
- public void testSwapObjectArray() {
- String[] a = this.buildStringArray1();
- a = CollectionTools.swap(a, 1, 2);
- assertEquals("zero", a[0]);
- assertEquals("two", a[1]);
- assertEquals("one", a[2]);
- }
-
- public void testSwapCharArray() {
- char[] a = this.buildCharArray();
- a = CollectionTools.swap(a, 1, 2);
- assertEquals('a', a[0]);
- assertEquals('c', a[1]);
- assertEquals('b', a[2]);
- }
-
- public void testSwapIntArray() {
- int[] a = this.buildIntArray();
- a = CollectionTools.swap(a, 1, 2);
- assertEquals(0, a[0]);
- assertEquals(20, a[1]);
- assertEquals(10, a[2]);
- }
-
- 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());
- }
-
- public void testRemoveDuplicateElementsObjectArray() {
- List<String> list = this.buildStringVector1();
- list.add("zero");
- list.add("zero");
- list.add("two");
- list.add("zero");
- String[] array = CollectionTools.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 = CollectionTools.removeDuplicateElements(new String[0]);
- assertEquals(0, array.length);
- }
-
- public void testRemoveDuplicateElementsObjectArray_SingleElement() {
- String[] array = CollectionTools.removeDuplicateElements(new String[] { "foo" });
- assertEquals(1, array.length);
- }
-
- 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()));
- }
-
- 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 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/CounterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CounterTests.java
deleted file mode 100644
index 9953e0ecf8..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CounterTests.java
+++ /dev/null
@@ -1,92 +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;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.Counter;
-
-public class CounterTests extends TestCase {
-
- public CounterTests(String name) {
- super(name);
- }
-
- public void testCtors() {
- Counter counter;
- counter = new Counter();
- assertEquals(0, counter.count());
- counter = new Counter(7);
- assertEquals(7, counter.count());
- counter = new Counter(-7);
- assertEquals(-7, counter.count());
- }
-
- public void testIncrement() {
- Counter counter;
- int count;
- counter = new Counter();
- assertEquals(0, counter.count());
-
- count = counter.increment(3);
- assertEquals(3, count);
- assertEquals(3, counter.count());
-
- count = counter.increment();
- assertEquals(4, count);
- assertEquals(4, counter.count());
-
- count = counter.increment(-7);
- assertEquals(-3, count);
- assertEquals(-3, counter.count());
- }
-
- public void testDecrement() {
- Counter counter;
- int count;
- counter = new Counter();
- assertEquals(0, counter.count());
-
- count = counter.decrement(3);
- assertEquals(-3, count);
- assertEquals(-3, counter.count());
-
- count = counter.decrement();
- assertEquals(-4, count);
- assertEquals(-4, counter.count());
-
- count = counter.decrement(-7);
- assertEquals(3, count);
- assertEquals(3, counter.count());
- }
-
- public void testClone() {
- Counter counter = new Counter(44);
- Counter counter2 = (Counter) counter.clone();
- assertEquals(44, counter2.count());
- assertEquals(counter, counter2);
- assertNotSame(counter, counter2);
- }
-
- public void testEquals() {
- Counter counter = new Counter(44);
- Counter counter2 = new Counter(44);
- assertEquals(counter, counter2);
- assertEquals(counter.hashCode(), counter2.hashCode());
- }
-
- public void testSerialization() throws Exception {
- Counter counter = new Counter(44);
- Counter counter2 = TestTools.serialize(counter);
- assertEquals(44, counter2.count());
- assertEquals(counter, counter2);
- assertNotSame(counter, counter2);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/EmptyIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/EmptyIterableTests.java
deleted file mode 100644
index ad6f1459e4..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/EmptyIterableTests.java
+++ /dev/null
@@ -1,30 +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.tests.internal;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.EmptyIterable;
-
-public class EmptyIterableTests extends TestCase {
-
- public EmptyIterableTests(String name) {
- super(name);
- }
-
- public void testIterator() {
- int i = 0;
- for (String string : EmptyIterable.<String>instance()) {
- fail("bogus string: " + string);
- i++;
- }
- assertEquals(0, i);
- }
-
-}
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 adcccf0992..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/FileToolsTests.java
+++ /dev/null
@@ -1,594 +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 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.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.FileTools;
-
-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);
- }
-
- 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);
- }
-
- private boolean isExecutingOnWindows() {
- return this.isExecutingOn("Windows");
- }
-
- // private boolean isExecutingOnLinux() {
- // return this.isExecutingOn("Linux");
- // }
- //
- private boolean isExecutingOn(String osName) {
- return System.getProperty("os.name").indexOf(osName) != -1;
- }
-
- public void testPathFiles() {
- File[] expected;
- File[] actual;
-
- if (this.isExecutingOnWindows()) {
- 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[]) ClassTools.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) ClassTools.executeStaticMethod(FileTools.class, "relativeParentFile", int.class, new Integer(len));
- }
-
- public void testConvertToRelativeFile() {
- String prefix = this.isExecutingOnWindows() ? "C:" : "";
- File file;
- File dir;
- File relativeFile;
-
- if (this.isExecutingOnWindows()) {
- // 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 = this.isExecutingOnWindows() ? "C:" : "";
- File file;
- File dir;
- File absoluteFile;
-
- if (this.isExecutingOnWindows()) {
- // 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 = this.isExecutingOnWindows();
- 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 = this.isExecutingOnWindows();
- 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 (this.isExecutingOnWindows()) {
- 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 (this.isExecutingOnWindows()) {
- 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 (this.isExecutingOnWindows()) {
- 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 (this.isExecutingOnWindows()) {
- 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(ClassTools.shortClassNameForObject(this) + "." + 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/HashBagTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/HashBagTests.java
deleted file mode 100644
index 10e31c798f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/HashBagTests.java
+++ /dev/null
@@ -1,545 +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.ConcurrentModificationException;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-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;
-
-@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);
- }
-
-//TODO - poor load factor is seen in the Eclipse build environment for some reason
-// 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);
-// assertTrue("WARNING - poor load factor: " + loadFactor, loadFactor > 0.20);
-// assertTrue("WARNING - poor load factor: " + loadFactor, loadFactor < 0.75);
-// }
-
- 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(CollectionTools.contains(a, null));
- assertTrue(CollectionTools.contains(a, "one"));
- assertTrue(CollectionTools.contains(a, "two"));
- assertTrue(CollectionTools.contains(a, "three"));
- assertTrue(CollectionTools.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(CollectionTools.contains(a, null));
- assertTrue(CollectionTools.contains(a, "one"));
- assertTrue(CollectionTools.contains(a, "two"));
- assertTrue(CollectionTools.contains(a, "three"));
- assertTrue(CollectionTools.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 8d7f394df7..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IdentityHashBagTests.java
+++ /dev/null
@@ -1,564 +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;
-
-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.CollectionTools;
-import org.eclipse.jpt.utility.internal.IdentityHashBag;
-
-@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);
- }
-
- // Commenting out this test as it is also failing in the Eclipse build
- // apparenly there are some hashing issues that need to be looked into.
-// 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);
-// // System.out.println("load factor: " + loadFactor + " (" + filledBucketCount + "/" + bucketCount + ")");
-// assertTrue("WARNING - poor load factor: " + loadFactor, loadFactor > 0.20);
-// assertTrue("WARNING - poor load factor: " + loadFactor, loadFactor < 0.75);
-// }
-
- 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(CollectionTools.contains(a, null));
- assertTrue(CollectionTools.contains(a, this.one));
- assertTrue(CollectionTools.contains(a, this.two));
- assertTrue(CollectionTools.contains(a, this.three));
- assertTrue(CollectionTools.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(CollectionTools.contains(a, null));
- assertTrue(CollectionTools.contains(a, this.one));
- assertTrue(CollectionTools.contains(a, this.two));
- assertTrue(CollectionTools.contains(a, this.three));
- assertTrue(CollectionTools.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 b971895bc1..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IndentingPrintWriterTests.java
+++ /dev/null
@@ -1,107 +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.io.StringWriter;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.IndentingPrintWriter;
-
-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.indentLevel());
- this.ipw1.indent();
- assertEquals("wrong indent level", 1, this.ipw1.indentLevel());
- }
-
- public void testUndent() {
- assertEquals("wrong indent level", 0, this.ipw1.indentLevel());
- this.ipw1.indent();
- assertEquals("wrong indent level", 1, this.ipw1.indentLevel());
- this.ipw1.undent();
- assertEquals("wrong indent level", 0, this.ipw1.indentLevel());
- }
-
- public void testIncrementIndentLevel() {
- assertEquals("wrong indent level", 0, this.ipw1.indentLevel());
- this.ipw1.incrementIndentLevel();
- assertEquals("wrong indent level", 1, this.ipw1.indentLevel());
- }
-
- public void testDecrementIndentLevel() {
- assertEquals("wrong indent level", 0, this.ipw1.indentLevel());
- this.ipw1.incrementIndentLevel();
- assertEquals("wrong indent level", 1, this.ipw1.indentLevel());
- this.ipw1.decrementIndentLevel();
- assertEquals("wrong indent level", 0, this.ipw1.indentLevel());
- }
-
- 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/JDBCTypeTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JDBCTypeTests.java
deleted file mode 100644
index 07dad198b5..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JDBCTypeTests.java
+++ /dev/null
@@ -1,66 +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.sql.Types;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.JDBCType;
-
-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 b83bbed1f3..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JptUtilityTests.java
+++ /dev/null
@@ -1,64 +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.Test;
-import junit.framework.TestSuite;
-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;
-
-/**
- * decentralize test creation code
- */
-public class JptUtilityTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityTests.class.getPackage().getName());
-
- suite.addTest(JptUtilityIteratorsTests.suite());
- suite.addTest(JptUtilityModelTests.suite());
- suite.addTest(JptUtilityNodeTests.suite());
-
- suite.addTestSuite(BitToolsTests.class);
- suite.addTestSuite(BooleanHolderTests.class);
- suite.addTestSuite(ClasspathTests.class);
- suite.addTestSuite(ClassToolsTests.class);
- suite.addTestSuite(CollectionToolsTests.class);
- suite.addTestSuite(CounterTests.class);
- suite.addTestSuite(EmptyIterableTests.class);
- suite.addTestSuite(FileToolsTests.class);
- suite.addTestSuite(HashBagTests.class);
- suite.addTestSuite(IdentityHashBagTests.class);
- suite.addTestSuite(IndentingPrintWriterTests.class);
- suite.addTestSuite(JavaTypeTests.class);
- suite.addTestSuite(JDBCTypeTests.class);
- suite.addTestSuite(ListenerListTests.class);
- suite.addTestSuite(MethodSignatureTests.class);
- suite.addTestSuite(NameToolsTests.class);
- suite.addTestSuite(RangeTests.class);
- suite.addTestSuite(ReverseComparatorTests.class);
- suite.addTestSuite(SimpleAssociationTests.class);
- suite.addTestSuite(SimpleStackTests.class);
- suite.addTestSuite(StringToolsTests.class);
- suite.addTestSuite(SynchronizedBooleanTests.class);
- suite.addTestSuite(SynchronizedObjectTests.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 2416f6333c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ListenerListTests.java
+++ /dev/null
@@ -1,179 +0,0 @@
-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;
-
-@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();
- Listener[] listeners = listenerList.getListeners();
- assertEquals(0, listeners.length);
-
- listenerList.add(listener1);
- listenerList.add(listener2);
- listeners = listenerList.getListeners();
- assertEquals(2, listeners.length);
- 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);
- }
-
-//TODO fix bug 252066 and then uncomment this
-// 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);
- }
-//TODO fix bug 252066 and then uncomment this
-// 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));
- }
-
-//TODO - This test doesn't pass in the Eclipse build environment (Linux) for some reason
-// public void testSerialization() 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 7203fbd4a1..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/MethodSignatureTests.java
+++ /dev/null
@@ -1,235 +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.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;
-
-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 testCompareTo1() throws Exception {
- MethodSignature ms1 = new SimpleMethodSignature(this.getMethod("method3"));
- MethodSignature ms2 = new SimpleMethodSignature(this.getMethod("method3"));
- assertEquals(0, ms1.compareTo(ms2));
- }
-
- public void testCompareTo2() throws Exception {
- MethodSignature ms1 = new SimpleMethodSignature(this.getMethod("method3"));
- MethodSignature ms2 = new SimpleMethodSignature(this.getMethod("method2"));
- assertTrue(ms1.compareTo(ms2) > 0);
- }
-
- public void testCompareTo3() throws Exception {
- MethodSignature msA1 = new SimpleMethodSignature(this.getMethod("methodA", new Class[] {int.class, String.class}));
- MethodSignature msA2 = new SimpleMethodSignature(this.getMethod("methodA", new Class[] {int.class, String.class, String.class}));
- assertTrue(msA1.compareTo(msA2) < 0);
- }
-
- public void testCompareTo4() throws Exception {
- MethodSignature msB1 = new SimpleMethodSignature(this.getMethod("methodB", new Class[] {int.class, Object.class}));
- MethodSignature msB2 = new SimpleMethodSignature(this.getMethod("methodB", new Class[] {int.class, String.class}));
- assertTrue(msB1.compareTo(msB2) < 0);
- }
-
- 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);
- }
-
- private Method getMethod(String methodName, Class<?>... parameterTypes) throws Exception {
- return this.getClass().getMethod(methodName, parameterTypes);
- }
-
- public void method0() { /* used by tests */ }
- public void method1(int foo) { /* used by tests */ }
- public void method2(int foo, String bar) { /* used by tests */ }
- public void method3(int foo, String bar, Object[][] baz) { /* used by tests */ }
-
- public void methodA(int foo, String bar) { /* used by tests */ }
- public void methodA(int foo, String bar, String baz) { /* used by tests */ }
-
- public void methodB(int foo, Object bar) { /* used by tests */ }
- 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/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/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/ReverseComparatorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ReverseComparatorTests.java
deleted file mode 100644
index 7ae00fdc2e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ReverseComparatorTests.java
+++ /dev/null
@@ -1,101 +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 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;
-
-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 ee5f5370bb..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleAssociationTests.java
+++ /dev/null
@@ -1,98 +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.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;
-
-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() {
- 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));
- }
-
- public void testHashCode() {
- assertEquals(this.assoc.hashCode(), this.copy(this.assoc).hashCode());
- }
-
- 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/SimpleStackTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleStackTests.java
deleted file mode 100644
index f1e97895c4..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleStackTests.java
+++ /dev/null
@@ -1,140 +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;
-
-import java.util.EmptyStackException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.SimpleStack;
-import org.eclipse.jpt.utility.internal.Stack;
-
-public class SimpleStackTests extends TestCase {
-
- public SimpleStackTests(String name) {
- super(name);
- }
-
- public void testIsEmpty() {
- Stack<String> stack = new SimpleStack<String>();
- 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 = new SimpleStack<String>();
- 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 = new SimpleStack<String>();
- 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 = new SimpleStack<String>();
- 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();
- } catch (EmptyStackException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testEmptyStackExceptionPop() {
- Stack<String> stack = new SimpleStack<String>();
- 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();
- } catch (EmptyStackException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testClone() {
- SimpleStack<String> stack = new SimpleStack<String>();
- stack.push("first");
- stack.push("second");
- stack.push("third");
-
- this.verifyClone(stack, stack.clone());
- }
-
- public void testSerialization() throws Exception {
- SimpleStack<String> stack = new SimpleStack<String>();
- 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 52cf8ca897..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java
+++ /dev/null
@@ -1,1640 +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.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());
- }
-
- // ********** 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());
- }
-
- // ********** 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 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 544b7a5c5c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedBooleanTests.java
+++ /dev/null
@@ -1,225 +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;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.SynchronizedBoolean;
-
-public class SynchronizedBooleanTests extends TestCase {
- private volatile SynchronizedBoolean sb;
- private volatile boolean exCaught;
- private volatile boolean timeoutOccurred;
- private volatile long startTime;
- private volatile long endTime;
-
-
- public SynchronizedBooleanTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.sb = new SynchronizedBoolean();
- this.exCaught = false;
- this.timeoutOccurred = false;
- this.startTime = 0;
- this.endTime = 0;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testAccessors() throws Exception {
- this.sb.setValue(false);
- assertFalse(this.sb.value());
- assertFalse(this.sb.isTrue());
- assertTrue(this.sb.isFalse());
-
- this.sb.setValue(true);
- assertTrue(this.sb.value());
- assertTrue(this.sb.isTrue());
- assertFalse(this.sb.isFalse());
-
- this.sb.setFalse();
- assertFalse(this.sb.value());
- assertFalse(this.sb.isTrue());
- assertTrue(this.sb.isFalse());
-
- this.sb.setTrue();
- assertTrue(this.sb.value());
- assertTrue(this.sb.isTrue());
- assertFalse(this.sb.isFalse());
-
- assertSame(this.sb, this.sb.mutex());
- }
-
- 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());
- }
-
- public void testWaitUntilTrue() throws Exception {
- this.verifyWaitUntilTrue(0);
- // no timeout occurs...
- assertFalse(this.timeoutOccurred);
- // ...and the value should be set to true by t2
- assertTrue(this.sb.value());
- // make a reasonable guess about how long t2 took
- assertTrue(this.elapsedTime() > 150);
- }
-
- public void testWaitUntilTrueTimeout() throws Exception {
- this.verifyWaitUntilTrue(20);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the value will eventually be set to true by t1
- assertTrue(this.sb.value());
- // make a reasonable guess about how long t2 took
- assertTrue(this.elapsedTime() < 150);
- }
-
- private void verifyWaitUntilTrue(long timeout) throws Exception {
- this.sb.setFalse();
- Runnable r1 = this.buildRunnable(this.buildSetTrueCommand(), this.sb, 200);
- Runnable r2 = this.buildRunnable(this.buildWaitUntilTrueCommand(timeout), this.sb, 0);
- Thread t1 = new Thread(r1);
- Thread t2 = new Thread(r2);
- t1.start();
- t2.start();
- while (t1.isAlive() || t2.isAlive()) {
- Thread.sleep(50);
- }
- assertFalse(this.exCaught);
- }
-
- public void testWaitToSetFalse() throws Exception {
- this.verifyWaitToSetFalse(0);
- // no timeout occurs...
- assertFalse(this.timeoutOccurred);
- // ...and the value should be set to false by t2
- assertFalse(this.sb.value());
- // make a reasonable guess about how long t2 took
- assertTrue(this.elapsedTime() > 150);
- }
-
- public void testWaitToSetFalseTimeout() throws Exception {
- this.verifyWaitToSetFalse(20);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the value will eventually be set to true by t1
- assertTrue(this.sb.value());
- // make a reasonable guess about how long t2 took
- assertTrue(this.elapsedTime() < 150);
- }
-
- private void verifyWaitToSetFalse(long timeout) throws Exception {
- this.sb.setFalse();
- Runnable r1 = this.buildRunnable(this.buildSetTrueCommand(), this.sb, 200);
- Runnable r2 = this.buildRunnable(this.buildWaitToSetFalseCommand(timeout), this.sb, 0);
- Thread t1 = new Thread(r1);
- Thread t2 = new Thread(r2);
- t1.start();
- t2.start();
- while (t1.isAlive() || t2.isAlive()) {
- Thread.sleep(50);
- }
- assertFalse(this.exCaught);
- }
-
- 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 Exception {
- SynchronizedBooleanTests.this.setStartTime(System.currentTimeMillis());
- SynchronizedBooleanTests.this.setTimeoutOccurred( ! syncBool.waitUntilTrue(timeout));
- SynchronizedBooleanTests.this.setEndTime(System.currentTimeMillis());
- }
- };
- }
-
- private Command buildWaitToSetFalseCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedBoolean syncBool) throws Exception {
- SynchronizedBooleanTests.this.setStartTime(System.currentTimeMillis());
- SynchronizedBooleanTests.this.setTimeoutOccurred( ! syncBool.waitToSetFalse(timeout));
- SynchronizedBooleanTests.this.setEndTime(System.currentTimeMillis());
- }
- };
- }
-
- private Runnable buildRunnable(final Command command, final SynchronizedBoolean syncBool, final long sleep) {
- return new Runnable() {
- public void run() {
- try {
- if (sleep != 0) {
- Thread.sleep(sleep);
- }
- command.execute(syncBool);
- } catch (Exception ex) {
- SynchronizedBooleanTests.this.setExCaught(true);
- }
- }
- };
- }
-
- void setExCaught(boolean exCaught) {
- this.exCaught = exCaught;
- }
-
- void setTimeoutOccurred(boolean timeoutOccurred) {
- this.timeoutOccurred = timeoutOccurred;
- }
-
- void setStartTime(long startTime) {
- this.startTime = startTime;
- }
-
- void setEndTime(long endTime) {
- this.endTime = endTime;
- }
-
- long elapsedTime() {
- return this.endTime - this.startTime;
- }
-
-
- // ********** Command interface **********
-
- private interface Command {
- void execute(SynchronizedBoolean syncBool) throws Exception;
- }
-
-}
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 22cd10936e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedObjectTests.java
+++ /dev/null
@@ -1,292 +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;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.SynchronizedObject;
-
-public class SynchronizedObjectTests extends TestCase {
- private volatile SynchronizedObject<Object> so;
- private volatile boolean exCaught;
- private volatile boolean timeoutOccurred;
- volatile Object value = new Object();
- private volatile long startTime;
- private volatile long endTime;
- private volatile Object soValue;
-
-
- public SynchronizedObjectTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.so = new SynchronizedObject<Object>();
- this.exCaught = false;
- this.timeoutOccurred = false;
- this.startTime = 0;
- this.endTime = 0;
- this.soValue = null;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testAccessors() throws Exception {
- this.so.setValue(null);
- assertNull(this.so.value());
- assertFalse(this.so.isNotNull());
- assertTrue(this.so.isNull());
-
- this.so.setValue(this.value);
- assertEquals(this.value, this.so.value());
- assertTrue(this.so.isNotNull());
- assertFalse(this.so.isNull());
-
- this.so.setNull();
- assertNull(this.so.value());
- assertFalse(this.so.isNotNull());
- assertTrue(this.so.isNull());
-
- assertSame(this.so, this.so.mutex());
- }
-
- 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.value());
- // make a reasonable guess about how long t2 took
- long time = this.elapsedTime();
- assertTrue("t2 finished a bit early (expected value should be > 150): " + time, time > 150);
- }
-
- /**
- * t2 will time out waiting for t1 to set the value to null
- */
- public void testWaitUntilNullTimeout() throws Exception {
- this.verifyWaitUntilNull(20);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the value will eventually be set to null by t1
- assertNull(this.so.value());
- // make a reasonable guess about how long t2 took
- long time = this.elapsedTime();
- assertTrue("t2 finished a bit late (expected value should be < 150): " + time, time < 150);
- }
-
- 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.elapsedTime();
- assertTrue("t2 finished a bit early (expected value should be > 150): " + time, time > 150);
- }
-
- /**
- * t2 will time out waiting for t1 to set the value to null
- */
- public void testWaitToSetValueTimeout() throws Exception {
- this.verifyWaitToSetValue(20);
- // 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.elapsedTime();
- assertTrue("t2 finished a bit late (expected value should be < 150): " + time, time < 150);
- }
-
- 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, 100);
- Thread t1 = new Thread(r1);
- Thread t2 = new Thread(r2);
- t1.start();
- t2.start();
- while (t1.isAlive() || t2.isAlive()) {
- Thread.sleep(50);
- }
- assertFalse(this.exCaught);
- assertEquals("foo", this.so.value());
- assertEquals("foo", this.soValue);
- // make a reasonable guess about how long t2 took
- long time = this.elapsedTime();
- assertTrue("t2 finished a bit early (expected value should be > 100): " + time, time > 300);
- }
-
- private void executeThreads(Command t1Command, Command t2Command) throws Exception {
- this.so.setValue(this.value);
- Runnable r1 = this.buildRunnable(t1Command, this.so, 200);
- Runnable r2 = this.buildRunnable(t2Command, this.so, 0);
- Thread t1 = new Thread(r1);
- Thread t2 = new Thread(r2);
- t1.start();
- t2.start();
- while (t1.isAlive() || t2.isAlive()) {
- Thread.sleep(50);
- }
- assertFalse(this.exCaught);
- }
-
- 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 Exception {
- SynchronizedObjectTests.this.setStartTime(System.currentTimeMillis());
- SynchronizedObjectTests.this.setTimeoutOccurred( ! sObject.waitUntilNull(timeout));
- SynchronizedObjectTests.this.setEndTime(System.currentTimeMillis());
- }
- };
- }
-
- private Command buildWaitToSetValueCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedObject<Object> sObject) throws Exception {
- SynchronizedObjectTests.this.setStartTime(System.currentTimeMillis());
- SynchronizedObjectTests.this.setTimeoutOccurred( ! sObject.waitToSetValue(SynchronizedObjectTests.this.value, timeout));
- SynchronizedObjectTests.this.setEndTime(System.currentTimeMillis());
- }
- };
- }
-
- private Command buildInitializeValueCommand() {
- return new Command() {
- public void execute(final SynchronizedObject<Object> sObject) throws Exception {
- sObject.execute(
- new org.eclipse.jpt.utility.Command() {
- public void execute() {
- // pretend to perform some long initialization process
- try {
- Thread.sleep(500);
- } catch (Exception ex) {
- SynchronizedObjectTests.this.setExCaught(true);
- }
- sObject.setValue("foo");
- }
- }
- );
- }
- };
- }
-
- private Command buildGetValueCommand() {
- return new Command() {
- public void execute(SynchronizedObject<Object> sObject) throws Exception {
- SynchronizedObjectTests.this.setStartTime(System.currentTimeMillis());
- SynchronizedObjectTests.this.setSOValue(sObject.value());
- SynchronizedObjectTests.this.setEndTime(System.currentTimeMillis());
- }
- };
- }
-
- private Runnable buildRunnable(final Command command, final SynchronizedObject<Object> sObject, final long sleep) {
- return new Runnable() {
- public void run() {
- try {
- if (sleep != 0) {
- Thread.sleep(sleep);
- }
- command.execute(sObject);
- } catch (Exception ex) {
- SynchronizedObjectTests.this.setExCaught(true);
- }
- }
- };
- }
-
- void setExCaught(boolean exCaught) {
- this.exCaught = exCaught;
- }
-
- void setTimeoutOccurred(boolean timeoutOccurred) {
- this.timeoutOccurred = timeoutOccurred;
- }
-
- void setStartTime(long startTime) {
- this.startTime = startTime;
- }
-
- void setEndTime(long endTime) {
- this.endTime = endTime;
- }
-
- private long elapsedTime() {
- return this.endTime - this.startTime;
- }
-
- void setSOValue(Object soValue) {
- this.soValue = soValue;
- }
-
-
- // ********** Command interface **********
-
- private interface Command {
- void execute(SynchronizedObject<Object> so) throws Exception;
- }
-
-}
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 50c353c2de..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedStackTests.java
+++ /dev/null
@@ -1,270 +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;
-
-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;
-
-public class SynchronizedStackTests extends SimpleStackTests {
- private volatile SynchronizedStack<String> ss;
- private volatile boolean exCaught;
- private volatile boolean timeoutOccurred;
- private volatile long startTime;
- private volatile long endTime;
- private volatile Object poppedObject;
-
- static final String ITEM_1 = new String();
- static final String ITEM_2 = new String();
-
- public SynchronizedStackTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.ss = new SynchronizedStack<String>();
- this.exCaught = false;
- 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");
-
- new Thread(this.buildRunnable(slowStack)).start();
- Thread.sleep(200);
-
- assertEquals(expected, slowStack.pop());
- }
-
- 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(500);
- } 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(100);
- } 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.elapsedTime() > 150);
- }
-
- public void testWaitToPopTimeout() throws Exception {
- this.verifyWaitToPop(20);
- // 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.elapsedTime() < 150);
- }
-
- private void verifyWaitToPop(long timeout) throws Exception {
- Runnable r1 = this.buildRunnable(this.buildPushCommand(), this.ss, 200);
- Runnable r2 = this.buildRunnable(this.buildWaitToPopCommand(timeout), this.ss, 0);
- Thread t1 = new Thread(r1);
- Thread t2 = new Thread(r2);
- t1.start();
- t2.start();
- while (t1.isAlive() || t2.isAlive()) {
- Thread.sleep(50);
- }
- assertFalse(this.exCaught);
- }
-
- 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.elapsedTime() > 150);
- }
-
- public void testWaitToPushTimeout() throws Exception {
- this.verifyWaitToPush(20);
- // 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.elapsedTime() < 150);
- }
-
- private void verifyWaitToPush(long timeout) throws Exception {
- this.ss.push(ITEM_1);
- Runnable r1 = this.buildRunnable(this.buildPopCommand(), this.ss, 200);
- Runnable r2 = this.buildRunnable(this.buildWaitToPushCommand(timeout), this.ss, 0);
- Thread t1 = new Thread(r1);
- Thread t2 = new Thread(r2);
- t1.start();
- t2.start();
- while (t1.isAlive() || t2.isAlive()) {
- Thread.sleep(50);
- }
- assertFalse(this.exCaught);
- }
-
- 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 Exception {
- SynchronizedStackTests.this.setStartTime(System.currentTimeMillis());
- try {
- SynchronizedStackTests.this.setPoppedObject(synchronizedStack.waitToPop(timeout));
- } catch (EmptyStackException ex) {
- SynchronizedStackTests.this.setTimeoutOccurred(true);
- }
- SynchronizedStackTests.this.setEndTime(System.currentTimeMillis());
- }
- };
- }
-
- private Command buildPopCommand() {
- return new Command() {
- public void execute(SynchronizedStack<String> synchronizedStack) {
- SynchronizedStackTests.this.setPoppedObject(synchronizedStack.pop());
- }
- };
- }
-
- private Command buildWaitToPushCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedStack<String> synchronizedStack) throws Exception {
- SynchronizedStackTests.this.setStartTime(System.currentTimeMillis());
- SynchronizedStackTests.this.setTimeoutOccurred( ! synchronizedStack.waitToPush(ITEM_2, timeout));
- SynchronizedStackTests.this.setEndTime(System.currentTimeMillis());
- }
- };
- }
-
- private Runnable buildRunnable(final Command command, final SynchronizedStack<String> synchronizedStack, final long sleep) {
- return new Runnable() {
- public void run() {
- try {
- if (sleep != 0) {
- Thread.sleep(sleep);
- }
- command.execute(synchronizedStack);
- } catch (Exception ex) {
- SynchronizedStackTests.this.setExCaught(true);
- }
- }
- };
- }
-
- void setExCaught(boolean exCaught) {
- this.exCaught = exCaught;
- }
-
- void setTimeoutOccurred(boolean timeoutOccurred) {
- this.timeoutOccurred = timeoutOccurred;
- }
-
- void setStartTime(long startTime) {
- this.startTime = startTime;
- }
-
- void setEndTime(long endTime) {
- this.endTime = endTime;
- }
-
- void setPoppedObject(Object poppedObject) {
- this.poppedObject = poppedObject;
- }
-
- long elapsedTime() {
- return this.endTime - this.startTime;
- }
-
-
- // ********** Command interface **********
-
- private interface Command {
- void execute(SynchronizedStack<String> synchronizedStack) throws Exception;
- }
-
-}
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 57fe19877c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/TestTools.java
+++ /dev/null
@@ -1,142 +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 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 junit.framework.TestCase;
-import junit.framework.TestFailure;
-import junit.framework.TestResult;
-
-/**
- * various tools that can be used by test cases
- */
-public final class TestTools {
-
- /**
- * 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);
- }
-
- /**
- * execute the specified test and dump the results to the console
- */
- 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(": ");
- if (result.wasSuccessful()) {
- writer.println("OK");
- } 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: ");
- long elapsed = end - start;
- writer.print(elapsed / 1000L);
- writer.println(" sec.");
- return stringWriter.toString();
- }
-
- private static final Class<TestCase> TestCase_class = TestCase.class;
-
- /**
- * 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<?> tempClass = testCase.getClass(); tempClass != TestCase_class; tempClass = tempClass.getSuperclass()) {
- Field[] fields = tempClass.getDeclaredFields();
- for (int i = fields.length; i-- > 0;) {
- Field field = fields[i];
- // 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);
- }
- }
- }
-
- /**
- * 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());
- }
-
- 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 3b104b9b89..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/XMLStringEncoderTests.java
+++ /dev/null
@@ -1,135 +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.FileTools;
-import org.eclipse.jpt.utility.internal.XMLStringEncoder;
-
-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/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 d2309c351c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayIteratorTests.java
+++ /dev/null
@@ -1,126 +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.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-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 = 0;
- 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 = new ArrayIterator<Number>(integers); stream.hasNext();) {
- assertEquals(i++, stream.next().intValue());
- }
- assertEquals(integers.length, i);
- }
-
- public void testVarargs() {
- int i = 0;
- for (Iterator<Number> stream = new ArrayIterator<Number>(new Integer(0), new Integer(1), new Integer(2)); stream.hasNext();) {
- assertEquals(i++, stream.next().intValue());
- }
- assertEquals(3, i);
- }
-
- public 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 2ccab87bb4..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayListIteratorTests.java
+++ /dev/null
@@ -1,150 +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.iterators;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.iterators.ArrayListIterator;
-
-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
- 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 = new ArrayListIterator<Number>(integers); stream.hasNext();) {
- assertEquals(i++, stream.next().intValue());
- }
- assertEquals(integers.length, i);
- }
-
- @Override
- public void testVarargs() {
- int i = 0;
- for (Iterator<Number> stream = new ArrayListIterator<Number>(new Integer(0), new Integer(1), new Integer(2)); stream.hasNext();) {
- assertEquals(i++, stream.next().intValue());
- }
- assertEquals(3, i);
- }
-
- 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 18b3db2669..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ChainIteratorTests.java
+++ /dev/null
@@ -1,132 +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.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;
-
-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 e3afdb585f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneIteratorTests.java
+++ /dev/null
@@ -1,252 +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.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.iterators.CloneIterator;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-public class CloneIteratorTests extends TestCase {
- Collection<String> originalCollection;
-
- private boolean concurrentProblem;
- private Collection<String> concurrentCollection;
-
- public CloneIteratorTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.originalCollection = this.buildCollection();
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- 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.Mutator<String> eliminator = new CloneIterator.Mutator<String>() {
- public void remove(String current) {
- CloneIteratorTests.this.originalCollection.remove(current);
- }
- };
- 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.concurrentProblem = false;
- this.concurrentCollection = new ArrayList<String>();
- Thread thread = new Thread(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");
- while (thread.isAlive()) {
- // wait for the other thread to finish
- Thread.yield();
- }
- assertFalse(this.concurrentProblem);
- Collection<String> expected = new ArrayList<String>();
- this.populateCollection(expected);
- assertEquals(expected, this.concurrentCollection);
- }
-
- private Runnable buildRunnable() {
- return new Runnable() {
- public void run() {
- CloneIteratorTests.this.loopWithCloneIterator();
- }
- };
- }
-
- /**
- * use a clone iterator to loop over the "slow" collection and copy its
- * contents to the concurrent collection
- */
- void loopWithCloneIterator() {
- try {
- for (Iterator<String> stream = this.buildCloneIterator(); stream.hasNext();) {
- this.concurrentCollection.add(stream.next());
- }
- } catch (Throwable t) {
- this.concurrentProblem = true;
- }
- }
-
- 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
- try {
- Thread.sleep(100);
- } catch (InterruptedException ex) {
- throw new RuntimeException(ex);
- }
- 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 c6045a9f12..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneListIteratorTests.java
+++ /dev/null
@@ -1,408 +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.iterators;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-public class CloneListIteratorTests extends TestCase {
- List<String> originalList;
-
- private boolean concurrentProblem;
- private List<String> concurrentList;
-
- public CloneListIteratorTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.originalList = this.buildList();
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- 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("IllegalStateException not thrown", 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("IllegalStateException not thrown", 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.concurrentProblem = false;
- this.concurrentList = new ArrayList<String>();
- Thread thread = new Thread(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");
- while (thread.isAlive()) {
- // wait for the other thread to finish
- Thread.yield();
- }
- assertFalse(this.concurrentProblem);
- List<String> expected = new ArrayList<String>();
- this.populateList(expected);
- assertEquals(expected, this.concurrentList);
- }
-
- private Runnable buildRunnable() {
- return new Runnable() {
- public void run() {
- CloneListIteratorTests.this.loopWithCloneListIterator();
- }
- };
- }
-
- /**
- * use a clone iterator to loop over the "slow" collection and copy its
- * contents to the concurrent collection
- */
- void loopWithCloneListIterator() {
- try {
- for (ListIterator<String> stream = this.buildCloneListIterator(); stream.hasNext();) {
- this.concurrentList.add(stream.next());
- }
- } catch (Throwable t) {
- this.concurrentProblem = true;
- }
- }
-
-}
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 58c3976076..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeIteratorTests.java
+++ /dev/null
@@ -1,350 +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.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;
-
-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 d3aa1d1be2..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeListIteratorTests.java
+++ /dev/null
@@ -1,330 +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.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;
-
-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/EmptyEnumerationTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyEnumerationTests.java
deleted file mode 100644
index 98697897b7..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyEnumerationTests.java
+++ /dev/null
@@ -1,53 +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.iterators;
-
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.EmptyEnumeration;
-
-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/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 6985ad4ffa..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyIteratorTests.java
+++ /dev/null
@@ -1,63 +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.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-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 35c8efc011..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyListIteratorTests.java
+++ /dev/null
@@ -1,127 +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.iterators;
-
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-
-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 528f101110..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EnumerationIteratorTests.java
+++ /dev/null
@@ -1,119 +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.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;
-
-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 c8805c981b..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/FilteringIteratorTests.java
+++ /dev/null
@@ -1,298 +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.iterators;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.SimpleFilter;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-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));
- }
- }
-
- // test a filtered iterator with a nested iterator of a sub-type (Number vs. Integer)
- public void testGenerics1() {
- List<Integer> integers = new ArrayList<Integer>();
- integers.add(new Integer(0));
- integers.add(new Integer(1));
- integers.add(new Integer(2));
- integers.add(new Integer(3));
- Iterator<Number> stream = new FilteringIterator<Integer, Number>(integers.iterator()) {
- @Override
- protected boolean accept(Integer o) {
- return o.intValue() > 1;
- }
- };
- assertEquals(2, CollectionTools.size(stream));
- }
-
- // test a filtered iterator with a nested iterator of a super-type (Integer vs. Number)
- // i.e. trust that Filter will only return the appropriate sub-type objects
- public void testGenerics2() {
- List<Number> numbers = new ArrayList<Number>();
- numbers.add(new Integer(0));
- numbers.add(new Long(1));
- numbers.add(new Integer(2));
- numbers.add(new Float(3));
- Iterator<Integer> stream = new FilteringIterator<Number, Integer>(numbers.iterator()) {
- @Override
- protected boolean accept(Number o) {
- return o instanceof Integer;
- }
- };
- assertEquals(2, CollectionTools.size(stream));
- }
-
- 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, String>(nestedIterator, filter);
- }
-
- private Iterator<String> buildInnerFilteredIterator(Iterator<String> nestedIterator) {
- return new FilteringIterator<String, 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, 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, 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 8048a2f10c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/GraphIteratorTests.java
+++ /dev/null
@@ -1,196 +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.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;
-
-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;
- }
-
- private 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/IteratorEnumerationTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/IteratorEnumerationTests.java
deleted file mode 100644
index 42d8eb459e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/IteratorEnumerationTests.java
+++ /dev/null
@@ -1,98 +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.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.IteratorEnumeration;
-
-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/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 8d9d3f7270..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/JptUtilityIteratorsTests.java
+++ /dev/null
@@ -1,55 +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.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(EmptyEnumerationTests.class);
- suite.addTestSuite(EmptyIteratorTests.class);
- suite.addTestSuite(EmptyListIteratorTests.class);
- suite.addTestSuite(EnumerationIteratorTests.class);
- suite.addTestSuite(FilteringIteratorTests.class);
- suite.addTestSuite(GraphIteratorTests.class);
- suite.addTestSuite(IteratorEnumerationTests.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(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 1a3b47b78f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/PeekableIteratorTests.java
+++ /dev/null
@@ -1,140 +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.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;
-
-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 b70af3f53c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyCompositeListIteratorTests.java
+++ /dev/null
@@ -1,204 +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.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;
-
-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<ListIterator<? extends Number>> list = new ArrayList<ListIterator<? extends Number>>();
- list.add(integerList.listIterator());
- list.add(floatList.listIterator());
- 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 4defa2e414..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyIteratorTests.java
+++ /dev/null
@@ -1,118 +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.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;
-
-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 4db72f6754..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyListIteratorTests.java
+++ /dev/null
@@ -1,203 +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.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;
-
-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 e84657c93d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementIteratorTests.java
+++ /dev/null
@@ -1,71 +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.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-
-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 e3e4197c7d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementListIteratorTests.java
+++ /dev/null
@@ -1,111 +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.iterators;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-
-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/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 bef2552570..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationIteratorTests.java
+++ /dev/null
@@ -1,229 +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.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;
-
-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 dc8a2e02c7..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationListIteratorTests.java
+++ /dev/null
@@ -1,321 +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.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;
-
-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 e15f1a8d50..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TreeIteratorTests.java
+++ /dev/null
@@ -1,210 +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.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;
-
-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/AbstractModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/AbstractModelTests.java
deleted file mode 100644
index 42a14dbec1..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/AbstractModelTests.java
+++ /dev/null
@@ -1,1721 +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;
-
-import java.io.Serializable;
-import java.util.Arrays;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-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.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class AbstractModelTests
- extends TestCase
- implements StateChangeListener, PropertyChangeListener, CollectionChangeListener, ListChangeListener, TreeChangeListener
-{
- private TestModel testModel;
- private static final String TEST_TO_STRING = "this is a test";
-
- private StateChangeEvent stateChangeEvent;
- private boolean stateChangedCalled = false;
-
- private PropertyChangeEvent propertyChangeEvent;
- private boolean propertyChangeCalled = false;
- private 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 Integer NEW_INT_VALUE = new Integer(42);
- static final Boolean OLD_BOOLEAN_VALUE = Boolean.TRUE;
- static final Boolean NEW_BOOLEAN_VALUE = Boolean.FALSE;
-
- private CollectionChangeEvent collectionChangeEvent;
- private boolean itemsAddedCollectionCalled = false;
- private boolean itemsRemovedCollectionCalled = false;
- private boolean collectionChangedCalled = false;
- private boolean collectionClearedCalled = false;
- private static final String COLLECTION_NAME = "collectionName";
- static final Object ADDED_OBJECT_VALUE = new Object();
- static final Object REMOVED_OBJECT_VALUE = new Object();
- static final int TARGET_INDEX = 7;
- static final int SOURCE_INDEX = 22;
-
- private ListChangeEvent listChangeEvent;
- private boolean itemsAddedListCalled = false;
- private boolean itemsRemovedListCalled = false;
- private boolean itemsReplacedListCalled = false;
- private boolean itemsMovedListCalled = false;
- private boolean listChangedCalled = false;
- private boolean listClearedCalled = false;
- private static final String LIST_NAME = "listName";
- private static final int ADD_INDEX = 3;
- private static final int REMOVE_INDEX = 5;
- private static final int REPLACE_INDEX = 2;
-
- private TreeChangeEvent treeChangeEvent;
- private boolean nodeAddedCalled = false;
- private boolean nodeRemovedCalled = false;
- private boolean treeChangedCalled = false;
- private boolean treeClearedCalled = false;
- private static final String TREE_NAME = "treeName";
- static final Object[] OBJECT_ARRAY_PATH = {new Object(), new Object(), new String()};
- static final Object[] EMPTY_PATH = {};
-
- public AbstractModelTests(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();
- }
-
- public void testFireStateChange() {
- this.stateChangeEvent = null;
- this.stateChangedCalled = false;
- this.testModel.addStateChangeListener(this);
- this.testModel.testFireStateChange();
- assertNotNull(this.stateChangeEvent);
- assertEquals(this.testModel, this.stateChangeEvent.getSource());
- assertTrue(this.stateChangedCalled);
- }
-
- public void testFirePropertyChangeObjectObject() {
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(this);
- this.testModel.testFirePropertyChangeObjectObject();
- this.verifyPropertyChangeEvent(OLD_OBJECT_VALUE, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(this);
- this.testModel.testFirePropertyChangeObjectObject();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this);
- this.testModel.testFirePropertyChangeObjectObject();
- this.verifyPropertyChangeEvent(OLD_OBJECT_VALUE, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this);
- this.testModel.testFirePropertyChangeObjectObject();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
- }
-
- public void testFirePropertyChangeObject() {
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(this);
- this.testModel.testFirePropertyChangeObject();
- this.verifyPropertyChangeEvent(null, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(this);
- this.testModel.testFirePropertyChangeObject();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this);
- this.testModel.testFirePropertyChangeObject();
- this.verifyPropertyChangeEvent(null, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this);
- this.testModel.testFirePropertyChangeObject();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
- }
-
- public void testFirePropertyChangeIntInt() {
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(this);
- this.testModel.testFirePropertyChangeIntInt();
- this.verifyPropertyChangeEvent(OLD_INT_VALUE, NEW_INT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(this);
- this.testModel.testFirePropertyChangeIntInt();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this);
- this.testModel.testFirePropertyChangeIntInt();
- this.verifyPropertyChangeEvent(OLD_INT_VALUE, NEW_INT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this);
- this.testModel.testFirePropertyChangeIntInt();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
- }
-
- public void testFirePropertyChangeBooleanBoolean() {
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(this);
- this.testModel.testFirePropertyChangeBooleanBoolean();
- this.verifyPropertyChangeEvent(OLD_BOOLEAN_VALUE, NEW_BOOLEAN_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(this);
- this.testModel.testFirePropertyChangeBooleanBoolean();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this);
- this.testModel.testFirePropertyChangeBooleanBoolean();
- this.verifyPropertyChangeEvent(OLD_BOOLEAN_VALUE, NEW_BOOLEAN_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this);
- this.testModel.testFirePropertyChangeBooleanBoolean();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
- }
-
- public void testFireItemAddedCollection() {
- this.collectionChangeEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(this);
- this.testModel.testFireItemAddedCollection();
- this.verifyCollectionChangeEvent(ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedCollectionCalled);
-
- this.collectionChangeEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(this);
- this.testModel.testFireItemAddedCollection();
- assertNull(this.collectionChangeEvent);
- assertFalse(this.itemsAddedCollectionCalled);
-
- this.collectionChangeEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this);
- this.testModel.testFireItemAddedCollection();
- this.verifyCollectionChangeEvent(ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedCollectionCalled);
-
- this.collectionChangeEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this);
- this.testModel.testFireItemAddedCollection();
- assertNull(this.collectionChangeEvent);
- assertFalse(this.itemsAddedCollectionCalled);
- }
-
- public void testFireItemRemovedCollection() {
- this.collectionChangeEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(this);
- this.testModel.testFireItemRemovedCollection();
- this.verifyCollectionChangeEvent(REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedCollectionCalled);
-
- this.collectionChangeEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(this);
- this.testModel.testFireItemRemovedCollection();
- assertNull(this.collectionChangeEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionChangeEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this);
- this.testModel.testFireItemRemovedCollection();
- this.verifyCollectionChangeEvent(REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedCollectionCalled);
-
- this.collectionChangeEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this);
- this.testModel.testFireItemRemovedCollection();
- assertNull(this.collectionChangeEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
- }
-
- public void testFireCollectionCleared() {
- this.collectionChangeEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.addCollectionChangeListener(this);
- this.testModel.testFireCollectionCleared();
- this.verifyCollectionChangeEvent(null);
- assertTrue(this.collectionClearedCalled);
-
- this.collectionChangeEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.removeCollectionChangeListener(this);
- this.testModel.testFireCollectionCleared();
- assertNull(this.collectionChangeEvent);
- assertFalse(this.collectionClearedCalled);
-
- this.collectionChangeEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this);
- this.testModel.testFireCollectionCleared();
- this.verifyCollectionChangeEvent(null);
- assertTrue(this.collectionClearedCalled);
-
- this.collectionChangeEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this);
- this.testModel.testFireCollectionCleared();
- assertNull(this.collectionChangeEvent);
- assertFalse(this.collectionClearedCalled);
- }
-
- public void testFireCollectionChanged() {
- this.collectionChangeEvent = null;
- this.collectionChangedCalled = false;
- this.testModel.addCollectionChangeListener(this);
- this.testModel.testFireCollectionChanged();
- this.verifyCollectionChangeEvent(null);
- assertTrue(this.collectionChangedCalled);
-
- this.collectionChangeEvent = null;
- this.collectionChangedCalled = false;
- this.testModel.removeCollectionChangeListener(this);
- this.testModel.testFireCollectionChanged();
- assertNull(this.collectionChangeEvent);
- assertFalse(this.collectionChangedCalled);
-
- this.collectionChangeEvent = null;
- this.collectionChangedCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this);
- this.testModel.testFireCollectionChanged();
- this.verifyCollectionChangeEvent(null);
- assertTrue(this.collectionChangedCalled);
-
- this.collectionChangeEvent = null;
- this.collectionChangedCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this);
- this.testModel.testFireCollectionChanged();
- assertNull(this.collectionChangeEvent);
- assertFalse(this.collectionChangedCalled);
- }
-
- public void testFireItemAddedList() {
- this.listChangeEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addListChangeListener(this);
- this.testModel.testFireItemAddedList();
- this.verifyListChangeEvent(ADD_INDEX, ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedListCalled);
-
- this.listChangeEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeListChangeListener(this);
- this.testModel.testFireItemAddedList();
- assertNull(this.listChangeEvent);
- assertFalse(this.itemsAddedListCalled);
-
- this.listChangeEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this);
- this.testModel.testFireItemAddedList();
- this.verifyListChangeEvent(ADD_INDEX, ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedListCalled);
-
- this.listChangeEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this);
- this.testModel.testFireItemAddedList();
- assertNull(this.listChangeEvent);
- assertFalse(this.itemsAddedListCalled);
- }
-
- public void testFireItemRemovedList() {
- this.listChangeEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addListChangeListener(this);
- this.testModel.testFireItemRemovedList();
- this.verifyListChangeEvent(REMOVE_INDEX, REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedListCalled);
-
- this.listChangeEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeListChangeListener(this);
- this.testModel.testFireItemRemovedList();
- assertNull(this.listChangeEvent);
- assertFalse(this.itemsRemovedListCalled);
-
- this.listChangeEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this);
- this.testModel.testFireItemRemovedList();
- this.verifyListChangeEvent(REMOVE_INDEX, REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedListCalled);
-
- this.listChangeEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this);
- this.testModel.testFireItemRemovedList();
- assertNull(this.listChangeEvent);
- assertFalse(this.itemsRemovedListCalled);
- }
-
- public void testFireItemReplacedList() {
- this.listChangeEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.addListChangeListener(this);
- this.testModel.testFireItemReplacedList();
- this.verifyListChangeEvent(REPLACE_INDEX, ADDED_OBJECT_VALUE, REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsReplacedListCalled);
-
- this.listChangeEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.removeListChangeListener(this);
- this.testModel.testFireItemReplacedList();
- assertNull(this.listChangeEvent);
- assertFalse(this.itemsReplacedListCalled);
-
- this.listChangeEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this);
- this.testModel.testFireItemReplacedList();
- this.verifyListChangeEvent(REPLACE_INDEX, ADDED_OBJECT_VALUE, REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsReplacedListCalled);
-
- this.listChangeEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this);
- this.testModel.testFireItemReplacedList();
- assertNull(this.listChangeEvent);
- assertFalse(this.itemsReplacedListCalled);
- }
-
- public void testFireItemMovedList() {
- this.listChangeEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.addListChangeListener(this);
- this.testModel.testFireItemMovedList();
- this.verifyListChangeEvent(TARGET_INDEX, SOURCE_INDEX);
- assertTrue(this.itemsMovedListCalled);
-
- this.listChangeEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.removeListChangeListener(this);
- this.testModel.testFireItemMovedList();
- assertNull(this.listChangeEvent);
- assertFalse(this.itemsMovedListCalled);
-
- this.listChangeEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this);
- this.testModel.testFireItemMovedList();
- this.verifyListChangeEvent(TARGET_INDEX, SOURCE_INDEX);
- assertTrue(this.itemsMovedListCalled);
-
- this.listChangeEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this);
- this.testModel.testFireItemMovedList();
- assertNull(this.listChangeEvent);
- assertFalse(this.itemsMovedListCalled);
- }
-
- public void testFireListCleared() {
- this.listChangeEvent = null;
- this.listClearedCalled = false;
- this.testModel.addListChangeListener(this);
- this.testModel.testFireListCleared();
- this.verifyListChangeEvent(-1, null);
- assertTrue(this.listClearedCalled);
-
- this.listChangeEvent = null;
- this.listClearedCalled = false;
- this.testModel.removeListChangeListener(this);
- this.testModel.testFireListCleared();
- assertNull(this.listChangeEvent);
- assertFalse(this.listClearedCalled);
-
- this.listChangeEvent = null;
- this.listClearedCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this);
- this.testModel.testFireListCleared();
- this.verifyListChangeEvent(-1, null);
- assertTrue(this.listClearedCalled);
-
- this.listChangeEvent = null;
- this.listClearedCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this);
- this.testModel.testFireListCleared();
- assertNull(this.listChangeEvent);
- assertFalse(this.listClearedCalled);
- }
-
- public void testFireListChanged() {
- this.listChangeEvent = null;
- this.listChangedCalled = false;
- this.testModel.addListChangeListener(this);
- this.testModel.testFireListChanged();
- this.verifyListChangeEvent(-1, null);
- assertTrue(this.listChangedCalled);
-
- this.listChangeEvent = null;
- this.listChangedCalled = false;
- this.testModel.removeListChangeListener(this);
- this.testModel.testFireListChanged();
- assertNull(this.listChangeEvent);
- assertFalse(this.listChangedCalled);
-
- this.listChangeEvent = null;
- this.listChangedCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this);
- this.testModel.testFireListChanged();
- this.verifyListChangeEvent(-1, null);
- assertTrue(this.listChangedCalled);
-
- this.listChangeEvent = null;
- this.listChangedCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this);
- this.testModel.testFireListChanged();
- assertNull(this.listChangeEvent);
- assertFalse(this.listChangedCalled);
- }
-
- public void testFireNodeAddedObjectArrayPath() {
- this.treeChangeEvent = null;
- this.nodeAddedCalled = false;
- this.testModel.addTreeChangeListener(this);
- this.testModel.testFireNodeAddedObjectArrayPath();
- this.verifyTreeChangeEvent(OBJECT_ARRAY_PATH);
- assertTrue(this.nodeAddedCalled);
-
- this.treeChangeEvent = null;
- this.nodeAddedCalled = false;
- this.testModel.removeTreeChangeListener(this);
- this.testModel.testFireNodeAddedObjectArrayPath();
- assertNull(this.treeChangeEvent);
- assertFalse(this.nodeAddedCalled);
-
- this.treeChangeEvent = null;
- this.nodeAddedCalled = false;
- this.testModel.addTreeChangeListener(TREE_NAME, this);
- this.testModel.testFireNodeAddedObjectArrayPath();
- this.verifyTreeChangeEvent(OBJECT_ARRAY_PATH);
- assertTrue(this.nodeAddedCalled);
-
- this.treeChangeEvent = null;
- this.nodeAddedCalled = false;
- this.testModel.removeTreeChangeListener(TREE_NAME, this);
- this.testModel.testFireNodeAddedObjectArrayPath();
- assertNull(this.treeChangeEvent);
- assertFalse(this.nodeAddedCalled);
- }
-
- public void testFireNodeRemovedObjectArrayPath() {
- this.treeChangeEvent = null;
- this.nodeRemovedCalled = false;
- this.testModel.addTreeChangeListener(this);
- this.testModel.testFireNodeRemovedObjectArrayPath();
- this.verifyTreeChangeEvent(OBJECT_ARRAY_PATH);
- assertTrue(this.nodeRemovedCalled);
-
- this.treeChangeEvent = null;
- this.nodeRemovedCalled = false;
- this.testModel.removeTreeChangeListener(this);
- this.testModel.testFireNodeRemovedObjectArrayPath();
- assertNull(this.treeChangeEvent);
- assertFalse(this.nodeRemovedCalled);
-
- this.treeChangeEvent = null;
- this.nodeRemovedCalled = false;
- this.testModel.addTreeChangeListener(TREE_NAME, this);
- this.testModel.testFireNodeRemovedObjectArrayPath();
- this.verifyTreeChangeEvent(OBJECT_ARRAY_PATH);
- assertTrue(this.nodeRemovedCalled);
-
- this.treeChangeEvent = null;
- this.nodeRemovedCalled = false;
- this.testModel.removeTreeChangeListener(TREE_NAME, this);
- this.testModel.testFireNodeRemovedObjectArrayPath();
- assertNull(this.treeChangeEvent);
- assertFalse(this.nodeRemovedCalled);
- }
-
- public void testFireTreeCleared() {
- this.treeChangeEvent = null;
- this.treeClearedCalled = false;
- this.testModel.addTreeChangeListener(this);
- this.testModel.testFireTreeCleared();
- this.verifyTreeChangeEvent(EMPTY_PATH);
- assertTrue(this.treeClearedCalled);
-
- this.treeChangeEvent = null;
- this.treeClearedCalled = false;
- this.testModel.removeTreeChangeListener(this);
- this.testModel.testFireTreeCleared();
- assertNull(this.treeChangeEvent);
- assertFalse(this.treeClearedCalled);
-
- this.treeChangeEvent = null;
- this.treeClearedCalled = false;
- this.testModel.addTreeChangeListener(TREE_NAME, this);
- this.testModel.testFireTreeCleared();
- this.verifyTreeChangeEvent(EMPTY_PATH);
- assertTrue(this.treeClearedCalled);
-
- this.treeChangeEvent = null;
- this.treeClearedCalled = false;
- this.testModel.removeTreeChangeListener(TREE_NAME, this);
- this.testModel.testFireTreeCleared();
- assertNull(this.treeChangeEvent);
- assertFalse(this.treeClearedCalled);
- }
-
- public void testFireTreeChangedObjectArrayPath() {
- this.treeChangeEvent = null;
- this.treeChangedCalled = false;
- this.testModel.addTreeChangeListener(this);
- this.testModel.testFireTreeChangedObjectArrayPath();
- this.verifyTreeChangeEvent(OBJECT_ARRAY_PATH);
- assertTrue(this.treeChangedCalled);
-
- this.treeChangeEvent = null;
- this.treeChangedCalled = false;
- this.testModel.removeTreeChangeListener(this);
- this.testModel.testFireTreeChangedObjectArrayPath();
- assertNull(this.treeChangeEvent);
- assertFalse(this.treeChangedCalled);
-
- this.treeChangeEvent = null;
- this.treeChangedCalled = false;
- this.testModel.addTreeChangeListener(TREE_NAME, this);
- this.testModel.testFireTreeChangedObjectArrayPath();
- this.verifyTreeChangeEvent(OBJECT_ARRAY_PATH);
- assertTrue(this.treeChangedCalled);
-
- this.treeChangeEvent = null;
- this.treeChangedCalled = false;
- this.testModel.removeTreeChangeListener(TREE_NAME, this);
- this.testModel.testFireTreeChangedObjectArrayPath();
- assertNull(this.treeChangeEvent);
- assertFalse(this.treeChangedCalled);
- }
-
- public void testHasAnyChangeListeners() {
- assertFalse(this.testModel.hasAnyPropertyChangeListeners(PROPERTY_NAME));
- this.testModel.addPropertyChangeListener(this);
- assertTrue(this.testModel.hasAnyPropertyChangeListeners(PROPERTY_NAME));
- this.testModel.removePropertyChangeListener(this);
-
- assertFalse(this.testModel.hasAnyPropertyChangeListeners(PROPERTY_NAME));
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this);
- assertTrue(this.testModel.hasAnyPropertyChangeListeners(PROPERTY_NAME));
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this);
-
- assertFalse(this.testModel.hasAnyCollectionChangeListeners(COLLECTION_NAME));
- this.testModel.addCollectionChangeListener(this);
- assertTrue(this.testModel.hasAnyCollectionChangeListeners(COLLECTION_NAME));
- this.testModel.removeCollectionChangeListener(this);
-
- assertFalse(this.testModel.hasAnyCollectionChangeListeners(COLLECTION_NAME));
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this);
- assertTrue(this.testModel.hasAnyCollectionChangeListeners(COLLECTION_NAME));
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this);
-
- assertFalse(this.testModel.hasAnyListChangeListeners(LIST_NAME));
- this.testModel.addListChangeListener(this);
- assertTrue(this.testModel.hasAnyListChangeListeners(LIST_NAME));
- this.testModel.removeListChangeListener(this);
-
- assertFalse(this.testModel.hasAnyListChangeListeners(LIST_NAME));
- this.testModel.addListChangeListener(LIST_NAME, this);
- assertTrue(this.testModel.hasAnyListChangeListeners(LIST_NAME));
- this.testModel.removeListChangeListener(LIST_NAME, this);
-
- assertFalse(this.testModel.hasAnyTreeChangeListeners(TREE_NAME));
- this.testModel.addTreeChangeListener(this);
- assertTrue(this.testModel.hasAnyTreeChangeListeners(TREE_NAME));
- this.testModel.removeTreeChangeListener(this);
-
- assertFalse(this.testModel.hasAnyTreeChangeListeners(TREE_NAME));
- this.testModel.addTreeChangeListener(TREE_NAME, this);
- assertTrue(this.testModel.hasAnyTreeChangeListeners(TREE_NAME));
- this.testModel.removeTreeChangeListener(TREE_NAME, this);
- }
-
- public void testAttributeValueHasChanged() {
- this.testModel.testAttributeValueHasChanged();
- }
-
- public void testClone() {
- assertFalse(this.testModel.hasAnyPropertyChangeListeners(PROPERTY_NAME));
- this.testModel.addPropertyChangeListener(this);
- 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.addPropertyChangeListener(this);
- 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.testFirePropertyChangeObjectObject();
- this.verifyPropertyChangeEvent(OLD_OBJECT_VALUE, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- // now test events fired by clone
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- clone.testFirePropertyChangeObjectObject();
- this.verifyPropertyChangeEvent(clone, OLD_OBJECT_VALUE, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
- }
-
- public void testAddNullStateListener() {
- boolean exCaught = false;
- try {
- this.testModel.addStateChangeListener(null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddNullPropertyListener() {
- boolean exCaught = false;
- try {
- this.testModel.addPropertyChangeListener(null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddNullCollectionListener() {
- boolean exCaught = false;
- try {
- this.testModel.addCollectionChangeListener(null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddNullListListener() {
- boolean exCaught = false;
- try {
- this.testModel.addListChangeListener(null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddNullTreeListener() {
- boolean exCaught = false;
- try {
- this.testModel.addTreeChangeListener(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 testAddNullCollectionListenerName() {
- boolean exCaught = false;
- try {
- this.testModel.addCollectionChangeListener("foo", null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddNullListListenerName() {
- boolean exCaught = false;
- try {
- this.testModel.addListChangeListener("foo", null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddNullTreeListenerName() {
- boolean exCaught = false;
- try {
- this.testModel.addTreeChangeListener("foo", null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusStateListener() {
- boolean exCaught = false;
- try {
- this.testModel.removeStateChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removeStateChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addStateChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removeStateChangeListener(new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusPropertyListener() {
- boolean exCaught = false;
- try {
- this.testModel.removePropertyChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addCollectionChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removePropertyChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removePropertyChangeListener(new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusCollectionListener() {
- boolean exCaught = false;
- try {
- this.testModel.removeCollectionChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removeCollectionChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addCollectionChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removeCollectionChangeListener(new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusListListener() {
- boolean exCaught = false;
- try {
- this.testModel.removeListChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removeListChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addListChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removeListChangeListener(new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusTreeListener() {
- boolean exCaught = false;
- try {
- this.testModel.removeTreeChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removeTreeChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addTreeChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removeTreeChangeListener(new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusPropertyListenerName() {
- boolean exCaught = false;
- try {
- this.testModel.removePropertyChangeListener("foo", this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addCollectionChangeListener("foo", this);
- exCaught = false;
- try {
- this.testModel.removePropertyChangeListener("foo", this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener("foo", this);
- exCaught = false;
- try {
- this.testModel.removePropertyChangeListener("foo", new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusCollectionListenerName() {
- boolean exCaught = false;
- try {
- this.testModel.removeCollectionChangeListener("foo", this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener("foo", this);
- exCaught = false;
- try {
- this.testModel.removeCollectionChangeListener("foo", this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addCollectionChangeListener("foo", this);
- exCaught = false;
- try {
- this.testModel.removeCollectionChangeListener("foo", new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusListListenerName() {
- boolean exCaught = false;
- try {
- this.testModel.removeListChangeListener("foo", this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener("foo", this);
- exCaught = false;
- try {
- this.testModel.removeListChangeListener("foo", this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addListChangeListener("foo", this);
- exCaught = false;
- try {
- this.testModel.removeListChangeListener("foo", new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusTreeListenerName() {
- boolean exCaught = false;
- try {
- this.testModel.removeTreeChangeListener("foo", this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener("foo", this);
- exCaught = false;
- try {
- this.testModel.removeTreeChangeListener("foo", this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addTreeChangeListener("foo", this);
- exCaught = false;
- try {
- this.testModel.removeTreeChangeListener("foo", new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testToString() {
- assertTrue(this.testModel.toString().indexOf(TEST_TO_STRING) != -1);
- }
-
-// ********** internal methods **********
-
- 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());
- }
-
- private void verifyCollectionChangeEvent(Object item) {
- assertNotNull(this.collectionChangeEvent);
- assertEquals(this.testModel, this.collectionChangeEvent.getSource());
- assertEquals(COLLECTION_NAME, this.collectionChangeEvent.getCollectionName());
- if (item == null) {
- assertFalse(this.collectionChangeEvent.items().hasNext());
- } else {
- assertEquals(item, this.collectionChangeEvent.items().next());
- }
- }
-
- private void verifyListChangeEvent(int index, Object item) {
- this.verifyListChangeEvent(index, item, null);
- }
-
- private void verifyListChangeEvent(int targetIndex, int sourceIndex) {
- assertNotNull(this.listChangeEvent);
- assertEquals(this.testModel, this.listChangeEvent.getSource());
- assertEquals(LIST_NAME, this.listChangeEvent.getListName());
- assertEquals(targetIndex, this.listChangeEvent.getTargetIndex());
- assertEquals(sourceIndex, this.listChangeEvent.getSourceIndex());
- }
-
- private void verifyListChangeEvent(int index, Object item, Object replacedItem) {
- assertNotNull(this.listChangeEvent);
- assertEquals(this.testModel, this.listChangeEvent.getSource());
- assertEquals(LIST_NAME, this.listChangeEvent.getListName());
- assertEquals(index, this.listChangeEvent.getIndex());
- if (item == null) {
- assertFalse(this.listChangeEvent.items().hasNext());
- } else {
- assertEquals(item, this.listChangeEvent.items().next());
- }
- if (replacedItem == null) {
- assertFalse(this.listChangeEvent.replacedItems().hasNext());
- } else {
- assertEquals(replacedItem, this.listChangeEvent.replacedItems().next());
- }
- }
-
- private void verifyTreeChangeEvent(Object[] path) {
- assertNotNull(this.treeChangeEvent);
- assertEquals(this.testModel, this.treeChangeEvent.getSource());
- assertEquals(TREE_NAME, this.treeChangeEvent.getTreeName());
- assertTrue(Arrays.equals(path, this.treeChangeEvent.getPath()));
- }
-
- public void testValuesAreEqual1() {
- assertTrue(this.testModel.testValuesAreEqual(null, null));
- assertFalse(this.testModel.testValuesAreDifferent(null, null));
- }
-
- public void testValuesAreEqual2() {
- assertTrue(this.testModel.testValuesAreEqual("foo", "foo"));
- assertFalse(this.testModel.testValuesAreDifferent("foo", "foo"));
- }
-
- public void testValuesAreEqual3() {
- assertFalse(this.testModel.testValuesAreEqual("foo", null));
- assertTrue(this.testModel.testValuesAreDifferent("foo", null));
- }
-
- public void testValuesAreEqual4() {
- assertFalse(this.testModel.testValuesAreEqual(null, "foo"));
- assertTrue(this.testModel.testValuesAreDifferent(null, "foo"));
- }
-
- public void testValuesAreEqual5() {
- assertFalse(this.testModel.testValuesAreEqual("bar", "foo"));
- assertTrue(this.testModel.testValuesAreDifferent("bar", "foo"));
- }
-
-
- // ********** listener implementations **********
-
- public void stateChanged(StateChangeEvent e) {
- this.stateChangedCalled = true;
- this.stateChangeEvent = e;
- }
-
- public void propertyChanged(PropertyChangeEvent e) {
- this.propertyChangeCalled = true;
- this.propertyChangeEvent = e;
- }
-
- public void itemsAdded(CollectionChangeEvent e) {
- this.itemsAddedCollectionCalled = true;
- this.collectionChangeEvent = e;
- }
- public void itemsRemoved(CollectionChangeEvent e) {
- this.itemsRemovedCollectionCalled = true;
- this.collectionChangeEvent = e;
- }
- public void collectionCleared(CollectionChangeEvent e) {
- this.collectionClearedCalled = true;
- this.collectionChangeEvent = e;
- }
- public void collectionChanged(CollectionChangeEvent e) {
- this.collectionChangedCalled = true;
- this.collectionChangeEvent = e;
- }
-
- public void itemsAdded(ListChangeEvent e) {
- this.itemsAddedListCalled = true;
- this.listChangeEvent = e;
- }
- public void itemsRemoved(ListChangeEvent e) {
- this.itemsRemovedListCalled = true;
- this.listChangeEvent = e;
- }
- public void itemsReplaced(ListChangeEvent e) {
- this.itemsReplacedListCalled = true;
- this.listChangeEvent = e;
- }
- public void itemsMoved(ListChangeEvent e) {
- this.itemsMovedListCalled = true;
- this.listChangeEvent = e;
- }
- public void listCleared(ListChangeEvent e) {
- this.listClearedCalled = true;
- this.listChangeEvent = e;
- }
- public void listChanged(ListChangeEvent e) {
- this.listChangedCalled = true;
- this.listChangeEvent = e;
- }
-
- public void nodeAdded(TreeChangeEvent e) {
- this.nodeAddedCalled = true;
- this.treeChangeEvent = e;
- }
- public void nodeRemoved(TreeChangeEvent e) {
- this.nodeRemovedCalled = true;
- this.treeChangeEvent = e;
- }
- public void treeCleared(TreeChangeEvent e) {
- this.treeClearedCalled = true;
- this.treeChangeEvent = e;
- }
- public void treeChanged(TreeChangeEvent e) {
- this.treeChangedCalled = true;
- this.treeChangeEvent = e;
- }
-
- // ********** inner class **********
-
- private static class TestModel extends AbstractModel implements Cloneable {
- TestModel() {
- super();
- }
-
- public void testFireStateChange() {
- this.fireStateChanged();
- }
-
- public void testFirePropertyChangeObjectObject() {
- this.firePropertyChanged(PROPERTY_NAME, OLD_OBJECT_VALUE, NEW_OBJECT_VALUE);
- }
-
- public void testFirePropertyChangeObject() {
- this.firePropertyChanged(PROPERTY_NAME, NEW_OBJECT_VALUE);
- }
-
- public void testFirePropertyChangeIntInt() {
- this.firePropertyChanged(PROPERTY_NAME, OLD_INT_VALUE.intValue(), NEW_INT_VALUE.intValue());
- }
-
- public void testFirePropertyChangeBooleanBoolean() {
- this.firePropertyChanged(PROPERTY_NAME, OLD_BOOLEAN_VALUE.booleanValue(), NEW_BOOLEAN_VALUE.booleanValue());
- }
-
- public void testFireItemAddedCollection() {
- this.fireItemAdded(COLLECTION_NAME, ADDED_OBJECT_VALUE);
- }
-
- public void testFireItemRemovedCollection() {
- this.fireItemRemoved(COLLECTION_NAME, REMOVED_OBJECT_VALUE);
- }
-
- public void testFireCollectionCleared() {
- this.fireCollectionCleared(COLLECTION_NAME);
- }
-
- public void testFireCollectionChanged() {
- this.fireCollectionChanged(COLLECTION_NAME);
- }
-
- public void testFireItemAddedList() {
- this.fireItemAdded(LIST_NAME, ADD_INDEX, ADDED_OBJECT_VALUE);
- }
-
- public void testFireItemRemovedList() {
- this.fireItemRemoved(LIST_NAME, REMOVE_INDEX, REMOVED_OBJECT_VALUE);
- }
-
- public void testFireItemReplacedList() {
- this.fireItemReplaced(LIST_NAME, REPLACE_INDEX, ADDED_OBJECT_VALUE, REMOVED_OBJECT_VALUE);
- }
-
- public void testFireItemMovedList() {
- this.fireItemMoved(LIST_NAME, TARGET_INDEX, SOURCE_INDEX);
- }
-
- public void testFireListCleared() {
- this.fireListCleared(LIST_NAME);
- }
-
- public void testFireListChanged() {
- this.fireListChanged(LIST_NAME);
- }
-
- public void testFireNodeAddedObjectArrayPath() {
- this.fireNodeAdded(TREE_NAME, OBJECT_ARRAY_PATH);
- }
-
- public void testFireNodeRemovedObjectArrayPath() {
- this.fireNodeRemoved(TREE_NAME, OBJECT_ARRAY_PATH);
- }
-
- public void testFireTreeCleared() {
- this.fireTreeCleared(TREE_NAME);
- }
-
- public void testFireTreeChangedObjectArrayPath() {
- this.fireTreeChanged(TREE_NAME, OBJECT_ARRAY_PATH);
- }
-
- public void testAttributeValueHasChanged() {
- assertTrue(this.attributeValueHasChanged(null, new Object()));
- assertTrue(this.attributeValueHasChanged(new Object(), null));
- assertTrue(this.attributeValueHasChanged(new Object(), new Object()));
-
- Object same = new Object();
- assertFalse(this.attributeValueHasChanged(same, same));
- assertFalse(this.attributeValueHasChanged(null, null));
- }
-
- @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);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(TEST_TO_STRING);
- }
-
- }
-
-
- // ********** serialization test **********
-
-//TODO - This test doesn't pass in the Eclipse build environment (Linux) for some reason
-// public void testSerialization() throws 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(joo1);
-// model1.addListChangeListener(jar1);
-//
-// ChangeListener[] listeners1 = this.listeners(model1, StateChangeListener.class);
-// assertEquals(2, listeners1.length);
-// // the order of these could change...
-// assertEquals(Foo.class, listeners1[0].getClass());
-// assertEquals(Bar.class, listeners1[1].getClass());
-//
-// listeners1 = this.listeners(model1, ListChangeListener.class);
-// assertEquals(2, listeners1.length);
-// // the order of these could change...
-// assertEquals(Joo.class, listeners1[0].getClass());
-// assertEquals(Jar.class, listeners1[1].getClass());
-//
-// LocalModel model2 = TestTools.serialize(model1);
-//
-// ChangeListener[] listeners2 = this.listeners(model2, StateChangeListener.class);
-// assertEquals(1, listeners2.length);
-// assertEquals(Foo.class, listeners2[0].getClass());
-//
-// listeners2 = this.listeners(model2, ListChangeListener.class);
-// assertEquals(1, listeners2.length);
-// assertEquals(Joo.class, listeners2[0].getClass());
-// }
-
-// >>>>>>>>>>>>>>>>> these methods are called by #testSerialization(), commented out above...
- private ChangeListener[] listeners(LocalModel model, Class<? extends ChangeListener> listenerClass) {
- ChangeSupport changeSupport = (ChangeSupport) ClassTools.fieldValue(model, "changeSupport");
- return (ChangeListener[]) ClassTools.executeMethod(changeSupport, "listeners", Class.class, listenerClass);
- }
-
- private static class LocalModel extends AbstractModel implements Serializable {
- LocalModel() {
- super();
- }
- }
-
- 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 {
-// private static final ObjectStreamField[] serialPersistentFields = {new ObjectStreamField("changeSupport", ChangeSupport.class)};
- 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");
- }
- void notifyListListeners() {
- this.fireListChanged("foo");
- }
- void notifyTreeListeners() {
- this.fireTreeChanged("foo");
- }
- }
-
- /**
- * This object will fire state change events whenever it receives
- * a state change event from localA.
- */
- private static class LocalB
- extends AbstractModel
- implements StateChangeListener, PropertyChangeListener, CollectionChangeListener, ListChangeListener, TreeChangeListener
- {
- LocalB(LocalA localA) {
- super();
- localA.addStateChangeListener(this);
- localA.addPropertyChangeListener(this);
- localA.addCollectionChangeListener(this);
- localA.addListChangeListener(this);
- localA.addTreeChangeListener(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");
- }
- public void collectionCleared(CollectionChangeEvent e) {/*ignore*/}
- public void itemsAdded(CollectionChangeEvent e) {/*ignore*/}
- public void itemsRemoved(CollectionChangeEvent e) {/*ignore*/}
-
- public void listChanged(ListChangeEvent e) {
- this.fireListChanged("bar");
- }
- public void listCleared(ListChangeEvent e) {/*ignore*/}
- public void itemsAdded(ListChangeEvent e) {/*ignore*/}
- public void itemsRemoved(ListChangeEvent e) {/*ignore*/}
- public void itemsReplaced(ListChangeEvent e) {/*ignore*/}
- public void itemsMoved(ListChangeEvent e) {/*ignore*/}
-
- public void treeChanged(TreeChangeEvent e) {
- this.fireTreeChanged("bar");
- }
- public void treeCleared(TreeChangeEvent e) {/*ignore*/}
- public void nodeAdded(TreeChangeEvent e) {/*ignore*/}
- public void nodeRemoved(TreeChangeEvent 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 StateChangeListener, PropertyChangeListener, CollectionChangeListener, ListChangeListener, TreeChangeListener
- {
- private LocalA localA;
- private LocalB localB;
- private boolean listeningToLocalA;
-
- LocalC(LocalA localA, LocalB localB) {
- super();
- this.localA = localA;
- this.localB = localB;
-
- localA.addStateChangeListener(this);
- localA.addPropertyChangeListener(this);
- localA.addCollectionChangeListener(this);
- localA.addListChangeListener(this);
- localA.addTreeChangeListener(this);
- this.listeningToLocalA = true;
-
- localB.addStateChangeListener(this);
- localB.addPropertyChangeListener(this);
- localB.addCollectionChangeListener(this);
- localB.addListChangeListener(this);
- localB.addTreeChangeListener(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.removeStateChangeListener(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.removePropertyChangeListener(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.removeCollectionChangeListener(this);
- this.listeningToLocalA = false;
- } else {
- throw new IllegalStateException("bogus event source: " + source);
- }
- }
- public void collectionCleared(CollectionChangeEvent e) {/*ignore*/}
- public void itemsAdded(CollectionChangeEvent e) {/*ignore*/}
- public void itemsRemoved(CollectionChangeEvent 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.removeListChangeListener(this);
- this.listeningToLocalA = false;
- } else {
- throw new IllegalStateException("bogus event source: " + source);
- }
- }
- public void listCleared(ListChangeEvent e) {/*ignore*/}
- public void itemsAdded(ListChangeEvent e) {/*ignore*/}
- public void itemsRemoved(ListChangeEvent e) {/*ignore*/}
- public void itemsReplaced(ListChangeEvent e) {/*ignore*/}
- public void itemsMoved(ListChangeEvent 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.removeTreeChangeListener(this);
- this.listeningToLocalA = false;
- } else {
- throw new IllegalStateException("bogus event source: " + source);
- }
- }
- public void treeCleared(TreeChangeEvent e) {/*ignore*/}
- public void nodeAdded(TreeChangeEvent e) {/*ignore*/}
- public void nodeRemoved(TreeChangeEvent 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 37e386b93f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/JptUtilityModelTests.java
+++ /dev/null
@@ -1,36 +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;
-
-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(AbstractModelTests.class);
- suite.addTestSuite(NewEventTests.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 b8dfa4bb02..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/NewEventTests.java
+++ /dev/null
@@ -1,187 +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.tests.internal.model;
-
-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.ChangeSupport;
-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.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 ChangeListener {
- void fooChanged(FooChangeEvent event);
- }
-
- static class FooChangeEvent extends ChangeEvent {
- private static final long serialVersionUID = 1L;
- public FooChangeEvent(FooModel source) {
- super(source);
- }
- @Override
- public String getAspectName() {
- return null; // the point of the event is that the name is unknown...
- }
- @Override
- public FooChangeEvent cloneWithSource(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 FooChangeListener[] fooChangeListeners() {
- return (FooChangeListener[]) this.listeners(FOO_CHANGE_LISTENER_CLASS);
- }
- public void fireFooChanged() {
- FooChangeListener[] targets = null;
- synchronized (this) {
- FooChangeListener[] fooChangeListeners = this.fooChangeListeners();
- if (fooChangeListeners != null) {
- targets = fooChangeListeners.clone();
- }
- }
- if (targets != null) {
- FooChangeEvent event = null;
- for (FooChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.fooChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new FooChangeEvent((FooModel) this.source);
- }
- target.fooChanged(event);
- }
- }
- }
- this.sourceChanged(null);
- }
- }
-
-}
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 4fb3a8c651..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveCollectionChangeListenerTests.java
+++ /dev/null
@@ -1,453 +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.listener;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.ClassTools;
-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.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.ReflectiveChangeListener;
-
-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 testItemAddedZeroArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(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 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 testItemAddedSingleArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(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 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 testItemRemovedZeroArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(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 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 testItemRemovedSingleArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(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 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 testCollectionClearedZeroArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(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 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 testCollectionClearedSingleArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(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 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 testCollectionChangedZeroArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(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 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 testCollectionChangedSingleArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(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 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 = ClassTools.method(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, "itemAddedSingleArgument");
- testModel.addListChangeListener((ListChangeListener) listener);
-
- boolean exCaught = false;
- try {
- testModel.changeList();
- fail("listener mismatch: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-
- private 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);
- }
- void changeList() {
- this.fireListChanged("bogus list");
- }
- }
-
- private 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;
- Target(TestModel testModel, String collectionName, String string) {
- super();
- this.testModel = testModel;
- this.collectionName = collectionName;
- this.string = string;
- }
- void itemAddedZeroArgument() {
- this.itemAddedZeroArgumentFlag = true;
- }
- void itemAddedSingleArgument(CollectionChangeEvent e) {
- this.itemAddedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.collectionName, e.getCollectionName());
- assertEquals(this.string, e.items().next());
- }
- void itemRemovedZeroArgument() {
- this.itemRemovedZeroArgumentFlag = true;
- }
- void itemRemovedSingleArgument(CollectionChangeEvent e) {
- this.itemRemovedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.collectionName, e.getCollectionName());
- assertEquals(this.string, e.items().next());
- }
- void collectionClearedZeroArgument() {
- this.collectionClearedZeroArgumentFlag = true;
- }
- void collectionClearedSingleArgument(CollectionChangeEvent e) {
- this.collectionClearedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.collectionName, e.getCollectionName());
- assertFalse(e.items().hasNext());
- }
- void collectionChangedZeroArgument() {
- this.collectionChangedZeroArgumentFlag = true;
- }
- void collectionChangedSingleArgument(CollectionChangeEvent e) {
- this.collectionChangedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.collectionName, e.getCollectionName());
- assertFalse(e.items().hasNext());
- }
- void collectionChangedDoubleArgument(CollectionChangeEvent e, Object o) {
- fail("bogus event: " + e);
- }
- }
-
-}
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 b3bfae6abb..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveListChangeListenerTests.java
+++ /dev/null
@@ -1,742 +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.listener;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.ClassTools;
-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.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.ReflectiveChangeListener;
-
-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 testItemAddedZeroArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- testModel.addListChangeListener(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 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 testItemAddedSingleArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- testModel.addListChangeListener(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 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 testItemRemovedZeroArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- testModel.addListChangeListener(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 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 testItemRemovedSingleArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- testModel.addListChangeListener(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 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 testItemReplacedZeroArgument() {
- 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(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 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 testItemReplacedSingleArgument() {
- 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(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 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 testItemMovedZeroArgument() {
- 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(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 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 testItemMovedSingleArgument() {
- 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(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 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 testListClearedZeroArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1);
- testModel.addListChangeListener(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 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 testListClearedSingleArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1);
- testModel.addListChangeListener(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 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 testListChangedZeroArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1);
- testModel.addListChangeListener(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 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 testListChangedSingleArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1);
- testModel.addListChangeListener(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 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 = ClassTools.method(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, "itemAddedSingleArgument");
- testModel.addCollectionChangeListener((CollectionChangeListener) listener);
-
- boolean exCaught = false;
- try {
- testModel.changeCollection();
- fail("listener mismatch: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-
- private 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);
- }
- void changeCollection() {
- this.fireCollectionChanged("bogus collection");
- }
- }
-
- private 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;
- 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(ListChangeEvent e) {
- this.itemAddedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.listName, e.getListName());
- assertEquals(this.string, e.items().next());
- assertEquals(this.index, e.getIndex());
- }
- void itemRemovedZeroArgument() {
- this.itemRemovedZeroArgumentFlag = true;
- }
- void itemRemovedSingleArgument(ListChangeEvent e) {
- this.itemRemovedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.listName, e.getListName());
- assertEquals(this.string, e.items().next());
- assertEquals(this.index, e.getIndex());
- }
- void itemReplacedZeroArgument() {
- this.itemReplacedZeroArgumentFlag = true;
- }
- void itemReplacedSingleArgument(ListChangeEvent e) {
- this.itemReplacedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.listName, e.getListName());
- assertEquals(this.string, e.items().next());
- assertEquals(this.replacedString, e.replacedItems().next());
- assertEquals(this.index, e.getIndex());
- }
- void itemMovedZeroArgument() {
- this.itemMovedZeroArgumentFlag = true;
- }
- void itemMovedSingleArgument(ListChangeEvent 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(ListChangeEvent e) {
- this.listClearedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.listName, e.getListName());
- assertFalse(e.items().hasNext());
- assertEquals(this.index, e.getIndex());
- }
- void listClearedZeroArgument() {
- this.listClearedZeroArgumentFlag = true;
- }
- void listChangedSingleArgument(ListChangeEvent e) {
- this.listChangedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.listName, e.getListName());
- assertFalse(e.items().hasNext());
- assertEquals(this.index, e.getIndex());
- }
- void listChangedDoubleArgument(ListChangeEvent e, Object o) {
- fail("bogus event: " + e);
- }
- }
-
-}
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 cf3734b3b3..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectivePropertyChangeListenerTests.java
+++ /dev/null
@@ -1,193 +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.listener;
-
-import java.lang.reflect.Method;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.ClassTools;
-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;
-
-public class ReflectivePropertyChangeListenerTests extends TestCase {
-
- public ReflectivePropertyChangeListenerTests(String name) {
- super(name);
- }
-
- public void testZeroArgument() {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- testModel.addPropertyChangeListener(ReflectiveChangeListener.buildPropertyChangeListener(target, "propertyChangedZeroArgument"));
- testModel.setValue(99);
- assertTrue(target.zeroArgumentFlag);
- assertFalse(target.singleArgumentFlag);
- }
-
- 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);
- }
-
- public void testSingleArgument() {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- testModel.addPropertyChangeListener(ReflectiveChangeListener.buildPropertyChangeListener(target, "propertyChangedSingleArgument"));
- testModel.setValue(99);
- assertFalse(target.zeroArgumentFlag);
- assertTrue(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 = ClassTools.method(target, "propertyChangedSingleArgument2", new Class[] {Object.class});
- testModel.addPropertyChangeListener(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 = ClassTools.method(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 = ClassTools.method(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);
- }
-
-
- private 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();
- }
- }
- }
-
- private 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);
- }
- }
-
-}
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 fce7db4402..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveStateChangeListenerTests.java
+++ /dev/null
@@ -1,144 +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.listener;
-
-import java.lang.reflect.Method;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.ClassTools;
-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;
-
-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 = ClassTools.method(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((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 = ClassTools.method(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);
- }
-
-
- private class TestModel extends AbstractModel {
- TestModel() {
- super();
- }
- void changeState() {
- this.fireStateChanged();
- }
- void changeProperty() {
- this.firePropertyChanged("value", 55, 42);
- }
- }
-
- private 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);
- }
- }
-
-}
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 8072da2a01..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveTreeChangeListenerTests.java
+++ /dev/null
@@ -1,513 +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.listener;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-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.ClassTools;
-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.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.ReflectiveChangeListener;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-
-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 testNodeAddedZeroArgument() {
- TestModel testModel = new TestModel("root");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- testModel.addTreeChangeListener(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 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 testNodeAddedSingleArgument() {
- TestModel testModel = new TestModel("root");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- testModel.addTreeChangeListener(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 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 testNodeRemovedZeroArgument() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- testModel.addTreeChangeListener(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 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 testNodeRemovedSingleArgument() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- testModel.addTreeChangeListener(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 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 testTreeClearedZeroArgument() {
- 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(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 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 testTreeClearedSingleArgument() {
- 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(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 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 testTreeChangedZeroArgument() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "another child"});
- testModel.addTreeChangeListener(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 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 testTreeChangedSingleArgument() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "another child"});
- testModel.addTreeChangeListener(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 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 testBogusDoubleArgument1() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- boolean exCaught = false;
- try {
- TreeChangeListener listener = ReflectiveChangeListener.buildTreeChangeListener(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("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- Method method = ClassTools.method(target, "collectionChangedDoubleArgument", new Class[] {TreeChangeEvent.class, Object.class});
- boolean exCaught = false;
- try {
- TreeChangeListener listener = ReflectiveChangeListener.buildTreeChangeListener(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("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, "nodeAddedSingleArgument");
- testModel.addCollectionChangeListener((CollectionChangeListener) listener);
-
- boolean exCaught = false;
- try {
- testModel.changeCollection();
- fail("listener mismatch: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-
- private 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 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).toArray(new String[reversePath.size()]);
- }
- 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");
- }
- Object[] 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");
- }
- }
-
- private class Target {
- TestModel testModel;
- String treeName;
- 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;
- Target(TestModel testModel, String treeName, String[] path) {
- super();
- this.testModel = testModel;
- this.treeName = treeName;
- this.path = path;
- }
- void nodeAddedZeroArgument() {
- this.nodeAddedZeroArgumentFlag = true;
- }
- void nodeAddedSingleArgument(TreeChangeEvent e) {
- this.nodeAddedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.treeName, e.getTreeName());
- assertTrue(Arrays.equals(this.path, e.getPath()));
- }
- void nodeRemovedZeroArgument() {
- this.nodeRemovedZeroArgumentFlag = true;
- }
- void nodeRemovedSingleArgument(TreeChangeEvent e) {
- this.nodeRemovedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.treeName, e.getTreeName());
- assertTrue(Arrays.equals(this.path, e.getPath()));
- }
- void treeClearedZeroArgument() {
- this.treeClearedZeroArgumentFlag = true;
- }
- void treeClearedSingleArgument(TreeChangeEvent e) {
- this.treeClearedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.treeName, e.getTreeName());
- assertTrue(Arrays.equals(this.path, e.getPath()));
- }
- void treeChangedZeroArgument() {
- this.treeChangedZeroArgumentFlag = true;
- }
- void treeChangedSingleArgument(TreeChangeEvent e) {
- this.treeChangedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.treeName, e.getTreeName());
- assertTrue(Arrays.equals(this.path, e.getPath()));
- }
- void collectionChangedDoubleArgument(TreeChangeEvent e, Object o) {
- fail("bogus event: " + e);
- }
- }
-
-}
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 18daeb427e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/BufferedWritablePropertyValueModelTests.java
+++ /dev/null
@@ -1,408 +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 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.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;
-
-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 WritablePropertyValueModel<Integer> bufferedIDHolder;
- private WritablePropertyValueModel<String> bufferedNameHolder;
- private WritablePropertyValueModel<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 testValue() {
- 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 testAccept() {
- 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 testReset() {
- 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() {
- PropertyChangeListener bufferedListener = this.buildBufferedListener();
- this.bufferedNameHolder.addPropertyChangeListener(bufferedListener);
-
- PropertyChangeListener adapterListener = this.buildAdapterListener();
- this.nameAdapter.addPropertyChangeListener(adapterListener);
-
- PropertyChangeListener employeeListener = this.buildEmployeeListener();
- this.employee.addPropertyChangeListener(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);
- }
-
- private PropertyChangeListener buildBufferedListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- BufferedWritablePropertyValueModelTests.this.bufferedEvent = e;
- }
- };
- }
-
- private PropertyChangeListener buildAdapterListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- BufferedWritablePropertyValueModelTests.this.adapterEvent = e;
- }
- };
- }
-
- private PropertyChangeListener buildEmployeeListener() {
- return new PropertyChangeListener() {
- 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 **********
-
- private 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 62c56b993f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CachingTransformationPropertyValueModelTests.java
+++ /dev/null
@@ -1,220 +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.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.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() {
- PropertyChangeListener listener = this.buildTransformationListener();
- this.transformationObjectHolder.addPropertyChangeListener(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));
- PropertyChangeListener listener = this.buildTransformationListener();
- this.transformationObjectHolder.addPropertyChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.transformationObjectHolder.removePropertyChangeListener(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.addPropertyChangeListener(this.buildListener());
- this.transformationObjectHolder.addPropertyChangeListener(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 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 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());
- }
-
-
- private 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 f198721ef4..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CachingTransformationWritablePropertyValueModelTests.java
+++ /dev/null
@@ -1,249 +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.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.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 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() {
- PropertyChangeListener listener = this.buildTransformationListener();
- this.transformationObjectHolder.addPropertyChangeListener(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() {
- PropertyChangeListener listener = this.buildTransformationListener();
- this.transformationObjectHolder.addPropertyChangeListener(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));
- PropertyChangeListener listener = this.buildTransformationListener();
- this.transformationObjectHolder.addPropertyChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.transformationObjectHolder.removePropertyChangeListener(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.addPropertyChangeListener(this.buildListener());
- this.transformationObjectHolder.addPropertyChangeListener(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 PropertyChangeListener buildListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- CachingTransformationWritablePropertyValueModelTests.this.event = e;
- }
- };
- }
-
- private PropertyChangeListener buildTransformationListener() {
- return new PropertyChangeListener() {
- 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());
- }
-
-
- private class Person extends AbstractModel {
-
- private String name;
- public static final String NAME_PROPERTY = "nameProperty";
-
- private String parentName;
- public static final String PARENT_NAME_PROPERTY = "parentNameProperty";
-
- 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 3fd4db8219..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionAspectAdapterTests.java
+++ /dev/null
@@ -1,367 +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 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.CollectionChangeEvent;
-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;
-
-public class CollectionAspectAdapterTests extends TestCase {
- private TestSubject subject1;
- private WritablePropertyValueModel<TestSubject> subjectHolder1;
- private LocalCollectionAspectAdapter aa1;
- private CollectionChangeEvent 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(CollectionChangeEvent e) {
- CollectionAspectAdapterTests.this.value1Changed(e, ADD);
- }
- public void itemsRemoved(CollectionChangeEvent e) {
- CollectionAspectAdapterTests.this.value1Changed(e, REMOVE);
- }
- public void collectionCleared(CollectionChangeEvent e) {
- CollectionAspectAdapterTests.this.value1Changed(e, CLEAR);
- }
- public void collectionChanged(CollectionChangeEvent e) {
- CollectionAspectAdapterTests.this.value1Changed(e, CHANGE);
- }
- };
- }
-
- void value1Changed(CollectionChangeEvent 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());
- assertFalse(this.event1.items().hasNext());
- 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.event1.items().hasNext());
- 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());
- assertFalse(this.event1.items().hasNext());
- 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", this.event1.items().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", this.event1.items().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", this.event1.items().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", this.event1.items().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());
- assertFalse(this.event1.items().hasNext());
- 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));
-
- CollectionChangeListener listener2 = this.buildValueChangeListener1();
- this.aa1.addCollectionChangeListener(listener2);
- assertTrue(this.aa1.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- assertTrue(this.subject1.hasAnyCollectionChangeListeners(TestSubject.NAMES_COLLECTION));
- this.aa1.removeCollectionChangeListener(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);
- }
- }
- 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 1c7ac82e94..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionListValueModelAdapterTests.java
+++ /dev/null
@@ -1,234 +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 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.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-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(ListChangeEvent 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(ListChangeEvent 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(ListChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(ListChangeEvent 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));
- this.adapter.addListChangeListener(synchList);
- assertTrue(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.removeListChangeListener(synchList);
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- public void testCollectionChangedToEmpty() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(ListChangeEvent e) {/* OK */}
- });
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- JList jList = new JList(new ListModelAdapter(this.adapter));
- this.wrappedCollectionHolder.setCollection(new HashBag<String>());
- assertEquals(0, jList.getModel().getSize());
- }
-
- public void testCollectionChangedFromEmpty() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(ListChangeEvent e) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- HashBag<String> bag = new HashBag<String>();
- bag.add("foo");
- bag.add("bar");
- this.wrappedCollectionHolder.setCollection(bag);
- assertEquals(2, jList.getModel().getSize());
- }
-
- public void testCollectionChangedFromEmptyToEmpty() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(ListChangeEvent e) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- HashBag<String> bag = new HashBag<String>();
- this.wrappedCollectionHolder.setCollection(bag);
- assertEquals(0, jList.getModel().getSize());
- }
-
-
- class TestListChangeListener implements ListChangeListener {
- public void itemsAdded(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void itemsRemoved(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void itemsReplaced(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void itemsMoved(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void listCleared(ListChangeEvent 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 f0ba9ac45f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionPropertyValueModelAdapterTests.java
+++ /dev/null
@@ -1,234 +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 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.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;
-
-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));
-
- PropertyChangeListener listener = new PropertyChangeListener() {
- 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.addPropertyChangeListener(listener);
- assertTrue(((AbstractModel) this.adapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.wrappedCollectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
-
- this.adapter.removePropertyChangeListener(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
- */
- private 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.collectionHolder).remove(this.item);
- }
- } else {
- if (this.booleanValueOf(value)) {
- // the value is changing from false to true
- ((SimpleCollectionValueModel<String>) this.collectionHolder).add(this.item);
- }
- }
- }
- @Override
- protected Boolean buildValue() {
- return Boolean.valueOf(CollectionTools.contains(this.collectionHolder.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/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 1a7b688bd1..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeCollectionValueModelTests.java
+++ /dev/null
@@ -1,414 +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 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;
-
-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
- */
- private 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
- */
- private 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
- */
- private 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 657ffc17fb..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeListValueModelTests.java
+++ /dev/null
@@ -1,847 +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.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.model.value.CompositeListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-public class CompositeListValueModelTests extends TestCase {
- private SimpleListValueModel<String> lvm0;
- private SimpleListValueModel<String> lvm1;
- private SimpleListValueModel<String> lvm2;
- private SimpleListValueModel<String> lvm3;
- private SimpleListValueModel<SimpleListValueModel<String>> uberLVM;
- private CompositeListValueModel<SimpleListValueModel<String>, String> compositeLVM;
-
- public CompositeListValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- this.lvm0 = new SimpleListValueModel<String>();
- this.lvm0.add("aaa");
- this.lvm0.add("bbb");
- this.lvm0.add("ccc");
-
- this.lvm1 = new SimpleListValueModel<String>();
- this.lvm1.add("ddd");
- this.lvm1.add("eee");
-
- this.lvm2 = new SimpleListValueModel<String>();
- this.lvm2.add("fff");
-
- this.lvm3 = new SimpleListValueModel<String>();
- this.lvm3.add("ggg");
- this.lvm3.add("hhh");
- this.lvm3.add("iii");
- this.lvm3.add("jjj");
- this.lvm3.add("kkk");
-
- this.uberLVM = new SimpleListValueModel<SimpleListValueModel<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<SimpleListValueModel<String>, String>((ListValueModel<SimpleListValueModel<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);
-
- SimpleListValueModel<String> lvm = new SimpleListValueModel<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);
-
- SimpleListValueModel<String> lvm = new SimpleListValueModel<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);
-
- SimpleListValueModel<String> lvm = new SimpleListValueModel<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);
-
- SimpleListValueModel<String> lvmA = new SimpleListValueModel<String>();
- lvmA.add("xxx");
- lvmA.add("yyy");
- lvmA.add("zzz");
- SimpleListValueModel<String> lvmB = new SimpleListValueModel<String>();
- lvmB.add("ppp");
- lvmB.add("qqq");
- lvmB.add("rrr");
- Collection<SimpleListValueModel<String>> c = new ArrayList<SimpleListValueModel<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);
-
- SimpleListValueModel<String> lvmA = new SimpleListValueModel<String>();
- lvmA.add("xxx");
- lvmA.add("yyy");
- lvmA.add("zzz");
- SimpleListValueModel<String> lvmB = new SimpleListValueModel<String>();
- lvmB.add("ppp");
- lvmB.add("qqq");
- lvmB.add("rrr");
- List<SimpleListValueModel<String>> list = new ArrayList<SimpleListValueModel<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() {
- SimpleListValueModel<String> lvm4 = new SimpleListValueModel<String>();
- lvm4.add("lll");
- lvm4.add("mmm");
- this.uberLVM.add(lvm4);
-
- SimpleListValueModel<String> lvm5 = new SimpleListValueModel<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() {
- SimpleListValueModel<String> lvm4 = new SimpleListValueModel<String>();
- lvm4.add("lll");
- lvm4.add("mmm");
- this.uberLVM.add(lvm4);
-
- SimpleListValueModel<String> lvm5 = new SimpleListValueModel<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() {
- SimpleListValueModel<String> lvm4 = new SimpleListValueModel<String>();
- lvm4.add("lll");
- lvm4.add("mmm");
- this.uberLVM.add(lvm4);
-
- SimpleListValueModel<String> lvm5 = new SimpleListValueModel<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 testChangeSources() {
- List<SimpleListValueModel<String>> newList = new ArrayList<SimpleListValueModel<String>>();
- SimpleListValueModel<String> lvm4 = new SimpleListValueModel<String>();
- lvm4.add("lll");
- lvm4.add("mmm");
- newList.add(lvm4);
-
- SimpleListValueModel<String> lvm5 = new SimpleListValueModel<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.setList(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 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_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.setList(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_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm1.setList(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_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.setList(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));
- }
-
-}
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 5bee337438..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedBag.java
+++ /dev/null
@@ -1,153 +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 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.CollectionChangeEvent;
-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 Iterator<Bag.Entry<E>> entries() {
- return this.bag.entries();
- }
-
- // ********** CollectionChangeListener implementation **********
-
- public void itemsAdded(CollectionChangeEvent e) {
- for (@SuppressWarnings("unchecked") Iterator<E> stream = (Iterator<E>) e.items(); stream.hasNext(); ) {
- this.bag.add(stream.next());
- }
- }
-
- public void itemsRemoved(CollectionChangeEvent e) {
- for (@SuppressWarnings("unchecked") Iterator<E> stream = (Iterator<E>) e.items(); stream.hasNext(); ) {
- this.bag.remove(stream.next());
- }
- }
-
- public void collectionCleared(CollectionChangeEvent e) {
- this.bag.clear();
- }
-
- @SuppressWarnings("unchecked")
- public void collectionChanged(CollectionChangeEvent e) {
- this.bag.clear();
- CollectionTools.addAll(this.bag, ((CollectionValueModel<E>) e.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 13f9267d73..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedList.java
+++ /dev/null
@@ -1,254 +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 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.ListChangeEvent;
-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(ListChangeEvent e) {
- int i = e.getIndex();
- for (Iterator<E> stream = this.items(e); stream.hasNext(); ) {
- this.list.add(i++, stream.next());
- }
- }
-
- public void itemsRemoved(ListChangeEvent e) {
- int i = e.getIndex();
- for (Iterator<E> stream = this.items(e); stream.hasNext(); ) {
- stream.next();
- this.list.remove(i);
- }
- }
-
- public void itemsReplaced(ListChangeEvent e) {
- int i = e.getIndex();
- for (Iterator<E> stream = this.items(e); stream.hasNext(); ) {
- this.list.set(i++, stream.next());
- }
- }
-
- public void itemsMoved(ListChangeEvent e) {
- CollectionTools.move(this.list, e.getTargetIndex(), e.getSourceIndex(), e.getMoveLength());
- }
-
- public void listCleared(ListChangeEvent 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);
- }
-
- /**
- * minimize the scope of the suppressed warnings.=
- */
- @SuppressWarnings("unchecked")
- private Iterator<E> items(ListChangeEvent event) {
- return (Iterator<E>) event.items();
- }
-
- /**
- * 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 2866e9aa68..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ExtendedListValueModelWrapperTests.java
+++ /dev/null
@@ -1,292 +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 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.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-public class ExtendedListValueModelWrapperTests extends TestCase {
- private SimpleListValueModel<String> listHolder;
- private ListValueModel<String> extendedListHolder;
- ListChangeEvent 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.addListChangeListener(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(this.event.items()));
-
- this.event = null;
- this.eventType = null;
- this.listHolder.set(0, "AA");
- this.verifyEvent(REPLACE);
- assertFalse(CollectionTools.contains(this.event.items(), "A"));
- assertTrue(CollectionTools.contains(this.event.items(), "AA"));
- }
-
- private ListChangeListener buildListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent e) {
- ExtendedListValueModelWrapperTests.this.eventType = ADD;
- ExtendedListValueModelWrapperTests.this.event = e;
- }
- public void itemsRemoved(ListChangeEvent e) {
- ExtendedListValueModelWrapperTests.this.eventType = REMOVE;
- ExtendedListValueModelWrapperTests.this.event = e;
- }
- public void itemsReplaced(ListChangeEvent e) {
- ExtendedListValueModelWrapperTests.this.eventType = REPLACE;
- ExtendedListValueModelWrapperTests.this.event = e;
- }
- public void itemsMoved(ListChangeEvent e) {
- ExtendedListValueModelWrapperTests.this.eventType = MOVE;
- ExtendedListValueModelWrapperTests.this.event = e;
- }
- public void listCleared(ListChangeEvent e) {
- ExtendedListValueModelWrapperTests.this.eventType = CLEAR;
- ExtendedListValueModelWrapperTests.this.event = e;
- }
- 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);
- assertEquals(index, this.event.getIndex());
- assertEquals(item, this.event.items().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));
-
- ListChangeListener 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.addListChangeListener(listener);
- assertTrue(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.extendedListHolder.removeListChangeListener(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 9eceba1a02..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringCollectionValueModelTests.java
+++ /dev/null
@@ -1,287 +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 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.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-public class FilteringCollectionValueModelTests extends TestCase {
- private SimpleCollectionValueModel<String> collectionHolder;
- CollectionChangeEvent addEvent;
- CollectionChangeEvent removeEvent;
- CollectionChangeEvent collectionClearedEvent;
- CollectionChangeEvent collectionChangedEvent;
-
- private CollectionValueModel<String> filteredCollectionHolder;
- CollectionChangeEvent filteredAddEvent;
- CollectionChangeEvent filteredRemoveEvent;
- CollectionChangeEvent 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.setCollection(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));
- CollectionChangeListener listener = this.buildFilteredListener();
- this.filteredCollectionHolder.addCollectionChangeListener(listener);
- assertTrue(((AbstractModel) this.collectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.filteredCollectionHolder.removeCollectionChangeListener(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.addCollectionChangeListener(this.buildListener());
- this.filteredCollectionHolder.addCollectionChangeListener(this.buildFilteredListener());
- 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.setCollection(newCollection);
-
- this.verifyEvent(this.collectionChangedEvent, this.collectionHolder, new Vector<String>());
-
- tempCollection.remove("foo");
- tempCollection.add("baz");
- this.verifyEvent(this.filteredCollectionChangedEvent, this.filteredCollectionHolder, new Vector<String>());
-
- }
-
- private CollectionChangeListener buildListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.addEvent = e;
- }
- public void itemsRemoved(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.removeEvent = e;
- }
- public void collectionCleared(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.collectionClearedEvent = e;
- }
- public void collectionChanged(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.collectionChangedEvent = e;
- }
- };
- }
-
- private CollectionChangeListener buildFilteredListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.filteredAddEvent = e;
- }
- public void itemsRemoved(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.filteredRemoveEvent = e;
- }
- public void collectionCleared(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.filteredCollectionClearedEvent = e;
- }
- public void collectionChanged(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.filteredCollectionChangedEvent = e;
- }
- };
- }
-
- private void verifyEvent(CollectionChangeEvent event, Object source, Object items) {
- assertEquals(source, event.getSource());
- assertEquals(CollectionValueModel.VALUES, event.getCollectionName());
- assertEquals(items, CollectionTools.vector(event.items()));
- }
-
- 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 7c3b8a6e59..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringPropertyValueModelTests.java
+++ /dev/null
@@ -1,186 +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.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.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;
-
-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));
- PropertyChangeListener listener = this.buildFilteredListener();
- this.filteredObjectHolder.addPropertyChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.filteredObjectHolder.removePropertyChangeListener(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.addPropertyChangeListener(this.buildListener());
- this.filteredObjectHolder.addPropertyChangeListener(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 PropertyChangeListener buildListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- FilteringPropertyValueModelTests.this.event = e;
- }
- };
- }
-
- private PropertyChangeListener buildFilteredListener() {
- return new PropertyChangeListener() {
- 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 1e3b3df19c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemCollectionListValueModelAdapterTests.java
+++ /dev/null
@@ -1,239 +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 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.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.Displayable;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-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 SortedListValueModelAdapter<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 {
- 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(Displayable o) {
- return DEFAULT_COMPARATOR.compare(this, o);
- }
-
- @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 ed58da1de3..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemListListValueModelAdapterTests.java
+++ /dev/null
@@ -1,240 +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 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.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.Displayable;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-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 SortedListValueModelAdapter<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 {
- 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(Displayable o) {
- return DEFAULT_COMPARATOR.compare(this, o);
- }
-
- @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 8e4e16c3df..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemPropertyListValueModelAdapterTests.java
+++ /dev/null
@@ -1,330 +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 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.swing.Displayable;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-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.setCollection(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.setList(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.compareTo(o1);
- }
- };
- }
-
- 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.setCollection(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 SortedListValueModelAdapter<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.setList(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 SortedListValueModelAdapter<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 SortedListValueModelAdapter<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 SortedListValueModelAdapter<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 {
- private String name;
- public Junk(String name) {
- this.name = name;
- }
- public String displayString() {
- return this.name;
- }
- public Icon icon() {
- return null;
- }
- public int compareTo(Displayable o) {
- return DEFAULT_COMPARATOR.compare(this, o);
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(DISPLAY_STRING_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/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 6285f39409..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemStateListValueModelAdapterTests.java
+++ /dev/null
@@ -1,302 +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 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.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-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 SortedListValueModelAdapter<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 SortedListValueModelAdapter<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 SortedListValueModelAdapter<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 SortedListValueModelAdapter<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 99585e69b1..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/JptUtilityModelValueTests.java
+++ /dev/null
@@ -1,73 +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.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(CompositeCollectionValueModelTests.class);
- suite.addTestSuite(CompositeListValueModelTests.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(StaticCollectionValueModelTests.class);
- suite.addTestSuite(StaticListValueModelTests.class);
- suite.addTestSuite(SimpleCollectionValueModelTests.class);
- suite.addTestSuite(SimpleListValueModelTests.class);
- suite.addTestSuite(SimplePropertyValueModelTests.class);
- suite.addTestSuite(SortedListValueModelAdapterTests.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 d05c360b9a..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListAspectAdapterTests.java
+++ /dev/null
@@ -1,473 +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 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.ListChangeEvent;
-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;
-
-public class ListAspectAdapterTests extends TestCase {
- private TestSubject subject1;
- private WritablePropertyValueModel<TestSubject> subjectHolder1;
- private LocalListAspectAdapter aa1;
- private ListChangeEvent 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(ListChangeEvent e) {
- ListAspectAdapterTests.this.value1Changed(e);
- }
- public void itemsRemoved(ListChangeEvent e) {
- ListAspectAdapterTests.this.value1Changed(e);
- }
- public void itemsReplaced(ListChangeEvent e) {
- ListAspectAdapterTests.this.value1Changed(e);
- }
- public void itemsMoved(ListChangeEvent e) {
- ListAspectAdapterTests.this.value1Changed(e);
- }
- public void listCleared(ListChangeEvent e) {
- ListAspectAdapterTests.this.value1Changed(e);
- }
- public void listChanged(ListChangeEvent e) {
- ListAspectAdapterTests.this.value1Changed(e);
- }
- };
- }
-
- void value1Changed(ListChangeEvent 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(-1, this.event1.getIndex());
- assertFalse(this.event1.items().hasNext());
- 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());
- assertEquals(-1, this.event1.getIndex());
- assertFalse(this.event1.items().hasNext());
- 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(-1, this.event1.getIndex());
- assertFalse(this.event1.items().hasNext());
- 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(), this.event1.getIndex());
- assertEquals("jam", this.event1.items().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, this.event1.getIndex());
- assertEquals("jaz", this.event1.items().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, this.event1.getIndex()); // only the last "add" event will still be there
- assertEquals("jam", this.event1.items().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, this.event1.getIndex());
- assertEquals(removedName, this.event1.items().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, this.event1.getIndex());
- assertEquals(removedItem, this.event1.items().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, this.event1.getIndex()); // only the last "remove" event will still be there
- assertEquals("baz", this.event1.items().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, this.event1.getIndex());
- assertEquals("jelly", this.event1.items().next());
- assertEquals(replacedName, this.event1.replacedItems().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, this.event1.getIndex());
- assertEquals("roll", this.event1.items().next());
- assertEquals(replacedName, this.event1.replacedItems().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());
- assertEquals(-1, this.event1.getIndex());
- assertFalse(this.event1.items().hasNext());
- 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));
-
- ListChangeListener listener2 = this.buildValueChangeListener1();
- this.aa1.addListChangeListener(listener2);
- assertTrue(this.aa1.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.subject1.hasAnyListChangeListeners(TestSubject.NAMES_LIST));
- this.aa1.removeListChangeListener(listener2);
- assertFalse(this.subject1.hasAnyListChangeListeners(TestSubject.NAMES_LIST));
- assertFalse(this.aa1.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
-
- // ********** inner class **********
-
- private 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);
- }
- 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
- private 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 2801585b9d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCollectionValueModelAdapterTests.java
+++ /dev/null
@@ -1,271 +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 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.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-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(CollectionChangeEvent 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(CollectionChangeEvent 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(CollectionChangeEvent e) {
- // override failure
- }
- @Override
- public void itemsRemoved(CollectionChangeEvent 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(CollectionChangeEvent e) {
- // override failure
- }
- @Override
- public void itemsRemoved(CollectionChangeEvent 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(CollectionChangeEvent e) {
- assertEquals("foo", e.items().next());
- assertFalse(CollectionTools.contains(ListCollectionValueModelAdapterTests.this.adapter.iterator(), "joo"));
- assertEquals(2, ListCollectionValueModelAdapterTests.this.adapter.size());
- }
- @Override
- public void itemsAdded(CollectionChangeEvent e) {
- assertEquals("joo", e.items().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));
- this.adapter.addCollectionChangeListener(synchCollection);
- assertTrue(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.adapter.removeCollectionChangeListener(synchCollection);
- assertFalse(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
- public void testListChangedToEmpty() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(CollectionChangeEvent 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.setList(new ArrayList<String>());
- assertEquals(0, jList.getModel().getSize());
- }
-
- public void testCollectionChangedFromEmpty() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(CollectionChangeEvent e) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- ArrayList<String> list = new ArrayList<String>();
- list.add("foo");
- list.add("bar");
- this.wrappedListHolder.setList(list);
- assertEquals(2, jList.getModel().getSize());
- }
-
- public void testCollectionChangedFromEmptyToEmpty() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(CollectionChangeEvent e) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- ArrayList<String> list = new ArrayList<String>();
- this.wrappedListHolder.setList(list);
- assertEquals(0, jList.getModel().getSize());
- }
-
-
- // ********** inner class **********
-
- class TestListener implements CollectionChangeListener {
- public void itemsAdded(CollectionChangeEvent e) {
- fail("unexpected event");
- }
- public void itemsRemoved(CollectionChangeEvent e) {
- fail("unexpected event");
- }
- public void collectionCleared(CollectionChangeEvent 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 f0155c1ab8..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCuratorTests.java
+++ /dev/null
@@ -1,314 +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 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.ListChangeEvent;
-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;
-
-public final class ListCuratorTests
- extends TestCase
-{
- private TestSubject subject1;
- private WritablePropertyValueModel<TestSubject> subjectHolder1;
-
- private ListCurator<TestSubject, String> curator;
- private ListChangeListener listener1;
- private ListChangeEvent 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(ListChangeEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- public void itemsRemoved(ListChangeEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- public void itemsReplaced(ListChangeEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- public void itemsMoved(ListChangeEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- public void listCleared(ListChangeEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- public void listChanged(ListChangeEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- };
- }
-
- void value1Changed(ListChangeEvent 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(-1, this.event1.getIndex());
- assertFalse(this.event1.items().hasNext());
- 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());
- assertEquals(-1, this.event1.getIndex());
- assertFalse(this.event1.items().hasNext());
- 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(-1, this.event1.getIndex());
- assertFalse(this.event1.items().hasNext());
- 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(), this.event1.getIndex());
- assertEquals("echo", this.event1.items().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, this.event1.getIndex());
- assertEquals("zulu", this.event1.items().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, this.event1.getIndex());
- assertEquals(removedString, this.event1.items().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, this.event1.getIndex());
- assertEquals(removedString, this.event1.items().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));
-
- ListChangeListener listener2 = this.buildListChangeListener1();
- this.curator.addListChangeListener(listener2);
- assertTrue(this.curator.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.subject1.hasAnyStateChangeListeners());
- this.curator.removeListChangeListener(listener2);
- assertFalse(this.subject1.hasAnyStateChangeListeners());
- assertFalse(this.curator.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
-
- // **************** 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 c3cdb4199e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyAspectAdapterTests.java
+++ /dev/null
@@ -1,326 +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.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;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-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 PropertyChangeListener buildValueChangeListener1() {
- return new PropertyChangeListener() {
- 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));
-
- PropertyChangeListener listener2 = this.buildValueChangeListener1();
- this.aa1.addPropertyChangeListener(listener2);
- assertTrue(this.aa1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.subject1.hasAnyPropertyChangeListeners(TestSubject.NAME_PROPERTY));
- this.aa1.removePropertyChangeListener(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());
- }
-
- 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;
- }
-
-
- // ********** inner class **********
-
- private 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 49da7ab7fc..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyCollectionValueModelAdapterTests.java
+++ /dev/null
@@ -1,151 +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 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.CollectionChangeEvent;
-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;
-
-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(CollectionChangeEvent 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(CollectionChangeEvent 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));
- this.adapter.addCollectionChangeListener(synchCollection);
- assertTrue(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.adapter.removeCollectionChangeListener(synchCollection);
- assertFalse(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
- public void testListChangedToEmpty() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(CollectionChangeEvent 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(CollectionChangeEvent 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(CollectionChangeEvent event) {
- fail("unexpected event");
- }
- public void itemsAdded(CollectionChangeEvent event) {
- fail("unexpected event");
- }
- public void itemsRemoved(CollectionChangeEvent 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 e9730f4be1..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyListValueModelAdapterTests.java
+++ /dev/null
@@ -1,198 +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.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.ListChangeEvent;
-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;
-
-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(ListChangeEvent 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(ListChangeEvent 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(ListChangeEvent 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(ListChangeEvent 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));
- this.adapter.addListChangeListener(synchList);
- assertTrue(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.removeListChangeListener(synchList);
- 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(ListChangeEvent 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(ListChangeEvent 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(ListChangeEvent 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(ListChangeEvent event) {
- fail("unexpected event");
- }
- public void itemsAdded(ListChangeEvent event) {
- fail("unexpected event");
- }
- public void itemsRemoved(ListChangeEvent event) {
- fail("unexpected event");
- }
- public void itemsMoved(ListChangeEvent event) {
- fail("unexpected event");
- }
- public void itemsReplaced(ListChangeEvent event) {
- fail("unexpected event");
- }
- }
-
-}
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 6c84c26bbe..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleCollectionValueModelTests.java
+++ /dev/null
@@ -1,409 +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 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.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-public class SimpleCollectionValueModelTests extends TestCase {
- private SimpleCollectionValueModel<String> bagHolder;
- CollectionChangeEvent bagEvent;
- String bagEventType;
-
- private SimpleCollectionValueModel<String> setHolder;
- CollectionChangeEvent 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 testSetCollection() {
- assertTrue(this.bagHolderContains("bar"));
- assertFalse(this.bagHolderContains("jar"));
- this.bagHolder.setCollection(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.setCollection(new HashBag<String>());
- assertFalse(this.bagHolderContains("jar"));
-
- assertTrue(this.setHolderContains("bar"));
- assertFalse(this.setHolderContains("jar"));
- this.setHolder.setCollection(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.setCollection(new HashBag<String>());
- assertFalse(this.setHolderContains("jar"));
- }
-
- public void testCollectionChange1() {
- this.bagHolder.addCollectionChangeListener(this.buildBagListener());
- this.verifyBagChange();
-
- this.setHolder.addCollectionChangeListener(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.setCollection(this.buildBag());
- this.verifyBagEvent(CHANGE);
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.addAll(this.buildBag());
- this.verifyBagEvent(ADD);
- assertEquals(this.buildBag(), CollectionTools.bag(this.bagEvent.items()));
- }
-
- 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.setCollection(this.buildSet());
- this.verifySetEvent(CHANGE);
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.addAll(this.buildSet());
- assertNull(this.setEvent);
- assertNull(this.setEventType);
- }
-
- private CollectionChangeListener buildBagListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.bagEventType = ADD;
- SimpleCollectionValueModelTests.this.bagEvent = e;
- }
- public void itemsRemoved(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.bagEventType = REMOVE;
- SimpleCollectionValueModelTests.this.bagEvent = e;
- }
- public void collectionCleared(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.bagEventType = CLEAR;
- SimpleCollectionValueModelTests.this.bagEvent = e;
- }
- public void collectionChanged(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.bagEventType = CHANGE;
- SimpleCollectionValueModelTests.this.bagEvent = e;
- }
- };
- }
-
- private CollectionChangeListener buildSetListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.setEventType = ADD;
- SimpleCollectionValueModelTests.this.setEvent = e;
- }
- public void itemsRemoved(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.setEventType = REMOVE;
- SimpleCollectionValueModelTests.this.setEvent = e;
- }
- public void collectionCleared(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.setEventType = CLEAR;
- SimpleCollectionValueModelTests.this.setEvent = e;
- }
- 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.bagEvent.items().next());
- }
-
- 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.setEvent.items().next());
- }
-
-}
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 e81ee4528e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleListValueModelTests.java
+++ /dev/null
@@ -1,327 +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 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.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-public class SimpleListValueModelTests extends TestCase {
- private SimpleListValueModel<String> listHolder;
- ListChangeEvent 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.setList(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.setList(new ArrayList<String>());
- assertFalse(this.listContains("jar"));
- }
-
- public void testListChange1() {
- this.listHolder.addListChangeListener(this.buildListener());
- 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.setList(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(this.event.items()));
-
- this.event = null;
- this.eventType = null;
- this.listHolder.set(0, "joo");
- this.verifyEvent(REPLACE);
- assertFalse(CollectionTools.contains(this.event.items(), "foo"));
- assertTrue(CollectionTools.contains(this.event.items(), "joo"));
- }
-
- private ListChangeListener buildListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent e) {
- SimpleListValueModelTests.this.eventType = ADD;
- SimpleListValueModelTests.this.event = e;
- }
- public void itemsRemoved(ListChangeEvent e) {
- SimpleListValueModelTests.this.eventType = REMOVE;
- SimpleListValueModelTests.this.event = e;
- }
- public void itemsReplaced(ListChangeEvent e) {
- SimpleListValueModelTests.this.eventType = REPLACE;
- SimpleListValueModelTests.this.event = e;
- }
- public void itemsMoved(ListChangeEvent e) {
- SimpleListValueModelTests.this.eventType = MOVE;
- SimpleListValueModelTests.this.event = e;
- }
- public void listCleared(ListChangeEvent e) {
- SimpleListValueModelTests.this.eventType = CLEAR;
- SimpleListValueModelTests.this.event = e;
- }
- 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);
- assertEquals(index, this.event.getIndex());
- assertEquals(item, this.event.items().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 57ed0d8c70..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimplePropertyValueModelTests.java
+++ /dev/null
@@ -1,93 +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.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;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-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.addPropertyChangeListener(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 PropertyChangeListener buildListener() {
- return new PropertyChangeListener() {
- 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 816bb599cc..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SortedListValueModelAdapterTests.java
+++ /dev/null
@@ -1,196 +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 java.util.ArrayList;
-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.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-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(ListChangeEvent e) {/* OK */}
- @Override
- public void itemsReplaced(ListChangeEvent 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(ListChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(ListChangeEvent e) {/* OK */}
- @Override
- public void itemsReplaced(ListChangeEvent 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));
- this.adapter.addListChangeListener(synchList);
- assertTrue(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.removeListChangeListener(synchList);
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- class TestListChangeListener implements ListChangeListener {
- public void itemsAdded(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void itemsRemoved(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void itemsReplaced(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void itemsMoved(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void listCleared(ListChangeEvent 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 dca32f9315..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticCollectionValueModelTests.java
+++ /dev/null
@@ -1,61 +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 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;
-
-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 0d7cbc6110..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticListValueModelTests.java
+++ /dev/null
@@ -1,64 +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 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;
-
-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 380cf17c58..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticValueModelTests.java
+++ /dev/null
@@ -1,46 +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.StaticPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-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 28dfb67f8b..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationListValueModelAdapterTests.java
+++ /dev/null
@@ -1,317 +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 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.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-public class TransformationListValueModelAdapterTests extends TestCase {
- private SimpleListValueModel<String> listHolder;
- private ListValueModel<String> transformedListHolder;
- ListChangeEvent 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.addListChangeListener(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(this.event.items()));
-
- this.event = null;
- this.eventType = null;
- this.listHolder.set(0, "joo");
- this.verifyEvent(REPLACE);
- assertFalse(CollectionTools.contains(this.event.items(), "FOO"));
- assertTrue(CollectionTools.contains(this.event.items(), "JOO"));
- }
-
- private ListChangeListener buildListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent e) {
- TransformationListValueModelAdapterTests.this.eventType = ADD;
- TransformationListValueModelAdapterTests.this.event = e;
- }
- public void itemsRemoved(ListChangeEvent e) {
- TransformationListValueModelAdapterTests.this.eventType = REMOVE;
- TransformationListValueModelAdapterTests.this.event = e;
- }
- public void itemsReplaced(ListChangeEvent e) {
- TransformationListValueModelAdapterTests.this.eventType = REPLACE;
- TransformationListValueModelAdapterTests.this.event = e;
- }
- public void itemsMoved(ListChangeEvent e) {
- TransformationListValueModelAdapterTests.this.eventType = MOVE;
- TransformationListValueModelAdapterTests.this.event = e;
- }
- public void listCleared(ListChangeEvent e) {
- TransformationListValueModelAdapterTests.this.eventType = CLEAR;
- TransformationListValueModelAdapterTests.this.event = e;
- }
- 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);
- assertEquals(index, this.event.getIndex());
- assertEquals(item, this.event.items().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));
-
- ListChangeListener 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.addListChangeListener(listener);
- assertTrue(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.transformedListHolder.removeListChangeListener(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 a732202671..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java
+++ /dev/null
@@ -1,185 +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.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.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 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));
- PropertyChangeListener listener = this.buildTransformationListener();
- this.transformationObjectHolder.addPropertyChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.transformationObjectHolder.removePropertyChangeListener(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.addPropertyChangeListener(this.buildListener());
- this.transformationObjectHolder.addPropertyChangeListener(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 PropertyChangeListener buildListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- TransformationPropertyValueModelTests.this.event = e;
- }
- };
- }
-
- private PropertyChangeListener buildTransformationListener() {
- return new PropertyChangeListener() {
- 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 a04d912139..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TreeAspectAdapterTests.java
+++ /dev/null
@@ -1,353 +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 java.util.Collection;
-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.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.TreeChangeEvent;
-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;
-
-public class TreeAspectAdapterTests extends TestCase {
- private TestSubject subject1;
- private WritablePropertyValueModel<TestSubject> subjectHolder1;
- private TreeAspectAdapter<TestSubject, TestNode[]> aa1;
- private TreeChangeEvent 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, TestNode[]> buildAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- return new TreeAspectAdapter<TestSubject, TestNode[]>(subjectHolder, TestSubject.NAMES_TREE) {
- // this is not a typical aspect adapter - the value is determined by the aspect name
- @Override
- protected Iterator<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 TreeChangeListener buildValueChangeListener1() {
- return new TreeChangeListener() {
- public void nodeAdded(TreeChangeEvent e) {
- TreeAspectAdapterTests.this.value1Changed(e);
- }
- public void nodeRemoved(TreeChangeEvent e) {
- TreeAspectAdapterTests.this.value1Changed(e);
- }
- public void treeCleared(TreeChangeEvent e) {
- TreeAspectAdapterTests.this.value1Changed(e);
- }
- public void treeChanged(TreeChangeEvent e) {
- TreeAspectAdapterTests.this.value1Changed(e);
- }
- };
- }
-
- void value1Changed(TreeChangeEvent 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());
- assertEquals(0, this.event1.getPath().length);
-
- this.event1 = null;
- this.subjectHolder1.setValue(null);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(TreeValueModel.NODES, this.event1.getTreeName());
- assertEquals(0, this.event1.getPath().length);
-
- this.event1 = null;
- this.subjectHolder1.setValue(this.subject1);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(TreeValueModel.NODES, this.event1.getTreeName());
- assertEquals(0, this.event1.getPath().length);
- }
-
- 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());
- Object[] path = this.event1.getPath();
- assertEquals(this.subject1.getRootNameNode(), path[path.length - 1]);
- 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<TestNode[]> namePaths) {
- Collection<String> result = new HashBag<String>();
- while (namePaths.hasNext()) {
- Object[] path = namePaths.next();
- StringBuffer sb = new StringBuffer();
- sb.append('[');
- for (int i = 0; i < path.length; i++) {
- sb.append(((TestNode) path[i]).getText());
- if (i < path.length - 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));
-
- TreeChangeListener listener2 = this.buildValueChangeListener1();
- this.aa1.addTreeChangeListener(listener2);
- assertTrue(this.aa1.hasAnyTreeChangeListeners(TreeValueModel.NODES));
- assertTrue(this.subject1.hasAnyTreeChangeListeners(TestSubject.NAMES_TREE));
- this.aa1.removeTreeChangeListener(listener2);
- assertFalse(this.subject1.hasAnyTreeChangeListeners(TestSubject.NAMES_TREE));
- assertFalse(this.aa1.hasAnyTreeChangeListeners(TreeValueModel.NODES));
- }
-
- // ********** inner classes **********
-
- private 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<TestNode[]> namePaths() {
- return new TransformationIterator<TestNode, TestNode[]>(this.nameNodes()) {
- @Override
- protected TestNode[] transform(TestNode next) {
- return next.path();
- }
- };
- }
- public TestNode addName(TestNode parent, String name) {
- TestNode child = new TestNode(name);
- parent.addChild(child);
- this.fireNodeAdded(NAMES_TREE, child.path());
- 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.path());
- }
- public void removeNameNode(TestNode nameNode) {
- nameNode.getParent().removeChild(nameNode);
- this.fireNodeRemoved(NAMES_TREE, nameNode.path());
- }
- 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<TestNode[]> descriptionPaths() {
- return new TransformationIterator<TestNode, TestNode[]>(this.descriptionNodes()) {
- @Override
- protected TestNode[] transform(TestNode next) {
- return next.path();
- }
- };
- }
- public TestNode addDescription(TestNode parent, String description) {
- TestNode child = new TestNode(description);
- parent.addChild(child);
- this.fireNodeAdded(DESCRIPTIONS_TREE, child.path());
- return child;
- }
- public void removeDescriptionNode(TestNode descriptionNode) {
- descriptionNode.getParent().removeChild(descriptionNode);
- this.fireNodeRemoved(DESCRIPTIONS_TREE, descriptionNode.path());
- }
- 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;
- }
- }
-
- private 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 TestNode[] path() {
- return CollectionTools.reverseList(this.buildAntiPath()).toArray(new TestNode[0]);
- }
- 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 efef38a95e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueCollectionAdapterTests.java
+++ /dev/null
@@ -1,156 +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 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.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-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.addPropertyChangeListener(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.addPropertyChangeListener(l);
- assertTrue(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.junkHolder2.removePropertyChangeListener(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());
- }
-
-
- private class LocalListener implements PropertyChangeListener, StateChangeListener {
- 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;
- }
- 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());
- }
- public void stateChanged(StateChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- assertNull(e.getAspectName());
- }
- 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 d1ada25d05..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueListAdapterTests.java
+++ /dev/null
@@ -1,167 +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 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.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-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.addPropertyChangeListener(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.addPropertyChangeListener(l);
- assertTrue(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.junkHolder2.removePropertyChangeListener(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());
- }
-
-
- private class LocalListener implements PropertyChangeListener, StateChangeListener {
- 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;
- }
- 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());
- }
- public void stateChanged(StateChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- assertNull(e.getAspectName());
- }
- 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 b8c6e1bf9c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValuePropertyAdapterTests.java
+++ /dev/null
@@ -1,143 +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.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.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-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.addPropertyChangeListener(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.addPropertyChangeListener(l);
- assertTrue(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.junkHolder2.removePropertyChangeListener(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());
- }
-
-
- private class LocalListener implements PropertyChangeListener, StateChangeListener {
- 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;
- }
- 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());
- }
- public void stateChanged(StateChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- assertNull(e.getAspectName());
- }
- boolean eventReceived() {
- return this.eventReceived;
- }
- }
-
- private 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 6aef58a2b9..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueStateAdapterTests.java
+++ /dev/null
@@ -1,143 +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.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.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-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.addPropertyChangeListener(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.addPropertyChangeListener(l);
- assertTrue(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.junkHolder2.removePropertyChangeListener(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.addPropertyChangeListener(l);
- this.junkHolder2.addStateChangeListener(l);
- this.junk.setName("bar");
- assertTrue(l.eventReceived());
- }
-
-
- private class LocalListener implements PropertyChangeListener, StateChangeListener {
- 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;
- }
- 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());
- }
- public void stateChanged(StateChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- assertNull(e.getAspectName());
- }
- boolean eventReceived() {
- return this.eventReceived;
- }
- }
-
- private 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 b04df31695..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencePropertyValueModelTests.java
+++ /dev/null
@@ -1,382 +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.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.ClassTools;
-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.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-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));
-
- PropertyChangeListener listener2 = this.buildValueChangeListener();
- this.preferenceAdapter.addPropertyChangeListener(listener2);
- assertTrue(this.preferenceAdapter.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.nodeHasAnyPrefListeners(this.testNode));
- this.preferenceAdapter.removePropertyChangeListener(listener2);
- assertFalse(this.nodeHasAnyPrefListeners(this.testNode));
- assertFalse(this.preferenceAdapter.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- 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[]) ClassTools.fieldValue(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 3bd1b41b52..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesCollectionValueModelTests.java
+++ /dev/null
@@ -1,276 +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.prefs;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-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.ClassTools;
-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.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-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;
-
-public class PreferencesCollectionValueModelTests extends PreferencesTestCase {
- private Map<String, String> expectedValues;
- private WritablePropertyValueModel<Preferences> nodeHolder;
- PreferencesCollectionValueModel<String> preferencesAdapter;
- CollectionChangeEvent 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(CollectionChangeEvent e) {
- this.logEvent(e);
- }
- public void itemsAdded(CollectionChangeEvent e) {
- this.logEvent(e);
- }
- public void itemsRemoved(CollectionChangeEvent e) {
- this.logEvent(e);
- }
- private void logEvent(CollectionChangeEvent 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(Collections.<String, String>emptyMap());
- this.verifyAdapter(this.preferencesAdapter);
-
- this.event = null;
- this.expectedValues.clear();
- this.nodeHolder.setValue(null);
- this.verifyEvent(this.expectedValues);
- assertFalse(this.preferencesAdapter.iterator().hasNext());
-
- this.event = null;
- this.nodeHolder.setValue(this.testNode);
- this.verifyEvent(Collections.<String, String>emptyMap());
- 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, this.event.itemsSize());
- @SuppressWarnings("unchecked")
- String key = ((PreferencePropertyValueModel<String>) this.event.items().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));
-
- CollectionChangeListener listener2 = this.buildCollectionChangeListener();
- this.preferencesAdapter.addCollectionChangeListener(listener2);
- assertTrue(this.preferencesAdapter.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- assertTrue(this.nodeHasAnyPrefListeners(this.testNode));
- this.preferencesAdapter.removeCollectionChangeListener(listener2);
- assertFalse(this.nodeHasAnyPrefListeners(this.testNode));
- assertFalse(this.preferencesAdapter.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
- private void verifyEvent(Map<String, String> items) {
- assertNotNull(this.event);
- assertEquals(this.preferencesAdapter, this.event.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event.getCollectionName());
- assertEquals(items.size(), this.event.itemsSize());
- @SuppressWarnings("unchecked")
- Iterator<PreferencePropertyValueModel<String>> eventItems = (Iterator<PreferencePropertyValueModel<String>>) this.event.items();
- this.verifyItems(items, eventItems);
- }
-
- 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.iterator());
- }
-
- private void verifyItems(Map<String, String> expected, Iterator<PreferencePropertyValueModel<String>> stream) {
- while (stream.hasNext()) {
- PreferencePropertyValueModel<String> model = stream.next();
- 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[]) ClassTools.fieldValue(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 ce4c304a6e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesTestCase.java
+++ /dev/null
@@ -1,85 +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.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.ClassTools;
-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
- */
-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(ClassTools.shortClassNameForObject(this));
- // 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(ClassTools.shortClassNameForObject(this));
- }
- 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() {
- try {
- while ( ! this.preferencesEventQueue().isEmpty()) {
- Thread.sleep(100);
- }
- Thread.sleep(100);
- } catch (InterruptedException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- @SuppressWarnings("unchecked")
- private List<EventObject> preferencesEventQueue() {
- return (List<EventObject>) ClassTools.staticFieldValue(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 4302458d3d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterTests.java
+++ /dev/null
@@ -1,134 +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 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.ClassTools;
-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;
-
-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) ClassTools.fieldValue(model, "listenerList");
- assertEquals(0, listenerList.getListenerList().length);
- }
-
- private void verifyHasListeners(Object model) throws Exception {
- EventListenerList listenerList = (EventListenerList) ClassTools.fieldValue(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 c3bc373dc7..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterUITest.java
+++ /dev/null
@@ -1,313 +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 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.
- */
-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(args);
- }
-
- private CheckBoxModelAdapterUITest() {
- super();
- }
-
- private void exec(String[] args) 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 e79111a232..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterTests.java
+++ /dev/null
@@ -1,110 +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 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.ClassTools;
-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;
-
-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) ClassTools.executeMethod(listModel, "hasNoListDataListeners")).booleanValue();
- assertTrue(hasNoListeners);
- }
-
- private void verifyHasListeners(ListModel listModel) throws Exception {
- boolean hasListeners = ((Boolean) ClassTools.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 bb6e8f0ce7..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest.java
+++ /dev/null
@@ -1,391 +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 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.ClassTools;
-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.
- */
-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(args);
- }
-
- protected ComboBoxModelAdapterUITest() {
- super();
- }
-
- protected void exec(String[] args) 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(ClassTools.shortNameFor(this.getClass()));
- 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 e9c5fc4a09..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest2.java
+++ /dev/null
@@ -1,74 +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 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;
-
-/**
- *
- */
-public class ComboBoxModelAdapterUITest2 extends ComboBoxModelAdapterUITest {
-
- public static void main(String[] args) throws Exception {
- new ComboBoxModelAdapterUITest2().exec(args);
- }
-
- 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 cb255e7b12..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DateSpinnerModelAdapterTests.java
+++ /dev/null
@@ -1,159 +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 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;
-
-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 d647360a88..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterTests.java
+++ /dev/null
@@ -1,158 +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 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.ClassTools;
-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;
-
-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 = ClassTools.fieldValue(document, "delegate");
- Object[] listeners = (Object[]) ClassTools.executeMethod(delegate, "getDocumentListeners");
- assertEquals(0, listeners.length);
- }
-
- private void verifyHasListeners(Object document) throws Exception {
- Object delegate = ClassTools.fieldValue(document, "delegate");
- Object[] listeners = (Object[]) ClassTools.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 39b43388cd..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterUITest.java
+++ /dev/null
@@ -1,255 +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 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.
- */
-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(args);
- }
-
- private DocumentAdapterUITest() {
- super();
- }
-
- private void exec(String[] args) 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 4cb2e0461b..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListModelAdapterTests.java
+++ /dev/null
@@ -1,315 +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 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.ClassTools;
-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.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;
-
-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 SortedListValueModelAdapter<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 SortedListValueModelAdapter<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) ClassTools.executeMethod(listModel, "hasNoListDataListeners")).booleanValue();
- assertTrue(hasNoListeners);
- }
-
- private void verifyHasListeners(ListModel listModel) throws Exception {
- boolean hasListeners = ((Boolean) ClassTools.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 8fc963bdf8..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this 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.SortedListValueModelAdapter;
-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
- */
-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(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 SortedListValueModelAdapter<String>(this.buildPrimitiveTaskListAdapter()));
- }
-
- private ListModel buildCustomSortedPrimitiveListModel() {
- return new ListModelAdapter(new SortedListValueModelAdapter<String>(this.buildPrimitiveTaskListAdapter(), this.buildCustomStringComparator()));
- }
-
- private ListModel buildUnsortedDisplayableListModel() {
- return new ListModelAdapter(this.buildDisplayableTaskListAdapter());
- }
-
- private ListModel buildStandardSortedDisplayableListModel() {
- return new ListModelAdapter(new SortedListValueModelAdapter<Task>(this.buildDisplayableTaskListAdapter()));
- }
-
- private ListModel buildCustomSortedDisplayableListModel() {
- return new ListModelAdapter(new SortedListValueModelAdapter<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.compareTo(to1);
- }
- };
- }
-
- 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;
- }
-
- private 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.taskObjects.clear();
- this.fireListChanged(TASKS_LIST);
- }
- }
-
- private 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 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 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 0407b59a60..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListSpinnerModelAdapterTests.java
+++ /dev/null
@@ -1,133 +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 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;
-
-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 bc5df140e8..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/NumberSpinnerModelAdapterTests.java
+++ /dev/null
@@ -1,147 +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 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;
-
-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 8744d6665b..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ObjectListSelectionModelTests.java
+++ /dev/null
@@ -1,202 +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 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.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-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(CollectionTools.contains(this.selectionModel.selectedValues(), "foo"));
- assertTrue(CollectionTools.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 3a8384c1a7..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/PrimitiveListTreeModelTests.java
+++ /dev/null
@@ -1,197 +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 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;
-
-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 **********
-
- private 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 0c4bbeb9f3..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterTests.java
+++ /dev/null
@@ -1,229 +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 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.ClassTools;
-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;
-
-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) ClassTools.fieldValue(model, "listenerList");
- assertEquals(0, listenerList.getListenerList().length);
- }
-
- private void verifyHasListeners(Object model) throws Exception {
- EventListenerList listenerList = (EventListenerList) ClassTools.fieldValue(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 f129e05afa..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterUITest.java
+++ /dev/null
@@ -1,257 +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 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.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.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.
- */
-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(args);
- }
-
- private RadioButtonModelAdapterUITest() {
- super();
- }
-
- private void exec(String[] args) 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 ( ! CollectionTools.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 c8bb0234ef..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterTests.java
+++ /dev/null
@@ -1,117 +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 javax.swing.SpinnerModel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.ClassTools;
-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;
-
-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 = ClassTools.fieldValue(adapter, "delegate");
- Object[] listeners = (Object[]) ClassTools.executeMethod(delegate, "getChangeListeners");
- assertEquals(0, listeners.length);
- }
-
- private void verifyHasListeners(Object adapter) throws Exception {
- Object delegate = ClassTools.fieldValue(adapter, "delegate");
- Object[] listeners = (Object[]) ClassTools.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 b622de13a0..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterUITest.java
+++ /dev/null
@@ -1,341 +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 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.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.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.
- */
-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(args);
- }
-
- private SpinnerModelAdapterUITest() {
- super();
- }
-
- private void exec(String[] args) 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());
- }
-
-
- private 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];
-
- public 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 ( ! CollectionTools.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 c08467d97d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterTests.java
+++ /dev/null
@@ -1,643 +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 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;
-
-/**
- *
- */
-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 ebe3d1a66b..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterUITest.java
+++ /dev/null
@@ -1,731 +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 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.ClassTools;
-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.SortedListValueModelAdapter;
-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)
- */
-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(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 SortedListValueModelAdapter<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(ListSelectionEvent e) {
- 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(ClassTools.shortClassNameForObject(this));
- 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(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 291c9bcb21..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterTests.java
+++ /dev/null
@@ -1,814 +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 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.internal.HashBag;
-import org.eclipse.jpt.utility.internal.IndentingPrintWriter;
-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.SortedListValueModelAdapter;
-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;
-
-/**
- *
- */
-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 {
- /** 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 **********
-
- /**
- * use the standard Displayable comparator
- */
- public int compareTo(Displayable d) {
- return DEFAULT_COMPARATOR.compare(this, d);
- }
-
- @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 SortedListValueModelAdapter<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(testModel);
- }
- return super.buildChildrenModel(testModel);
- }
- protected ListValueModel<TreeNodeValueModel<Object>> buildSpecialChildrenModel(TestModel testModel) {
- 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 b8f40c394f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterUITest.java
+++ /dev/null
@@ -1,424 +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 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
- */
-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(args);
- }
-
- private TreeModelAdapterUITest() {
- super();
- }
-
- private void exec(String[] args) 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(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 4a30ba3625..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/node/AbstractNodeTests.java
+++ /dev/null
@@ -1,526 +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.node;
-
-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.HashBag;
-import org.eclipse.jpt.utility.internal.Range;
-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;
-
-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());
- }
-
- public void testSort() {
- List<TestWorkbenchModel> nodes = this.buildSortedNodes();
- assertTrue(new Range(0, 1).includes(this.indexOf(nodes, "aaa")));
- assertTrue(new Range(0, 1).includes(this.indexOf(nodes, "AAA")));
- assertTrue(new Range(2, 3).includes(this.indexOf(nodes, "bbb")));
- assertTrue(new Range(2, 3).includes(this.indexOf(nodes, "BBB")));
- assertTrue(new Range(4, 6).includes(this.indexOf(nodes, "ccc")));
- assertTrue(new Range(4, 6).includes(this.indexOf(nodes, "CCC")));
- assertTrue(new Range(4, 6).includes(this.indexOf(nodes, "���")));
- }
-
- private int indexOf(List<TestWorkbenchModel> nodes, String nodeName) {
- for (int i = nodes.size(); i-- > 0; ) {
- if (nodes.get(i).getName().equals(nodeName)) {
- return i;
- }
- }
- throw new IllegalArgumentException();
- }
-
- private List<TestWorkbenchModel> buildSortedNodes() {
- List<TestWorkbenchModel> result = new ArrayList<TestWorkbenchModel>();
- result.add(new RootTestWorkbenchModel("AAA"));
- result.add(new RootTestWorkbenchModel("BBB"));
- result.add(new RootTestWorkbenchModel("CCC"));
- result.add(new RootTestWorkbenchModel("���"));
- result.add(new RootTestWorkbenchModel("ccc"));
- result.add(new RootTestWorkbenchModel("bbb"));
- result.add(new RootTestWorkbenchModel("aaa"));
- return CollectionTools.sort(result);
- }
-
-
- // ********** inner classes **********
-
- private 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/test.xml b/jpa/tests/org.eclipse.jpt.utility.tests/test.xml
deleted file mode 100644
index bf3ab7e506..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/test.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0"?>
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name -->
- <property name="plugin-name" value="org.eclipse.jpt.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}"/>
- <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

Back to the top